Tutorial request

Discuţii legate de instalarea şi funcţionarea unor MODificări vechi sau noi ale forumului phpBB 2.0.x.
Închis
BODY
Utilizator înregistrat
Mesaje: 389
Membru din: 21-Iun-2007, 17:26:13
Ext: Nu
Server: Windows
Nivel phpBB: Mediu
Nivel php: Mediu

Tutorial request

Mesaj de BODY »

As vrea sa stiu si eu cum se instaleaza acest mod -- > Simple Warning & Ban System ... Sunt nou aici .. Scz de deranj
carol
Utilizator înregistrat
Mesaje: 94
Membru din: 27-Mar-2007, 19:07:54
Ext: Nu
Server: Windows
Nivel phpBB: Mediu
Nivel php: Mediu

Mesaj de carol »

Urmezi instrucţiunile din fişierul .mod care vine cu modul (click dreapta - open with notepad )

Cod: Selectaţi tot

#################################################################
## MOD Title: Simple Warning & Ban System
## MOD Version: 0.2.0
## MOD Author: Eminem_Fan <N> (Dean Oakes) http://www.phpbb.com
## MOD Description: This modification will allow you to warn your users and automaticly ban them on after the 3rd warning. 
##
## Installation Level: Easy
## Installation Time: 20 Minutes
##
## Files To Edit:	viewtopic.php
##					language/lang_english/lang_main.php
##					language/lang_english/lang_admin.php
##					includes/usercp_viewprofile.php
##					includes/constants.php
##					admin/admin_board.php
##					templates/subSilver/admin/board_config_body.tpl
##					templates/subSilver/viewtopic_body.tpl
##					templates/subSilver/profile_view_body.tpl
## Included Files:	N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Note:
##	Finaly, a simple way to warn your members and ban them if they persist!
##############################################################
## MOD History:
##
##	2005-22-12 - Version 0.1.0
##	-	Development started
##
##	2005-22-12 - Version 0.2.0
##	-	Stable Release
## 
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################

#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users ADD user_warnings tinyint(1) DEFAULT 0 NOT NULL;
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnmod_banrank', 0);
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnmod_unbanrank', 0);

#
#-----[ COPY ]------------------------------------------
#
copy root/warning.php to warning.php

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

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

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

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

