The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hey all, I've stumbled across an issue that has got me totally stumped.
What I have is a script that will run via the scheduled task system that will update a users membergroups based on whether they have a particular award assigned to them. (and removes if they no longer have that award) This was working great when it was done for a couple of awards as I simply hardcoded in the award and group id's. Now, as there are many awards and groups to assign I modified the script and put all of the values into an array, which will then loop through that and update everyone accordingly. Sounds simple, and when I echo to screen all of the data it looks like it is working perfectly. However it is not updating everyone as per what is being displayed on the screen. It is almost as if the PHP Code:
As mentioned above, if I hard code the group and award id's it works perfectly. So it appears to be something to do with the looping of the array that is upsetting the datamanager. Just wondering if this is a limitation or just something I'm doing wrong! I've tried several variants of looping the array from foreach, do while, and finally a simple count array and then a for loop until count. All the same result! Below is the first half of the script that has the add users. The delete is essentially the same problem. This is the latest test with the count array and for until count option. Here's a sample of the many echos (being very thorough!) that is produced when the script is run. The first ID user 66 is being assigned to group 50 as he has that award, but when I check the account after the script has been run it is not there even though it says it's been saved. Any ideas at all? Code:
18| Award=3, Group=50 Existing Groups=27,43 | UserID=66 Membergroups=27,43,50 | Account updated! | UserID=66 Membergroups=27,43,50 Existing Groups=52 | UserID=806 Membergroups=52,50 | Account updated! | UserID=806 Membergroups=50,52 Existing Groups=37,48,50 | UserID=234 Membergroups=37,48,50 | Account updated! | UserID=234 Membergroups=37,48,50 Existing Groups=48,50 | UserID=800 Membergroups=48,50 | Account updated! | UserID=800 Membergroups=48,50 PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|