The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Please help!
Here's what I'm trying to do in the threadbit template:
Code:
<if condition="SOME CODE TO GENERATE A RANDOM CHANCE 1:50"> <if condition="$show['gotonewpost']"> <strong><a href="SPONSOR URL" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong> <else /> <a href="SPONSOR URL" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a> </if> <else /> <if condition="$show['gotonewpost']"> <strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong> <else /> <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a> </if> </if> Pleeease help. Thank you. |
#2
|
|||
|
|||
Cheap way to do it:
PHP CODE Using this will add a value to $random. That value can be anywhere between the #1 threw the #5. PHP Code:
HTML Code:
<if condition="$random == '3'"> <if condition="$show['gotonewpost']"> <strong><a href="SPONSOR URL" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong> <else /> <a href="SPONSOR URL" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a> </if> <else /> <if condition="$show['gotonewpost']"> <strong><a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a></strong> <else /> <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]">$thread[threadtitle]</a> </if> </if> |
#3
|
||||
|
||||
Quote:
Just tried it out... Doesn't seem to be outputting the sponsor link. Here's what I did... 1. Added a New Plugin via the Plugin Manager 2. This new plugin is called randNum and it contains this code: $random = rand(1, 5); 3. I set this to be called in the global_start. 4. I edited the template with the above template edit. Doesn't seem to be displaying the sponsor URL. Any ideas? EDIT: Nevermind. I think I got it working. Thanks for your help! This RULES! |
#4
|
|||
|
|||
No problem, remember its random. Sometimes it won't show up.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|