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)

Bison 08-08-2003 08:23 PM

Quote:

07-14-03 at 12:18 PM Pikok said this in Post #19
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. ;)

If you look a line down from that elseif statement, there's a reason why the elseif is used again ... the condition is continued from an else statement that opens another series of test conditions.

JeffyJoe 08-30-2003 11:01 PM

Bison
what is your suggestion?

Bison 09-01-2003 12:07 PM

Insert the code the way it is written in the hack ... it works!

X-Fan 09-09-2003 03:13 AM

No, it didn't work for me with the second elseif. Changing it to an else got my showthread working again.

007 01-08-2004 11:54 PM

Ok, it works just fine on a clean copy of VB. If you have hacked your board up then it may cause problems. Sorry to hear you guys had trouble. At least it's working now :)

akanevsky 04-19-2005 05:59 PM

Nice hack, shall install :)

Bison 10-09-2006 04:13 PM

Anyone done this hack for VB 3.5?


All times are GMT. The time now is 07:59 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.01395 seconds
  • Memory Usage 1,745KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_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
  • (7)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