The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need an idea on how to do this..
I have set up Paypal subscriptions on my forum and when someone subscribes, they get an additional usergroup. The only problem is that once someone pays via paypal, I have to manually change which Display Group is being displayed.
The new additional user group ID is 12 and the following SQL can be used to update which user group is displayed. Code:
update user set displaygroupid = 12 where membergroupids = 12 and displaygroupid = 0; |
#2
|
||||
|
||||
The query won't work if they have more than one secondary group.
Anyway, you need to identify WHERE the usergroup change is made, and add another line: $DB_site->query("query here"); |
#3
|
|||
|
|||
Quote:
I created the following cron, which seems to work Code:
<?php error_reporting(E_ALL & ~E_NOTICE); if (!is_object($DB_site)) { exit; } $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET displaygroupid = 12 WHERE membergroupids = 12 and displaygroupid = 0"); log_cron_action('Subscribing Member Display Group Updated', $nextitem); ?> |
#4
|
||||
|
||||
membergroupids can have more than one id, and therefore the query won't work for users which are in group 12 AND 13 for example
that's what rake meant |
#5
|
|||
|
|||
Ok, thanks for clearing that up. I only have one additional user group, so I think I am OK.
Since I only have one additional user group, does my SQL look ok? I have set it up to run as a VBcron. If I were to run this every 30 minutes, would it be to resource intensive? Im on a shared hosting account. Thanks. |
#6
|
||||
|
||||
It's not only about the usergroups you have added. A member could have as secondary groups both 12 and 6 (your custom group and admin) for example. But unless you have manually changed the secondary groups for some users or you have added promotions, you should be ok.
Running the cron every 30 minutes is fine. |
#7
|
|||
|
|||
Guys thanks for the help. The only seconday group I have is the promotions. BTW, this would be the first "hack" that I have written!
|
#8
|
||||
|
||||
Quote:
|
#9
|
||||
|
||||
erm?
it's a cron script, so no need to call global.php |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|