vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Pm Datamanager (https://vborg.vbsupport.ru/showthread.php?t=139961)

paul41598 02-20-2007 06:28 PM

Pm Datamanager
 
n/m

paul41598 02-21-2007 07:44 PM

Ok reviving this after a day cuz Im stumped, utterly. This sends the PM great, fine it works. However, IT DOES NOT indicate to the user that they have a new PM on forumhome. You basically have to open up your USERCP -- > Private Messages or whathaveyou in order to see the PM. Basically it doesnt update the pmtotal and pmunread fields. I've been at it all day, and just don't understand :eek: :mad:


PHP Code:

global $vbulletin$vbphrase;
$vbphrase init_language();
        
$pmbody construct_phrase($vbphrase['sendpm_on_p_alertpm']);

$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_ARRAY);
$pmdm->set('fromuserid'$vbulletin->options['sendpm_on_fromuserid']);
$pmdm->set('fromusername'$vbulletin->options['sendpm_on_fromusername']);
$pmdm->set('title'$vbulletin->options['sendpm_on_subject']);
$pmdm->set('message'$pmbody);
$pmdm->set_recipients($user['username'], $botpermissions);
$pmdm->set('dateline'TIMENOW);
$pmdm->save(); 


Guest190829 02-22-2007 07:05 AM

Quote:

Originally Posted by paul41598 (Post 1187755)
Ok reviving this after a day cuz Im stumped, utterly. This sends the PM great, fine it works. However, IT DOES NOT indicate to the user that they have a new PM on forumhome. You basically have to open up your USERCP -- > Private Messages or whathaveyou in order to see the PM. Basically it doesnt update the pmtotal and pmunread fields. I've been at it all day, and just don't understand :eek: :mad:


PHP Code:

global $vbulletin$vbphrase;
$vbphrase init_language();
        
$pmbody construct_phrase($vbphrase['sendpm_on_p_alertpm']);

$pmdm =& datamanager_init('PM'$vbulletinERRTYPE_ARRAY);
$pmdm->set('fromuserid'$vbulletin->options['sendpm_on_fromuserid']);
$pmdm->set('fromusername'$vbulletin->options['sendpm_on_fromusername']);
$pmdm->set('title'$vbulletin->options['sendpm_on_subject']);
$pmdm->set('message'$pmbody);
$pmdm->set_recipients($user['username'], $botpermissions);
$pmdm->set('dateline'TIMENOW);
$pmdm->save(); 


Where are you running this code?

paul41598 02-22-2007 09:58 AM

paidsub_build actually, which there in might be the problem. You can see by my code that in order for the phrases to actually work, I had to initiate the language there. Its very hard to work within that plugin, lol

Guest190829 02-25-2007 10:19 PM

You need to make sure print_output is being called somewhere, as those fields (pmunread and pmtotal) are updated via a shutdown query.

Adrian Schneider 02-25-2007 10:31 PM

I remember bashing my head on the desk for a while on that one (shutdown query) last year... :(

paul41598 02-25-2007 11:01 PM

hmmm, print_output as in for fetching a template? What if Im not using any?

Adrian Schneider 02-25-2007 11:08 PM

Call the exec_shut_down() function


All times are GMT. The time now is 06:09 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.01259 seconds
  • Memory Usage 1,750KB
  • 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)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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