[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.
grillish
Registered User
Posts: 1
Joined: Sat May 01, 2004 9:20 am

Post by grillish »

yes, I have it running on phpBB 2.0.8. It works, but i had problems under the installation and had to edit the yellow-card txt-file i order to set it up.

My problem;
after installing YellowCard mod (the latest version), all users have 1-2 extra lines with 'air' under their username.
Does anyone know how to fix this minor problem?
User avatar
Lord 0f The Lanyards
Registered User
Posts: 222
Joined: Fri Jan 09, 2004 2:33 am
Location: cheeseland
Contact:

Post by Lord 0f The Lanyards »

in viewtopic is there a way to make it show the amount of warnings people have?
User avatar
Lord 0f The Lanyards
Registered User
Posts: 222
Joined: Fri Jan 09, 2004 2:33 am
Location: cheeseland
Contact:

Post by Lord 0f The Lanyards »

also is there a way i can link this mod to the jail mod by dr_dlp, like if they get 3 warnings they are banned for a week...
Vamp
Registered User
Posts: 1
Joined: Tue Aug 24, 2004 1:41 pm
Location: Brazil

Post by Vamp »

I have a yellow card 1.4.11 installed, but the cards not show.
I can only give cards by ACP
This is the code i changed.
Anyone can help me?
Sorry for my english

viewtopic.php

Code: Select all

#-----[ FIND ]------------------------------------------------ 
# 
$order_sql = ( 
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
f.auth_attachments

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, f.auth_ban, f.auth_greencard, f.auth_bluecard  

##---[ MY CODE]------

, f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard  ORDER BY p.post_id ASC";


# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "SELECT t.topic_id, t.topic_title

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
" . $count_sql

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
# 
, f.auth_ban, f.auth_greencard, f.auth_bluecard

##---[ MY CODE]------
 f.auth_attachments, f.auth_ban, f.auth_greencard, f.auth_bluecard" . $count_sql . "

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "SELECT u.username

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
u.user_allowsmile

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
, u.user_warnings, u.user_level

##---[ MY CODE]------
, u.user_allowsmile, u.user_warnings, u.user_level, u.user_level, u.user_ou_sig, u.user_ou_avatar, u.user_allow_viewonline,.....

# 
#-----[ FIND ]------------------------------------------------ 
# 
$s_auth_can .= ( ( $is_auth['auth_vote']

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$s_auth_can .= ( $is_auth['auth_ban'] ) ? $lang['Rules_ban_can'] . "<br />" : ""; 
$s_auth_can .= ( $is_auth['auth_greencard'] ) ? $lang['Rules_greencard_can'] . "<br />" : ""; 
$s_auth_can .= ( $is_auth['auth_bluecard'] ) ? $lang['Rules_bluecard_can'] . "<br />" : ""; 

##---[ MY CODE]------
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';
$s_auth_can .= ( $is_auth['auth_ban'] ) ? $lang['Rules_ban_can'] . "<br />" : ""; 
$s_auth_can .= ( $is_auth['auth_greencard'] ) ? $lang['Rules_greencard_can'] . "<br />" : ""; 
$s_auth_can .= ( $is_auth['auth_bluecard'] ) ? $lang['Rules_bluecard_can'] . "<br />" : ""; 
attach_build_auth_levels($is_auth, $s_auth_can);

# 
#-----[ FIND ]------------------------------------------------ 
# 
$delpost = '';
}
}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
........

##---[ MY CODE]------
			$delpost_img = '';
			$delpost = '';
		}
	}
if($poster_id != ANONYMOUS && $postrow[$i]['user_level'] != ADMIN) 
{ 
	$current_user = str_replace("'","\'",$postrow[$i]['username']);
	if ($is_auth['auth_greencard']) 
	{ 
	      $g_card_img = ' <input type="image" name="unban" value="unban" onClick="return confirm(\''.sprintf($lang['Green_card_warning'],$current_user).'\')" src="'. $images['icon_g_card'] . '" alt="' . $lang['Give_G_card'] . '" >'; 
	} 
	else 
	{
		$g_card_img = ''; 
	}
	$user_warnings = $postrow[$i]['user_warnings'];
//	$card_img = ($user_warnings) ? (( $user_warnings < $board_config['max_user_bancard']) ? sprintf($lang['Warnings'], $user_warnings) : $lang['Banned'] ) : '';
// these lines will make a icon apear beside users post, if user have warnings or ar banned
// used instead of the previous line of code, witch shows the status as a text
//  ------ From here --- do not include this line
 $card_img = ($user_warnings) ? '<img src="'.(( $user_warnings < $board_config['max_user_bancard']) ? 
		$images['icon_y_card'] . '" alt="'. sprintf($lang['Warnings'], $user_warnings) .'">' : 
		$images['icon_r_card'] . '" alt="'. $lang['Banned'] .'">') : '';
//  ----- To this line --- Do not included this line
// 
// You may also included several images, instead of only one yellow, these lines below will produce several yellow images, depending on mumber of yellow cards
//  ------ From here --- do not include this line
$card_img = ($user_warnings >= $board_config['max_user_bancard'])  ? '<img src="'.$images['icon_r_card'] . '" alt="'. $lang['Banned'] .'">' : '';
for ($n=0 ; $n<$user_warnings && $user_warnings < $board_config['max_user_bancard'];$n++)
{
$card_img .= ($user_warnings) ? '<img src="'.(( $user_warnings < $board_config['max_user_bancard']) ? 
$images['icon_y_card'] . '" alt="'. sprintf($lang['Warnings'], $user_warnings) .'">' : 
$images['icon_r_card'] . '" alt="'. $lang['Banned'] .'">') : '';
}
//  ----- To this line --- Do not included this line

	if ($user_warnings<$board_config['max_user_bancard'] && $is_auth['auth_ban'] )
	{ 
		$y_card_img = ' <input type="image" name="warn" value="warn" onClick="return confirm(\''.sprintf($lang['Yellow_card_warning'],$current_user).'\')" src="'. $images['icon_y_card'] . '" alt="' . sprintf($lang['Give_Y_card'],$user_warnings+1) . '" >'; 
     		$r_card_img = ' <input type="image" name="ban" value="ban"  onClick="return confirm(\''.sprintf($lang['Red_card_warning'],$current_user).'\')" src="'. $images['icon_r_card'] . '" alt="' . $lang['Give_R_card'] . '" >'; 
	}
	else
	{
		$y_card_img = '';
		$r_card_img = ''; 
	} 
} else
{
	$card_img = '';
	$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'])) ? ' <input type="image" name="report_reset" value="report_reset" onClick="return confirm(\''.$lang['Clear_blue_card_warning'].'\')" src="'. $images['icon_bhot_card'] . '" alt="'. sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']) . '">':' <input type="image" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\')" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >'; 
		} 
   		else 
		{ 
			$b_card_img = ' <input type="image" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\')" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >';
			
   		}
	} else $b_card_img = '';

// parse hidden filds if cards visible
$card_hidden = ($g_card_img || $r_card_img || $y_card_img || $b_card_img) ? '<input type="hidden" name="post_id" value="'. $postrow[$i]['post_id'].'">' :'';


	$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';

# 
#-----[ FIND ]------------------------------------------------ 
# 
'DELETE' =>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

'USER_WARNINGS' => $user_warnings,
'CARD_IMG' => $card_img,
'CARD_HIDDEN_FIELDS' => $card_hidden,
'CARD_EXTRA_SPACE' => ($r_card_img || $y_card_img || $g_card_img || $b_card_img) ? ' ' : '',


##---[ MY CODE]------
		'DELETE_IMG' => $delpost_img,
		'DELETE' => $delpost,

		'USER_WARNINGS' => $user_warnings,
		'CARD_IMG' => $card_img,
		'CARD_HIDDEN_FIELDS' => $card_hidden,
		'CARD_EXTRA_SPACE' => ($r_card_img || $y_card_img || $g_card_img || $b_card_img) ? ' ' : '',

		'L_MINI_POST_ALT' => $mini_post_alt,

# 
#-----[ FIND ]------------------------------------------------ 
# 
'U_MINI_POST' =>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
'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),


##---[ MY CODE]------
		'U_MINI_POST' => $mini_post_url,
		'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),

		'U_POST_ID' => $postrow[$i]['post_id'])


viewtopic_body.tpl

Code: Select all

# 
#-----[ FIND ]------------------------------------------------ 
# 
{postrow.POSTER_NAME}</b>

# 
#-----[ IN-LINE FIND ]------------------------------------------------ 
# 
{postrow.POSTER_NAME}</b>

# 
#-----[ IN-LINE AFTER, ADD]------------------------------------------- 
# 
<br />{postrow.CARD_IMG}

##---[ MY CODE]------
#
</a><b>{postrow.POSTER_NAME}</b><br />{postrow.CARD_IMG}</span><br />.....


# 
#-----[ FIND ]------------------------------------------------ 
# 
{postrow.U_MINI_POST}

# 
#-----[ BEFORE, ADD]------------------------------------------ 
#

<!-- Start add - Yellow card admin MOD -->
<form method="post" action="{postrow.S_CARD}">
<!-- End add - Yellow card admin MOD -->
# 
#-----[ FIND ]------------------------------------------------ 
# 
{postrow.U_MINI_POST}

# 
#-----[ BEFORE, ADD]------------------------------------------ 
#

<!-- Start add - Yellow card admin MOD -->
<form method="post" action="{postrow.S_CARD}">
<!-- End add - Yellow card admin MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
# 
{postrow.IP_IMG} 

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
{postrow.IP_IMG} 

# 
#-----[ IN-LINE AFTER, ADD]----------------------------------- 
#
{postrow.U_R_CARD}{postrow.U_Y_CARD}{postrow.U_G_CARD}{postrow.U_B_CARD}{postrow.CARD_EXTRA_SPACE}{postrow.CARD_HIDDEN_FIELDS}

# 
#-----[ AFTER, ADD]------------------------------------------- 
#

<!-- Start add - Yellow card admin MOD -->
</form>
<!-- End add - Yellow card admin MOD -->


##---[ MY CODE]------
#
			<tr>
<!-- Start add - Yellow card admin MOD -->
<form method="post" action="{postrow.S_CARD}">
<!-- End add - Yellow card admin MOD -->
				<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
				<td valign="top" nowrap="nowrap">{postrow.CARD_IMG} {postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG} {postrow.U_R_CARD}{postrow.U_Y_CARD}{postrow.U_G_CARD}{postrow.U_B_CARD}{postrow.CARD_EXTRA_SPACE}{postrow.CARD_HIDDEN_FIELDS}</td>
<!-- Start add - Yellow card admin MOD --> 
</form> 
<!-- End add - Yellow card admin MOD --> 
			</tr>


This is what´s happen.
Image
User avatar
Tiger8559
Registered User
Posts: 80
Joined: Tue Aug 24, 2004 6:44 pm

Post by Tiger8559 »

where can i download the latest version of this mod for phobb version 2.0.10?
Bradman
Registered User
Posts: 84
Joined: Mon Nov 11, 2002 6:39 am
Location: Ledyard, CT
Contact:

Post by Bradman »

Get it from Neils site, http://mods.db9.dk

I'm having a few problems with this mod also. When I had 2.0.4 the then current version of this mod worked perfectly. Now I have 2.0.10 and the current mod version and have a few problems. I'm not gonna waste time posting them here, unless of course someone who has it working is interested in chatting about it.
ihrm
Registered User
Posts: 4
Joined: Fri Nov 12, 2004 11:36 am

Post by ihrm »

[deleted]
Blisk
Registered User
Posts: 270
Joined: Wed Aug 20, 2003 10:43 am
Location: Slovenia

Post by Blisk »

where it shows up how many yellow card user have?
fjl
Registered User
Posts: 125
Joined: Sat Apr 02, 2005 6:53 pm

Post by fjl »

Are the forum permissions the only ACP controls for this mod? Where can I set how many warnings a poster gets before being banned? Thsi mod works but I don't know if I was supposed to get some additional ACP menu for this mod. All I got was being able to decide who can ban and unban in the Forum Permissions ACP. Did I perhaps install this wrong?
This is my Sig... :|
fjl
Registered User
Posts: 125
Joined: Sat Apr 02, 2005 6:53 pm

Post by fjl »

How can I move the yellow cards from being above the avatar to the bottom like under the word "Location?"
This is my Sig... :|
User avatar
UseLess
Registered User
Posts: 521
Joined: Mon Jul 22, 2002 7:26 pm
Location: North East UK

Post by UseLess »

Greetings,

General settings for the mod are done in the general config section of the ACP, or where you select which forum the reports for posts being reported will be posted to.

Move the code you added to 'viewtopic_body.tpl' so it's below the location, just look for {L_LOCATION} or similar and put it below that.
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
GruntsMilitary
Registered User
Posts: 30
Joined: Tue Jun 08, 2004 4:50 pm

Post by GruntsMilitary »

Hello,

First of all, this is a fantastic mod and I'm using it actively in my own forum.

However, I would like to allow only ONE of my moderators to warn/ban members in my forum. I want to restrict this access from other moderators to keep things better organized and under control. Unfortunatley, it appears that once a user is set to "Is Moderator", they automatically have access to warn and ban members. Is there something I can edit to allow me to specify a single user rather than all moderators?

I know I could install a "junior admin" mod, but I'd like to avoid this if at all necessary.

Any help would be appreciated, thank you!
Bull_UK
Registered User
Posts: 23
Joined: Tue May 17, 2005 5:01 pm

Post by Bull_UK »

Hi,
I've tried posting this at Niels' web site but I get a debug error during the update of the search index so I'm trying here to see if anyone can help.

I've been messing with this for a good few hours and just can't work it out. All I want is to swap the blue card icon for some text such as "report post".

I've think found the area in vewtopic.php I need to be looking in

Code: Select all

	if ($is_auth['auth_bluecard']) 
	{ 
		if ($is_auth['auth_mod']) 
		{ 
			$b_card_img = (($postrow[$i]['post_bluecard'])) ? ' <input type="image" name="report_reset" value="report_reset" onClick="return confirm(\''.$lang['Clear_blue_card_warning'].'\')" src="'. $images['icon_bhot_card'] . '" alt="'. sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']) . '">':' <input type="image" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\')" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >'; 
		} 
   		else 
		{ 
			$b_card_img = ' <input type="image" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\')" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >';
			
   		}
	} else $b_card_img = '';
and I think I need something like

Code: Select all

if ($is_auth['auth_bluecard']) 
	{ 
		if ($is_auth['auth_mod']) 
		{ 
			$b_card_img = (($postrow[$i]['post_bluecard'])) ? ' <input type="image" name="report_reset" value="report_reset" onClick="return confirm(\''.$lang['Clear_blue_card_warning'].'\')" src="'. $images['icon_bhot_card'] . '" alt="'. sprintf($lang['Clear_b_card'],$postrow[$i]['post_bluecard']) . '">':' <input type="image" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\')" src="'. $images['icon_b_card'] . '" alt="'. $lang['Give_b_card'] . '" >'; 
		} 
   		else 
		{ 
			$b_card_img = ' <input type="WHAT HERE" name="report" value="report" onClick="return confirm(\''.$lang['Blue_card_warning'].'\') $lang['MY REPORT POST VARIABLE IN lamgmain.php']>';
			
   		}
	} else $b_card_img = '';

I feel like I'm really close but I cant quite finish it... can anyone help

Thanks in advance
Dagon
Registered User
Posts: 422
Joined: Tue Jun 03, 2003 8:59 pm

Post by Dagon »

The easy way is to open up an image editor, make an icon that says report post, and give it the same name as the blue card, and over write the existing blue card icon with it. Done deal. lol

Image
Bull_UK
Registered User
Posts: 23
Joined: Tue May 17, 2005 5:01 pm

Post by Bull_UK »

Dagon wrote: The easy way is to open up an image editor, make an icon that says report post, and give it the same name as the blue card, and over write the existing blue card icon with it. Done deal. lol

Image


I was looking into doing that but I have 2 themes (the default subsilver and a dark version called subblack downloaded from here) and my graphical skills are awful so I figured it'd be easier just to use text and let css take care of colour matching. I've tried using the colour grab tool in photoshop to match the tones of the buttons already there but they never look right.

Basically my graphical skills are awful :roll:
Locked

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