Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2009, 06:37 PM
Senti.Jatt Senti.Jatt is offline
 
Join Date: Mar 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default conditional for usertools.php

PROBLEM solved thanks to lynne and Redlinemotorsports
Reply With Quote
  #2  
Old 08-14-2009, 06:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you want to use $bbuserinfo as that is related to the person trying to view the page.
Reply With Quote
  #3  
Old 08-14-2009, 07:08 PM
Senti.Jatt Senti.Jatt is offline
 
Join Date: Mar 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ not person trying to view the page to but something like

PHP Code:
if (!$userinfo OR if (is_member_of($userinfo6)) 
I want no result found for usergroup 6
even if usergroup 6 searches it
Reply With Quote
  #4  
Old 08-14-2009, 07:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Who is the condition supposed to work on? And where are you adding this code (line number and perhaps a couple of lines of code above and below it, please).
Reply With Quote
  #5  
Old 08-14-2009, 07:21 PM
Senti.Jatt Senti.Jatt is offline
 
Join Date: Mar 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ($vbulletin->GPC['username'])
    {
        
$getuserid $db->query_first("
            SELECT userid
            FROM " 
TABLE_PREFIX "user
            WHERE username = '" 
$db->escape_string(htmlspecialchars_uni($vbulletin->GPC['username'])) . "'
        "
);
        
$userid intval($getuserid['userid']);

        
$userinfo fetch_userinfo($userid);
        if (!
$userinfo OR is_member_of($userinfo6)); 
        {
            
print_stop_message('protected_user');
        }
    }
    else if (
$vbulletin->GPC['userid'])
    {
        
$userid $vbulletin->GPC['userid'];
        
$userinfo fetch_userinfo($userid);
        if (!
$userinfo OR is_member_of($userinfo6));  
        {
            
print_stop_message('protected_user');
        }
        
$vbulletin->GPC['username'] = unhtmlspecialchars($userinfo['username']);
    } 
When someone searches for x user's ip address(x user is in usergroup 6)
it should come up with something like No results found
i know how to add error message but can't make conditional to work
Reply With Quote
  #6  
Old 08-14-2009, 09:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why are you putting a ; at the end of the if condition? It won't continue.

Should be:
PHP Code:
if (!$userinfo OR is_member_of($userinfo6)) 
Reply With Quote
  #7  
Old 08-14-2009, 09:50 PM
Senti.Jatt Senti.Jatt is offline
 
Join Date: Mar 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ dude you are the best
Reply With Quote
  #8  
Old 08-14-2009, 09:56 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this...
PHP Code:
if (!is_member_of($vbulletin->userinfo6))
{
    
print_stop_message('protected_user');

Reply With Quote
  #9  
Old 08-14-2009, 10:22 PM
Senti.Jatt Senti.Jatt is offline
 
Join Date: Mar 2008
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ thanks but lynne one has worked fine
yours will only disable ip's for usergroup 6 but i wont show an error when we mistype a username

Thanks very much guys
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 10:39 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.04279 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_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