vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Hooks and variables after paid subscription complete (https://vborg.vbsupport.ru/showthread.php?t=172787)

nighteyes 03-12-2008 10:48 AM

Hooks and variables after paid subscription complete
 
Hi!

I need some help from a vBulletin programming god!

I'm working on a fairly simple plugin that will send a private message to users who subscribe to one particular subscription plan in vBulletin.

The subscription has the ID of 3.
The usergroup ID users get moved after subscription is 9.

So I've decided the best way to do this is check the usergroup ID after their payment is complete.

I've chosen this hook:
paidsub_build

And the code:
<phpcode><![CDATA[if ($user['usergroupid'] == 9)
{
---CODE GOES HERE IF TRUE----
}]]></phpcode>

This isn't working for whatever reason. I guess the variable I'm trying to check is not valid, set or available from within the hook.

Should I use a different hook location? Which one?
And which variable should I check (i.e. $newusergroupid == 2)?

I'd be so grateful if someone could give me some hints on what I'm doing wrong. This is really driving me insane today.

MoT3rror 03-12-2008 07:29 PM

$vbulletin->userinfo['usergroupid']

Antivirus 03-12-2008 08:07 PM

I think what you want is something like:

PHP Code:

if ($currentsubscription['subscriptionid'] == 3)
{
     
code here


Since the subscription you're talking about always changes the user's usergroup to 9, there's no need to check the usergroupid - check the subscriptionid instead.

nighteyes 03-13-2008 07:13 AM

Thanks for the advise. I've given up on this, I can't even get the private message to send - let alone concern myself with checking the usergroup or subscription ID.

If anyone is interested in coding this for me, I've posted a paid work request here:
https://vborg.vbsupport.ru/showthread.php?t=172882

As I posted in the above link, you'll find plenty of code around already to get this job done. I'm willing to pay a premium if someone has the time to get this done today. :)


All times are GMT. The time now is 04:48 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.01017 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)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