mod?

ами може
не знам как става изтриването
така може и да стане изтриването
if($userdata['user_level'] == ADMIN)
{
if(strstr($post_message, ":delete:"))
{
$sql = "DELETE
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_id_sql)
OR topic_moved_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql);
}

if ( $post_id_sql != '' )
{
$sql = "DELETE
FROM " . POSTS_TABLE . "
WHERE post_id IN ($post_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE
FROM " . POSTS_TEXT_TABLE . "
WHERE post_id IN ($post_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql);
}

remove_search_post($post_id_sql);
}

if ( $vote_id_sql != '' )
{
$sql = "DELETE
FROM " . VOTE_DESC_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote descriptions', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE
FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote results', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id IN ($vote_id_sql)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete vote users', '', __LINE__, __FILE__, $sql);
}
}

$sql = "DELETE
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql);
}
}
}


а за местенето

if($userdata['user_level'] == ADMIN)
{
if(strstr($post_message, ":delete:"))
{
$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_forum_id = intval($HTTP_POST_VARS['new_forum']);
$old_forum_id = $forum_id;

$sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $new_forum_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select from forums table', '', __LINE__, __FILE__, $sql);
}

if (!$db->sql_fetchrow($result))
{
message_die(GENERAL_MESSAGE, 'New forum does not exist');
}

$db->sql_freeresult($result);

if ( $new_forum_id != $old_forum_id )
{
$topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id);

$topic_list = '';
for($i = 0; $i < count($topics); $i++)
{
$topic_list .= ( ( $topic_list != '' ) ? ', ' : '' ) . intval($topics[$i]);
}

$sql = "SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_list)
AND forum_id = $old_forum_id
AND topic_status <> " . TOPIC_MOVED;
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not select from topic table', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

for($i = 0; $i < count($row); $i++)
{
$topic_id = $row[$i]['topic_id'];

if ( isset($HTTP_POST_VARS['move_leave_shadow']) )
{
// Insert topic in the old forum that indicates that the forum has moved.
$sql = "INSERT INTO " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_status, topic_type, topic_vote, topic_views, topic_replies, topic_first_post_id, topic_last_post_id, topic_moved_id)
VALUES ($old_forum_id, '" . addslashes(str_replace("\'", "''", $row[$i]['topic_title'])) . "', '" . str_replace("\'", "''", $row[$i]['topic_poster']) . "', " . $row[$i]['topic_time'] . ", " . TOPIC_MOVED . ", " . POST_NORMAL . ", " . $row[$i]['topic_vote'] . ", " . $row[$i]['topic_views'] . ", " . $row[$i]['topic_replies'] . ", " . $row[$i]['topic_first_post_id'] . ", " . $row[$i]['topic_last_post_id'] . ", $topic_id)";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert shadow topic', '', __LINE__, __FILE__, $sql);
}
}

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

$sql = "UPDATE " . POSTS_TABLE . "
SET forum_id = $new_forum_id
WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update post topic ids', '', __LINE__, __FILE__, $sql);
}
}

// Sync the forum indexes
sync('forum', $new_forum_id);
sync('forum', $old_forum_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 . "=$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(
'movetopic' => 'modcp_move.tpl')
);

$template->assign_vars(array(
'MESSAGE_TITLE' => $lang['Confirm'],
'MESSAGE_TEXT' => $lang['Confirm_move_topic'],

'L_MOVE_TO_FORUM' => $lang['Move_to_forum'],
'L_LEAVESHADOW' => $lang['Leave_shadow_topic'],
'L_YES' => $lang['Yes'],
'L_NO' => $lang['No'],

'S_FORUM_SELECT' => make_forum_select('new_forum', $forum_id),
'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
'S_HIDDEN_FIELDS' => $hidden_fields)
);

$template->pparse('movetopic');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
}
}
 
Горното беше за местенето.
Това за изтриването :cry:
Код:
Could not delete topics

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') OR topic_moved_id IN ()' at line 3

DELETE FROM phpbb_topics WHERE topic_id IN () OR topic_moved_id IN ()

Line : 281
File : functions_post.php
 
не мога да помогна....
виж файла modcp.php дано ти стане ясно как се изтриват и преместват темите

може да се направи и си линк
if($userdata['user_level'] == ADMIN)
{
if(strstr($post_message, ":move:"))
{
echo "пишеш линк към преместването на темата";
}
}
 

Back
Горе