Verfasst: 01.05.2005 17:44
Hallo,
hast Du überhaupt schon einmal einen MOD eingebaut ????
hast Du überhaupt schon einmal einen MOD eingebaut ????

phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
##############################################################
## MOD Title: ModCP Merge Hack
## MOD Author: Sko22 < sko22@quellicheilpc.it > (N/A) http://www.quellicheilpc.it/
## MOD Description: This mod adds topics merge function in moderator control panel.
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit:
## modcp.php
## viewtopic.php
## includes/functions_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/subSilver.cfg
## templates/subSilver/modcp_body.tpl
## Included Files:
## templates/subSilver/modcp_merge.tpl
## templates/subSilver/images/topic_merge.gif
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## I have tested this MOD whit phpBB 2.0.10 and MySQL Database 3.23.56
## This MOD is an updating to the ModCP Merge Hack realized by sickb0y < http://www.p2pitalia.com >
##
## Future versions can be found at http://www.quellicheilpc.it
## I've set up a support forum for my mods at http://www.quellicheilpc.it/forum
##
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
## Copyright: ©2004 ModCP Merge Hack 1.0.2 - Sko22 & sickb0y
##############################################################
## MOD History:
##
## 2004-10-16 - Version 1.0.2
## - Update for phpBB 2.0.10 from Sko22 < http://www.quellicheilpc.it >
## - Added Merge button in viewtopic.php
## 2003-03-23 - Version 1.0.1
## - ModCP Merge Hack realized by sickb0y < http://www.p2pitalia.com >
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy templates/subSilver/modcp_merge.tpl to templates/subSilver/modcp_merge.tpl
copy templates/subSilver/images/topic_merge.gif to templates/subSilver/images/topic_merge.gif
#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
$unlock = ( isset($HTTP_POST_VARS['unlock']) ) ? TRUE : FALSE;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$merge = ( isset($HTTP_POST_VARS['merge']) ) ? TRUE : FALSE;
#
#-----[ FIND ]------------------------------------------
#
else if ( $unlock )
{
$mode = 'unlock';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
else if ( $merge )
{
$mode = 'merge';
}
#
#-----[ FIND ]------------------------------------------
#
message_die(GENERAL_MESSAGE, $lang['Topics_Unlocked'] . '<br /><br />' . $message);
break;
#
#-----[ AFTER, ADD ]------------------------------------------
#
case 'merge':
$page_title = $lang['Mod_CP'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
if ( $confirm )
{
if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
{
message_die(GENERAL_MESSAGE, $lang['None_selected']);
}
$new_topic_id = $HTTP_POST_VARS['new_topic'];
$topic_id_list = isset($HTTP_POST_VARS['topic_id_list']) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id);
for ($i=0; $i < count($topic_id_list); $i++)
{
$old_topic_id = $topic_id_list[$i];
if ( $new_topic_id != $old_topic_id )
{
$sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $new_topic_id
WHERE topic_id = $topic_id_list[$i]";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
}
$sql = "DELETE FROM " . TOPICS_TABLE . "
WHERE topic_id = $topic_id_list[$i]";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
}
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id_list[$i]";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
}
// Sync the forum indexes
sync('forum', $forum_id);
sync('topic', $new_topic_id);
$message = $lang['Topics_Moved'] . '<br /><br />';
}
else
{
$message = $lang['No_Topics_Moved'] . '<br /><br />';
}
}
if ( !empty($topic_id) )
{
$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id&sid=" . $userdata['session_id'];
$message .= sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];
$message .= sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
$message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id&sid=" . $userdata['session_id'] . '">', '</a>');
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
);
message_die(GENERAL_MESSAGE, $message);
}
else
{
if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
{
message_die(GENERAL_MESSAGE, $lang['None_selected']);
}
$hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
if ( isset($HTTP_POST_VARS['topic_id_list']) )
{
$topics = $HTTP_POST_VARS['topic_id_list'];
for($i = 0; $i < count($topics); $i++)
{
$hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . intval($topics[$i]) . '" />';
}
}
else
{
$hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
}
//
// Set template files
//
$template->set_filenames(array(
'mergetopic' => 'modcp_merge.tpl')
);
$template->assign_vars(array(
'MESSAGE_TITLE' => $lang['Confirm'],
'MESSAGE_TEXT' => $lang['Confirm_move_topic'],
'L_MERGE_TOPIC' => $lang['Merge_topic'],
'L_YES' => $lang['Yes'],
'L_NO' => $lang['No'],