Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 02-03-2003, 05:08 AM
Dan_UPC Dan_UPC is offline
 
Join Date: Dec 2002
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default IP Addresses

On our board we have enabled show ip's publicly. If the person viewing a post is a moderator / admin i would like them to see the full ip address... if they are not a moderator / admin i would like them to see only the first 3 segments of the address with the 4th segment blanked out ...

Eg.
ip address = 123.123.123.123
moderators and admins will see 123.123.123.123
everyone else will see 123.123.123.xxx

I'm sure this is probably a very simple hack in showthread.php but I just cant get it working :'(

Any ideas or advice would be greatly appreciated.

We are using vBulletin 2.2.6

Regards,
Dan.
Reply With Quote
  #2  
Old 02-03-2003, 12:02 PM
Dan_UPC Dan_UPC is offline
 
Join Date: Dec 2002
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok,

After a little more thought, I figured out how to do it ...

In admin/functions.php,

find:

PHP Code:
// do ip addresses 
below it,

add:

PHP Code:
if ($bbuserinfo['userid']==0) {
  
$logip=1;
}

if (!
ismoderator()) {
  
$postip=explode(".",$post[ip]);
  
$postip[3]=xxx;
  
$post[ip]=implode(".",$postip);

The result is:
Eg.
IP Address = 123.123.123.123
moderators / admins will see 123.123.123.123
all other logged on members will see 123.123.123.xxx
anyone who is not registered or not logged on will see IP Logged.
Reply With Quote
  #3  
Old 02-03-2003, 01:35 PM
Dan_UPC Dan_UPC is offline
 
Join Date: Dec 2002
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's no good :'( it adds 1 extra query per post on the page. I have 40 posts on each page so we had 65 queries on showthread, it was like that for less than 10 minutes and I'm lucky it didnt bring the server down.

I need to be able to check if the person viewing the thread is a mod once and then save that to a variable then send the variable each time as part of getpostbit() but I dont know how to do this...

Any ideas anyone?
Reply With Quote
  #4  
Old 02-03-2003, 11:13 PM
Dan_UPC Dan_UPC is offline
 
Join Date: Dec 2002
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok,

I've had more time to think and i've replaced !ismoderator() with $bbuserinfo['usergroupid']!=5 AND $bbuserinfo['usergroupid']!=6 AND $bbuserinfo['usergroupid']!=7

Works fine now and *no* extra queries for this hack ... but I would like to release this as a hack for others and depending on how they have their forum set, this may not always work...

I really would like a way of calling ismoderator once per page view and saving the result as a variable ... anyone know how I can do this? The problem seems to be that the posts are done before the thread code is done ... so I dont know where I can put the ismoderator() line and have it run *once* prior to the posts getting done.
Reply With Quote
Reply

Thread Tools
Display Modes

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 08:51 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.04361 seconds
  • Memory Usage 2,187KB
  • 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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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