This is probably too small to qualify has a hack but i've seen one or two posts looking for it. This finds the most popular thread on the board.
Open index.php and before
add either of the following depending on what you want to be picked as most popular.
then below that add the following
save index.php and upload.
Then within the control panel click add templates.
Template name is popular_thread
and the code should be this
Then in either of your forumhome templates place $popularthread and the text "Most populat thread is THREADTITLE"
the threadtitle will be a link to the title.
Open index.php and before
Code:
// get total posts $countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
Code:
//Most Popular Thread by Replies $popular=$DB_site->query_first("SELECT * FROM thread ORDER by replycount DESC LIMIT 1");
Code:
//Most Popular Thread by Views $popular=$DB_site->query_first("SELECT * FROM thread ORDER by views DESC LIMIT 1");
Code:
eval("\$popularthread = \"".gettemplate("popular_thread")."\";");
Then within the control panel click add templates.
Template name is popular_thread
and the code should be this
Code:
Most popular thread is <a href="showthread.php?s=$session[sessionhash]&threadid=$popular[threadid]">$popular[title]</a>
the threadtitle will be a link to the title.
Comment