Quote:
Originally Posted by LiveWire
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:
$random = rand(1, 5);
Template Condition can be...
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>
That will make it a 1 & 5 chance that the value of $random will be equaled to 3. Maybe this can give you a tip in the right direction :ermm:
|
Cool thanks.
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!