[FINAL] yellow card (+ card ban system)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

This looks interesting... Has anyone yet tried it on 2.0.5?
User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

DVX_Rune wrote: replace all of the u.whatevers with just one u.* (the asterisk is a wildcard so it covers all of the u.username, u.user_id, etc)


The problem with this is that there are other mods that will break if you do this. I have sticky avatars installed and it stopped working after I did this on Niels' advice... ggrrrrr..... It seems that some mods require the exact field to be called...

Niels: is there any way you could tell me what fields I need to use if I were to edit this manually (i.e. not use u.*, but do it longhand)

thanks!
User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

DVX_Rune wrote: I like the functionality of everything as you've got it, but I want to add my own "Vote off the Island" mod to it. I'm thinking I'll add another card ... the "black with skull and crossbones" card. :lol: I'll make that one replace the red, then turn the red into a vote to ban ... similar to the yellow card but users can use it without sending out a warning. That way:
  • Image yellow card: (admins and mods only) +1 on warnings count - if user reaches limit, they're banned (same as now)
  • Image green card: (admins only) unbans user (same as now)
  • Image blue card: (ALL users) reports post to mod/admin (same as now)
  • Image black card: (admins only) instant ban (same as RED is now)
  • Image red card: (ALL users) +1 vote to ban - if user reaches limit, they're banned (similar to present yellow card but user-useable and no warning email sent, just an anonymous +1 to the "ban votes")


Any progress on that yet DVX_Rune?
DVX_Rune
Registered User
Posts: 124
Joined: Tue Jul 30, 2002 3:49 am

Post by DVX_Rune »

Yep. :)

http://www.phpbb.com/phpBB/viewtopic.php?t=101518

It's not exactly as I described in this thread (I left the red card alone and just added the black card), but it basically adds a "vote to ban" black card to the yellow card mod. It works fine, I just still haven't had the time to add a "take back your vote" option to it, so currently voters have to contact the admin to take back their banvote and then the admin have to change the banvoted member's black card count by -1 manually in their admin profile ... but other than that it works peachy.
User avatar
Haywood Jahelpme
Registered User
Posts: 475
Joined: Wed Oct 23, 2002 9:16 am
Location: San Diego
Contact:

Post by Haywood Jahelpme »

Looks do-able... Thanks!
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

just as a "confirmation"
I have to day installed version 1.4.6. on a moded version 2.0.6. - without problems.
the problem of the "subject" in post report was not pressent. - so I asume you have been doning something wrong.
how-ever it is intended that the subject is locked - but the subject should already been filled with the "subject from the reported post"

(I did use EM to install it)


about the u.* contra u.user_warnins - it is a fact that SQL uses a asterix as a wild card, the * will replace ANY other field in the user table, if it did not work for some of you - it might have been due to other problems - e.g. leaving out some fields from other tables.
u.* <=> u.username, u.user_id........

but not
u.* <=> u.username, u.user_id...p.post_id.....
Earth should spin a litle slower, then there would be 28H/dayImage
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

I wish to have it PM the mods instead of Email them how hard would it be to do this? any quick and easy way of doing such?
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

no, currently not posible to PM moderators
Earth should spin a litle slower, then there would be 28H/dayImage
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

How hard do you reckon it would be to modify it to pm any mods instead of sending them an Email.
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

the card.php would need to be modifyed - it would be posible, but I haven't the time to do it...
the code part witch generate the email will need to be replaced by some code witch generate the PM, in fact it should not be that hard.
Earth should spin a litle slower, then there would be 28H/dayImage
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

if youd ont think it should be that hard ill take a stab at it since it is something i would really like to have instead of the emailing.
R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 »

This mod is not PostgreSQL compatible because of quoted numbers in the SQL.

To fix, in the SQL, anywhere you see "'.$post_id.'" or "'.$topic_id.'" or ".$poster_id.'", remove the " "

Please don't quote numerics for integer columns, it is bad SQL.

Also, another thing preventing postgres compatibility is the use of double qoutes to enclose text. While MySQL allows it, it is again not ANSI SQL compliant. Use single quotes..
User avatar
thewizard
Registered User
Posts: 356
Joined: Sun Sep 29, 2002 7:46 am

Post by thewizard »

R45 wrote: This mod is not PostgreSQL compatible because of quoted numbers in the SQL.

To fix, in the SQL, anywhere you see "'.$post_id.'" or "'.$topic_id.'" or ".$poster_id.'", remove the " "

Please don't quote numerics for integer columns, it is bad SQL.

Also, another thing preventing postgres compatibility is the use of double qoutes to enclose text. While MySQL allows it, it is again not ANSI SQL compliant. Use single quotes..


I thought this mod was fully Dbal complient... lol and here i am converting my DB from MySQL to PostgreSQL....
R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 »

DBAL compliant doesn't mean the SQL is correct. 75% of the mods out there don't work with any RDMS besides MySQL. The SQL syntax differs between the different databases. MySQL is one of the least strict of them all, that's why things like quoted numerics will not produce errors. But other database comply strictly to the ANSI SQL specifications.
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

the intergers are single quoted, becurse if not, it will in some cases fail...e.g. if a empty value (value=0) is parsed, the SQL will look like
so in genneral I make quotes around values, witch in some cases can be 0

e.g.
user_lastlogon=0 would look like user_lastlogon=
while if it is quoted, it will look like
user_lastlogon=''

in mySQL ths will make it a working SQL, witch would else fail.

a better solution, witch would be more compatible will be to use code like this

Code: Select all

user_lastlogon=".intval($user_lastlogon)."
this should make it apper correct, even if a zero value
user_lastlogon=0

I havenøt tested this, but this should be the recormented way if runing on other DB types, witch does not accept single quotes
Earth should spin a litle slower, then there would be 28H/dayImage
Locked

Return to “[2.0.x] MODs in Development”