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)

The Realist 01-10-2005 03:21 PM

In my members warning section within there profile, the choose warning options is blank and none show up.

I have added warning to the system?

Any ideas?

Also.....

My postbit_legacy template is differant from the basic one, can someone help us put the correct code in this template please.

My Original Template:
Code:

<td class="alt1">
       
                <if condition="$show['messageicon'] OR $post['title']">
                        <!-- icon and title -->
                        <div class="smallfont">
                                <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
                                <if condition="$post['title']"><strong>$post[title]</strong></if>

Code Needed to be added:
Code:

<td class="alt1">
        <TABLE width=100%><TR>
                <TD width=90%><if condition="$show['messageicon'] OR $post['title']">
                        <!-- icon and title -->
                        <div class="smallfont">
                                <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
                                <if condition="$post['title']"><strong>$post[title]</strong></if>
                        </div>
</td><TD width=10% align="$stylevar[right]">
<if condition="THIS_SCRIPT=='showthread' AND ($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7) AND $post[warn_flag]>0">
                      <A HREF="Warn.php?do=ViewPostWarnings&post=$post[postid]"  onclick="window.open('Warn.php?do=ViewPostWarnings&post=$post[postid]','','width=1000, height=500, resizable=yes, scrollbars=yes'); return false;" target="_blank"><img src="images/misc/warn.gif" border=0></a>
</if>
</td></tr></table>
                        <hr size="1" style="color:$stylevar[tborder_bgcolor]" />

Thanks.

sv1cec 01-10-2005 03:34 PM

Quote:

Originally Posted by The Realist
In my members warning section within there profile, the choose warning options is blank and none show up.

I have added warning to the system?

Any ideas?

Also.....

My postbit_legacy template is differant from the basic one, can someone help us put the correct code in this template please.

My Original Template:
Code:

<td class="alt1">
       
                <if condition="$show['messageicon'] OR $post['title']">
                        <!-- icon and title -->
                        <div class="smallfont">
                                <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
                                <if condition="$post['title']"><strong>$post[title]</strong></if>

Code Needed to be added:
Code:

<td class="alt1">
        <TABLE width=100%><TR>
                <TD width=90%><if condition="$show['messageicon'] OR $post['title']">
                        <!-- icon and title -->
                        <div class="smallfont">
                                <if condition="$show['messageicon']"><img class="inlineimg" src="$post[iconpath]" alt="$post[icontitle]" border="0" /></if>
                                <if condition="$post['title']"><strong>$post[title]</strong></if>
                        </div>
</td><TD width=10% align="$stylevar[right]">
<if condition="THIS_SCRIPT=='showthread' AND ($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7) AND $post[warn_flag]>0">
                      <A HREF="Warn.php?do=ViewPostWarnings&post=$post[postid]"  onclick="window.open('Warn.php?do=ViewPostWarnings&post=$post[postid]','','width=1000, height=500, resizable=yes, scrollbars=yes'); return false;" target="_blank"><img src="images/misc/warn.gif" border=0></a>
</if>
</td></tr></table>
                        <hr size="1" style="color:$stylevar[tborder_bgcolor]" />

Thanks.

Got me mixed up here. Warning Options in profile? Maybe you mean the links to warn xyz and to view xyz's warnings? Are you sure that you have set up your options properly? Are you and admin or a mod viewing the profile? If the answer is yes, check that you have made all the changes properly.

We cross-posted, please send me a larger part of your template, what you posted is not enough for me to help you.

Rgds


Rgds

PKRWUD 01-10-2005 06:04 PM

Just installed this last night and I absolutely LOVE it!!! Instructions were excellent, and it installed without a single problem! Took me 2 hours to do it, lol, but it works perfect, I think...

The only issue I may have is that none of my moderators can see the WARN image. I can see it everytime I come across a post where the member was warned, but they can't see it at all, even posts they warned in their own forums.

Is this the way it's designed to work? If not, where should I look to correct this, and if it is designed that way, is there something I can do to enable the mods to see it?

Thanks!

*edit*
I'm running vB3.0.5, if it matters.

sv1cec 01-10-2005 06:20 PM

