vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Advanced Warning System (AWS) (https://vborg.vbsupport.ru/forumdisplay.php?f=105)
-   -   Parse error in banning.php (https://vborg.vbsupport.ru/showthread.php?t=76424)

zemic 02-16-2005 09:17 AM

Parse error in banning.php
 
Parse error: parse error, unexpected T_STRING in /home/fhlinux199/k/kroozing.com/user/htdocs/forum/modcp/banning.php on line 279

I get that error message when I open banning.php . "View Banned Users" link under "Users" menu in Admin CP.

Any ideas?

I've checked the instructions and it seems like I've copied it correctly :s

sv1cec 02-16-2005 12:05 PM

Quote:

Originally Posted by zemic
Parse error: parse error, unexpected T_STRING in /home/fhlinux199/k/kroozing.com/user/htdocs/forum/modcp/banning.php on line 279

I get that error message when I open banning.php . "View Banned Users" link under "Users" menu in Admin CP.

Any ideas?

I've checked the instructions and it seems like I've copied it correctly :s

Here is what my file looks like, in that area. Compare it with yours.

PHP Code:

        // there is already a record - just update this record
        
$DB_site->query("
            UPDATE " 
TABLE_PREFIX "userban SET
            adminid = 
$bbuserinfo[userid],
            bandate = " 
TIMENOW ",
            liftdate = 
$liftdate,
            reason = '" 
addslashes($reason) . "' 
            WHERE userid = 
$user[userid]
        "
);
    }
    else
    {
        
// insert a record into the userban table
        
$DB_site->query("
            INSERT INTO " 
TABLE_PREFIX "userban
            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate, reason)
            VALUES
            (
$user[userid]$user[usergroupid]$user[displaygroupid]$user[customtitle], '" addslashes($user['usertitle']) . "', $bbuserinfo[userid], " TIMENOW ", $liftdate,  '" addslashes($reason) . "')
        "
);
    }

    
// update the user record
    
$DB_site->query("
        UPDATE " 
TABLE_PREFIX "user SET
        
$bantitlesql
        usergroupid = 
$usergroupid,
        displaygroupid = 0
        WHERE userid = 
$user[userid]
    "
);

    
define('CP_REDIRECT''banning.php');
    if (
$period == 'PERMANENT')
    {
        
print_stop_message('user_x_has_been_banned_permanently'$user['username']);
    }
    else
    {
        
print_stop_message('user_x_has_been_banned_until_y'$user['username'], vbdate("$vboptions[dateformat] $vboptions[timeformat]"$liftdate));
    } 

Rgds

Aceman 05-23-2005 02:04 PM

It's amazing what leaving out a ";" can do to an application.

Aceman

sv1cec 05-23-2005 06:16 PM

Indeed!!! Quite amazing!

heynurse 05-27-2005 09:09 AM

I don't have any TABLE_PREFIX's in my db, how do I update my code so it it doesn't read TABLE_PREFIX in the banning.php file?

Thanks

Quote:

Originally Posted by sv1cec
Here is what my file looks like, in that area. Compare it with yours.

PHP Code:

        // there is already a record - just update this record
        
$DB_site->query("
            UPDATE " 
TABLE_PREFIX "userban SET
            adminid = 
$bbuserinfo[userid],
            bandate = " 
TIMENOW ",
            liftdate = 
$liftdate,
            reason = '" 
addslashes($reason) . "' 
            WHERE userid = 
$user[userid]
        "
);
    }
    else
    {
        
// insert a record into the userban table
        
$DB_site->query("
            INSERT INTO " 
TABLE_PREFIX "userban
            (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate, reason)
            VALUES
            (
$user[userid]$user[usergroupid]$user[displaygroupid]$user[customtitle], '" addslashes($user['usertitle']) . "', $bbuserinfo[userid], " TIMENOW ", $liftdate, '" addslashes($reason) . "')
        "
);
    }
 
    
// update the user record
    
$DB_site->query("
        UPDATE " 
TABLE_PREFIX "user SET
        
$bantitlesql
        usergroupid = 
$usergroupid,
        displaygroupid = 0
        WHERE userid = 
$user[userid]
    "
);
 
    
define('CP_REDIRECT''banning.php');
    if (
$period == 'PERMANENT')
    {
        
print_stop_message('user_x_has_been_banned_permanently'$user['username']);
    }
    else
    {
        
print_stop_message('user_x_has_been_banned_until_y'$user['username'], vbdate("$vboptions[dateformat] $vboptions[timeformat]"$liftdate));
    } 

Rgds

I think I figured it out, at least I'm not getting any errors when I try to access banned users from the modcp?

Since I don't use Table Prefix's, all I did was delete the green portion below:

$DB_site->query("
UPDATE " . TABLE_PREFIX . "userban SET
adminid = $bbuserinfo[userid],
bandate = " . TIMENOW . ",
liftdate = $liftdate
WHERE userid = $user[userid]
");

is that right, or should I have done something else?

sv1cec 05-27-2005 09:24 AM

Actually, you do not have to delete anything, since the part you indicate is something that vB knows, and is replaced during execution, automatically.

It's one thing to replace that, when running a query externally, and another thing to edit the files and remove that. You do not have to remove that part, your vB should work fine as it is. If you have to remove it for your vB to work, something is wrong.

Rgds

heynurse 05-27-2005 09:37 AM

hmmmm......

Well before making the change, when I tried accessing "ban a user" in the modcp, I got an error on line 260 of the banning.php file????? I removed the " . TABLE_PREFIX . " portion that line and the error went away??? Anyways, it appears that it is working now? :)

Thanks for your great and prompt support!


sv1cec 05-27-2005 10:50 AM

Yes, but I am sure that if you look in the file, you will find plenty of other instances where that particular piece of code is used. It's in every query that is run by the program. So it can't cause an error in one particular line and not cause the error in all the other lines. Unless of course, something is wrong with that line, somewhere else.

Rgds


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

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.01063 seconds
  • Memory Usage 1,765KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete