Habe mal versucht die "knuffelhighscore.php" an den Color Group Mod anzupassen, bin mal nach einem anderen Beispiel gegangen, aber wenn ich es eingebaut habe verschwinden die Namen in der liste?
Habe ihn so eingebaut:
Code: Alles auswählen
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/functions_color_groups.'.$phpEx);
// Start session management
$userdata = session_pagestart($user_ip, PAGE_KNUFFEL);
init_userprefs($userdata);
if (!$userdata['session_logged_in'] )
{
redirect(append_sid("login.$phpEx?redirect=knuffel.$phpEx", true));
exit;
}
include($phpbb_root_path . 'language/lang_' .$userdata['user_lang']. '/lang_knuffel.' . $phpEx);
// End session management
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$start = ($start < 0) ? 0 : $start;
$page_title = 'Knuffel';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'knuffelhighscore' => 'knuffelhighscore.tpl')
);
$i = $start + 1;
$sql = "SELECT * FROM ". KNUFFEL_TABLE ." WHERE played <> '0' ORDER BY score DESC LIMIT $start,10";
if( !$result = $db->sql_query($sql) ) {
message_die(GENERAL_ERROR, "Could not get top 10 information.", "", __LINE__, __FILE__, $sql);
}
$r = $db -> sql_query($sql);
while($row = $db -> sql_fetchrow($r)) {
$highscorename = $row['name'];
$highscorepoints = $row['score'];
$highscoreplayed = $row['played'];
$highscoreaverage = $row['average'];
if ( $i < 4 ) {
$highscoreposition = "<b>".$i."</b>";
}
else {
$highscoreposition = $i;
}
$row_class = ( !($i % 2) ) ? $theme['td_class2'] : $theme['td_class1'];
$template -> assign_block_vars('highscore', array(
'POSITION' => $highscoreposition,
'NAME' => color_group_colorize_name($user_id, true),
'POINTS' => $highscorepoints,
'PLAYED' => $highscoreplayed,
'AVERAGE' => $highscoreaverage,
'ROW_CLASS' => $row_class
)
);
$i++;
}
//
// generate the pagination
//
$sql = "SELECT count(*) AS total FROM " . KNUFFEL_TABLE . " WHERE played <> '0' ";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, 'Error getting total players', '', __LINE__, __FILE__, $sql);
}
if ( $total = $db->sql_fetchrow($result) ) {
$total_players = $total['total'];
$pagination = generate_pagination("knuffelhighscore.$phpEx?", $total_players, 10, $start). ' ';
}
$db->sql_freeresult($result);
//
// OK - that´s it - let's tell the template what we want!
//
$template->assign_vars(array(
'KNUFFEL_COPY' => $lang['Knuffel_Copy'],
'U_KNUFFEL' => append_sid('knuffel.'.$phpEx),
'L_KNUFFELHIGHSCORE' => $lang['Knuffelhighscore'],
'L_KNUFFEL' => $lang['Knuffel'],
'L_POINTS' => $lang['Points'],
'L_PLAYED' => $lang['Played'],
'L_HIGHSCORENAME' => $lang['Highscorename'],
'L_AVERAGE' => $lang['Average'],
'L_POSITION' => $lang['Position'],
'L_PLAY_AGAIN' => $lang['Play_Again'],
'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
'L_GOTO_PAGE' => $lang['Goto_page']
)
);
$template->pparse('knuffelhighscore');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Was ist daran falsch?? Weiß jemand warum die Namen dann verschwinden?