Quote:

Originally Posted by PKRWUD
Just installed this last night and I absolutely LOVE it!!! Instructions were excellent, and it installed without a single problem! Took me 2 hours to do it, lol, but it works perfect, I think...

The only issue I may have is that none of my moderators can see the WARN image. I can see it everytime I come across a post where the member was warned, but they can't see it at all, even posts they warned in their own forums.

Is this the way it's designed to work? If not, where should I look to correct this, and if it is designed that way, is there something I can do to enable the mods to see it?

Thanks!


*edit*
I'm running vB3.0.5, if it matters.

No, this is not the way it should work. Mods, supermods and admins should be able to see the Warn sign, that's the whole idea behind it. Actually, the management team has also the ability to click on the sign to see the warnings the post has received.

If the sign does not appear for your mods, while it appears for you (I assume you are the admin), check the postbit template (or postbit_legacy).

This is the code that you should have in postbit (assuming your mods, supermods and admins are usergroups 6,5 and 7):

HTML Code:

<!-- Show warned sign -->

<if condition="THIS_SCRIPT=='showthread' AND ($bbuserinfo[usergroupid]==5 OR $bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==7) AND $post[warn_flag]>0">
                      <td><A HREF="Warn.php?do=ViewPostWarnings&post=$post[postid]"  onclick="window.open('Warn.php?do=ViewPostWarnings&post=$post[postid]','','width=1000, height=500, resizable=yes, scrollbars=yes'); return false;" target="_blank"><img src="images/misc/warn.gif" border=0></a></td>
</if>

<!-- End of show warned sign -->

Let me know if you got it.

Oh, next release the Warn Sign behaviour changes a bit. Again, the management team will be able to see the sign and click on it to see the warnings the post has received, but if the "Who can see the warning level and bans" is set to "All" then the rest of the gang can see the sign (i.e. they can tell the post was warned), but they can't view the warnings.

Rgds

The Realist 01-10-2005 06:28 PM

I dont see any warn sign and Im admin?

Id this right?

PKRWUD 01-10-2005 06:48 PM

Okay, that was my problem. Apparently it's not going to work properly because I have 6 usergroups between the mods, super mods, and admin. I'm guessing I should add the other three usergroups to each of the instances in postbit (actually legacy postbit) where that occurs?

PKRWUD 01-10-2005 06:59 PM

Actually, now that I look at it, it may be a little more complicated than that. I've got everyone seeing the image now, but they don't all share the same abilities. My staff user groups are as follows: 6 & 13 are admins, 5 & 21 are super mods, and 7 & 20 are mods. With that in mind, what changes should I make to the legacy postbit?

*edit*
One more question; is this supposed to allow any moderator to issue a warning anywhere, or only in their own forums?

sv1cec 01-10-2005 07:33 PM

Quote:

Originally Posted by PKRWUD
Actually, now that I look at it, it may be a little more complicated than that. I've got everyone seeing the image now, but they don't all share the same abilities. My staff user groups are as follows: 6 & 13 are admins, 5 & 21 are super mods, and 7 & 20 are mods. With that in mind, what changes should I make to the legacy postbit?


*edit*
One more question; is this supposed to allow any moderator to issue a warning anywhere, or only in their own forums?

The whole hack is based on the standard usergroups of vB, that's 5, 6 and 7. Changing it to work with 6 usergroups instead of 3 is not going to be easy. Try to find instances where it refers to $bbuserinfo[usergoupid]==6 and add $bbuserinfo[usergoupid]==13, same thing for 5 and 21 and 7 and 20. I can't remember right now if that is all you have to edit though.

To answer your second question, the mods can warn only in the forums they can moderate.

PKRWUD 01-10-2005 07:42 PM

That's pretty much what I figured, but my coding skills don't really exist, I'm an engine man. lol. What is the proper syntax for adding two user groups together like you are suggesting? I'm not asking for the whole code, but do I write "$bbuserinfo[usergoupid]==6, $bbuserinfo[usergoupid]==13" or "$bbuserinfo[usergoupid]==6 and $bbuserinfo[usergoupid]==13", etc. ? What's the proper way to write it out so that the browser recognizes those two go together?

