Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Jun 2012, 10:48
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
I have a php if conditional, please help how to write it in template

this is if conditional for if the url is xxx, in php

if ($vbulletin->url == 'http://domain.com/forum/somepage.html')
{
}

i want to use it in template, please help what is looks like?






i already tried this
<if condition="$vbulletin->url == http://domain.com/forum/somepage.html">
</if>
but got error like this and cant save the template

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ':' in /home/username/public_html/includes/adminfunctions_template.php(3605) : eval()'d code on line 91

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #2  
Old 13 Jun 2012, 12:39
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You removed the single quotes when you put it in the template condition, but you need them. Try taking the php condition that's between the parentheses and just copy it to between the quotes in the template.
Reply With Quote
  #3  
Old 28 Aug 2012, 04:42
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
arghh i am still cant make it, already tried add the single quote, so like this

<if condition="$vbulletin->url == 'http://domain.com/forum/somepage.html'">
</if>


can anyone tried it please, or know the working this conditional



i already tried this too (from this thread), but looks like still not working too
<if condition="$_SERVER['REQUEST_URI'] == '/forum/somepage.html'">
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #4  
Old 28 Aug 2012, 09:22
Scanu's Avatar
Scanu Scanu is offline
 
Join Date: Nov 2010
Originally Posted by basketmen View Post
arghh i am still cant make it, already tried add the single quote, so like this





can anyone tried it please, or know the working this conditional



i already tried this too (from this thread), but looks like still not working too
<if condition="$_SERVER['REQUEST_URI'] == '/forum/somepage.html'">
Strange.. Try

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Or this

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by Scanu; 28 Aug 2012 at 09:38.
Reply With Quote
  #5  
Old 29 Aug 2012, 01:47
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by Scanu View Post
Strange.. Try

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Or this

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
thank you for answering, but that code still not working too

can anyone try it in your forum please
__________________
I am SEO specialist and forum coordinator
Reply With Quote
  #6  
Old 30 Aug 2012, 11:57
basketmen's Avatar
basketmen basketmen is offline
 
Join Date: Nov 2006
Originally Posted by basketmen View Post
i already tried this too (from this thread), but looks like still not working too
<if condition="$_SERVER['REQUEST_URI'] == '/forum/somepage.html'">
ah this one at least works,

and the url used is the non rewrited url, so the original url, if the url are rewrited by vbseo or another mod

Scanu methode above maybe works too, and using the original url

only the first methode that not working, even already using original url, wonder why, but its ok already have the working code
<if condition="$vbulletin->url == 'http://domain.com/forum/somepage.html'">
</if>


Thank you and GBU for Scanu and kh99
__________________
I am SEO specialist and forum coordinator
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 18:59.

Layout Options | Width: Wide Color: