vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   one line plugin not working (https://vborg.vbsupport.ru/showthread.php?t=95606)

Nullifi3d 09-04-2005 02:41 AM

one line plugin not working
 
When I submit a new reply I get the following error:
Quote:

Fatal error: Call to a member function on a non-object in /home/whd/public_html/includes/functions_newpost.php(427) : eval()'d code on line 1
I installed a plugin in newpost_complete. I tried 2 variations of the code:
Code:

$db->query("UPDATE user SET available = available + 100 WHERE userid = $bbuserinfo[userid]");
Code:

$db->query("UPDATE user SET available = available + 100 WHERE userid = $vbulletin->userinfo[userid]");

Andreas 09-04-2005 02:47 AM

1) $db is not within the Scope of build_new_post(); $vbulletin is.
2) $bbuserinfo does not exist in vB 3.5
3) You cant use $vbulletin->userinfo within an evaluated String - break out of it or use {}

But it might be a good idea to use userdata_postsave anyway to avaoid an additional Query.

Nullifi3d 09-05-2005 12:32 AM

Quote:

Originally Posted by KirbyDE
1) $db is not within the Scope of build_new_post(); $vbulletin is.
2) $bbuserinfo does not exist in vB 3.5
3) You cant use $vbulletin->userinfo within an evaluated String - break out of it or use {}

But it might be a good idea to use userdata_postsave anyway to avaoid an additional Query.

Thanks for the info. Do you have any other information on this userdata_postsave?

Would it be something like this?
Code:

$uid = $vbulletin->userinfo[userid];
$this->query("UPDATE user SET available = available + 100 WHERE userid = $uid");


Andreas 09-05-2005 03:44 AM

Actually it would be smth. like this in the Datamanager
PHP Code:

$this->registry->db->query_write("UPDATE " TABLE_PREFIX "user SET available = available + 100 WHERE userid =" $this->registry->userinfo['userid']); 


Nullifi3d 09-05-2005 02:18 PM

thanks for helping out KirbyDE. Is there any place I can look to see more detailed documentation as to what can be used in which hooks?

Andreas 09-05-2005 02:37 PM

Yes - the PHP files :)

Nullifi3d 11-08-2005 08:53 PM

Can you tell me which php file has userdata_postsave hook in it?

Andreas 11-08-2005 10:19 PM

class_dm_user.php

Nullifi3d 11-09-2005 10:03 AM

Thank You


All times are GMT. The time now is 03:42 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.01037 seconds
  • Memory Usage 1,727KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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