rinkrat 01-11-2005 02:43 AM

Jeez, now I'm getting this when I try and warn someone from admincp

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','8449','1','1105418299','test','','1','N ','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Monday 10th of January 2005 08:38:19 PM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn....n=user&id=8449
Username: RinkRat
IP Address: 66.214.41.130

sv1cec 01-11-2005 04:33 AM

Quote:

Originally Posted by rinkrat
Jeez, now I'm getting this when I try and warn someone from admincp

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','8449','1','1105418299','test','','1','N ','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Monday 10th of January 2005 08:38:19 PM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn....n=user&id=8449
Username: RinkRat
IP Address: 66.214.41.130

Strange, this error shows the proper columns OK. What is the description of your warnings table? Run this query and post your results here:

DESCRIBE warnings

Rgds

sv1cec 01-11-2005 04:38 AM

Quote:

Originally Posted by PKRWUD
That's pretty much what I figured, but my coding skills don't really exist, I'm an engine man. lol. What is the proper syntax for adding two user groups together like you are suggesting? I'm not asking for the whole code, but do I write "$bbuserinfo[usergoupid]==6, $bbuserinfo[usergoupid]==13" or "$bbuserinfo[usergoupid]==6 and $bbuserinfo[usergoupid]==13", etc. ? What's the proper way to write it out so that the browser recognizes those two go together?

It depends on the statement. Most of the times, it should be OR, like :

HTML Code:

<if condition="$bbuserinfo[usergroupid]==6">
  do this
</if>

should be converted to :

HTML Code:

<if condition="$bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==13">
  do this
</if>

Rgds

rinkrat 01-11-2005 05:17 AM

Quote:

Originally Posted by sv1cec
Strange, this error shows the proper columns OK. What is the description of your warnings table? Run this query and post your results here:

DESCRIBE warnings

Rgds


Code:

Host: localhost
Database : lgk2
Generation Time: Jan 10, 2005 at 11:14 PM
Generated by: phpMyAdmin 2.6.0-alpha2 / MySQL 4.0.15-standard
SQL-query: DESCRIBE warnings;
Rows: 10
Field        Type        Null        Key        Default        Extra
wid        int(15)                  PRI        NULL        auto_increment
warned_user        int(15)                            0         
warned_by        int(15)                            0         
warned_time        int(15)                            0         
warned_reason        text                                       
warned_post        int(15)                            0         
warned_warning_id        int(15)                            0         
warned_status        char(1)        YES                  NULL         
removed_by        int(15)        YES                  NULL         
removed_date        int(15)        YES                  NULL


sv1cec 01-11-2005 06:25 AM

Quote:

Originally Posted by rinkrat
Code:

Host: localhost
Database : lgk2
Generation Time: Jan 10, 2005 at 11:14 PM
Generated by: phpMyAdmin 2.6.0-alpha2 / MySQL 4.0.15-standard
SQL-query: DESCRIBE warnings;
Rows: 10
Field        Type        Null        Key        Default        Extra
wid        int(15)                  PRI        NULL        auto_increment
warned_user        int(15)                            0         
warned_by        int(15)                            0         
warned_time        int(15)                            0         
warned_reason        text                                       
warned_post        int(15)                            0         
warned_warning_id        int(15)                            0         
warned_status        char(1)        YES                  NULL         
removed_by        int(15)        YES                  NULL         
removed_date        int(15)        YES                  NULL


Rinkrat,

That does not make sense. Your table has the right columns, the SQL statement is trying to insert the right number of values, what on earth is this? Here is my warnings table description:

HTML Code:

wid          int(15)                    PRI                    auto_increment
warned_user        int(15)                            0         
warned_by        int(15)                            0         
warned_time        int(15)                            0         
warned_reason        text                                       
warned_post        int(15)                            0         
warned_warning_id        int(15)                            0         
caused_ban        char(1)        YES                             
warned_status        char(1)        YES                             
removed_by        int(15)        YES                             
removed_date        int(15)        YES

Exactly the same as yours. And at that part of the code, the hack is using Warn.php routines, which should be fine, since they work OK here, and I assume with others, because no one has complained about it.

