Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-07-06 17:38:57

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: /path/to/site automatically?

We posted at the same time :-)

I get the correct path like so:

C:\xampp\htdocs\minim\hello

So it’s a zem_ir thing then…


BB6 Band My band
Gud One My blog

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

#15 2007-07-09 06:41:15

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

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 :-)


BB6 Band My band
Gud One My blog

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

#17 2007-07-10 11:21:28

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: /path/to/site automatically?

Wow, Mary, I didn’t expect you to go to any trouble! Thank you very much, I’ll use it!


BB6 Band My band
Gud One My blog

Offline

Board footer

Powered by FluxBB