Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Show Most Viewed Threads based on days?
#1
Not Solved
hai all, I want to show most viewed threads based on 7 days  before today, can anybody help me out?

I create this code

if(!$most_viewed)
{
    $cache->update_most_viewed_threads();
    $most_viewed = $cache->read("most_viewed_threads", true);
}
$x = 0;
if(!empty($most_viewed))
{
    foreach($most_viewed as $key => $thread)
    {
        $x+=1;
        if($x <= 7)  
        {
            $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
            $numberbit = my_number_format($thread['views']);
	   
            $thread['threadlink'] = get_thread_link($thread['tid']);
            eval("\$diskusi_most .= \"".$templates->get("index_most_viewed")."\";");
        }
    }
}
but how to filter it to 7 days before today only?

thanks Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)