Вид бан - Юзърът не може да пише мнения
Това е вид бан при който забранявате на даден юзър да поства мнения.
Картинки:
http://i.data.bg/08/01/02/736026_orig.jpg
http://i.data.bg/08/01/02/736028_orig.jpg
Модът е тестван и работи!
Източник: http://phpbbhacks.com
Нужни файлове:
Салагате картинката в templates\XXX\images\lang_XXX


#-----[ SQL ]------------------------------------------
#
#

ALTER TABLE phpbb_users ADD user_can_post TINYINT(1) default '1'

#
#-----[ Отворете ]------------------------------------------
#

language/lang_english/lang_main.php

#
#----[ Намерете ]------------------------------------------
#

?>

#
#-----[ Преди това добавете ]------------------------------------------
#

$lang['User_can_post'] = 'User can post';
$lang['Ban'] = 'You banned from forum.You can not post new topics, replies or edit your old messages. Only you can check, get or send private messages.';

#
#-----[ Отворете ]------------------------------------------
#

posting.php

#
#----[ Намерете ]------------------------------------------
#

if ( $post_info['forum_status'] == FORUM_LOCKED && !$is_auth['auth_mod'])
{
message_die(GENERAL_MESSAGE, $lang['Forum_locked']);
}


#
#-----[ Преди това добавете ]------------------------------------------
#

// special ban by emrag
$userid = $userdata['user_id'];
$sql = "SELECT user_can_post
FROM " . USERS_TABLE . "
WHERE user_id = $userid";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_MESSAGE, 'Could not obtain user_can_post data');
}
$row = $db->sql_fetchrow($result);
$user_can_post = $row['user_can_post'];

if (!$user_can_post)
{
$post_info['forum_status'] = FORUM_LOCKED;
}
// special ban by emrag

#
#----[ Отворете ]------------------------------------------
#

admin/admin_users.php

#
#----[ Намерете ]------------------------------------------
#

$user_status = ( !empty($HTTP_POST_VARS['user_status']) ) ? intval( $HTTP_POST_VARS['user_status'] ) : 0;
$user_allowpm = ( !empty($HTTP_POST_VARS['user_allowpm']) ) ? intval( $HTTP_POST_VARS['user_allowpm'] ) : 0;



#
#-----[ Преди това добавете ]------------------------------------------
#

$user_can_post = ( !empty($HTTP_POST_VARS['user_can_post']) ) ? intval( $HTTP_POST_VARS['user_can_post'] ) : 0;

#
#----[ Намерете ]------------------------------------------
#

//
// Update entry in DB
//
if( !$error )
{
$sql = "UPDATE " . USERS_TABLE . "


#
#-----[ В реда намерете]------------------------------------------
#

, user_active = $user_status,

#
#----[ След това добавете]------------------------------------------
#

user_can_post = $user_can_post,

#
#----[ Намерете ]------------------------------------------
#

$user_status = $this_userdata['user_active'];
$user_allowavatar = $this_userdata['user_allowavatar'];

#
#-----[ Преди това добавете ]------------------------------------------
#

$user_can_post = $this_userdata['user_can_post'];

#
#----[ Намерете ]------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="user_status" value="' . $user_status . '" />';
$s_hidden_fields .= '<input type="hidden" name="user_allowpm" value="' . $user_allowpm . '" />';

#
#----[ Преди това добавете ]------------------------------------------
#

$s_hidden_fields .= '<input type="hidden" name="user_can_post" value="' . $user_can_post . '" />';

#
#----[ Намерете ]------------------------------------------
#

'ALLOW_PM_YES' => ($user_allowpm) ? 'checked="checked"' : '',
'ALLOW_PM_NO' => (!$user_allowpm) ? 'checked="checked"' : '',

#
#----[ Преди това добавете ]------------------------------------------
#

'USER_CAN_POST_YES' => ($user_can_post) ? 'checked="checked"' : '',
'USER_CAN_POST_NO' => (!$user_can_post) ? 'checked="checked"' : '',

#
#----[Намерете ]------------------------------------------
#

'L_SPECIAL' => $lang['User_special'],
'L_SPECIAL_EXPLAIN' => $lang['User_special_explain'],

#
#----[ Преди това добавете ]------------------------------------------
#

'L_USER_CAN_POST' => $lang['User_can_post'],

#
#----[ Отворете ]------------------------------------------
#

templates/subsilver/admin/user_edit_body.tpl

#
#----[ Намерете ]------------------------------------------
#

<tr>
<td class="row1"><span class="gen">{L_ALLOW_AVATAR}</span></td>
<td class="row2">
<input type="radio" name="user_allowavatar" value="1" {ALLOW_AVATAR_YES} />
<span class="gen">{L_YES}</span>  
<input type="radio" name="user_allowavatar" value="0" {ALLOW_AVATAR_NO} />
<span class="gen">{L_NO}</span></td>
</tr>

#
#-----[ След това добавете ]------------------------------------------
#

<tr>
<td class="row1"><span class="gen">{L_USER_CAN_POST}</span></td>
<td class="row2">
<input type="radio" name="user_can_post" value="1" {USER_CAN_POST_YES} />
<span class="gen">{L_YES}</span>  
<input type="radio" name="user_can_post" value="0" {USER_CAN_POST_NO} />
<span class="gen">{L_NO}</span></td>
</tr>

#
#----[ Отворете ]------------------------------------------
#

viewtopic.php

#
#----[Намерете ]------------------------------------------
#

$reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
$reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked1'] : $lang['Reply_to_topic'];
$post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];

#
#-----[ Заместете с ]------------------------------------------
#

// цzel ban by emrag
$userid = $userdata['user_id'];
$sql = "SELECT user_can_post
FROM " . USERS_TABLE . "
WHERE user_id = $userid";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_MESSAGE, 'Could not obtain user_can_post data');
}
$row = $db->sql_fetchrow($result);
$user_can_post = $row['user_can_post'];

if (!$user_can_post)
{
$post_info['forum_status'] = FORUM_LOCKED;
}
// цzel ban by emrag

if(!$user_can_post)
{
$reply_img = $images['ban'];
$reply_alt = $lang['Ban'];
$post_img = $images['ban'];
$post_alt = $lang['Ban'];
}
else
{
$reply_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $images['reply_locked'] : $images['reply_new'];
$reply_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED || $forum_topic_data['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked1'] : $lang['Reply_to_topic'];
$post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];
}

#
#----[ Отворете ]------------------------------------------
#

viewforum.php

#
#----[ Намерете ]------------------------------------------
#

$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_row['forum_name'],

#
#-----[ Преди това добавете]------------------------------------------
#

// цzel ban by emrag
$userid = $userdata['user_id'];
$sql = "SELECT user_can_post
FROM " . USERS_TABLE . "
WHERE user_id = $userid";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_MESSAGE, 'Could not obtain user_can_post data');
}
$row = $db->sql_fetchrow($result);
$user_can_post = $row['user_can_post'];

if (!$user_can_post)
{
$post_info['forum_status'] = FORUM_LOCKED;
}
// цzel ban by emrag
if(!$user_can_post)
{
$post_img_replace_with = $images['ban'];
$l_post_new_topic_replace_with = $lang['Ban'];
}
else
{
$post_img_replace_with = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];
$l_post_new_topic_replace_with = ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];
}

#
#----[ Намерете ]------------------------------------------
#

'POST_IMG' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],

#
#-----[ Заместете с ]------------------------------------------
#

'POST_IMG' => $post_img_replace_with,

#
#----[ Намерете ]------------------------------------------
#

'L_POST_NEW_TOPIC' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],

#
#-----[ Заместете с ]------------------------------------------
#

'L_POST_NEW_TOPIC' => $l_post_new_topic_replace_with,

#
#----[ Отворете ]------------------------------------------
#

templates/subsilver/subsilver.cfg

#
#----[ Намерете ]------------------------------------------
#

$images['reply_new'] = "$current_template_images/{LANG}/reply.gif";
$images['reply_locked'] = "$current_template_images/{LANG}/reply-locked.gif";

#
#-----[ След това добавете ]------------------------------------------
#

$images['ban'] = "$current_template_images/{LANG}/ban.gif";

#
#-----[Запишете/затворете всички файлове]------------------------------------------
#


/ Трябва да сте регистриран за да напишете коментар /