The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Conditonal Help
I am trying to create a conditional to use for the thread prefix hack. I would use two prefixes, one called members and one called guests. If the prefix is guest, i want guests to get a pop up asking them to register, or be redirected to the register.php.
If your familiar with the prefix hack you know the prefix itself can not have HTML mark up, you have to put it in the prefix HTML mark up box ( see screen shot here) So what kind of mark up could I use? I got as far as something like <if condition="({1} == guest (then) $bbuserinfo, 1")><else><if condition="({1} == Members (then) !$bbuserinfo, 1")> I know that is slopy and i could not think of the proper conditional to use for then, so atleast I tried. If some one could clean that up much appreciated. |
#2
|
|||
|
|||
I'd say the easiest way would be to just edit the appropriate Thread Prefix plugins. There are 7 "Display Prefix" plugins for each location it shows the Thread Prefix in though..
For example in "Prefix: Display Prefix in Front of Title (Thread)" plugin you could change PHP Code:
PHP Code:
EDIT: Thinking about it.. I realized this would print the error for every thread prefix that should be on the page though. Might want to insert it somewhere else? EDIT #2: Although I guess if you would try doing it your way by inserting it into the Prefix Markup box, it would be executing the code for every instance of the thread prefix, too. lol. EDIT #3: I just realized the plugin in my example was for SHOWTHREAD... not FORUMDISPLAY. lol. I need to lay off the caffeine. The right plugin might be "Prefix: Generate Prefix List (Forumdisplay)" |
#3
|
|||
|
|||
One thing i notice is in your code there is no checks to make the prefixes see weather a person is a guest or a member.
|
#4
|
|||
|
|||
Check the first line.
I'm not saying that will work (since that's not even the right plugin) but I was just using *any* Thread Prefix plugin to get the point across. I didn't exactly spend a lot of time thinking about it. haha. |
#5
|
|||
|
|||
I was told this can all be done via the HTML mark up so I think your code is going to deep in the first place.
This cant be to complicated but what about something like PHP Code:
|
#6
|
|||
|
|||
Well, what I was trying to explain is that if you were to use a JavaScript alert in the Prefix Markup, it's going to be executing it for every prefix on the page. I don't think 20 popups will be very user friendly? I can't be certain this will happen as I don't know the ins and outs of the code, but I'd say it's more than likely.
Alternately, you could try: Code:
<if condition="$show['member']">{1}<else /><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></if> Code:
<if condition="$show['member']">{1}<else />Register to View</if> EDIT: I think you're going to have to alter the plugins. Sorry. It didn't know what to do with the variables I used, so they'd need to be added into the plugin anyway.. OR whoever said conditionals would work in that markup box was wrong. Sorry. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|