The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[HELP] Coding Help.
Well im trying to create a link that is dependent upon which "Team" you pick in "Edit Options" (done using the profile fields)
For example, if you pick "Team A" in your options then the link will go to /forums/teamA.php And if you pick "Team B" iny our options then the link will go to /forums/teamB.php Now i can't quite figure it out, since im no good at coding, but i will never just post on vb.org without trying myself. Here is what i managed to come up with. PHP Code:
and if im not mistaken the code is set so that if field10 is Team B then the link should be /forums/TeamB.php Any ideas please? Here is what it comes up with when i try to save. Code:
The following error occurred when attempting to evaluate this template: Parse error: syntax error, unexpected T_STRING in /home/oregami/public_html/forum/includes/adminfunctions_template.php(3929) : eval()'d code on line 139 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. |
#2
|
|||
|
|||
You need quotes around 'Team A' and 'Team B' in the conditionals
|
#3
|
|||
|
|||
Well thats sorted the error problem when i save it lol, but now the link isn't showing..
|
#4
|
||||
|
||||
Can we see what the page source says where the link is supposed to be?
Also, I think you want to do this: HTML Code:
<if condition="$post['field10'] === 'Team A'">
|
#5
|
|||
|
|||
There is no page source as of yet, im currently testing it with the URL's as http://www.MYSITE.com/forum/TeamA.php
and checking to see if it works by putting my cursor over the link and seeing if it goes to /forum/TeamA.php when my user profile field option is set as Team A But my problem now is, i have added the quotation marks around the field names 'Team A' and ' Team B' but now the link is not showing up on my navbar. |
#6
|
||||
|
||||
It won't show up in your navbar if you use $post. That is not valid there. Use $bbuserinfo if it is for the person viewing the site.
|
#7
|
|||
|
|||
Ahh, Thanks a lot - Worked like a charm
Really new to this coding business, so i don't know much, but i was half right eh. At least i now know for future use, thank you for your help, it's appreciated. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|