vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Query in postbit (https://vborg.vbsupport.ru/showthread.php?t=124891)

rogersnm 08-25-2006 12:40 PM

Query in postbit
 
I am trying to make a query inisde ta plugin with the location:postbit_display_complete but when i put $db->query_read or $vbulletin->db->query_read then you get:
Quote:

Fatal error: Call to a member function on a non-object in /home/vbnova/public_html/includes/class_postbit.php(296) : eval()'d code on line 20
Which plugin location should i use?

Guest190829 08-25-2006 01:02 PM

It's in a class, so try:

PHP Code:

$this->registry->db-> 


rogersnm 08-25-2006 01:59 PM

now i have:
PHP Code:

$postuserid $post['userid'];


$threadsmade $this->registry->db->query_read("SELECT COUNT(*) AS threads FROM thread WHERE postuserid = '$postuserid'");


$post['threadsmade'] = $threadsmade['threads'];


echo 
$post['threadsmade'] . ", "

And all i get is: ", , , , , ," Any ideas?

fabioski 08-15-2008 12:40 PM

I have the same problem.
How can I query my DB in a postbit_display_complete location plug-in?

--------------- Added [DATE]1218810281[/DATE] at [TIME]1218810281[/TIME] ---------------

With:
$this->registry->db->query_read("
SELECT COUNT(*) AS numerolibri
FROM tab_mylib
WHERE myl_userid = '1'
");
$testo_libri .= "$this[numerolibri]";

I obtain this error:
Quote:

Fatal error: Cannot use object of type vB_Postbit_Post as array in /var/www/web157/html/forum/includes/class_postbit.php(293) : eval()'d code on line 18

Marco van Herwaarden 08-16-2008 11:40 AM

Try:
PHP Code:

$query_result $this->registry->db->query_first("
 SELECT COUNT(*) AS numerolibri
 FROM tab_mylib
 WHERE myl_userid = '1'
"
);
$testo_libri .= $query_result['numerolibri']; 


fabioski 08-16-2008 03:34 PM

Yeahhhh now it works!

I add some keywords for future searches:
query postbit
postbit plugin
query postbit_display_complete


All times are GMT. The time now is 05:04 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.01095 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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