The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
What am I doing wrong here?
PHP Code:
Why is it doing this? Is there something i've missed out here? |
#2
|
||||
|
||||
this line
Code:
$adminonline = mysql_query("SELECT userid FROM session"); you have to use a fetch array command (as vb does nearly always). also you should use WHERE userid=1 in the query |
#3
|
|||
|
|||
Well if I select userid, I can do the if conditions for multiple userids
I don't know how to do a fetch_array command, please could you show me how it would be done for me to achieve the correct results in my situation? Last time I needed help with hack (the intval function), you showed me how it was done, and then I managed to use it in another hack successfully! |
#4
|
||||
|
||||
hmm, i don't know the mysql php commandos very good.., i always use the $DB_site var from vb
it would look something like that: PHP Code:
|
#5
|
|||
|
|||
I noticed that in index.php, in the code for online users, usergroupid is being called from the session table, I looked in the session table and there is no usergroupid field?! How can it be calling usergroupid if it isn't in the table?
Also, if I want to base it on usergroupid and not userid, how would I do that? I mean, it's definitely possible but the fact that there's no usergroupid field in the session table confuses me as I can't just call it because it doesn't exist! |
#6
|
||||
|
||||
in index.php there was used a joined query..
it's also possible but slows down the query a bit. in that case it would look like that: PHP Code:
|
#7
|
|||
|
|||
Ok so I'm almost there, I have one more question, what is the significance of 'total' in the query? What is it implying, what does it mean? This is a bit new to me as I'm used to just running a simple query, then using specific if conditions such as if ($adminonline['usergroupid'] == 6) but that's written into the query...
|
#8
|
||||
|
||||
total is just a counter, it will save the ammount of admins online
|
#9
|
|||
|
|||
So I can go one step further and do this:
PHP Code:
|
#10
|
||||
|
||||
two mistakes in it:
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|