Das Anzeigen der Links klappt soweit auch.
Jetzt möchte ich gerne noch die Blätterfunktion des Forums nutzen.
Welchen Code brauche ich dafür?
Code: Alles auswählen
<?PHP
#######################################
# EZ - WebLink #
#######################################
// --> Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// --> Benötigte Dateien und Variablen von WebLink
include($phpbb_root_path . 'link/constants.'.$phpEx);
include($phpbb_root_path . 'link/functions.' . $phpEx );
// --> Welcome Text
$CFG['welcome_text'] = '<b> +++ Weblink Database +++ </b>';
$CFG['text'] = '
<div class="gen" align="center">Dieser Bereich ist noch in Arbeit</div>
';
$CFG['titel_adlink'] = '<b> +++ Link hinzufügen +++ </b>';
// --> Session auslesen und Benutzer-Informationen laden
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// --> Link Template laden
$page_title = $lang['Links'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
include($phpbb_root_path . 'link/link_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'links.tpl'));
$template->assign_vars(array(
// --> Titel, Text
'WELCOME_TEXT' => $CFG['welcome_text'] ,
'TEXT' => $CFG['text'],
'PAGETITEL'=> $CFG['pagetitel'],
// --> Link Statistik
'TOTAL_LINKS'=> $totallinks,
// Navigation in der Seite
'L_LINK_INDEX' => $lang['Link_title'],
'U_LINK_INDEX' => append_sid('links.'.$phpEx),
'L_LINK_ADD' => $lang['Link_add'],
'U_LINK_ADD' => append_sid( this_link_url( "mode=add" ) ),
'L_MOST_POPULAR' => $lang['Link_most_popular'],
'U_MOST_POPULAR' => append_sid( this_link_url( "mode=stats&stats=popular" ) ),
'L_TOPLINK' => $lang['Link_toplink'],
'U_LINK_INDEX' => append_sid( this_link_url( "mode=stats&stats=toplink" ) ),
'L_LATEST' => $lang['Link_latest'],
'U_LATEST' => append_sid( this_link_url( "mode=stats&stats=latest" ) )
));
$cat_sql = 'SELECT category_id, category_description FROM ' . ezlink_CATEGORY_TABLE . ' ORDER BY category_id ASC';
if(!$cat_result = $db->sql_query($cat_sql)) {
message_die(GENERAL_ERROR, 'Fehler beim Auslesen der Kategorien-Informationen', '', __LINE__, __FILE__, $cat_sql);
}
while($cat_row = $db->sql_fetchrow($cat_result)) {
$template->assign_block_vars('category', array(
'ID' => $cat_row['category_id'],
'CAT_DESC' => $cat_row['category_description'],
'U_VIEWCAT' => $cat_row['category_description']
));
$link_sql = 'SELECT link_id, link_category_id, link_description, link_url, link_titel
FROM ' . ezlink_LINK_TABLE . '
WHERE link_category_id=' . $cat_row['category_id'] . ' ORDER BY link_id ASC';
if(!$link_result = $db->sql_query($link_sql)) {
message_die(GENERAL_ERROR, 'Fehler beim Auslesen der LinkInformationen', '', __LINE__, __FILE__, $forum_sql);
}
while($link_row = $db->sql_fetchrow($link_result)) {
$linkurl = $link_row['link_url'];
$template->assign_block_vars('category.link', array(
'ID' => $link_row['link_category_id'],
'DESC' => $link_row['link_description'],
'VIEWLINK' => $link_row['link_url'],
'URL' => $link_row['link_url'],
'TITEL' => $link_row['link_titel']
));
}
}
// --> Seiten entsprechend dem Mode laden
if (isset($_REQUEST["mode"])) {
$mode = $_REQUEST["mode"];
}
if (isset($_REQUEST["mode"])) {
switch ($_REQUEST["mode"]) {
case "alllink": include( $link_root_path . 'link/link_all.' . $phpEx );
case "add": include( $link_root_path . 'link/link_add.' . $phpEx );
case "edit": include( $link_root_path . 'link/link_edit.' . $phpEx );
case "drop": include( $link_root_path . 'link/link_drop.' . $phpEx );
case "stats": include( $link_root_path . 'link/link_stats.' . $phpEx );
default: print ' Keine Auswahl ';
}
}
$template->pparse('body');
include($phpbb_root_path . 'link/link_footer.'.$phpEx);
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>