vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Views Don't Count If Done By Guest Or Thread Starter Unless Replying (https://vborg.vbsupport.ru/showthread.php?t=49867)

Boofo 05-05-2003 12:50 AM

006, in your first step in the showthread.php, the last 2 lines are wrong (they give a db error):

Instead of:

PHP Code:

elseif {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");} 

it should be:

PHP Code:

else {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");} 

shouldn't it?

Boofo 05-05-2003 03:23 AM

For some reason, this hack is no longer working for me. The thread views are not updating even when I am not the thread starter or last poster.

007 05-05-2003 04:24 AM

That's weird. That's what happened to me before I "fixed" it... which I thought I did. I haven't been having any problems with it. I'll check it tomorrow.

The code you mentioned above is set to -1 so it doesn't give you a view after posting your own topic.

You wouldn't want to change it to +1 because it is already adding one. I think that part is no longer necessary since I took out the disableing view count adding if you are the last poster option since that gave me trouble.

I will look into this tomorrow and let you know.

Boofo 05-05-2003 06:26 AM

After you look at the file in post 1, let me know what you find out. I'd really like to get this working. Thanks. ;)

007 05-05-2003 04:07 PM

Ok, try cdownloading the file again. If it does not say "Updated 05/05/03" after "by 006" then you will need to clear your history and try opening it again.

What I did was remove some unecessary code in the 2nd step. This should have an effect on whether or not it works, but it makes the code cleaner.

The reason for the -1 as you mentioned before, is so after someone makes a post, usualy in VB by the time they finish posting it, there are already 2 views on it. This simply makes it so first of all they don't get a view as the thread poster, and second of all, the first view will be subtracted. This leaves new posts with 0 views.

Boofo 05-05-2003 05:13 PM

The code you updated was for the newreply, right? That's not where I was having the problem yesterday. ;)

007 05-05-2003 05:43 PM

I know but are you sure you have the most recent file??? It works totally fine with the most recent.

The problem you are having sounds a lot like what I was having before I fixed it... The new file says Updated 05/05/03 near the top of it. Let me know. :ermm:

007 05-19-2003 02:59 PM

Does this work for you now Boofo?

Pikok 07-14-2003 03:18 PM

There's an error in your code in step 3..

In "root/showthread.php" you say to replace:
PHP Code:

if ($noshutdownfunc) {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'"); 

With
PHP Code:

//Start Views Don't Count based on Variables by 006
if ($noshutdownfunc) {
if (
$thread['postuserid']==$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif (!
$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");}
//End Views Don't Count based on Variables by 006 

However, it should be replaced with:
PHP Code:

//Start Views Don't Count based on Variables by 006
if ($noshutdownfunc) {
if (
$thread['postuserid']==$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif (!
$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
else {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");}
//End Views Don't Count based on Variables by 006 

The last elseif statement should be an else statement. Can't have an if statement with no condition to be checked against. ;)

Azhrialilu 08-08-2003 08:14 AM

Pikok.. I could kiss you LOL I was just on the verge of going back to my last backup after the third time of installing, then I finally spotted your post!!!

It works beautifully now :)

*Clicks install*


All times are GMT. The time now is 07:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01148 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete