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 11-27-2004 12:21 PM

I just uploaded a new version, with some minor changes.

The report, I've added yesterday, was not correct. In order to show you which members have been warned, it was checking the warning level of the users. However, a user may have a warning level of zero points, and still have received warnings, which have expired or were deleted. So I added another column in the user table, where I keep the number of warnings a user has received and changed the report accordingly. The upgrade is an easy one, two or three things to do.

Rgds
--------
John

mcyates 11-27-2004 12:23 PM

thankyou, just updating now

mcyates 11-27-2004 12:27 PM

Get an error

ALTER TABLE `user` ADD COLUMN `warnings` int(5) before warning_level

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'before warning_level' at line 1

Revan 11-27-2004 02:49 PM

Wow, this is getting better by the day! :D
I do however have some questions:
  1. The warning sys I use now cumulates warning points until my set value is reached, then it auto bans. With this maturity level system, do I have to set the maturity to insanely high to have cumulating work as it does now, or can it auto ban no matter how long ago it has been since he was warned?
  2. Does a member see his own warning level? If no, then I submit it as a feature suggestion :)
Im sorry if these have already been answered before, but 8 pages of replies.... neeh ;)

And @ mcyates: Try running the query without the "column" word. I have never seen this in a SQL query, and I have added fields to the user table before (in fact I did this just north of 3h ago ;))


//peace

mcyates 11-27-2004 03:02 PM

that didn't help, i still got the warning, the code it from the latest upgrade so i don't see why its not working:

Code:

ALTER TABLE `user` ADD COLUMN `warnings` int(5) before warning_level

Torqued 11-28-2004 12:46 AM

I upgraded to 1.3 and am getting the following error when trying to warn someone:

Database error in vBulletin 3.0.3:

Invalid SQL: insert into vb3warnings values('','11','1','1101609844','test 1.3','464','1','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Torqued 11-28-2004 01:00 AM

Quote:

Originally Posted by mcyates
Get an error

ALTER TABLE `user` ADD COLUMN `warnings` int(5) before warning_level


#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'before warning_level' at line 1

I am also getting this error when trying to upgrade to 1.3.1

Torqued 11-28-2004 01:34 AM

Ok. I fixed the above by running the following:

Quote:

ALTER TABLE `user` ADD COLUMN `warnings` int(5) AFTER salt
I looked @ the table structure and the new column should be inserted between `salt` and `warning_level`. I took a peek @ the ALTER TABLE documentation and didn't see a BEFORE parameter, but did see an AFTER parameter, so decided to try that.

http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html

Quote:

Still getting this error, though when trying to warn a user:

Database error in vBulletin 3.0.3:

Invalid SQL: insert into vb3warnings values('','11','1','1101613183','spam 1.3.1','470','1','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

ptenthus 11-28-2004 03:15 PM

I have ZT's warn hack (1.5) and get the following error when I run the admincp/upgrade_warn.php script:

Quote:

Parse error: parse error, unexpected ',' in /path/to/my/forums/admincp/upgrade_warn.php on line 185
Any idea what is wrong?

Also, I downloaded the code last night (November 27th, 2004)...

sv1cec 11-28-2004 07:35 PM

1. BEFORE and AFTER parameter in SQL.

I would swear I used before, but I may be wrong. I'll change the documentation.

2. Revan's question. Two different things here, the maturity is the number of days that the points stay in a user's account. It doesn't pay to warn a user for a minor thing (maybe one point) and keep that warning point for ever. If you do not want that to happen, yes, you need to set the maturity of the warnings to something like 99999.

Yes, a member sees a link, which shows him his own warnings.

3. Torqued. If the column hasn't been added because of the mistake that mcyates reported, and which you were also getting, it's normal to receive an incorrect columns error. Now that you added the column, does it still produces that error?

4. Ptenthus, change that line (185) from

PHP Code:

$install[]="alter table ".TABLE_PREFIX."user add `warning_bans` int(2)"add `warningsint(5); 

to:

PHP Code:

$install[]="alter table ".TABLE_PREFIX."user add `warning_bans` int(2), add `warnings` int(5); 

Those damn quotes are the problem.

OK folks, sorry for these issues, I am trying my best.

Rgds
---------
John


All times are GMT. The time now is 10:31 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.01894 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)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