Wenn man bei Small Shoutbox im ACP einstellt, dass die letzten 50 SHouts angezeigt werden sollen, und man über 50 Shouts schon hat, werden die neueren Shouts nicht angezeigt!! (man kann also weiter shouten wie man will, die neueren werden nicht angezeigt...)
Wenn ich die Zahl von 50 auf z.b 100 erhöhe sehe ich erst die neueren Shouts....
Kann man das nicht so einstellen, dass die neueren Shouts (also die neueren 50 Shouts) erscheinen, und dann die älteren immer mehr weggehen (von mir aus können sie auch gelöscht werden!).
Anzeige der Posts bei Small Shoutbox
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
shoutbox_view.php (ich hoffe das ist die Datei die man verändern muss):
Code: Alles auswählen
<?php
/***************************************************************************
* shoutbox_view.php
* -------------------
* begin : Friday, Jul 12, 2003
* copyright : (C) 2003 Przemo
* website : http://www.przemo.org
* email : przemo@przemo.org
* version : 1.4
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
}
if ( isset($HTTP_GET_VARS['name']) || isset($HTTP_POST_VARS['name']) )
{
$name = ( isset($HTTP_GET_VARS['name']) ) ? $HTTP_GET_VARS['name'] : $HTTP_POST_VARS['name'];
}
if ( isset($HTTP_GET_VARS['message']) || isset($HTTP_POST_VARS['message']) )
{
$message = ( isset($HTTP_GET_VARS['message']) ) ? $HTTP_GET_VARS['message'] : $HTTP_POST_VARS['message'];
}
if ( isset($HTTP_GET_VARS['msg']) || isset($HTTP_POST_VARS['msg']) )
{
$msg = ( isset($HTTP_GET_VARS['msg']) ) ? $HTTP_GET_VARS['msg'] : $HTTP_POST_VARS['msg'];
}
if ( isset($HTTP_GET_VARS['id']) || isset($HTTP_POST_VARS['id']) )
{
$id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : $HTTP_POST_VARS['id'];
}
if ( isset($HTTP_GET_VARS['del_sb_id']) || isset($HTTP_POST_VARS['del_sb_id']) )
{
$del_sb_id = ( isset($HTTP_GET_VARS['del_sb_id']) ) ? $HTTP_GET_VARS['del_sb_id'] : $HTTP_POST_VARS['del_sb_id'];
}
if ( isset($HTTP_GET_VARS['name_id']) || isset($HTTP_POST_VARS['name_id']) )
{
$name_id = ( isset($HTTP_GET_VARS['name_id']) ) ? $HTTP_GET_VARS['name_id'] : $HTTP_POST_VARS['name_id'];
}
if ( isset($HTTP_GET_VARS['date_edit']) || isset($HTTP_POST_VARS['date_edit']) )
{
$date_edit = ( isset($HTTP_GET_VARS['date_edit']) ) ? $HTTP_GET_VARS['date_edit'] : $HTTP_POST_VARS['date_edit'];
}
if ( isset($HTTP_GET_VARS['name_edit']) || isset($HTTP_POST_VARS['name_edit']) )
{
$name_edit = ( isset($HTTP_GET_VARS['name_edit']) ) ? $HTTP_GET_VARS['name_edit'] : $HTTP_POST_VARS['name_edit'];
}
if ( isset($HTTP_GET_VARS['clean_msg']) || isset($HTTP_POST_VARS['clean_msg']) )
{
$clean_msg = ( isset($HTTP_GET_VARS['clean_msg']) ) ? $HTTP_GET_VARS['clean_msg'] : $HTTP_POST_VARS['clean_msg'];
}
if ( isset($HTTP_GET_VARS['submit_button']) || isset($HTTP_POST_VARS['submit_button']) )
{
$submit_button = ( isset($HTTP_GET_VARS['submit_button']) ) ? $HTTP_GET_VARS['submit_button'] : $HTTP_POST_VARS['submit_button'];
}
$sb_user_id = $userdata['user_id'];
if ( $mode == "show" )
{
@setcookie('shoutbox',on , (time()+3600*9000), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
header("Location: " . append_sid("index.$phpEx?redirect=shoutbox_view.$phpEx", true));
}
if ( $mode == "submit" && $msg )
{
if ( !$shoutbox_config['allow_guest'] && !$userdata['session_logged_in'] )
{
echo '<body onload="window.scrollTo(0,0);" />
<table align="center"><tr><td align="left"><span class="gensmall">
<b>' . $lang['login_to_shoutcast'] . '</b></span></td></tr></table>';
}
$check_lenght=explode(" ",$msg);
$total=sizeof($check_lenght);
for($i=0; $total > $i; $i++)
if (strlen($check_lenght[$i])>$shoutbox_config['word_lenght'])
{
$too_long = true;
echo '<body onload="window.scrollTo(0,0);" />
<table align="center"><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall">
<b>' . $lang['too_long_word'] . '</b></span></td></tr></table>';
}
$current_time = time();
$sql = "SELECT MAX(timestamp) AS last_msg_time
FROM " . SHOUTBOX_TABLE . "
WHERE sb_user_id = $sb_user_id";
if ( $result = $db->sql_query($sql) )
{
if ( $row = $db->sql_fetchrow($result) )
{
if ( $row['last_msg_time'] > 0 && ( $current_time - $row['last_msg_time'] ) < $board_config['flood_interval'] )
{
$flood_msg = true;
echo '<body onload="window.scrollTo(0,0);" />
<table align="center"><tr><td align="left"><span class="gensmall">
' . $lang['Flood_Error'] . '</span></td></tr></table>';
}
}
}
$shoutbox_config['banned_user_id'] = $GLOBALS['shoutbox_config']['banned_user_id'];
if( strstr($shoutbox_config['banned_user_id'], ',') )
{
$fids = explode(',', $shoutbox_config['banned_user_id']);
while( list($foo, $id) = each($fids) )
{
$fid[] = intval( trim($id) );
}
}
else
{
$fid[] = intval( trim($shoutbox_config['banned_user_id']) );
}
reset($fid);
if ( in_array($sb_user_id, $fid) != false )
{
echo '<body onload="window.scrollTo(0,0);" />
<table align="center"><tr><td align="left"><span class="gensmall">
' . $lang['sb_banned_send'] . '</span></td></tr></table>';
$shoutbox_banned = true;
}
if ( !$too_long && !$flood_msg && !$shoutbox_banned ) if ( $shoutbox_config['allow_guest'] || $userdata['session_logged_in'] )
{
$sql = "INSERT INTO " . SHOUTBOX_TABLE . "
VALUES('', '$sb_user_id', '$msg', '".time()."', '$name')";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not insert shoutbox message', '', __LINE__, __FILE__, $sql); }
$start = time() - $shoutbox_config['delete_days'] * 86400;
$sql = "DELETE FROM " . SHOUTBOX_TABLE . "
WHERE timestamp < $start";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not delete shoutbox messages', '', __LINE__, __FILE__, $sql); }
}
}
if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous ) $aedit = 1; else $aedit = 0;
if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous ) $adel = 1; else $adel = 0;
if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1;
if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1;
else $del_mod = "AND sb_user_id = $sb_user_id";
if ( $mode == "delete" && $adel )
{
$sql = "DELETE FROM " . SHOUTBOX_TABLE . "
WHERE id = $id $del_mod";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not delete shoutbox message', '', __LINE__, __FILE__, $sql); }
}
if ( $mode == "edit" && $aedit )
{
echo '<body onload="window.scrollTo(0,0);" />
<table><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall">
' . $lang['Edit_pm'] . ': <input type="text" name="message" style="height:15px" size="60" maxlength="150" " value="' . $clean_msg . '" class="editbox"><input type="hidden" name="mode" value="edited_msg"><input type="hidden" name="id" value="' . $id . '"><input type="hidden" name="name_edit" value="' . $name_edit . '">
<input type="hidden" name="date_edit" value="' . $date_edit . '">
<input type="hidden" name="name_id" value="' . $name_id . '">
<input type="submit" name="submit_button" value="' . $lang['Submit'] . '" style="font-size:9px; height:16px;" class="button"></span></td>
</form></tr></table>';
}
if ( $mode == "edited_msg" && $aedit )
{
$sql = "REPLACE INTO " . SHOUTBOX_TABLE . "
VALUES('$id', '$name_id', '$message', '$date_edit', '$name_edit')";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not replace shoutbox message', '', __LINE__, __FILE__, $sql); }
}
$template->set_filenames(array(
'body' => 'shoutbox_view_body.tpl')
);
$shoutbox_config['banned_user_id_view'] = $GLOBALS['shoutbox_config']['banned_user_id_view'];
if( strstr($shoutbox_config['banned_user_id_view'], ',') )
{
$fids = explode(',', $shoutbox_config['banned_user_id_view']);
while( list($foo, $id) = each($fids) )
{
$fid[] = intval( trim($id) );
}
}
else
{
$fid[] = intval( trim($shoutbox_config['banned_user_id_view']) );
}
reset($fid);
if ( in_array($sb_user_id, $fid) != false )
{
$shoutbox_banned_view = true;
}
if ( $shoutbox_config['shoutbox_on'] && $shoutbox != "off" && !$shoutbox_banned_view ) if ( $shoutbox_config['allow_guest'] || $shoutbox_config['allow_guest_view'] || $userdata['session_logged_in'] )
{
function get_shout_msg()
{
global $db;
$sql = "SELECT COUNT(id) AS total
FROM " . SHOUTBOX_TABLE . "";
if ( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not query shoutbox count messages', '', __LINE__, __FILE__, $sql); }
$row = $db->sql_fetchrow($result);
return $row['total'];
}
$msg_count = get_shout_msg();
$number = $shoutbox_config['count_msg'];
$start = $msg_count - $number;
if ( $msg_count < $number ) $start = 0;
$sql = "SELECT id, sb_user_id, msg, timestamp, sb_username
FROM " . SHOUTBOX_TABLE . "
ORDER by timestamp LIMIT $start, $number";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not query shoutbox messages', '', __LINE__, __FILE__, $sql); }
if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$name_id = $row['sb_user_id'];
$username = $row['sb_username'];
$username = stripslashes(htmlspecialchars(trim($username)));
if ( $shoutbox_config['links_names'] ) $name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$name_id") . '" target="_blank" class="gensmall" title="' . $lang['Read_profile'] . '">' . $username . '</a>';
else $name = $username;
if ( $username == Anonymous ) $name = '' . $lang['Guest'] . '';
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
if ( $shoutbox_config['date_on'] )
{
$make_date = create_date($shoutbox_config['date_format'], $row['timestamp'], $board_config['board_timezone']);
$date = '[' . $make_date . ']';
}
$msg = $row['msg'];
$msg = htmlspecialchars(trim($msg));
if ( $shoutbox_config['allow_smilies'] )
{
$msg = smilies_pass($msg);
$msg = preg_replace('/images\/smiles/', 'images/smiles', $msg);
}
if ( $shoutbox_config['make_links'] ) $msg = make_clickable($msg);
if ( $shoutbox_config['allow_bbcode'] )
{
$msg = str_replace("[/i]","</i>",$msg); $msg = str_replace("[i]","<i>",$msg);
$msg = str_replace("[/b]","</b>",$msg); $msg = str_replace("[b]","<b>",$msg);
$msg = str_replace("[/u]","</u>",$msg); $msg = str_replace("[u]","<u>",$msg);
}
else
{
$msg = str_replace("[/i]","",$msg); $msg = str_replace("[i]","",$msg);
$msg = str_replace("[/b]","",$msg); $msg = str_replace("[b]","",$msg);
$msg = str_replace("[/u]","",$msg); $msg = str_replace("[u]","",$msg);
}
$id = $row['id'];
if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous && $sb_user_id == $name_id ) $aedit = 1; else $aedit = 0;
if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous && $sb_user_id == $name_id ) $adel = 1; else $adel = 0;
if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1;
if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1;
if ( $adel )
{
$temp_url = append_sid("shoutbox_view.$phpEx?mode=delete&id=$id&del_sb_id=$sb_user_id");
$delmsg = '<a href="' . $temp_url . '" class="mainmenu" title="' . $lang['Delete_message'] . '"><b>X</b></a>';
}
else
{
$delmsg = '';
}
if ( $aedit )
{
$date_edit = $row['timestamp'];
$name_edit = $row['sb_username'];
$clean_msg = $row['msg'];
$temp_url_e = append_sid("shoutbox_view.$phpEx?mode=edit&id=$id&name_id=$name_id&date_edit=$date_edit&name_edit=$name_edit&clean_msg=$clean_msg");
$editmsg = '<a href="' . $temp_url_e . '" class="mainmenu" title=" ' .$lang['Edit_pm'] . '"><b>E</b></a>';
}
else
{
$editmsg = '';
}
$template->assign_block_vars('shoutrow', array(
'DELMSG' => $delmsg,
'EDITMSG' => $editmsg,
'ROW_CLASS' => $row_class,
'NAME' => $name,
'DATE' => $date,
'MSG' => $msg
)
);
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}
}
$template->assign_vars(array(
'S_CONTENT_ENCODING' => $lang['ENCODING'])
);
$template->pparse('body');
?>
hab herausgefunden, das das Ende dieser Datei für mich wichtig ist (msg_count):
[Also für msg_count setzt man dann im ACP 50. Nun will ich ess hier so haben, dass dann die neuesten 50 (und nicht die letzten 50!) in der Shoutbox erscheinen!
[Also für msg_count setzt man dann im ACP 50. Nun will ich ess hier so haben, dass dann die neuesten 50 (und nicht die letzten 50!) in der Shoutbox erscheinen!
Code: Alles auswählen
$msg_count = get_shout_msg();
$number = $shoutbox_config['count_msg'];
$start = $msg_count - $number;
if ( $msg_count < $number ) $start = 0;
$sql = "SELECT id, sb_user_id, msg, timestamp, sb_username
FROM " . SHOUTBOX_TABLE . "
ORDER by timestamp LIMIT $start, $number";
if( !($result = $db->sql_query($sql)) )
{ message_die(GENERAL_ERROR, 'Could not query shoutbox messages', '', __LINE__, __FILE__, $sql); }
if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$name_id = $row['sb_user_id'];
$username = $row['sb_username'];
$username = stripslashes(htmlspecialchars(trim($username)));
if ( $shoutbox_config['links_names'] ) $name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$name_id") . '" target="_blank" class="gensmall" title="' . $lang['Read_profile'] . '">' . $username . '</a>';
else $name = $username;
if ( $username == Anonymous ) $name = '' . $lang['Guest'] . '';
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
if ( $shoutbox_config['date_on'] )
{
$make_date = create_date($shoutbox_config['date_format'], $row['timestamp'], $board_config['board_timezone']);
$date = '[' . $make_date . ']';
}
$msg = $row['msg'];
$msg = htmlspecialchars(trim($msg));
if ( $shoutbox_config['allow_smilies'] )
{
$msg = smilies_pass($msg);
$msg = preg_replace('/images\/smiles/', 'images/smiles', $msg);
}
if ( $shoutbox_config['make_links'] ) $msg = make_clickable($msg);
if ( $shoutbox_config['allow_bbcode'] )
{
$msg = str_replace("[/i]","</i>",$msg); $msg = str_replace("[i]","<i>",$msg);
$msg = str_replace("[/b]","</b>",$msg); $msg = str_replace("[b]","<b>",$msg);
$msg = str_replace("[/u]","</u>",$msg); $msg = str_replace("[u]","<u>",$msg);
}
else
{
$msg = str_replace("[/i]","",$msg); $msg = str_replace("[i]","",$msg);
$msg = str_replace("[/b]","",$msg); $msg = str_replace("[b]","",$msg);
$msg = str_replace("[/u]","",$msg); $msg = str_replace("[u]","",$msg);
}
$id = $row['id'];
if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous && $sb_user_id == $name_id ) $aedit = 1; else $aedit = 0;
if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous && $sb_user_id == $name_id ) $adel = 1; else $adel = 0;
if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1;
if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1;
if ( $adel )
{
$temp_url = append_sid("shoutbox_view.$phpEx?mode=delete&id=$id&del_sb_id=$sb_user_id");
$delmsg = '<a href="' . $temp_url . '" class="mainmenu" title="' . $lang['Delete_message'] . '"><b>X</b></a>';
}
else
{
$delmsg = '';
}
if ( $aedit )
{
$date_edit = $row['timestamp'];
$name_edit = $row['sb_username'];
$clean_msg = $row['msg'];
$temp_url_e = append_sid("shoutbox_view.$phpEx?mode=edit&id=$id&name_id=$name_id&date_edit=$date_edit&name_edit=$name_edit&clean_msg=$clean_msg");
$editmsg = '<a href="' . $temp_url_e . '" class="mainmenu" title=" ' .$lang['Edit_pm'] . '"><b>E</b></a>';
}
else
{
$editmsg = '';
}
$template->assign_block_vars('shoutrow', array(
'DELMSG' => $delmsg,
'EDITMSG' => $editmsg,
'ROW_CLASS' => $row_class,
'NAME' => $name,
'DATE' => $date,
'MSG' => $msg
)
);
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
}
}
$template->assign_vars(array(
'S_CONTENT_ENCODING' => $lang['ENCODING'])
);
$template->pparse('body');
?>