Announcement

Collapse
No announcement yet.

[Release] Show most popular thread on index page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Release] Show most popular thread on index page

    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
    Code:
    // get total posts
    $countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
    add either of the following depending on what you want to be picked as most popular.

    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");
    then below that add the following
    Code:
    eval("\$popularthread = \"".gettemplate("popular_thread")."\";");
    save index.php and upload.

    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.
    Last edited by Scott MacVicar; Sun 19 Aug '01, 4:14am.
    Scott MacVicar

    My Blog | Twitter

  • #2
    hmmm doesnt work

    doesnt show up in forum home

    Comment


    • #3
      Same here - doesn't work for me, either.

      Phil~

      Comment


      • #4
        nice one PPN works fine, take a look http://www.skytronic-forums.com/forum/

        ltr Mobile
        visit www.skytronic-forums.com

        Comment


        • #5
          don't work ;(

          don't work...
          please fix bug's...
          Sorry for my bad English! :)

          Comment


          • #6
            Are you getting any error messages at all?

            i've installed it twice on other boards and it worked fine. Another person pasted in both lines for getting most popular. Ie the one for popular by reply and the popular by views. Make sure you only paste one of them in.
            Scott MacVicar

            My Blog | Twitter

            Comment


            • #7
              Ok. Thx! All work! Fine work!
              You could not make Show most popular thread on index page at present (at the rate of 24 hours)?
              Sorry for my bad English! :)

              Comment


              • #8
                Not a bad idea but I think I'll skip this one. The one weakness to the linear style bulletin board is that once you go beyond one page it's much harder to read and manage than threaded bbs'es or some other style bbs'es (it does exist). On my board this would just encourage people to make those monster threads even more unmanageable.

                Comment


                • #9
                  nope

                  all code is correct

                  just doesnt show up!?

                  weird....

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  X