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>
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.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
//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");
Exactly how would you insert this?
Code:
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.
Thanks but I still don't understand quite yet. What about the eval part that goes under it? Don't I need 2 of them? And what do I call the templates? Can you give me the complete code with this stuff in it, please? And is there any way to incorporate Lesane's addon for the character limit in these?
Quote:
Originally posted by musicfreak12399 have it like this
Code:
//Most Popular Thread by Replies
$popularreply=$DB_site->query_first("SELECT * FROM thread ORDER by replycount DESC LIMIT 1");
Code:
//Most Popular Thread by Views
$popularview=$DB_site->query_first("SELECT * FROM thread ORDER by views DESC LIMIT 1");
Template Change
Code:
Most popular thread by reply is <a href="showthread.php?s=$session[sessionhash]&threadid=$popularreply[threadid][threadid]">$popularreply[title]</a>
Code:
Most popular thread by views is <a href="showthread.php?s=$session[sessionhash]&threadid=$popularview[threadid][threadid]">$popularview[title]</a>
//Most Popular Thread by Replies
$popularreply=$DB_site->query_first("SELECT * FROM thread ORDER by replycount DESC LIMIT 1");
//Most Popular Thread by Views
$popularview=$DB_site->query_first("SELECT * FROM thread ORDER by views DESC LIMIT 1");
Quote:
Originally posted by Lesane Great Hack PPN, i luv it but i had the "Show most popular thread" in a table and my most popular thread has a very long title, more then 40 characters so i reduced it 2 25.
I figured it out. Instead of making any templates, I just used the template code you gave directly in the forum home template. I put the first 2 parts in the index.php and that last 2 lines of code in the forumhome template. Is that what you meant?
Nice Hack thanks. Installed on v2.3 #3 Easily. The code I used was that which was posted by 'musicfreak12399' above. There is a slight code difference.
On the forum home template, you will note that his code has an extra: '[threadid]' on it - While it will work that way, its not correct. Just remove it from the end and you should be fine.