Verfasst: 16.10.2003 13:36
so sieht sie aus
[ externes Bild ]
[ externes Bild ]
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
//-- sortierung der beiträge--------------------------------------------------------------------------------------------------------------------------------
//
$order = ( $forum_id == 15 ) ? 't.topic_title ASC' : 't.topic_type DESC, t.topic_last_post_id DESC';
$order = ( $forum_id == 25 ) ? 't.topic_calendar_time ASC' : 't.topic_type DESC, t.topic_last_post_id DESC';
//
//-- sortierung zu ende-------------------------------------------------------------------------------------------------------------------------------------
Code: Alles auswählen
//-- sortierung der beiträge--------------------------------------------------------------------------------------------------------------------------------
//
$order = ( $forum_id == 25 ) ? 't.topic_calendar_time ASC' : 't.topic_title ASC, t.topic_last_post_id DESC';
//
//-- sortierung zu ende------------------------------------------------------------------------------------------------------------------------------------
In der includes/functions.php soll die Sortierung wie folgt verwendet werden.//
// Grab all the basic data (all topics except announcements)
// for this forum
//
//-- mod : topic display order --------------------------------------------------------------------
// default forum values
$dft_sort = $forum_row['forum_display_sort'];
$dft_order = $forum_row['forum_display_order'];
// Sort def
$sort_value = $dft_sort;
if ( isset($HTTP_GET_VARS['sort']) || isset($HTTP_POST_VARS['sort']) )
{
$sort_value = isset($HTTP_GET_VARS['sort']) ? intval($HTTP_GET_VARS['sort']) : intval($HTTP_POST_VARS['sort']);
}
$sort_list = '<select name="sort">' . get_forum_display_sort_option($sort_value, 'list', 'sort') . '</select>';
// Order def
$order_value = $dft_order;
if ( isset($HTTP_GET_VARS['order']) || isset($HTTP_POST_VARS['order']) )
{
$order_value = isset($HTTP_GET_VARS['order']) ? intval($HTTP_GET_VARS['order']) : intval($HTTP_POST_VARS['order']);
}
$order_list = '<select name="order">' . get_forum_display_sort_option($order_value, 'list', 'order') . '</select>';
// display
$s_display_order = ' ' . $lang['Sort_by'] . ': ' . $sort_list . $order_list . ' ';
// selected method
$sort_method = get_forum_display_sort_option($sort_value, 'field', 'sort');
$order_method = get_forum_display_sort_option($order_value, 'field', 'order');
//-- fin mod : topic display order -----------------------------------------------------------------
//-- mod : topic display order ---------------------------------------------------------------------
// here we added
// , $sort_method $order_method
//-- modify
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
AND t.topic_type = " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, $sort_method $order_method, t.topic_last_post_id DESC
LIMIT $start, ".$board_config['topics_per_page'];
//-- fin mod : topic display order -----------------------------------------------------------------
Kann mir da bitte jemand helfen?function get_forum_display_sort_option($selected_row=0, $action='list', $list='sort')
{
global $lang;
$forum_display_sort = array(
'lang_key' => array('next_party', 'Last_Post', 'Sort_Topic_Title', 'Sort_Time', 'Sort_Author'),
'fields' => array('cal_date', 't.topic_last_post_id', 't.topic_title', 't.topic_time', 'u.username'),
);
$forum_display_order = array(
'lang_key' => array('Sort_Descending', 'Sort_Ascending'),
'fields' => array('DESC', 'ASC'),
);
// get the good list
$list_name = 'forum_display_' . $list;
$listrow = $$list_name;
// init the result
$res = '';
if ( $selected_row > count($listrow['lang_key']) )
{
$selected_row = 0;
}
// build list
if ($action == 'list')
{
for ($i=0; $i < count($listrow['lang_key']); $i++)
{
$selected = ($i==$selected_row) ? ' selected="selected"' : '';
$l_value = (isset($lang[$listrow['lang_key'][$i]])) ? $lang[$listrow['lang_key'][$i]] : $listrow['lang_key'][$i];
$res .= '<option value="' . $i . '"' . $selected . '>' . $l_value . '</option>';
}
}
else
{
// field
$res = $listrow['fields'][$selected_row];
}
return $res;
}