Solved: 1 Year, 8 Months ago How to put ads per every 5 threads on forumdisplay?
Solved: 1 Year, 8 Months 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;">

How do I solve this?

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

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

Forum Jump:

Users browsing this thread: 1 Guest(s)