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)

Delphiprogrammi 01-11-2005 10:16 AM

sv1cec,

i'm having a problem to upgrade to 3.0.8 with an SQL querry this sql querry

Code:

ALTER TABLE `".TABLE_PREFIX."warning_options` ADD COLUMN warnings_before_banned int(5) NOT NULL default '0' AFTER points_before_banned WHERE oid='1'
MySQL is giving me error 1064 and i tryed like 10 times (i do remove the TABLE_PREFIX part) but it doesn't help what the heck is this ?

Code:

#1064 - You have an error in your SQL syntax near 'WHERE oid =  '1'' at line 1
regards

sv1cec 01-11-2005 11:07 AM

Quote:

Originally Posted by Revan
That there looks like a missing addslashes()
Just throwing the few cents I got about this out there :)

I am not sure, because this happened even when his text was just "test".

And the value of that variable is going through a function which is supposed to replace the '.

I am puzzled.

sv1cec 01-11-2005 12:35 PM

Quote:

Originally Posted by PKRWUD
I was going to say I noticed that the Warnings by Warners Statistic doesn't list anyone in the other three usergroups. If you get a chance, and have the time, I'd appreciate it if you could note where else I will need to make changes.

I first tried adding an "OR" to each one, followed by it's counterpart, but that made it possible for all the staff to warn in every forum, and allowed the members to see the links. The way it is now, every staff member can see the WARN image, and the view links, but only the super mod, admin, and the specific mod for that forum can see and use the warn links. It may not be right, but so far, I absolutely love it. It took me a couple hours to install it, but I haven't received a single error message yet, and for me, that's an accomplishment worth celebrating. :)

The two Admin usergroups are for webmaster and admin, which have slightly different abilities, but are still both admin. The rest of the usergroups were doubled a couple years ago when we decided to create a second usergroup for sponsoring members, sponsoring moderators, and sponsoring super mods, and everything has just been built around that ever since.

I'm sure there was/is an easier method, but I'm a mechanic, not a coder, and this stuff is as foreign to me as cooking. lol.

That's easy. Edit your admin_warn.php file and find:

PHP Code:

