vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Unregistered/Deleted Members Cause This SQL Error... (https://vborg.vbsupport.ru/showthread.php?t=69520)

InsaneContender 09-16-2004 01:24 PM

Unregistered/Deleted Members Cause This SQL Error...
 
I've been having problems with this, but whenever someone posts and then that user gets deleted as well - I get this SQL error on every page that they posted on.

Just the one link is an example of it.

http://www.communityforums.net/forum...ead.php?t=1242

NTLDR 09-16-2004 02:29 PM

The prolem comes from whichever hack adds the following query in showthread.php:

[sql]COUNT(*) AS count FROM user WHERE referrerid =[/sql]

The problem being there is no numer after referrerid = in the query for guests/unregistered users.

Agent Jones 02-05-2005 03:29 PM

Also having the exact same problem... Found out in

/includes/functions_showthread.php

PHP Code:

    //Referral link mod
    
if ($vboptions['usereferrer'])
    {
        
$refcount $DB_site->query_first("SELECT
    COUNT(*) AS count FROM " 
TABLE_PREFIX "user WHERE referrerid =
     
$post[userid]");
        
$referrals vb_number_format($refcount['count']);
    }
    
//!Referral link mod 

Maybe I added something, but I just commented out (look below) and it now works...

PHP Code:

    //Referral link mod
    /*if ($vboptions['usereferrer'])
    {
        $refcount = $DB_site->query_first("SELECT
    COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE referrerid =
     $post[userid]");
        $referrals = vb_number_format($refcount['count']);
    }*/
    //!Referral link mod 

PS: This might cause some malfunction in the mod... I hope not!


All times are GMT. The time now is 11:55 PM.

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.01061 seconds
  • Memory Usage 1,715KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete