Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-19 07:56:55

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,643
GitHub Twitter

Just a little help with PHP...

I want to create a conditional structure in my template.
So, I put this code in it :
<code>
<txp:php>
global $pretext;
echo (($global [‘pretext’][‘prev_title’]==Null ?
“Previous article : none” :
“Previous article : <a href=\”“.$pretext[‘prev_utitle’].” title=\”“.$pretext[‘prev_title’].”\”>”.$pretext[‘prev_title’].”</a>” ) );
</txp:php>
</code>
…but it’s doesn’t work. And I can’t find what’s wrong. (I’m very stupid :o)
Someone could help me?
Tks by advance.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2006-05-19 11:26:33

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Just a little help with PHP...

I think you should have echo( ($pretext['prev_title']==Null ... in your condition.

Change the echo (($global ['pretext']['prev_title']==Null ? part.

Last edited by net-carver (2006-05-19 11:28:10)


Steve

Offline

#3 2006-05-19 13:47:18

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,643
GitHub Twitter

Re: Just a little help with PHP...

…Very good net-carver! It’s works…fine :o))
Thanks a lot.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB