2-for-1 special on thread views?!?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shredfest
    New Member
    • Aug 2001
    • 4

    2-for-1 special on thread views?!?

    Every time I enter a thread, then hit the back button on my browser, the "Views" for that thread has increased by two! I am the only one on the board. Any fix for this?

    Thanks!
    Real Guitar Rock!
    www.houseofshred.com
  • reveltaion456
    Senior Member
    • Jul 2001
    • 216

    #2
    This is one of the reasons I recommended there only be one view counted per user no matter how many time he visits the thread.

    It didn't go through so now you know.

    Comment

    • Shredfest
      New Member
      • Aug 2001
      • 4

      #3
      OK, but I still don't understand why entering a thread, then backing out of it causes the views to increment by two. I'm only loading the page that displays the thread once.

      When I do the same thing here, the views only increment by one.

      Help!
      Real Guitar Rock!
      www.houseofshred.com

      Comment

      • reveltaion456
        Senior Member
        • Jul 2001
        • 216

        #4
        Maybe its because conincidentially, someone else viewed the thread at the same time?

        Comment

        • Mike Sullivan
          Former vBulletin Developer
          • Apr 2000
          • 13327
          • 3.6.x

          #5
          It's a strange issue that's cropped up once or twice before. The one time, I remember, had something to do with something the guy put in his templates. It made no sense why it was happening, but try reverting your header/footer/phpinclude/showthread templates and see if that helps...

          Comment

          • Freddie Bingham
            Former vBulletin Developer
            • May 2000
            • 14057
            • 1.1.x

            #6
            And try changing this in showthread.php
            Code:
            if ($noshutdownfunc) {
              $DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
            } else {
              $shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'";
            }
            to
            Code:
            if ($noshutdownfunc) {
              $DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");
            } else {
              $shutdownqueries[]="UPDATE thread SET views=views+1 WHERE threadid='$threadid'";
            }

            Comment

            • Shredfest
              New Member
              • Aug 2001
              • 4

              #7
              Thanks for the ideas. Freddie, I made the code change you suggested, but it didn't fix the problem. The only two templates I had changed were the header and footer. I reverted the footer back to the original - not fixed. I then reverted the header back - FIXED!

              Here's the modified header code that was causing the problem:

              Code:
              <!-- logo and buttons -->
              <center>
              <table border="0" width="100%" cellpadding="0" cellspacing="0">
              <tr>
                <td valign="top" align="left" background="#000000"><a href="/index.htm"><img src="images/vBulletin_logo.gif" border="0" alt="$bbtitle"></a></td>[COLOR=red]</tr>
                <tr>[/COLOR]<td valign="bottom" [COLOR=red]align="center"[/COLOR] nowrap background="images/menu_background.gif">
                 <!-- toplinks -->
                 <a href="usercp.php?s=$session[sessionhash]"><img src="images/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" border="0"></a>
                 <a href="register.php?s=$session[sessionhash]&action=signup"><img src="images/top_register.gif" alt="Registration is free!" border="0"></a>
                 <a href="calendar.php?s=$session[sessionhash]"><img src="images/top_calendar.gif" alt="Calendar" border="0"></a>
                 <a href="memberlist.php?s=$session[sessionhash]"><img src="images/top_members.gif" alt="Find other members" border="0"></a>
                 <a href="misc.php?s=$session[sessionhash]&action=faq"><img src="images/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
                 <a href="search.php?s=$session[sessionhash]"><img src="images/top_search.gif" alt="Search" border="0"></a>
                 <a href="index.php?s=$session[sessionhash]"><img src="images/top_home.gif" alt="Home" border="0"></a>
                 <!-- <a href="member.php?s=$session[sessionhash]&action=logout"><img src="images/top_logout.gif" alt="Logout" border="0"></a>  -->
                 &nbsp;
                 <!-- /toplinks -->
                </td>
              </tr>
              </table>
              <!-- /logo and buttons -->
              
              <!-- content table -->
              <table bgcolor="#FFFFFF" width="100%" cellpadding="10" cellspacing="0" border="0">
              <tr>
                <td valign="top">
              Basically all I did was center the buttons. Can anyone spot anything that might cause the doubling up of the page views?

              Thanks,
              Kevin

              EDIT: I also put the buttons in another table row to put a little more space between them and my site's logo and the area for a banner ad.
              Last edited by Shredfest; Mon 27 Aug '01, 5:59pm.
              Real Guitar Rock!
              www.houseofshred.com

              Comment

              • k2webfusion
                New Member
                • Jan 2002
                • 26

                #8
                Did anyone ever find a fix for this issue? One view actually is being counted as 2 on my forum as well. Just posted a new thread about it because I could not find an answer to the question after searching the forums for similar issue. It appears it happens a lot, but no explanation yet. If there's a fix, I haven't found it yet.

                Comment

                • almighty one
                  Senior Member
                  • Feb 2001
                  • 392

                  #9
                  Originally posted by k2webfusion
                  Did anyone ever find a fix for this issue? One view actually is being counted as 2 on my forum as well. Just posted a new thread about it because I could not find an answer to the question after searching the forums for similar issue. It appears it happens a lot, but no explanation yet. If there's a fix, I haven't found it yet.
                  i have the same prob however i have swutiched to he holiday theme for now and all is fine but if i switch to mystandard tems then double views once before it gave 3 to1 instead of 2 to 1 when i upgraded from 2.03 to 2.2.8 it fixed it but then somewhere something was edited and it screwed back up i just take out views and forget it as i consider it another lost feature
                  http://www.danasoft.com/vipersig.jpg

                  Comment

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