[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
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

[FINAL] yellow card (+ card ban system)

Post by Niels Chr. Denmark »

I have now updated my yellow card mod
new version is 1.1.4.

Ther are no changes into funtionality, still ablew to ban,unban, warn and post repport, nothing change about that.

Now this mod uses POST for parsing the actions, making it more secure and less vounderble, users using this mod are adviced to follw this upgrade.


how-to upgrade:
in file viewtopic.php

Code: Select all

[FIND]
if($poster_id != ANONYMOUS && $postrow[$i]['user_level'] != ADMIN) 
{ 
   if ($is_auth['auth_greencard']) 
   { 
      $g_card_uri = append_sid("card.$phpEx?c=1&b=". $poster_id. "&p=".$postrow[$i]['post_id']); 
      $g_card_img = '<a href="' . $g_card_uri . '"><img src="' . $images['icon_g_card'] . '" alt="' . $lang['Give_G_card'] . '" title="' . $lang['Give_G_card'] . '" border="0" /></a>'; 
   } else $g_card_img=""; 
   if ($postrow[$i]['user_active'] && $is_auth['auth_ban'] ) 
   { 
      $y_card_uri = append_sid("card.$phpEx?c=".($postrow[$i]['user_active']+1)."&b=". $poster_id. "&p=".$postrow[$i]['post_id']); 
      $y_card_img = '<a href="' . $y_card_uri . '"><img src="' . $images['icon_y_card'] . '" alt="' . sprintf($lang['Give_Y_card'],$postrow[$i]['user_active']) . '" title="' . sprintf($lang['Give_Y_card'],$postrow[$i]['user_active']) . '" border="0" /></a>'; 
      $r_card_uri = append_sid("card.$phpEx?b=". $poster_id. "&p=".$postrow[$i]['post_id']); 
      $r_card_img = '<a href="' . $r_card_uri . '"><img src="' . $images['icon_r_card'] . '" alt="' . $lang['Give_R_card'] . '" title="' . $lang['Give_R_card'] . '" border="0" /></a>'; 
   } else { $y_card_img=""; $r_card_img=""; } 
} else { $g_card_img=""; $y_card_img=""; $r_card_img=""; } 
if ($is_auth['auth_bluecard']) 
{ 
   if ($is_auth['auth_mod']) 
   { 
      $b_card_uri = append_sid("card.$phpEx?p=".$postrow[$i]['post_id']."&c=".(($postrow[$i]['post_bluecard'])?"0":($postrow[$i]['post_bluecard']+1))); 
      $b_card_img = '<a href="' . $b_card_uri . '"><img src="' . (($postrow[$i]['post_bluecard'])?$images['icon_bhot_card']:$images['icon_b_card']) . '" alt="'. ( ($postrow[$i]['post_bluecard'])? sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']) : $lang['Give_b_card'] ) . '" title="' . (($postrow[$i]['post_bluecard'])? sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']):$lang['Give_b_card']) . '" border="0" /></a>'; 
   } 
   else 
   { 
      $b_card_uri = append_sid("card.$phpEx?p=".$postrow[$i]['post_id']."&c=".($postrow[$i]['post_bluecard']+1)); 
      $b_card_img = '<a href="' . $b_card_uri . '"><img src="'.$images['icon_b_card'] . '" alt="'.$lang['Give_b_card']. '" title="' . $lang['Give_b_card'] . '" border="0" /></a>'; 
   } 
} else $b_card_img=''; 

[REPLACE WITH]
if($poster_id != ANONYMOUS && $postrow[$i]['user_level'] != ADMIN) 
{ 
	$card_hidden='';
	if ($is_auth['auth_greencard']) 
	{ 
	      $g_card_img = '&nbsp;<input type="image" name="unban" value="unban" src="'. $images['icon_g_card'] . '" alt="' . $lang['Give_G_card'] . '" >'; 
	} 
	else $g_card_img=''; 
	if ($postrow[$i]['user_active'] && $is_auth['auth_ban'] )
	{ 
	      $y_card_img = '&nbsp;<input type="image" name="warn" value="warn" src="'. $images['icon_y_card'] . '" alt="' . sprintf($lang['Give_Y_card'],$postrow[$i]['user_active']) . '" >'; 
      	$r_card_img = '&nbsp;<input type="image" name="ban" value="ban" src="'. $images['icon_r_card'] . '" alt="' . $lang['Give_R_card'] . '" >'; 
	}
	else
	{
		 $y_card_img=''; $r_card_img=''; 
	} 
} else
{
	$g_card_img='';
	$y_card_img='';
	$r_card_img='';
}

if ($is_auth['auth_bluecard']) 
{ 
   if ($is_auth['auth_mod']) 
   { 
	$b_card_img = (($postrow[$i]['post_bluecard'])) ? '&nbsp;<input type="image" name="rapport_reset" value="rapport_reset" src="'. $images['icon_bhot_card'] . '" alt="'. sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']) . '">':'&nbsp;<input type="image" name="rapport" value="rapport" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >'; 
   } 
   else 
   { 
	$b_card_img = '&nbsp;<input type="image" name="rapport" value="rapport" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >'; 
   } 
} else $b_card_img='';

[FIND]
'DELETE' => $delpost, 

[ AFTER, ADD ]
'CARD_HIDDEN_FIELDS' => $card_hidden,

"U_G_CARD" => $g_card_img, 
"U_Y_CARD" => $y_card_img, 
"U_R_CARD" => $r_card_img, 
"U_B_CARD" => $b_card_img,

[REPLACE WITH]
'U_G_CARD' => $g_card_img, 
'U_Y_CARD' => $y_card_img, 
'U_R_CARD' => $r_card_img, 
'U_B_CARD' => $b_card_img,
'S_CARD' => append_sid("card.".$phpEx),
in file viewtopic_body.tpl

Code: Select all

[FIND]
<td width="100%"><a href="{postrow.U_MINI_POST}">

[BEFORE, ADD]
<form method="post" action="{postrow.S_CARD}">

[FIND]
{postrow.U_B_CARD}

[AFTER, ADD]
{postrow.CARD_HIDDEN_FIELDS}

[FIND]
{postrow.IP_IMG}

[AFTER, ADD]
</form>
then update the file card.php, with the new version (ver 1.2.4.)
Last edited by Niels Chr. Denmark on Sat Oct 19, 2002 1:21 pm, edited 2 times in total.
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

i suggest you to change the title of this topic because if not, we don't of what you are talking about !

Bye
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
Teach
Registered User
Posts: 305
Joined: Wed Nov 28, 2001 6:58 am
Location: Hopefully, soon to be somewhere else

Post by Teach »

morpheus2matrix wrote: i suggest you to change the title of this topic because if not, we don't of what you are talking about !

I agree!
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

sorry about the title, I missed that

I have found that the new card.php file, had a minor fail, every time a post was reported to moderators, the email notification was sendt out, regadless of the settings in the admin panel

I have now updated the file card.php, new version for this file is 1.2.5.
please update
certifyd
Registered User
Posts: 22
Joined: Sun Oct 28, 2001 11:17 pm
Contact:

Post by certifyd »

is it possible to have a prompt that asks "are you sure" before a user gets banned or warned?
technology is wonderful....when it works
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

Maybe later...remindme if I forget
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

webmasterx, have been so kind to report a special bug, with in some cases can make the warned cards number go down to 1, please do this

Code: Select all

OPEN: /includes/usercp_register.php 

[FIND]

$sql = "UPDATE " . USERS_TABLE . " SET " . $username_sql . 

[FIND, IN-LINE] 

user_active = $user_active 

[DELETE, IN-LINE] 

user_active = $user_active 

ianroessle
Registered User
Posts: 6
Joined: Wed May 22, 2002 1:03 am

1 question

Post by ianroessle »

What does it do?
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Re: 1 question

Post by Niels Chr. Denmark »

ianroessle wrote: What does it do?
what does what do.., the mod...?, demo is availble at mods.db9.dk, where you can give your self cards inside the yellow card form
User avatar
GoleyC
Registered User
Posts: 374
Joined: Thu Mar 14, 2002 5:22 pm
Location: Ohio
Contact:

URL to download this mod

Post by GoleyC »

What's the URL to download this Mod?
CG
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

I haven't got the time to submit a fully "official template" therefore it has not been submitted yet

download most up to date how-to here
http://mods.db9.dk/contrib/card_ban_system.zip

at mods.db9.dk, you can find several language packs for this mod aswell
scottyman
Registered User
Posts: 34
Joined: Sun Apr 07, 2002 9:45 pm
Location: London, UK
Contact:

Post by scottyman »

I've found a problem - when using the gallery mod I get the following error:

Code: Select all

Fatal error: Call to a member function on a non-object in /usr/local/psa/home/vhosts/londonplunge.com/httpdocs/forums/includes/page_header.php on line 64
lines referenced are:

Code: Select all

$template->set_filenames(array(
	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
Any ideas? I'm trying to at least find a start point for the debugging.

Thx,


Scotty
I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams RIP
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

scottyman wrote: I've found a problem - when using the gallery mod I get the following error:

Code: Select all

Fatal error: Call to a member function on a non-object in /usr/local/psa/home/vhosts/londonplunge.com/httpdocs/forums/includes/page_header.php on line 64
lines referenced are:

Code: Select all

$template->set_filenames(array(
	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
Any ideas? I'm trying to at least find a start point for the debugging.

Thx,


Scotty


it doesen't look like a bug, more like a typo, are you shure you have followed the how-to...? or maybe the placement of some of the code isen't rigth - or it could be due to the version you are runing... several users have repported back that it works fine

anyway make shure that, if any replacement in both mods in/at the same file/spot, then you have to take special care

:D
scottyman
Registered User
Posts: 34
Joined: Sun Apr 07, 2002 9:45 pm
Location: London, UK
Contact:

Post by scottyman »

hey Niels - good time off?

Found the fault - wasn't pulling the !userdata for some reason.

Fixed - plus not your mod... isp changed a couple of security settings, and for some reason fault that wasn't there before turned up on another mod. Bad timing all around!

Scotty
I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams RIP
a mud forum
Registered User
Posts: 61
Joined: Sat May 04, 2002 10:53 pm

Post by a mud forum »

I cannot find in the file phpBB2/templates/Subsilver/viewtopic_body.tpl the following code. Is there something I'm missing or just overlooked?

Code: Select all

<span class="postdetails">{postrow.U_POST_TRANSLATE} </span>
</td>
Locked

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