The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Hookname and easy fix for the smart!
I am looking for someone who might know the correct hookname and the correct db name in bold and red below. I have it half working but once you refresh, you go from working to not working and so on. Any feedback or help is much appreciated. This is for the Who's Online page.
<plugin active="1" executionorder="5"> <title><![CDATA[Hide IP on whos online page.]]></title> <hookname>online_bit_complete</hookname> <phpcode><![CDATA[global $vbulletin; $sadminid = $vbulletin->options['superadmin_id']; if ($vbulletin->options['bogus_ip_enable']) { if ($vbulletin->userinfo['userid'] == $sadminid) { $posts = $vbulletin->db->query_write(" UPDATE " . TABLE_PREFIX . "session SET host = '" . $vbulletin->options['bogus_ip'] . "' WHERE userid = '" . $vbulletin->options['superadmin_id'] . "' "); } }]]></phpcode> </plugin> |
#2
|
|||
|
|||
I'm not sure, but I think your problem may be that a session is tied to an ip address, so if you overwrite the ip address in the session table it probably just creates a new session when you reload the page.
About the "$posts = ", if you're doing an update query you don't need to capture the return value. The only thing you can do is check it for TRUE or FALSE to see if it succeeded or not (and it only makes sense to do that if you have a way to handle the error). In any case, if you just want to hide the ip for that one user you could try this: Code:
if ($userinfo['userid'] == $vbulletin->options['superadmin_id']) { $userinfo['host_encoded'] = 'Hidden'; // or just make it a null string } |
#3
|
||||
|
||||
Thanks. I'm not sure where to put these. If I use online_start as the hook, it stays the same for me all the time. On the test account, it changes. That has me confused so i'm not sure if i'm even using the right hook, etc. I had this working with changing the hook and that $post but I lost the file so I am kicking myself.
|
#4
|
|||
|
|||
I think you should just be able to create a new plugin (using the plugin manager - you don't need to create an xml file). Use hook online_bit_complete and the code I posted above. But I haven't tried it at all so it's just a guess based on looking at the code.
|
#5
|
||||
|
||||
kh99, thank you for all of your help! You have no idea how much this has been driving me insane! LOL Props to you!
--------------- Added [DATE]1333981179[/DATE] at [TIME]1333981179[/TIME] --------------- It didn't fix. The problem seems to be $posts. I know I changed that the last time but I really have no idea what I put in there. If I change to other things, I get different operations from it. I am beyond confused but I really do thank you for helping me. |
#6
|
||||
|
||||
If I can send the entire plugin to someone, would anyone be able to look at it? Otherwise, I am stuck with a Facebook group, page and a live chat with no MD5 from VB.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|