Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
#14 2007-07-09 00:14:13
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: /path/to/site automatically?
How paths work in PHP is relevant: by default if you don’t supply an absolute path, it will use the current file’s position as the starting point.
The other part of the problem is that you won’t get expected results if you try to embed PHP within a tag like that. Try using $path_to_site, but use the PHP verson of the entire tag, not just for the font
attribute value.
Offline
Re: /path/to/site automatically?
I’m not sure how I would do that when I have this tag!
<txp:zem_ir_set group=“h3” font=”/htdocs/minim/files/copper.ttf” fontsize=16 backgroundcolor=”#111” color=”#ccc” transform=“lowercase” wraptag=“h3” padding=“1 3 1 0” />
However, I am no longer going to worry about it. I can use the path for my own purposes and for template users, just put font=“copper.ttf” and ask them to put the font beyond the public_html folder. They should all have ftp access or how did they install txp in the first place?
But thank you Ruud and Mary. I now understand it better and know the answer to my original question: ie $path_to_site. Wow, I almost had the answer when I wrote the topic /path/to/site :-)
Offline
#16 2007-07-10 00:45:23
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: /path/to/site automatically?
Sure. FWIW, you can do:
<txp:php>
$font = 'copper.ttf';
echo zem_ir_set(array(
'group' => 'h3',
'font => $GLOBALS['path_to_site'].$font,
'fontsize' => '16',
'backgroundcolor' => '#111',
'color' => '#ccc',
'transform' => 'lowercase'
'wraptag' => 'h3',
'padding' => '1 3 1 0'
));
</txp:php>
Offline
Offline