| Re: Smarty function |
| by blueteen on 2008/3/13 9:37:24 Hello, here's how i proceed to do something similar. Create a new file "my_functions.php" in your theme folder. Copy this code inside Then, in your theme, add this line, right under the body tag le="color: #000000"><?php <{include_php file="$xoops_rootpath/themes/YOUR_THEME_NAME/my_functions.php"}> and you can now use this piece of code in your theme : le="color: #000000"><?php <{if $newsok == "1"}> your code here <{/if}> I use this code too for personnal use le="color: #000000"><?php if (eregi('viewpmsg',$_SERVER['SCRIPT_NAME']) || eregi('readpmsg',$_SERVER['SCRIPT_NAME'])) { $this->assign('messagerie', '1'); } So, for your question, I think that you can use this : le="color: #000000"><?php if (eregi('storytopic,$_SERVER['SCRIPT_NAME'])) { $this->assign('storytopic', '1'); } and in your theme le="color: #000000"><?php <{if $storytopic == "1"}> your code here <{/if}> i'm using this, to display a custom block, only on http://www.website.fr/modules/news/ webpage. and not on http://www.website.fr/modules/news/index.php?storytopic=12 for example. |
| Re: Smarty function |
| by iHackCode on 2008/3/13 3:14:17 searching in google i found this. http://www.phpinsider.com/smarty-forum/viewtopic.php?=&p=39484 so try <{if $xoops_requesturi|strstr:"storytopic"}> ... <{/if}> or <{if $xoops_requesturi|eregi:"storytopic"}> ... <{/if}> .i havent tested it though. my wamp died. |
| Smarty function |
| by Kumar on 2008/3/12 8:29:33 I want to know whether a string is there in a variable <{if $xoops_requesturi 'contains' "storytopic"}> do this.. <{/if}> what function can i use instead on 'contains'? Any solutions. Thanks in Advance. |