vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Advanced Warning System (AWS) (https://vborg.vbsupport.ru/showthread.php?t=71992)

sv1cec 01-16-2005 07:31 PM

Ok, for the member who asked for a different message, when a banned member tries to log in the site, I have found the place to check it out and produce a different message. I am not releasing it as a new version though, as I want to elaborate on it a bit, but if you are in a hurry to put this into action, here is what you have to do:

Edit file functions.php and find:

PHP Code:

    $postvars construct_post_vars_html();

    
$bbuserinfo['badlocation'] = 1// Used by exec_shut_down();

    
if ($bbuserinfo['userid'])
    {
        eval(
print_standard_error('nopermission_loggedin'true));
    }
    else 

Replace that, with:

PHP Code:

$postvars construct_post_vars_html();

    
$bbuserinfo['badlocation'] = 1// Used by exec_shut_down();

    
    
if (($bbuserinfo['usergroupid']==$warn_opts['banned_usergroup_id'] OR $bbuserinfo['usergroupid']==$warn_opts['troll_usergroup_id']) AND $bbuserinfo['userid'])
    {
        eval(
print_standard_error('nopermission_banned'true));
    }
    
    
    if (
$bbuserinfo['userid'] AND (!$bbuserinfo['usergroupid']==$warn_opts['banned_usergroup_id'] OR !$bbuserinfo['usergroupid']==$warn_opts['troll_usergroup_id'])
    {
        eval(
print_standard_error('nopermission_loggedin'true));
    }
    else 

Also, create a new phrase, named nopermission_banned, its type being Front-End Error Messages, which says something like:

HTML Code:

<p><strong>$bbuserinfo[username]</strong>,<p> You do not have permission to access the forums, because you are temporarily banned.<p>Sorry, we hope to see you again in our forums soon.
<p><div align="$stylevar[right]"> <a href="login.php?$session[sessionurl]do=logout&amp;u=$bbuserinfo[userid]">Log Out</a> <a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a> </div>

Try this out and let me know if it works, I have a reservation, since I am not sure if warn_opts have been evaluated at that point. If not, I'll give you a better solution tomorrow.

Delphiprogrammi 01-16-2005 09:34 PM

hi sv1cec ,

yeah i forgot about the logged in part it is /includes/functions.php you're right

however i tryed this on my "testvb" board and this block of code is giving me a parse error

PHP Code:

if($bbuserinfo['userid']) AND !$bbuserinfo['usergroupid']==$warn_opts['banned_usergroup_id'] OR !$bbuserinfo['usergroupid']==$warn_opts['troll_usergroup_id'])
    {
        eval(
print_standard_error('nopermission_loggedin',true));
    } 

anyway time to sleep now :tired:

sv1cec 01-17-2005 09:21 AM

The new version includes the checking for the special message that banned users receive when they try to log in.

Rgds to all

Delphiprogrammi 01-17-2005 10:32 AM

Quote:

Originally Posted by sv1cec
The new version includes the checking for the special message that banned users receive when they try to log in.

Rgds to all

hi sv1cec,

thanks for the new version but i'm facing a problem the modification that takes care of the "special message" for banned users well i banned my test account just to see what happens and the PHP parser gives me this error

Code:

Fatal error: Call to a member function on a non-object in /path/to/includes/functions.php on line 2066
line 2066 from /includes/adminfunctions.php is

PHP Code:

$warn_opts=$DB_site->query_first("select * from ".TABLE_PREFIX."warning_options where oid='1'"); 

i can't see anything wrong it

rgds

sv1cec 01-17-2005 11:36 AM

Nothing's wrong with that phrase, what I ... forgot to tell you guys, was that you have to do another edit in the functions file. Scroll a bit higher up from where you made that mod, and find a phrase that looks like:

PHP Code:

    global $vboptions$logincode$url$bbuserinfo$session$stylevar

Replace that with:

PHP Code:

    global $DB_site$vboptions$logincode$url$bbuserinfo$session$stylevar

Don't expect me to be perfect at 08:30 am, not enough coffee in my system yet.

Delphiprogrammi 01-17-2005 11:43 AM

Quote:

Originally Posted by sv1cec
Nothing's wrong with that phrase, what I ... forgot to tell you guys, was that you have to do another edit in the functions file. Scroll a bit higher up from where you made that mod, and find a phrase that looks like:

PHP Code:

    global $vboptions$logincode$url$bbuserinfo$session$stylevar

Replace that with:

PHP Code:

    global $DB_site$vboptions$logincode$url$bbuserinfo$session$stylevar

Don't expect me to be perfect at 08:30 am, not enough coffee in my system yet.

nobody is perfect my friend errors /mistakes do happen we are all humans not *machines*

i searched the web about this error and found out it was something with a global statement already i just had no idea where i'll get back to you if that works and do not worry about to much ;)

Delphiprogrammi 01-17-2005 12:07 PM

sv1cec,

YES YES man can i buy a bucket of coffee :D :D working fine i modified the standerd "print_no_permission()" function

PHP Code:

function print_no_permission()
{
    global 
$DB_site,$vboptions,$logincode,$url,$bbuserinfo,$session,$stylevar;
    if(!
$logincode)
    {
        
$logincode=construct_login_code();
    }
    
$postvars=construct_post_vars_html();
    
$bbuserinfo['badlocation'] = 1// Used by exec_shut_down();
    
$warn_opts=$DB_site->query_first("SELECT * FROM " TABLE_PREFIX "warning_options WHERE oid='1'");
    if ((
$bbuserinfo['usergroupid']==$warn_opts['banned_usergroup_id'] OR $bbuserinfo['usergroupid']==$warn_opts['troll_usergroup_id']) AND $bbuserinfo['userid'])
    {
        
$ban $DB_site->query_first("SELECT liftdate FROM " TABLE_PREFIX "userban WHERE userid=$bbuserinfo[userid]");
        if (
$ban['liftdate']=='0')
        {
            
$until="permanently banned";
        }
        else
        {
            
$untilvbdate $vboptions['dateformat'], $ban[liftdate] );
            
$until=" temporarily banned, until the $until";
        }
        eval(
print_standard_error('nopermission_banned'true));
    }
    
// test
    
if($bbuserinfo['userid'])
    {
        eval(
print_standard_error('nopermission_loggedin',true));
    }
    else
    {
        
$scriptpath htmlspecialchars_uni(SCRIPTPATH);
        
define('VB_ERROR_PERMISSION'true);
        eval(
print_standard_error('nopermission_loggedout'false));
    }


thanks man for sorting that one out

sv1cec 01-20-2005 11:17 AM

Three days with no reported errors or problems??!!!

OK, so now it's time to start thinking of new things to add.

Rgds

jluerken 01-20-2005 11:35 AM

Quote:

Originally Posted by sv1cec
Three days with no reported errors or problems??!!!

OK, so now it's time to start thinking of new things to add.

Rgds

Oh please no. An update once every two month is enough I think.
I really don't like it to update a hack twice a week :D

Dennis B 01-20-2005 09:25 PM

Quote:

Originally Posted by jluerken
Oh please no. An update once every two month is enough I think.
I really don't like it to update a hack twice a week :D

These are days when we upgrade vBulletin every week, why not our hacks...? :D:D


All times are GMT. The time now is 03:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02196 seconds
  • Memory Usage 1,790KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (9)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete