The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
![]()
Oh I had it generating txt files that outputted the values being passed to ensure they were working. I even had ones for various parts of the functions so I know it runs fine until it gets into that loop and does the if statement checks. However I feed that loop with hard coded values of lets say 16 for both paidsub_build and useradmin_update_save but it does not work on paidsub_build and does work on useradmin_update_save
It is mind blowing. Even with the variables set to the same values how can I get different results from the same function where the only difference is that it is being run on a different hook. The part where is breaks down is here: PHP Code:
I got a b-day and graduation parties to get to today so I will deal with this more tomorrow. Thanks for all the help so far ![]() --------------- Added [DATE]1306090100[/DATE] at [TIME]1306090100[/TIME] --------------- Here is a good chunk of the functions (slightly edited) PHP Code:
Something goes wrong in that foreach loop and only does so in paidsub_build even when the loop is fed with the same input. While I am new to programing in vbb I have coded for years in general html php sourcepawn java ect and never have I seen a situation where you can feed a function the same input and get different outputs where there was not complex math or randomization involved... these results are blowing my mind and the only think I can think is that the function that the paidsub_hook is running in some how forcefully prevents the running of that loop. However, that would mean that we need to get a developer or someone that really understands the vb code in and out to explain just what is going wrong here. |
#12
|
||||
|
||||
![]()
First, you only use the TABLE_PREFIX for tables and not fields or columns (as in Kevin's post above which is proper).
|
#13
|
|||
|
|||
![]()
I will make that change when I can but I can say it is not what is going wrong as that still outputs 6 as it should. I even bypassed it completely by just hardcoading $sbaid=6; in its place for a few runs. (as I make a post before jumping in the shower, I am actually writing post bys as I get ready for the day and try to get all this info posted up lol)
Thanks again for your help everyone, hopefully this can be figured out once I try out some new changes tomorrow. |
#14
|
|||
|
|||
![]()
FWIW I put this code in a plugin on both hooks and it worked in both places, both with and without 16 in the list of groups in data2.txt.
PHP Code:
|
#15
|
|||
|
|||
![]()
Interesting that must mean that the issue is the variable that I was storing 16 in as that is the only difference. I will hard code in all numbers even for constant variables. In theory this should fix the problem.
--------------- Added [DATE]1306176320[/DATE] at [TIME]1306176320[/TIME] --------------- Yea the issue is that when running in paidsub_build it randomly decides on its own if it is going to use constant variables or not. I will now just hard code in all constant values in place of variables and hopefully that will then work. --------------- Added [DATE]1306176915[/DATE] at [TIME]1306176915[/TIME] --------------- Ok it appears to be working now. The issue is that for what ever reason within the paidsub_build hook you can not use any global variables other than $db so anything you want to use variable wise must be defined within the function. This is only the case with the paidsub_ hooks. I now can move on to programing the rest which should be easy now that it is clear what the rules are for these functions. Thank you all so much for you help, I could not have gotten this working without you! |
#16
|
|||
|
|||
![]()
Glad you got it working. Yeah, the paidsub_build hook is in a function, so any globals you want to use would have to be declared with a "global" statement (except any vbulletin vars which might already be declared global in that function).
Edit: Oh, yeah, I do see you have the big list of globals in the code you posted a while back. Weird. |
#17
|
|||
|
|||
![]()
Oh they were declared with a global statement. They just did not work despite that but worked fine in other hooks...
Just a very strange glitch I never expected variables that were declared in a global statement to work on one hook but not on another. But whatever all I care about is the dam thing works now lol |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|