The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Quote:
|
#12
|
|||
|
|||
Actually I'm sorry, I was wrong. It appears that the datamanager does in fact update the userinfo if you're changing the current user. I never knew that.
|
#13
|
|||
|
|||
You learn something everyday! .
Which still makes me curious why the execution order isn't working properly. ^^ |
#14
|
|||
|
|||
I'm pretty sure that the execution order is screwed up.
I have this as execution order 2,3 and even tried 4: Code:
$userdata_rank->set('usergroupid', 42); $userdata_rank->save(); This works great, awesome! Now I've added another plugin to check if the user has been flagged on SteamREP.com as a scammer. I've disabled the usergroupID 42 move plugin to see after I steam linked my profile on the forums I would be banned.. and, it works! Now, if I enable both of them (move usergroupdID execution order 2, 3 or 4) with the second steamrep ban plugin execution order 1. I get moved to usergroupID 42, rather than the specific steamrep banned usergroup of which is 26. So, which made me wonder.. what if execution order 2, 3 or 4 beats 1? So I used the following code at the plugin with execution 2, 3 or 4 (tried all 3): Code:
if (!in_array($vbulletin->userinfo['usergroupid'], array(26)) ) { $userdata_rank->set('usergroupid', 42); $userdata_rank->save(); } Now, once again.. why isn't execution order doing its job? Both of these plugins are using the exact same hook. Is it broken? Has anyone tested it? Does execution order depends on the amount of the code? If one is smaller than the other, second one is being executed faster? What's the deal? |
#15
|
||||
|
||||
Honestly, I find it hard to follow what exactly you are doing, but if I read you correctly, your logic and your expectations seem to be at fault.
What you're describing: - plugin at exec order 1 that puts the user into ug 26. - second plugin at exec order 2, 3 or 4 that puts the user into ug 42. Both plugins are executed one after another. Result: The user ends up in ug 42. What else do you expect? This is confirmed by your second bit of code. Now you tell the second plugin to only move the user into ug 42 if he has not prior been moved to ug 26. Then he stays in 26. If you don't do that check, every user is moved to 42, whatever his prior ug. Again: That is correct and perfectly logical. I just don't see what else you could expect as a result based on the information you're giving. |
#16
|
|||
|
|||
Indeed, I just have checked and noticed a flaw in my execution order.. so, I switched them.
The first plugin, with execution order 1: Code:
$userdata_rank->set('usergroupid', 42); $userdata_rank->save(); The second plugin now with execution order 2 but with a much larger code but ends up with this: Code:
if (!in_array($vbulletin->userinfo['usergroupid'], array(6,7,5)) ) RESTOFTHECODE HERE $dataman->set('usergroupid', 26); $dataman->save(); Oddly enough, when both plugins are active.. the end results are that I'm being moved into usergroupID 42. Which makes me wonder, why. The second plugin is designed to move the user to usergroupID 26 despite whatever usergroup he/she is in (but ignores the specified 3 usergroups). Which makes me assume, that plugin 2 runs first, and then executes the first plugin with execution order 1. if I disable the first plugin (usergroupID 42), I'm being moved perfectly to usergroupID 26 that is executed by the second plugin. So.. I'm expecting this: First plugin -> Steam Link -> Move user to Usergroup 42 Second plugin -> Steam link -> Check steamrep.com -> User is flagged -> Move to usergroupID 26 Seeing the second plugin only ignores usergroupID 6,7 and 5 (which the user isn't even getting into) it should move the user IF the execution order was done properly. Yet, as I stated.. I end up being in usergroupID 42, rather than 26. From the way I see things, the execution order isn't working as it should.. It could be me, or the code. but as far as I'm concerned, both plugins are working perfectly if they are running separately. (eg, one is on, other is off) |
#17
|
||||
|
||||
It is your code. Has to be.
It's easy to make sure, and always a good idea to do testing with the most basic approach possible: Create two plugins at login_process, with execution order set to 1 and 2 respectively. PHP Code:
PHP Code:
HTML Code:
exec order 1 exec order 2 |
#18
|
||||
|
||||
The limited bit of code you're actually supplying is making it difficult to diagnose what's going on, but based on the first, more complete, code provided in the third post I would expect the user to remain in the usergroup they are set to in the plugin at execution order 1.
Why do you have the code in two separate plugins instead of in just a single plugin given the code is supposed to run serially (i.e. one after another) anyways? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|