The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Alter membergroupids through MySQL?
My forum has a custom usergroup for 'member' which is a paid membership not managed through vBulletin. I'd like to update this through MySQL, based on information in a separate table. In my case let's say it is group 11.
This means that if a user's membergroupids value is: - blank I need to add '11' - 10 I need to add ', 11' - 12 I need to insert '11, ' - 10,12 I need to insert '11, ' - etc. Plus if someone's membership expires I'll want to remove the 11 along with any extra commas. Ideally there is a routine I can use somewhere in VB that will do this for me, but either way - is this something that anyone has dealt with before? Any suggestions? Sure I can write a bunch of if/then statements but I'm probably overlooking a much better solution. --------------- Added [DATE]1285008651[/DATE] at [TIME]1285008651[/TIME] --------------- Doing a bit more looking, it seems the process would be: Get membergroupids Explode it If arraysearch (11, membergroupids) - remove the 11 element - Implode it - save it Is there a function for removing a specific array element? I can find them for adding and removing end elements but nothing for a specific one that might be in the middle. |
#2
|
|||
|
|||
OK, looks like this hasn't really been tackled before. I'll get to it in the next few weeks, but it looks like array_splice() is going to be my friend for removing group IDs and array_push() will let me add them to the end.
get explode() array_search() array_splice() or array_push() or nothing if changed: - implode() - update |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|