Simple Bin MOD
: , , , , ACP. , . - Winking

:
: 6
, : 4

modcp.php
admin/admin_board.php
templates/subSilver/admin/board_config_body.tpl
language/lang_english/lang_admin.php

, , !

:
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('bin_forum',1);

#
#-----[ ]------------------------------------------
#
modcp.php

#
#-----[ ]------------------------------------------
#
//
// Got all required info so go ahead and start deleting everything
//

#
#-----[ , ]------------------------------------------
#
if ( $forum_id != $board_config['bin_forum'] )
{
for($i = 0; $i < count($row); $i++)
{
$topic_id = $row[$i]['topic_id'];

$sql = "UPDATE " . TOPICS_TABLE . "
SET forum_id = '" . $board_config['bin_forum'] . "'
WHERE topic_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update old topic', '', __LINE__, __FILE__, $sql);
}

$sql = "UPDATE " . POSTS_TABLE . "
SET forum_id = '" . $board_config['bin_forum'] . "'
WHERE topic_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update post topic ids', '', __LINE__, __FILE__, $sql);
}
}
// Sync the forum indexes
sync('forum', $board_config['bin_forum']);
sync('forum', $forum_id);

$redirect_page = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];
$l_redirect = sprintf($lang['Click_return_forum'], '<a href="' . $redirect_page . '">', '</a>');

$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
);

message_die(GENERAL_MESSAGE, $lang['Topics_Removed'] . '<br /><br />' . $l_redirect);
}

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

#
#-----[ ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

#
#-----[ , ]------------------------------------------
#
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);

#
#-----[ ]------------------------------------------
#
$template->set_filenames(array(

#
#-----[ , ]------------------------------------------
#
// Simple Bin
$bin_forum = make_forum_select('bin_forum', false, $new['bin_forum']);
// Simple Bin

#
#-----[ ]------------------------------------------
#
"L_SYSTEM_TIMEZONE" => $lang['System_timezone'],

#
#-----[ , ]------------------------------------------
#
"L_BIN_FORUM" => $lang['Bin_forum'],

#
#-----[ ]------------------------------------------
#
"TIMEZONE_SELECT" => $timezone_select,

#
#-----[ , ]------------------------------------------
#
"BIN_FORUM" => $bin_forum,

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

#
#-----[ ]------------------------------------------
#
<tr>
<td class="row1">{L_SYSTEM_TIMEZONE}</td>
<td class="row2">{TIMEZONE_SELECT}</td>
</tr>

#
#-----[ , ]------------------------------------------
#
<tr>
<td class="row1">{L_BIN_FORUM}</td>
<td class="row2"><span class="gen">{BIN_FORUM}</span></td>
</tr>
#
#-----[ ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ ]------------------------------------------
#
//
// That's all Folks!

#
#-----[ , ]------------------------------------------
#
$lang['Bin_forum'] = 'Bin Forum';

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

. ACP. . .


/ /