[Release VB2] Total Thread Views

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SystemLogic
    Senior Member
    • Jan 2001
    • 119

    [Release VB2] Total Thread Views

    This hack was done by Kier, just wanted to post it in its own thread

    What It Does

    Counts all the views for each thread and adds them together. Basically a sum of the pageviews for all of your threads.

    How To Implement This

    Copy and paste this code into index.php in the regular forum directory.

    PHP Code:
    // Total Thread Views

    $boardviews $DB_site->query_first("
        SELECT SUM(views) AS threadviews FROM thread"
    );
    $totalviews number_format($boardviews[threadviews]); 
    Then just print $totalviews anywhere you want.

    Example: http://www.systemlogic.net/boards on the top left next to the number of posts/threads stats.
  • bokhalifa
    Member
    • Feb 2001
    • 99

    #2
    good hack min

    Comment

    • JJR512
      Senior Member
      • Dec 2000
      • 507

      #3
      This is a cool little hack, I've just implemented it with no problems other than my own stupidity (I forgot to upload the new index.php -- d'Oh!).

      Anyway, after I installed it and looked at it (I put the output on a new line under the thread and post counts), it occurred to me that if you've imported from UBB (as I have), this isn't really a true count. UBB doesn't keep track of thread views, so however many you had while using UBB don't count. Your actual number may be a little higher or much higher; there's no real way to know.

      This is not a criticism; I don't mean to rain on this parade. I'm just pointing it out, that's all.
      -Justin "JJR512" Rebbert
      JJR512.com: Chat about anything!

      Comment

      • George L
        Former vBulletin Support
        • May 2000
        • 32996
        • 3.8.x

        #4
        nice
        :: Always Back Up Forum Database + Attachments BEFORE upgrading !
        :: Nginx SPDY SSL - World Flags Demo [video results]
        :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

        Comment

        • SystemLogic
          Senior Member
          • Jan 2001
          • 119

          #5
          Anyway, after I installed it and looked at it (I put the output on a new line under the thread and post counts), it occurred to me that if you've imported from UBB (as I have), this isn't really a true count. UBB doesn't keep track of thread views, so however many you had while using UBB don't count. Your actual number may be a little higher or much higher; there's no real way to know.
          Yup, you're right, but I guess it's a good thing if you're starting over or just starting up using VBulletin. If you're importing into VB from anything else like UBB, it won't convert the thread views.....Just thought it be cool to have for those that wanted it

          Comment

          • The_Sisko
            Senior Member
            • Jun 2000
            • 384

            #6
            Good idea! Thx for repost it as a own thread.
            The Sisko
            SciFi-Forum.de

            Comment

            • n3n
              New Member
              • Mar 2001
              • 28

              #7
              great little hack!!
              I have added this feature on my forum ^_^
              thanks

              Comment

              • TimberLand
                Senior Member
                • Feb 2001
                • 148
                • 3.0.3

                #8
                As far as the ubb missing views, could you add a little saying as of May 7, 2001 or something like that. If so how would I do that?

                Dan
                Dan Flynn
                http://www.powerwashnetwork.com

                Comment

                • Sarge
                  Senior Member
                  • Oct 2000
                  • 312

                  #9
                  where do I insert this at?

                  what line number?

                  And what about adding "Thread views since""
                  Like posted above

                  Great idea.

                  Comment

                  • TimberLand
                    Senior Member
                    • Feb 2001
                    • 148
                    • 3.0.3

                    #10
                    Who Knows

                    That was just an idea I had. I would like to know as well. Any hackers interested.
                    Dan Flynn
                    http://www.powerwashnetwork.com

                    Comment

                    • Sarge
                      Senior Member
                      • Oct 2000
                      • 312

                      #11
                      easy dude

                      Just insert

                      $totalviews since 1-5-01 into where you want it on your forum home template

                      Comment

                      • JJR512
                        Senior Member
                        • Dec 2000
                        • 507

                        #12
                        Well, it's very simple. Where ever you stick the $totalviews, just put the text by that. For example, if you put it in your forumhome template, so it's below your total threads and total posts, as I did, like this:
                        Code:
                        <b>$totalviews</b> total thread views
                        You could just change it to this:
                        Code:
                        <b>$totalviews</b> total thread views since May 7, 2001
                        (Or use whatever date it was when you converted from UBB to vB.)
                        -Justin "JJR512" Rebbert
                        JJR512.com: Chat about anything!

                        Comment

                        • TimberLand
                          Senior Member
                          • Feb 2001
                          • 148
                          • 3.0.3

                          #13
                          Where do you paste the code at, in the index.php? Anywhere special.

                          Can someone give an example of placement.

                          Thanks
                          Dan
                          Dan Flynn
                          http://www.powerwashnetwork.com

                          Comment

                          • Sarge
                            Senior Member
                            • Oct 2000
                            • 312

                            #14
                            in the forum home template


                            Put it under launch buddy list or wherever

                            Comment

                            • JJR512
                              Senior Member
                              • Dec 2000
                              • 507

                              #15
                              Originally posted by JJR512
                              Well, it's very simple. Where ever you stick the $totalviews, just put the text by that. For example, if you put it in your forumhome template, so it's below your total threads and total posts, as I did, like this:
                              Code:
                              <b>$totalviews</b> total thread views
                              You could just change it to this:
                              Code:
                              <b>$totalviews</b> total thread views since May 7, 2001
                              (Or use whatever date it was when you converted from UBB to vB.)
                              -Justin "JJR512" Rebbert
                              JJR512.com: Chat about anything!

                              Comment

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