Do me a favor, try to add a non-post related warning from a user's public profile. See if that produces the same error.

Rgds

rinkrat 01-11-2005 07:26 AM

OK here it is.


Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','145','1','1105435458','Ignore this I'm just testing','','1','N','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 11th of January 2005 01:24:18 AM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn.php?do=WarnUserNoPost&return=user&id=145
Username: RinkRat
IP Address: 66.214.41.130


OK I just tried a warning from a thread and got this

Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','1742','1','1105435656','Just testing ignore this.','809396','11','N','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 11th of January 2005 01:27:36 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

I might have screwed up the edits (there were a lot) but I was really careful. Maybe I'll try it all over again.

sv1cec 01-11-2005 07:53 AM

Quote:

Originally Posted by rinkrat
OK here it is.


Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','145','1','1105435458','Ignore this I'm just testing','','1','N','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 11th of January 2005 01:24:18 AM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn.php?do=WarnUserNoPost&return=user&id=145
Username: RinkRat
IP Address: 66.214.41.130


OK I just tried a warning from a thread and got this

Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','1742','1','1105435656','Just testing ignore this.','809396','11','N','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 11th of January 2005 01:27:36 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

I might have screwed up the edits (there were a lot) but I was really careful. Maybe I'll try it all over again.

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

PKRWUD 01-11-2005 09:35 AM

Quote:

Originally Posted by sv1cec
It depends on the statement. Most of the times, it should be OR, like :

HTML Code:

<if condition="$bbuserinfo[usergroupid]==6">
  do this
</if>

should be converted to :

HTML Code:

<if condition="$bbuserinfo[usergroupid]==6 OR $bbuserinfo[usergroupid]==13">
  do this
</if>

Rgds



Well, it took a little trial and error, but I got it to work. If you're interested, the code I used follows...

Again, Admin is 6 & 13, Super Mods are 5 & 21, and Mods are 7 & 20:

HTML Code:

<if condition="$hierarchical=='Yes'">
        <if condition="($post[usergroupid]!=6 AND $post[usergroupid]!=5 AND $post[usergroupid]!=7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])) OR ($post[usergroupid]==7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid]) AND $bbuserinfo[usergroupid]==5) OR
        ($bbuserinfo[usergroupid]==6 AND $post[usergroupid]!=6) OR ($post[usergroupid]!=13 AND $post[usergroupid]!=21 AND $post[usergroupid]!=20 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])) OR ($post[usergroupid]==20 AND can_moderate($forum[forumid], '', $bbuserinfo[userid]) AND $bbuserinfo[usergroupid]==21) OR
        ($bbuserinfo[usergroupid]==13 AND $post[usergroupid]!=13)
"
>

        <a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'>Warn $post[username]</a> ?
        </if>
        <if condition="($post[usergroupid]!=6 AND $post[usergroupid]!=5 AND $post[usergroupid]!=7 AND ($bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==5)) OR ($post[usergroupid]==7 AND $bbuserinfo[usergroupid]==5) OR ($bbuserinfo[usergroupid]==6 AND $post[usergroupid]!=6) OR ($post[usergroupid]!=13 AND $post[usergroupid]!=21 AND $post[usergroupid]!=20 AND ($bbuserinfo[usergroupid]==20 OR $bbuserinfo[usergroupid]==21)) OR ($post[usergroupid]==20 AND $bbuserinfo[usergroupid]==21) OR ($bbuserinfo[usergroupid]==13 AND $post[usergroupid]!=13)">
        <a href='Warn.php?do=ViewWarnings&id=$post[userid]'>View $post[username]'s Warnings</a> ?
        </if>
        <if condition="($post[userid]==$bbuserinfo[userid] AND $post[usergroupid]!=6 AND $post[warning_level]>0) OR ($post[userid]==$bbuserinfo[userid] AND $post[usergroupid]!=13 AND $post[warning_level]>0)">
        <a href='Warn.php?do=ViewMyWarnings'>View your Warnings</a> ?
        </if>
</if>
</if>

<!-- end of warning system -->


sv1cec 01-11-2005 09:40 AM

