FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » how to execute php code into fud templates?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
how to execute php code into fud templates? [message #32754] Wed, 19 July 2006 00:10 Go to next message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Hello

I would like to display a partnership link only on main forums pages. How could I do this?

If i would know how to execute php code in templates, i would put this little code
$neo="LINK";

if ($REDIRECT_URL=="/forums/") {echo $neo;}
if (ereg("/f/13/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/14/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/15/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/11/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/6/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/7/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/8/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/10/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/f/9/0/",$REDIRECT_URL)) {echo $neo;}
if (ereg("/l/0/",$REDIRECT_URL)) {echo $neo;}


Is it possible in fud forum?
For example in smarty template engine I can do this by adding {php} tag before and {/php} after the little php code.

Thanks in advance for help!
Matt
Re: how to execute php code into fud templates? [message #32763 is a reply to message #32754] Wed, 19 July 2006 14:44 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The forum templating engine support the IF tag so you can do things like this inside the template

{IF: ereg("/f/13/0/",$REDIRECT_URL)}{VAR: neo}{ENDIFI}


FUDforum Core Developer
Re: how to execute php code into fud templates? [message #32776 is a reply to message #32763] Thu, 20 July 2006 14:06 Go to previous message
matthieu_phpmv is currently offline  matthieu_phpmv   France
Messages: 44
Registered: November 2004
Karma: 0
Member
Hello Ilia,
Thanks for the quick answer, as usual, this is great Smile

I've installed the following code which works Smile


{IF: ereg("/f/13/0/",$_SERVER['PHP_SELF']) ||  ereg("/f/14/0/",$_SERVER['PHP_SELF'])||    ereg("/f/15/0/",$_SERVER['PHP_SELF']) ||    ereg("/f/11/0/",$_SERVER['PHP_SELF'])||    ereg("/f/6/0/",$_SERVER['PHP_SELF'])||    ereg("/f/7/0/",$_SERVER['PHP_SELF'])||    ereg("/f/8/0/",$_SERVER['PHP_SELF'])||    ereg("/f/10/0/",$_SERVER['PHP_SELF'])||    ereg("/f/9/0/",$_SERVER['PHP_SELF'])||    ereg("/l/0/",$_SERVER['PHP_SELF'])||    ereg("/forums/index.php$",$_SERVER['PHP_SELF'])} 
text here
{ENDIF}

This is useful for printing a text only on a few page on a forum.

Matt

[Updated on: Thu, 20 July 2006 14:29]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Integrate With A Mailing List
Next Topic: Email Mailing list integration
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 19:27:59 GMT 2024

Total time taken to generate the page: 0.02173 seconds