asa..
dupa ce am instalat statistics mod, am mai pus si un addon , k sa-mi arate rankurile
doar k e o mica eroare:)
imaginea rankului nu mi-o afiseaza :
in loc de :
Cod: Selectaţi tot
http://www.canalul18.dap.ro/forum/images/ranks/rosu/rank0.gif
imi apare asa (am dat click dreapta pe locul unde ar trebui sa fie imaginea, si am dat properties):
Cod: Selectaţi tot
http://www.canalul18.dap.ro/forum//forum/images/ranks/rosu/rank0.gif
si m-am bagat un pic pe la sursa moduluiui
care e asa:
Cod: Selectaţi tot
<?php
/***************************************************************************
* module.php
* -------------------
* begin : Tuesday, Aug 20, 2002
* copyright : RustyDragon
* contact : <dev@RustyDragon.com>, http://www.RustyDragon.com
* $Id: module.php,v 1.3.1.4 2002/10/21 14:59:29 RustyDragon Exp $
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
//
//All your code
//
//Vote Images based on the theme path, (i.e. templates/CURRNT_THEME/ is already inserted below)
$vote_left = 'images/vote_lcap.gif';
$vote_right = 'images/vote_rcap.gif';
$vote_bar = 'images/voting_bar.gif';
$rank = 0;
//
// Getting voting bar info from template
//
if( !$board_config['override_user_style'] )
{
if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) )
{
$style = $userdata['user_style'];
if( !$theme )
$style = $board_config['default_style'];
}
else
$style = $board_config['default_style'];
}
else
$style = $board_config['default_style'];
$sql = 'SELECT *
FROM ' . THEMES_TABLE . "
WHERE themes_id = $style";
if(!$result = $db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Couldn't query database for theme info.");
}
if( !$row = $db->sql_fetchrow($result) )
{
message_die(CRITICAL_ERROR, "Couldn't get theme data for themes_id=$style.");
}
$template_path = $phpbb_root_path . 'templates/' ;
$template_name = $row['template_name'] ;
$current_template_path = $template_path . $template_name . '/';
$template->assign_vars(array(
'LEFT_GRAPH_IMAGE' => $current_template_path . $vote_left,
'RIGHT_GRAPH_IMAGE' => $current_template_path . $vote_right,
'GRAPH_IMAGE' => $current_template_path . $vote_bar)
);
$total_users = get_db_stat('usercount');
$lines_num = 0;
$percentage = 0;
$bar_percent = 0;
//
// Regular ranks
//
$sql = 'SELECT *
FROM ' . RANKS_TABLE . '
WHERE rank_special != 1
ORDER BY rank_min ASC';
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql);
}
$ranks_count = $db->sql_numrows($result);
$ranks_data = $db->sql_fetchrowset($result);
for ($j = 0; $j < $ranks_count && $lines_num<$return_limit ; $j++)
{
$rank_min = $ranks_data[$j]['rank_min'];
if ( $j == $ranks_count - 1 )
{
$sql = 'SELECT COUNT(user_id) used_counter
FROM ' . USERS_TABLE . '
WHERE user_posts >= '. $rank_min;
$posts_range = $rank_min . ' + ';
}
else
{
$rank_max = $ranks_data[$j+1]['rank_min'];
$sql = 'SELECT COUNT(user_id) used_counter
FROM ' . USERS_TABLE . '
WHERE user_posts >= '. $rank_min .'
AND user_posts < '. $rank_max;
$posts_range = $rank_min . ' - ' . $rank_max;
}
if ($rank_min == ($rank_max - 1)) {
$posts_range = $rank_min;
} else {
$posts_range = $rank_min . " - " . ($rank_max - 1);
}
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql);
}
$user_data = $db->sql_fetchrowset($result);
$user_count = $user_data[0]['used_counter'];
if ( $j == 0 ){//first row
$firstcount = $user_count;
$cst = 90 / $firstcount;
}
if ( $user_count != 0 )
{
$percentage = round( min(100, ($user_count /$total_users) * 100));
}
else
{
continue;
}
$bar_percent = round($user_count * $cst);
if ($ranks_data[$j]['rank_image'])
{
$rank_image = "<img src='".$phpbb_root_path.$ranks_data[$j]['rank_image']."' border=0 alt=".$ranks_data[$j]['rank_title'].">";
}
else
{
$rank_image = "";
}
$lines_num++;
$template->assign_block_vars('ranks', array(
'RANK' => $lines_num,
'CLASS' => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'],
'RANK_TITLE' => $ranks_data[$j]['rank_title'],
'RANK_IMAGE' => $rank_image,
'RANK_RANGE' => $posts_range,
'USERS' => $user_count,
'PERCENTAGE' => $percentage,
'BAR' => $bar_percent)
);
}
/*
//
// Uncomment this if you want to see special ranks statistic
//
$sql = 'SELECT COUNT(u.user_rank) used_counter, r.rank_title , r.rank_image
FROM ' . USERS_TABLE . ' u, '. RANKS_TABLE . ' r
WHERE u.user_id != -1
AND u.user_rank = r.rank_id
GROUP BY u.user_rank ORDER BY used_counter DESC';
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql);
}
$user_count = $db->sql_numrows($result);
$user_data = $db->sql_fetchrowset($result);
for ($i = 0; $i < $user_count; $i++)
{
if ( $user_data[$i]['used_counter'] != 0 )
{
$percentage = round( min(100, ($user_data[$i]['used_counter'] /$total_users) * 100));
}
else
{
$percentage = 0;
}
$bar_percent = round($user_data[$i]['used_counter'] * $cst);
if ($user_data[$i]['rank_image'])
{
$rank_image = "<img src='".$phpbb_root_path.$user_data[$i]['rank_image']."' border=0 alt=".$user_data[$i]['rank_title'].">";
}
else
{
$rank_image = "";
}
$lines_num++;
$template->assign_block_vars('ranks', array(
'RANK' => $lines_num,
'CLASS' => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'],
'RANK_TITLE' => $user_data[$i]['rank_title'],
'RANK_IMAGE' => $rank_image,
'RANK_RANGE' => $lang['Rank_special'],
'USERS' => $user_data[$i]['used_counter'],
'PERCENTAGE' => $percentage,
'BAR' => $bar_percent)
);
}
*/
$template->assign_vars(array(
'L_RANK' => $lang['Rank'],
'L_USERS' => $lang['Memberlist'],
'L_PERCENTAGE' => $lang['Percent'],
'L_RANK_IMAGE' => $lang['Rank_image'],
'L_RANK_TITLE' => $lang['Poster_rank'],
'L_RANK_RANGE' => $lang['Rank_range'],
'L_GRAPH' => $lang['Graph'],
'MODULE_NAME' => $lang['module_name'])
);
?>
si eu cred ca greseala este de aici:
Cod: Selectaţi tot
{
$rank_image = "<img src='".$phpbb_root_path.$ranks_data[$j]['rank_image']."' border=0 alt=".$ranks_data[$j]['rank_title'].">";
}
ce ar trebui sa modific, ca sa imi apara imaginile de la rankuri? sa nu apara /forum
//forum ci /forum ?
pt a vedea eroarea click
aici apoi cautati
Ranks