von AmigaLink » 17. Jan 2007 14:01
Hiermit wird der Status-Selector des "add status to topic" nur noch Admins, Moderatoren sowie dem Topic-Starter angezeigt und außerdem der wird Code ein wenig Optimiert.
- Code: Alles auswählen
#
#-----[ OPEN ]----------------------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]----------------------------------------------------------------
#
if( $userdata['user_id'] != ANONYMOUS )
{
$template->assign_block_vars('switch_info', array());
}
if( isset($HTTP_POST_VARS['submit']) && $HTTP_POST_VARS['topic_info'] != 0 && $userdata['user_id'] != ANONYMOUS )
{
$sql = "UPDATE ". TOPICS_TABLE ." SET topic_info = '". str_replace("\'", "''", $HTTP_POST_VARS['topic_info']) ."' WHERE topic_id = $topic_id";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'could not update topic info.', '', __LINE__, __FILE__, $sql);
}
$message = $lang['Topic_info_updated'] .'<br /><br />'. sprintf($lang['Click_return_topic'], '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL ."=$topic_id") .'">', '</a>') .'<br /><br />'. sprintf($lang['Click_return_forum'], '<a href="'. append_sid("viewforum.$phpEx?". POST_FORUM_URL ."=$forum_id") .'">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
#
#-----[ REPLACE WITH ]--------------------------------------------------------
#
if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $userdata['user_id'] == $topic_poster )
{
$template->assign_block_vars('switch_info', array());
if( isset($HTTP_POST_VARS['submit']) && intval($HTTP_POST_VARS['topic_info']) != 0 )
{
$topic_info_status = intval($HTTP_POST_VARS['topic_info']);
$sql = "UPDATE ". TOPICS_TABLE ." SET topic_info = $topic_info_status WHERE topic_id = $topic_id";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'could not update topic info.', '', __LINE__, __FILE__, $sql);
}
$message = $lang['Topic_info_updated'] .'<br /><br />'. sprintf($lang['Click_return_topic'], '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL ."=$topic_id") .'">', '</a>') .'<br /><br />'. sprintf($lang['Click_return_forum'], '<a href="'. append_sid("viewforum.$phpEx?". POST_FORUM_URL ."=$forum_id") .'">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------------
#
# EoM
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.