The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
If ...Else...help please!!
Hi there all.
Im new to PHP but having some troube in getting some simple bit of code to work.And I am trying... I know that the syntax for a PhP if..Else test is basically: < if(condition) dothis.... else dothat.... > But inside VBulletin when I go to edit my navbar template I see this: HTML Code:
<if condition="$bbuserinfo['pmunread']"> <a href="http://www.pakistancricketzone.com/private.php?"><img border="0" src="http://www.pakistancricketzone.com/images/xbox/nonewpm.gif" width="220" height="13"></a> HTML Code:
<if condition="$bbuserinfo['pmunread']"> <a href="http://www.pakistancricketzone.com/private.php?"><img border="0" src="http://www.pakistancricketzone.com/images/xbox/nonewpm.gif" width="220" height="13"></a> <else> <a href="http://www.pakistancricketzone.com/private.php?"><img border="0" src="http://www.pakistancricketzone.com/images/xbox/newpm.gif" width="220" height="13"></a> </if> Many thanks, Naeem anyone??? |
#2
|
||||
|
||||
<else />
|
#3
|
||||
|
||||
You might also want to switch your images -- you've got the No New PMs image being displayed when there are Unread Messages and the New PMs Image being displayed when there aren't any.
|
#4
|
|||
|
|||
Quote:
Dont worry it wasnt like that in the actual code as I didnt copy and paste all of it 1st time around. Below is the actual code I put in with <IF><Else/> and its still not working. Basically if there is a message then show newpm.gif otherwise show nonewpm.gif...at the moment it shows neither or both! For the life of me I really cant see why it shouldnt work....it still 'reads' good to me.:surprised: HTML Code:
<if condition="$bbuserinfo['pmunread']"> <a href="http://www.....com/private.php?"> <img border="0" src="http://www......com/images/xbox/newpm.gif" width="220" height="13"></a> <else/> <a href="http://www.....com/private.php?"><img border="0" src="http://www......com/images/xbox/nonewpm.gif" width="220" height="13"></a> </if> |
#5
|
||||
|
||||
<else /> don't forget the space before the / and it's better if you post your code here in code tags.
|
#6
|
|||
|
|||
Quote:
I always thought that the space before the > didnt matter and that the space was just insignificant! Now i know...many thanks again for your help |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|