Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > Premium Archives > Advanced Warning System (AWS)
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools
Parse error in banning.php Details »»
Parse error in banning.php
Version: , by zemic zemic is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-16-2005 Last Update: Never Installs: 0
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-16-2005, 12:05 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #3  
Old 05-23-2005, 02:04 PM
Aceman's Avatar
Aceman Aceman is offline
 
Join Date: Mar 2002
Location: Virginia, USA
Posts: 172
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Aceman
  #4  
Old 05-23-2005, 06:16 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Indeed!!! Quite amazing!
  #5  
Old 05-27-2005, 09:09 AM
heynurse heynurse is offline
 
Join Date: Jan 2002
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
  #6  
Old 05-27-2005, 09:24 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #7  
Old 05-27-2005, 09:37 AM
heynurse heynurse is offline
 
Join Date: Jan 2002
Posts: 160
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!

  #8  
Old 05-27-2005, 10:50 AM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Closed Thread


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:47 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.05566 seconds
  • Memory Usage 2,302KB
  • Queries Executed 21 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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