Quote:

Originally Posted by PKRWUD
Well, it took a little trial and error, but I got it to work. If you're interested, the code I used follows...

Again, Admin is 6 & 13, Super Mods are 5 & 21, and Mods are 7 & 20:

HTML Code:

<if condition="$hierarchical=='Yes'">
        <if condition="($post[usergroupid]!=6 AND $post[usergroupid]!=5 AND $post[usergroupid]!=7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])) OR ($post[usergroupid]==7 AND can_moderate($forum[forumid], '', $bbuserinfo[userid]) AND $bbuserinfo[usergroupid]==5) OR
        ($bbuserinfo[usergroupid]==6 AND $post[usergroupid]!=6) OR ($post[usergroupid]!=13 AND $post[usergroupid]!=21 AND $post[usergroupid]!=20 AND can_moderate($forum[forumid], '', $bbuserinfo[userid])) OR ($post[usergroupid]==20 AND can_moderate($forum[forumid], '', $bbuserinfo[userid]) AND $bbuserinfo[usergroupid]==21) OR
        ($bbuserinfo[usergroupid]==13 AND $post[usergroupid]!=13)
"
>

        <a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'>Warn $post[username]</a> ?
        </if>
        <if condition="($post[usergroupid]!=6 AND $post[usergroupid]!=5 AND $post[usergroupid]!=7 AND ($bbuserinfo[usergroupid]==7 OR $bbuserinfo[usergroupid]==5)) OR ($post[usergroupid]==7 AND $bbuserinfo[usergroupid]==5) OR ($bbuserinfo[usergroupid]==6 AND $post[usergroupid]!=6) OR ($post[usergroupid]!=13 AND $post[usergroupid]!=21 AND $post[usergroupid]!=20 AND ($bbuserinfo[usergroupid]==20 OR $bbuserinfo[usergroupid]==21)) OR ($post[usergroupid]==20 AND $bbuserinfo[usergroupid]==21) OR ($bbuserinfo[usergroupid]==13 AND $post[usergroupid]!=13)">
        <a href='Warn.php?do=ViewWarnings&id=$post[userid]'>View $post[username]'s Warnings</a> ?
        </if>
        <if condition="($post[userid]==$bbuserinfo[userid] AND $post[usergroupid]!=6 AND $post[warning_level]>0) OR ($post[userid]==$bbuserinfo[userid] AND $post[usergroupid]!=13 AND $post[warning_level]>0)">
        <a href='Warn.php?do=ViewMyWarnings'>View your Warnings</a> ?
        </if>
</if>
</if>

<!-- end of warning system -->


Just wish that this is the only place that you have to change the code for your situation. I just can't check where you need to make this change to make the hack safe for your condition.

One thing I would suggest, is to avoid using the Hierarchical Schema, and declare those additional user groups, as protected user groups, so that they can't be warned. I know that not using the hierarchical schema reduces the functionality, in the sense that a super mod cannot warn a moderator, but it also simplifies things, which in your case is something you would like.

Correction: This solves your Warn sign issue. But it does not solve the hack's operation issues. There are more places where you have to do the same changes, like for example, when the "Warn XYZ" and "View XYZ's Warnings". The code there also uses the group information to decide if the links should be visible or not. Also, in the place where the warning points and the number of bans is shown.

It's none of my business of course, but why are you using two groups for each role?

Rgds


Rgds

Revan 01-11-2005 09:50 AM

Quote:

Originally Posted by rinkrat
OK here it is.


Code:

Database error in vBulletin 3.0.5:

