how to execute php code into fud templates? [message #32754] |
Wed, 19 July 2006 00:10 |
matthieu_phpmv
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 #32776 is a reply to message #32763] |
Thu, 20 July 2006 14:06 |
matthieu_phpmv
Messages: 44 Registered: November 2004
Karma: 0
|
Member |
|
|
Hello Ilia,
Thanks for the quick answer, as usual, this is great
I've installed the following code which works
{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
|
|
|