The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I made this script : ( in a hook )
PHP Code:
if i take off the AND isset($activeusers) then i get the error : Invalid argument supplied for foreach() any ideas with this ? i tried to do as $key => $value but it didnt work, again this only happening with IE, with CHROME and FIREFOX everything works great. |
#2
|
|||
|
|||
![]()
PHP isn't a client side language, it's server side. So if it works with FF or any other browser, it will work with IE.
What hook did you use? Where is $activeusers being populated? Is $activeusers an array? |
#3
|
|||
|
|||
![]()
the hook is showthread_complete .
all im saying, this is what happening . FF and Chrome works well, on IE i get the above error message ( if the isset() is not stated also at the IF condition ) . $activeusers is an array defined on the showthread.php file . |
#4
|
|||
|
|||
![]()
I just tested your code, but to do so I had to remove your if condition because there's no DO condition like that on my system and there's no 'active_users_onoff' that I know of in a standard vB4 install.
So I ended up testing this... PHP Code:
The other question I have is why not just use the 'Show Users Browsing Threads' option that's built in to vB? |
#5
|
|||
|
|||
![]()
whats the 'Show Users Browsing Threads' option?
|
#6
|
|||
|
|||
![]()
It does exactly what you're doing with your code. It shows who's currently viewing a thread.
It's in ACP->Settings->Options->Thread Display Options(showthread). |
#7
|
|||
|
|||
![]()
oh, i thought there is a variable for that.
i have made a refresh button for the thread information using ajax... so thats the replaced text when clicking on the button . regarding the issue, it does happend also on firefox now for some reason, but i have no idea what is the problem . why would $activeusers would be invalid for foreach .. --------------- Added [DATE]1368652200[/DATE] at [TIME]1368652200[/TIME] --------------- this is the code for $activeusers in showthread : PHP Code:
|
#8
|
|||
|
|||
![]()
I've never done something like this with ajax, but if I'm not mistaken you need to rebuild the activeusers with a database query in your ajax code and save it to the ajax xml.
The way it is now, you don't have $activeusers in your ajax code. That's why the error is popping up. Perhaps someone with more ajax experience than me will chime in on this. |
#9
|
|||
|
|||
![]()
you can see it on action on this page : http://www.emath.co.il/forums/%D7%97...7%9D/68746.htm
you need to click the button on the left ( see pic ) EDIT : IT IS WORKING FOR CHROME and WORKED for firefox... probably its something with the cookies the reason it worked with ff and not its not. though it is working, no need to rebuild the $activeusers ... |
#10
|
|||
|
|||
![]()
IT seems that if im not logged in, its working otherwise, gives the invalid error.
--------------- Added [DATE]1368653172[/DATE] at [TIME]1368653172[/TIME] --------------- *sigh* i guess the error is because the $activeusers is empty (when no user is logged in..) thanks for the help.. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|