vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [MYSQL] error: Call to a member function fetch_array() (https://vborg.vbsupport.ru/showthread.php?t=282970)

ezak 05-15-2012 07:44 PM

[MYSQL] error: Call to a member function fetch_array()
 
I'm trying o make this modification Threads notifications work with VB4


and get this error
PHP Code:

Fatal errorCall to a member function fetch_array() on a non-object in /home/username/public_html/vbtest/includes/class_bootstrap.php(1212) : eval()'d code on line 11 


follwing this error found this

PHP Code:

($hook vBulletinHook::fetch_hook('notifications_list')) ? eval($hook) : false

-- but I don't know where is "eval()d code on line 11"

following the notifications_list hook in this modification
found this

EDITED BY BOP5

PHP Code:

    // fetch user readed threads 
    
$notifications_get $vbulletin->db->query_read("
        SELECT * FROM . nlp_notifications_read
        WHERE userid = " 
$vbulletin->userinfo['userid'] . 
        
iif(((THIS_SCRIPT == 'SHOWTHREAD') AND $threadid),'AND threadid =' $threadid));
    while(
$notifications_ids $db->fetch_array($notifications_get))
    {
        
//if(THIS_SCRIPT == 'SHOWTHREAD' AND $threadid = $notifications_ids['threadid']) continue;
        
$notifications_threadids .= ', ' $notifications_ids['threadid'];
    } 


I dont' know where is the error , and how to solve it
is this mysql functions is not working with VB4 ?

BirdOPrey5 05-15-2012 08:20 PM

The problem is with the line:

Code:

while($notifications_ids = $db->fetch_array($notifications_get))
You should update all database calls from $db->blah_blah_blah to $vbulletin->db->blah_blah_blah

and make sure you've made $vbulletin global in the plugin by calling:
Code:

global $vbulletin;
if it hasn't been done already in the code... it doesn't hurt to call it again if you're not sure.

While you are allowed up update a mod for personal use, please do not post any additional full plugins from the mod- the code is copyright from the original author and he did not give permission to re-use the code.

Only the most minimal code necessary to answer a specific question should be posted in the future.

ezak 05-16-2012 04:18 PM

thanks alot sir and sorry for that miss

the error has gone >>> but nothing appear for seeing the modification is working, I think the problem is in the templates

I need an reference for how to convert the templates form vb3 to vb4

BirdOPrey5 05-16-2012 04:27 PM

Check out this article:
https://vborg.vbsupport.ru/showthread.php?t=228078

There are quite a few changes in both template syntax and how templates are called in plugins. This wasn't going to be something you can upgrade with a couple of lines edited.


All times are GMT. The time now is 11:16 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.01269 seconds
  • Memory Usage 1,725KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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