Page 1 of 11

[FINAL] yellow card (+ card ban system)

Posted: Tue May 14, 2002 2:38 pm
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.)

Posted: Tue May 14, 2002 2:43 pm
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

Posted: Tue May 14, 2002 4:28 pm
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!

Posted: Wed May 15, 2002 10:51 am
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

Posted: Mon May 20, 2002 3:06 pm
by certifyd
is it possible to have a prompt that asks "are you sure" before a user gets banned or warned?

Posted: Tue May 21, 2002 8:05 am
by Niels Chr. Denmark
Maybe later...remindme if I forget

Posted: Sun May 26, 2002 10:59 pm
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 


1 question

Posted: Sun May 26, 2002 11:24 pm
by ianroessle
What does it do?

Re: 1 question

Posted: Mon May 27, 2002 1:02 am
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

URL to download this mod

Posted: Wed Jun 12, 2002 7:38 pm
by GoleyC
What's the URL to download this Mod?

Posted: Thu Jun 13, 2002 8:16 am
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

Posted: Sat Aug 03, 2002 1:22 am
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

Posted: Fri Aug 09, 2002 10:04 am
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

Posted: Fri Aug 09, 2002 10:07 am
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

Posted: Sun Aug 11, 2002 5:41 am
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>