Seite 2 von 2

Verfasst: 01.08.2003 18:46
von Henne
top10.php:

Code: Alles auswählen

<?php
/***************************************************************************
 *
 *   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);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

//
// Generate page
//
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
	'body' => 'top10_body.tpl')
);

###### start most posts_#####
    $sql = "SELECT user_id, username, user_posts
        FROM " . USERS_TABLE . "
        WHERE user_id <> " . ANONYMOUS . "
        ORDER BY user_posts DESC
        LIMIT 10";
    if ( !($result = $db->sql_query($sql)) )
    {
            message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
    }

    while ($row = $db->sql_fetchrow($result))
    {
        $user_id=$row['user_id'];
            $template->assign_block_vars("most_posts", array(
                'USERNAME' => $row['username'],
                'POSTS' => $row['user_posts'],
            	'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
            );
    }
##### end most posts_#######

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
Kannst da uch noch $gen_simple_header = true; einfügen, dann haste im PopUp nicht den normalen phpBB Header...

top10_body.tpl siehe einige Posts weiter oben...

Verfasst: 02.08.2003 14:31
von tschekowski
Funktioniert einwandfrei..........


Vieeeeeeeeeeeeeeelen Dank !!!