Invalid SQL: insert into warnings values('','145','1','1105435458','Ignore this I'm just testing','','1','N','A','','')
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 11th of January 2005 01:24:18 AM
Script: http://www.letsgokings.com/bbs/Warn.php
Referer: http://www.letsgokings.com/bbs/Warn.php?do=WarnUserNoPost&return=user&id=145
Username: RinkRat
IP Address: 66.214.41.130


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

PKRWUD 01-11-2005 10:07 AM

Quote:

Originally Posted by sv1cec
Correction: This solves your Warn sign issue. But it does not solve the hack's operation issues. There are more places where you have to do the same changes, like for example, when the "Warn XYZ" and "View XYZ's Warnings". The code there also uses the group information to decide if the links should be visible or not. Also, in the place where the warning points and the number of bans is shown.

It's none of my business of course, but why are you using two groups for each role?

Rgds


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.

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.

jluerken 01-11-2005 04:35 PM

Hi,

I upgraded to 3.0.8 and have two questions.

1.

In the user section in the admincp I have now two different links with the same name and output. See attachment. Can I delete one or are they really different?

2.

I entered a lot of censored words but still the users don't get warned automatically when using them. sv1cec do you think you'll find time to take a look at this at my board next days?

Kind regards
jluerken

sv1cec 01-11-2005 05:45 PM

Quote:

Originally Posted by jluerken
Hi,

I upgraded to 3.0.8 and have two questions.

1.

In the user section in the admincp I have now two different links with the same name and output. See attachment. Can I delete one or are they really different?

2.

I entered a lot of censored words but still the users don't get warned automatically when using them. sv1cec do you think you'll find time to take a look at this at my board next days?

Kind regards
jluerken

On issue 1, yes, the first line can be deleted. The code for the two buttons is the one I have in the UpgradeToLatestVersion.txt file.

PHP Code:

print_description_row("<center><a href=\"../Warn.php?$session[sessionurl]do=WarnUserNoPost&return=user&id=$userid\"><img src=\"../images/misc/warnuser.gif\" border='0'></a>&nbsp;<a href=\"admin_warn.php?act=do_finduserwarnings&userid=$userid\"  onclick=\"window.open('admin_warn.php?act=do_finduserwarnings&userid=$userid','','width=1024, height=500, resizable=yes, scrollbars=yes'); return false;\" target=\"_blank\"><img src=\"../images/misc/viewuserwarnings.gif\" border='0'></a></center>"); 

On the second issue, in order for the automatic warnings to work you have to have defined:

- censored words
- set the automatic warnings for posts to 'yes'
- define an automatic warner
- define a warning type called 'ObsceneWords' and charaterize it as automatic

If one of them is not done, the warnings cannot be issued. If you have done all these and you still have problems, I can have a look at your site and try to figure out what's the problem.

Rgds

rinkrat 01-11-2005 05:51 PM

OK it looks like it worked!! Thanks so much for taking the time to see this through and for the prompt replies. This is part of what makes VB so cool is the great community. You rule!

Oh yeah, after I get the success message it gets forwarded to the wrong address

"The requested URL /admincp/user.php was not found on this server."

It's actually in /bbs/admincp/user.php Where can I fix this?

jluerken 01-11-2005 05:59 PM

Quote:

Originally Posted by sv1cec
- define a warning type called 'ObsceneWords' and charaterize it as automatic

I did not had this in my installation.
I will add it an test this in the next days.

Thanks for the fast feedback.

One more question.

I have only one cron called: delete_old_warnings in my sheduled task folder but in the cron folder of 3.0.8 there are two files called kill_bans.php and kill.warns.php.

Do I have forgotten to add a second sheduled job?

sv1cec 01-11-2005 06:09 PM

Quote:

Originally Posted by jluerken
I did not had this in my installation.
I will add it an test this in the next days.

Thanks for the fast feedback.

One more question.

I have only one cron called: delete_old_warnings in my sheduled task folder but in the cron folder of 3.0.8 there are two files called kill_bans.php and kill.warns.php.

Do I have forgotten to add a second sheduled job?

Yes, the kill_bans is used to kill bans which expire, from the user account. See the related Option, on Bans Maturity. If you do not plan to use that, no need to install it.

sv1cec 01-11-2005 06:11 PM

Quote:

Originally Posted by rinkrat
OK it looks like it worked!! Thanks so much for taking the time to see this through and for the prompt replies. This is part of what makes VB so cool is the great community. You rule!

Oh yeah, after I get the success message it gets forwarded to the wrong address

"The requested URL /admincp/user.php was not found on this server."

It's actually in /bbs/admincp/user.php Where can I fix this?

First of all, I do not remember what you are trying to do. Please remind me. I mean after all these posts, I do not remember what you were doing when you got the error, so let me know.

Also, what is your $vboptions[bburl] ?

rinkrat 01-11-2005 07:05 PM

Quote:

Originally Posted by sv1cec
First of all, I do not remember what you are trying to do. Please remind me. I mean after all these posts, I do not remember what you were doing when you got the error, so let me know.

Also, what is your $vboptions[bburl] ?


When I am in Admincp and issue a warning I get the success message "You have issued a warning" or whatever, then I'm forwarded to /admincp/user.php instead of /bbs/admincp/user.php (the correct location of bbs root is /bbs/).

Torqued 01-12-2005 12:57 AM

John,

I found a small typo in the instructions for 3.0.7 -> 3.0.8:

For the code after // ########################## REQUIRE BACK-END :

in this code:

Quote:

else
{
$DB_site->reporterror = 1;
$warn_opts=$DB_site->query_first("select * from ".TABLE_PREFIX." warning_options where oid='1'");
$aws='1';
}
There is an extra space between ".TABLE_PREFIX." and warning_options

Instead of ".TABLE_PREFIX." warning_options

Should be ".TABLE_PREFIX."warning_options

I was getting an error when trying to access my AdminCP before I fixed this.

edited to add:

Also, it is not saving my options when I click on "Update Warning Options"

:(

I had initially installed up to 3.0.3, so I ran the uninstaller script, uploaded the 3.0.8 files, then the 3.0.8 installer script, and then did the file edits for 3.0.3 -> 3.0.8. I figured that would be quicker/easier than all of the manual table/template edits. :D

I'm also getting "Warning: Division by zero in /admincpanel/admin_warn.php on line 672" when trying to view "Statistics - Warnings per user" via the admincp.

and "Warning: Division by zero in /admincpanel/admin_warn.php on line 1889"
when trying to view "Statistics - Bans per User" via the admincp

sv1cec 01-12-2005 04:03 AM

Rinkrat

OK, edit your Warn.php file and search for :

PHP Code:

$url="/$admincpdir/user.php?do=edit&userid={$_POST['id']}"

Replace that with:

PHP Code:

$url="$vboptions[bburl]/$admincpdir/user.php?do=edit&userid={$_POST['id']}"

rgds

sv1cec 01-12-2005 04:44 AM

Quote:

Originally Posted by Torqued
John,

I found a small typo in the instructions for 3.0.7 -> 3.0.8:

For the code after // ########################## REQUIRE BACK-END :

in this code:



There is an extra space between ".TABLE_PREFIX." and warning_options

Instead of ".TABLE_PREFIX." warning_options

Should be ".TABLE_PREFIX."warning_options

I was getting an error when trying to access my AdminCP before I fixed this.

edited to add:

Also, it is not saving my options when I click on "Update Warning Options"

:(

I had initially installed up to 3.0.3, so I ran the uninstaller script, uploaded the 3.0.8 files, then the 3.0.8 installer script, and then did the file edits for 3.0.3 -> 3.0.8. I figured that would be quicker/easier than all of the manual table/template edits. :D

I'm also getting "Warning: Division by zero in /admincpanel/admin_warn.php on line 672" when trying to view "Statistics - Warnings per user" via the admincp.

and "Warning: Division by zero in /admincpanel/admin_warn.php on line 1889"
when trying to view "Statistics - Bans per User" via the admincp

Torqued,

Space thingy, you are right, some stupid editor must have brought that in, sorry I'll correct that.

Saving the warning options? Does it come up with any message? It's wierd, 'cause it works fine in both my test site and in the production one. Try downloading the zip again and upload the admin_warn.php to your server's admincp directory.

The two division by zero errors you get, are because the warning_options are not saved and the program tries to divide by the number of lines per page, the last field in the warning_options, which is zero, since the value you entered didn't get saved.

Try what I suggested and come back to me.

Rgds


All times are GMT. The time now is 01:56 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.02560 seconds
  • Memory Usage 2,073KB
  • 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
  • (20)bbcode_code_printable
  • (8)bbcode_html_printable
  • (9)bbcode_php_printable
  • (24)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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