if ($_GET['act'] == "viewstats2"
{
    
$get_warns=$DB_site->query("select wt.userid, wt.username, wt.usergroupid  from
    "
.TABLE_PREFIX."user wt WHERE (usergroupid=5 OR usergroupid=6 OR usergroupid=7) ORDER BY userid"); 

Replace that with:

PHP Code:

if ($_GET['act'] == "viewstats2"
{
    
$get_warns=$DB_site->query("select wt.userid, wt.username, wt.usergroupid  from
    "
.TABLE_PREFIX."user wt WHERE (usergroupid=5 OR usergroupid=6 OR usergroupid=7 OR usergroupid=13 OR usergroupid=21 OR usergroupid=20 ) ORDER BY userid"); 

As for the other changes, what you should do, is make sure that wherever there is a reference to group 6, there is also a reference to the equivalent group. Typically, the two references should be OR-ed and even better put them in a parenthesis like ($bbuserinfo[usergroupidi]==6 OR $bbuserinfo[usergroupid]==13 ). Same with the rest.

Let me know how you are progressing.

Rgds

sv1cec 01-11-2005 12:36 PM

Quote:

Originally Posted by Delphiprogrammi
sv1cec,

i'm having a problem to upgrade to 3.0.8 with an SQL querry this sql querry

Code:

ALTER TABLE `".TABLE_PREFIX."warning_options` ADD COLUMN warnings_before_banned int(5) NOT NULL default '0' AFTER points_before_banned WHERE oid='1'
MySQL is giving me error 1064 and i tryed like 10 times (i do remove the TABLE_PREFIX part) but it doesn't help what the heck is this ?

Code:

#1064 - You have an error in your SQL syntax near 'WHERE oid =  '1'' at line 1
regards

Remove the WHERE oid='1'. We are altering the table, not updating it.

Stupid me!!! I am going to correct that in the zip.

rinkrat 01-11-2005 12:54 PM

Quote:

Originally Posted by sv1cec
OK, let's do this test. Open your includes/functions_warning.php file and find:

PHP Code:

$DB_site->query("insert into ".TABLE_PREFIX."warnings values('','{$user['userid']}','{$bbuser}','".time()."','{$wcomment}','{$wpost}','{$warn_type['tid']}','N','A','','')"); 

Replace that line with:

PHP Code:

$DB_site->query("insert into ".TABLE_PREFIX."warnings (wid, warned_user, warned_by, warned_time, warned_reason, warned_post, warned_warning_id, caused_ban, warned_status, removed_by, removed_date) values('','{$user['userid']}','{$bbuser}','".time()."','{$wcomment}','{$wpost}','{$warn_type['tid']}','N','A','','')"); 

See if that works OK.

Rgds



I couldn't find that exact line in a fresh upload of the file but found something very close and changed it. This is what I get now.

Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings (wid, warned_user, warned_by, warned_time, warned_reason, warned_post, warned_warning_id, caused_ban, warned_status, removed_by, removed_date) values('','1742','1','1105455062','Just testing ignore this.','809396','11','N','A','','')
mysql error: Unknown column 'caused_ban' in 'field list'

mysql error number: 1054

Date: Tuesday 11th of January 2005 06:51:02 AM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn.php?do=WarnUser&id=1742&post=809396
Username: RinkRat
IP Address: 66.214.41.130


rinkrat 01-11-2005 12:56 PM

It appears as if all of the errors are listing the first value as being empty

values('','1742','1'

Is that right? I don't know php/mysql real well so I have no idea.

sv1cec 01-11-2005 02:54 PM

No, this is not your problem, this column is an auto-increment column, so you shouldn't enter a value.

Add the missing column by running this query:

ALTER TABLE `warning_options` ADD COLUMN `caused_ban` char(1) AFTER warned_warning_id

Then try again.

rinkrat 01-11-2005 03:21 PM

OK here I go.. It's weird because I ran the upgrade script adn even went back and ran the install script.

rinkrat 01-11-2005 03:23 PM

Code:

Error

SQL-query :

ALTER TABLE `warning_options` ADD COLUMN `caused_ban` char( 1 ) AFTER warned_warning_id

MySQL said:
#1054 - Unknown column 'warned_warning_id' in 'warning_options'

Here's the table:

Code:

          Field          Type          Attributes          Null          Default          Extra          Action
        oid          int(15)                  No                    auto_increment          Change        Drop        Primary        Index        Unique        Fulltext
        banned_limit          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        points_before_banned          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        banned_usergroup_id          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        protected_usergroups          varchar(255)                  No                              Change        Drop        Primary        Index        Unique        Fulltext
        version          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        hierarchical          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automatic          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automaticpm          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        autocomments          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automatic_warner          int(10)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        warner          int(15)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        troll_usergroup_id          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        aprotected_usergroups          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        restore_groupid          smallint(5)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        incr_ban_days          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        max_no_bans          int(5)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        bans_mature          int(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        viewoption          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        multiple_per_post          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        send_pm_warning          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        send_em_warning          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        email_on_ban          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        historical          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        allowoffpost          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        warnings_per_page          int(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        collector          int(10)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext


sv1cec 01-11-2005 04:24 PM

Quote:

Originally Posted by rinkrat
Code:

Error

SQL-query :

ALTER TABLE `warning_options` ADD COLUMN `caused_ban` char( 1 ) AFTER warned_warning_id

MySQL said:
#1054 - Unknown column 'warned_warning_id' in 'warning_options'

Here's the table:

Code:

          Field          Type          Attributes          Null          Default          Extra          Action
        oid          int(15)                  No                    auto_increment          Change        Drop        Primary        Index        Unique        Fulltext
        banned_limit          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        points_before_banned          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        banned_usergroup_id          int(15)                  No          0                    Change        Drop        Primary        Index        Unique        Fulltext
        protected_usergroups          varchar(255)                  No                              Change        Drop        Primary        Index        Unique        Fulltext
        version          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        hierarchical          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automatic          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automaticpm          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        autocomments          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        automatic_warner          int(10)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        warner          int(15)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        troll_usergroup_id          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        aprotected_usergroups          varchar(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        restore_groupid          smallint(5)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        incr_ban_days          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        max_no_bans          int(5)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        bans_mature          int(10)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        viewoption          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        multiple_per_post          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        send_pm_warning          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        send_em_warning          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        email_on_ban          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        historical          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        allowoffpost          char(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        warnings_per_page          int(3)                  Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext
        collector          int(10)        UNSIGNED        Yes          NULL                    Change        Drop        Primary        Index        Unique        Fulltext


Sorry, wrong input on my behalf. Here is the proper query:

ALTER TABLE `warnings` ADD COLUMN `caused_ban` char(1) AFTER warned_warning_id

Then use the modification I told you before in the functions_warning.php and try to issue a warning.


All times are GMT. The time now is 03:45 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.02221 seconds
  • Memory Usage 1,855KB
  • 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
  • (9)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)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