#
#-----[ FIND ]------------------------------------------
#
	if ( $poster_id != ANONYMOUS )
	{

#
#-----[ REPLACE WITH ]------------------------------------------
#
	$user_warnings = 0;
	if ( $poster_id != ANONYMOUS )
	{
		$user_warnings = $postrow[$i]['user_warnings'];

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

#
#-----[ AFTER, ADD ]------------------------------------------
#
	$warn_lnk = '';
	if($userdata['user_level'] != USER)
	{
		if($user_warnings != MAGIC_NUMBER_BANNED)
		{
			$warn_lnk .= '<a class="gensmall" href="' . append_sid(" POST_USERS_URL=" . $postrow[$i]['user_id']) . '">' . $lang['warnmod_warn'] . '</a>';
		}
		else
		{
			$warn_lnk .= '<a class="gensmall" href="' . append_sid(" POST_USERS_URL=" . $postrow[$i]['user_id']) . '">' . $lang['warnmod_unban'] . '</a>';
		}
		if($user_warnings && $user_warnings != MAGIC_NUMBER_BANNED)
		{
			$warn_lnk .= ' || <a class="gensmall" href="' . append_sid(" POST_USERS_URL=" . $postrow[$i]['user_id']) . '">' . $lang['warnmod_unwarn'] . '</a>';;
		}
	}
	if($warn_lnk)
	{
		$warn_lnk .= '<br>';
	}

#
#-----[ FIND ]------------------------------------------
#
'EDITED_MESSAGE' => $l_edited_by,

#
#-----[ AFTER, ADD ]------------------------------------------
#
		'WARNINGS' => ($user_warnings && $userdata['user_level'] != USER && $user_warnings != MAGIC_NUMBER_BANNED) ? $lang['warnmod_vtitle'] . ': ' . $user_warnings . '<br>' : '',
		'WARN_USER' => $warn_lnk,

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['warnmod_warn'] = 'Warn';
$lang['warnmod_unwarn'] = 'Unwarn';
$lang['warnmod_unban'] = 'Unban';
$lang['warnmod_title'] = 'Warnings System';
$lang['warnmod_vtitle'] = 'Warnings';
$lang['User_has_no_warnings'] = 'You cannot unwarn this user as they do not have any warnings.';
$lang['User_already_banned_warnmod'] = 'This user has already been banned.';
$lang['User_successfully_banned_warnmod'] = 'This user has been succesfully banned.';
$lang['User_successfully_warned_warnmod'] = 'This user has been succesfully warned.';
$lang['User_successfully_unwarned_warnmod'] = 'This user bas been unwarned successfully.';
$lang['User_successfully_unbanned_warnmod'] = 'This user has been succesfully unbanned.';
$lang['User_not_banned_warnmod'] = 'You cannot unban this user as they are not banned.';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['warnmod_banrank'] = 'WarnMOD Banned Rank';
$lang['warnmod_banrank_explain'] = 'When somebody is banned using the WarnMOD system they will automaticly be given the rank id you specify';
$lang['warnmod_unbanrank'] = 'WarnMOD Unbanned Rank';
$lang['warnmod_unbanrank_explain'] = 'When somebody is unbanned using the WarnMOD system they will automaticly be given the rank id you specify';

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#
if (!$profiledata)
{
	message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#
if($profiledata['user_warnings'] && $userdata['user_level'] != USER && $profiledata['user_warnings'] != MAGIC_NUMBER_BANNED)
{
	$template->assign_block_vars('switch_warning', array());
}

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

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'WARNINGS' => $profiledata['user_warnings'],

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

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_WARNINGS' => $lang['warnmod_vtitle'],

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
define('MAGIC_BAN_NUMBER', 3);
define('MAGIC_NUMBER_BANNED', 4);

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------
#
"L_RESET" =>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	"L_BAN_RANK" => $lang['warnmod_banrank'],
	"L_BAN_RANK_EXPLAIN" => $lang['warnmod_banrank_explain'],
	"L_UNBAN_RANK" => $lang['warnmod_unbanrank'],
	"L_UNBAN_RANK_EXPLAIN" => $lang['warnmod_unbanrank_explain'],

	"BAN_RANK" => $new['warnmod_banrank'],
	"UNBAN_RANK" => $new['warnmod_unbanrank'],

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#
		<td><input> {L_YES}&nbsp;&nbsp;<input> {L_NO}</td>
	</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
	<tr>
		<td>{L_BAN_RANK}<br><span>{L_BAN_RANK_EXPLAIN}</span></td>
		<td><input></td>
	</tr>
	<tr>
		<td>{L_UNBAN_RANK}<br><span>{L_UNBAN_RANK_EXPLAIN}</span></td>
		<td><input></td>
	</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{postrow.POSTER_RANK}<br>

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

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
{postrow.WARNINGS}

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

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

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#
		  <td><b><span>{JOINED}</span></b></td>
		</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
		<BEGIN>
		<tr> 
		  <td><span>{L_WARNINGS}:&nbsp;</span></td>
		  <td><b><span>{WARNINGS}</span></b></td>
		</tr>
		<END>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Avatar utilizator
seelview
Fost coleg
Mesaje: 2146
Membru din: 13-Apr-2005, 21:24:50
Versiune: 3.x
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Foarte experimentat
Localitate: Cu curu' pe scaun
Contact:

Mesaj de seelview »

Nu era nevoie sa postezi tot fisierul.
"Don't have fear, I is here"
Seelview Photography / Blog this
Închis

Înapoi la “2.0.x Suport pentru MODificări”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator