ich habe ein kleines script geschrieben das mir auf einer Seite die neuesten Posts im phpBB anzeigt nun möchte ich gerne ein Drop Down Menü hinzufügen in dem die User wählen können ob die ab oder aufsteigend sortiert angezeigt werden!Das script sieht so aus:
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
init_userprefs($userdata);
$page_title = $l_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$sql = "SELECT t.topic_id, t.topic_title
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE f.forum_id = t.forum_id
ORDER BY t.topic_last_post_id DESC
LIMIT 5";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query topic info', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$topics = '<a href="viewtopic.php?' . POST_TOPIC_URL . '=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a><br>';
$template->assign_block_vars('sitemap_topics', array(
'TOPIC_LINKS' => $topics)
);
}
$template->set_filenames(array(
'body' => 'sitemap.tpl',
'jumpbox' => 'jumpbox.tpl')
);
$jumpbox = make_jumpbox($forum_id);
$template->assign_vars(array(
'L_GO' => $lang['Go'],
'L_JUMP_TO' => $lang['Jump_to'],
'L_SELECT_FORUM' => $lang['Select_forum'],
'S_JUMPBOX_LIST' => $jumpbox,
'S_JUMPBOX_ACTION' => append_sid('viewforum.php'))
);
$template->assign_var_from_handle('JUMPBOX', 'jumpbox');
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Ich wäre für Tipps dankbar!
Grüße sabrina