Solved: 1 Year, 6 Months, 1 Week ago How to put ads per every 5 threads on forumdisplay?
#1
Solved: 1 Year, 6 Months, 1 Week ago
Hello, I am trying to put ads in forumdisplay per every 5 thread. I looked into forumdisplay file, there is a variable $threadcount in forumdisplay.php.
But this is called only once, and it doesn't count exact number of posts in current page. It just yields total number of threads in all pages.
So putting code like follow in forumdisplay_thread template didn't work using PHP and template conditional plugin:

<if $threadcount % 5 == 0 then>
<div style="text-align:center;">
{myadvertisements[zone_4]}
</div>
</if>

How do I solve this?
Thanks.

Solved. Just put
$threadcounter = 0;
before "if(!empty($threadcache) && is_array($threadcache))" in forumdisplay, then modify below

else
{
$bgcolor = alt_trow();
$threadcounter++;
echo "<script>console.log('Debug Objects: " . $threadcounter . "' );</script>";
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)