Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2012, 01:13 PM
connkid25's Avatar
connkid25 connkid25 is offline
 
Join Date: Jul 2005
Location: Los Angeles, CA
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
  #2  
Old 04-08-2012, 01:29 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
}
Reply With Quote
  #3  
Old 04-08-2012, 03:24 PM
connkid25's Avatar
connkid25 connkid25 is offline
 
Join Date: Jul 2005
Location: Los Angeles, CA
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 04-08-2012, 04:27 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-08-2012, 04:34 PM
connkid25's Avatar
connkid25 connkid25 is offline
 
Join Date: Jul 2005
Location: Los Angeles, CA
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-09-2012, 04:34 PM
connkid25's Avatar
connkid25 connkid25 is offline
 
Join Date: Jul 2005
Location: Los Angeles, CA
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:35 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03977 seconds
  • Memory Usage 2,210KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete