Банн по сайт
Автор: djvato
Здравейте … мисля , че това уроче може да ви е полезно и затова го пускам … това е просто като сте решили да изгоните някой от вашия форум да го изгоните по неговия сайт
#
#-----[ SQL ]------------------------------------------
#
CREATE TABLE `phpbb_disallow_website` (
`id` tinyint(1) NOT NULL default '0',
`disallow_text` text,
PRIMARY KEY (`id`),
KEY `id` (`disallow_text`(512))
);
INSERT INTO `phpbb_disallow_website` (`id`, `disallow_text`) VALUES (1, 'porn,gamble,poker,custom');
#
#-----[ отваряте ]------------------------------------------
#
admin/admin_user_ban.php
#
#-----[ намирате ]------------------------------------------
#
$message = $lang['Ban_update_sucessful'] . '<br /><br />' . sprintf($lang['Click_return_banadmin'], '<a href="' . append_sid("admin_user_ban.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
#
#-----[ преди него добавяте ]------------------------------------------
#
// Web_Ban_Mod
$webbanlist = htmlspecialchars($HTTP_POST_VARS['ban_site']);
$sql = "UPDATE " . WEB_BAN_TABLE . " SET disallow_text = '$webbanlist' WHERE id = 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update WEB_BAN_TABLE', '', __LINE__, __FILE__, $sql);
}
#
#-----[ намирате ]------------------------------------------
#
$template->set_filenames(array(
'body' => 'admin/user_ban_body.tpl')
);
#
#-----[ след него добавяте ]------------------------------------------
#
//Web_Ban_Mod
$sql = "SELECT disallow_text
FROM " . WEB_BAN_TABLE. " LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain web_banlist information", "", __LINE__, __FILE__, $sql);
}
while ($words = mysql_fetch_array($result))
{
$webbanlist = $words['disallow_text'];
}
$db->sql_freeresult($result);
// End Web_Ban_Mod
#
#-----[ намирате ]------------------------------------------
#
'S_BANLIST_ACTION' => append_sid("admin_user_ban.$phpEx"))
);
$template->assign_vars(array(
#
#-----[ след него добавяте ]------------------------------------------
#
'L_BAN_SITE' => $lang['Ban_site_words'],
'L_SITE_WORDS' => $lang['site_words'],
'L_BAN_SITE_EXPLAIN' => $lang['Ban_site_explain'],
'V_SITE_WORDS' => $webbanlist,
#
#-----[ отваряте ]------------------------------------------
#
includes/constants.php
#
#-----[ намирате ]------------------------------------------
#
define('BANLIST_TABLE', $table_prefix.'banlist');
#
#-----[ след него добавяте ]------------------------------------------
#
define('WEB_BAN_TABLE', $table_prefix.'disallow_website');
#
#-----[ отваряте ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ намирате ]------------------------------------------
#
if ( $website != '' )
{
rawurlencode($website);
}
#
#-----[ заменяте го с ]------------------------------------------
#
if ( $website != '' )
{
$sitewords_list = array();
$sql = "SELECT disallow_text FROM " . WEB_BAN_TABLE. " LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain web_banlist information", "", __LINE__, __FILE__, $sql);
}
while ($words = mysql_fetch_array($result))
{
$webbanlist = $words['disallow_text'];
}
$db->sql_freeresult($result);
$sitewords_list = explode(',', $webbanlist);
$times = count($sitewords_list);
for($i = 0; $i < $times; $i++)
{
if (stristr($website, $sitewords_list[$i]))
{
message_die(GENERAL_ERROR, $lang['Invalid_website']);
}
else
{
rawurlencode($website);
}
}
}
#
#-----[ отваряте ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ намирате ]------------------------------------------
# Full line is longer
$lang['No_banned_email'] =
#
#-----[ след него добавяте ]------------------------------------------
#
// Site_Ban_Mod
$lang['Ban_site_words'] = 'Ban websites containing these words or phrases';
$lang['site_words'] = 'Website';
$lang['Ban_site_explain'] = 'To specify more than one word, separate them with commas. Do NOT use *.';
#
#-----[ отваряте ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ намирате ]------------------------------------------
# Full line is longer
$lang['Email_invalid'] =
#
#-----[ след него добавяте ]------------------------------------------
#
$lang['Invalid_website'] = 'You entered an invalid website adres.';
#
#-----[ отваряте ]------------------------------------------
#
templates/subSilver/admin/user_ban_body.tpl
#
#-----[ намирате ]------------------------------------------
#
<tr>
<td class="catBottom" colspan="2" align="center"><input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" /> <input type="reset" value="{L_RESET}" class="liteoption" /></td>
</tr>
</table></form>
#
#-----[ преди него добавяте ]------------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_BAN_SITE}</th>
</tr>
<tr>
<td class="row1">{L_SITE_WORDS}: <br /><span class="gensmall">{L_BAN_SITE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="ban_site" size="35" value="{V_SITE_WORDS}" /></td>
</tr>Това е Успех


