site history mod verändern
Verfasst: 17.12.2005 17:07
hallo ich habe den site history mod eingebaut
nun möchte ich aber nicht nur die letzten 7 tage, sondern eine grössere antahl von tagen anzeigen lassen (seit beginn des forums)
zum anschauen bitte hier klicken
die imho entscheidenen zeilen müssten hier irgendwo stehen:
vielleicht macht sich ja mal einer die mühe und schaut sich das an
danke kolja
nun möchte ich aber nicht nur die letzten 7 tage, sondern eine grössere antahl von tagen anzeigen lassen (seit beginn des forums)
zum anschauen bitte hier klicken
die imho entscheidenen zeilen müssten hier irgendwo stehen:
Code: Alles auswählen
$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.");
}
$current_template_path = 'templates/' . $row['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)
);
$template->set_filenames(array(
'body' => 'site_hist.tpl')
);
$db->sql_freeresult($result);
$current_time=time();
$minutes = date('is', $current_time);
// $minutes= sprintf('%04d',date('is',$current_time));
$hour_now = $current_time - (60*($minutes[0].$minutes[1])) - ($minutes[2].$minutes[3]);
$dato=date('H', $current_time);
$time_today = $hour_now - (3600*$dato);
$year=create_date('Y', $current_time, 0);
$month [0] = mktime (0,0,0,1,1,$year)-($board_config['board_timezone']*3600)+3600;
$month [1] = $month [0] + 2678400;
$month [2] = mktime (0,0,0,3,1,$year)-($board_config['board_timezone']*3600)+3600;
$month [3] = $month [2] + 2678400;
$month [4] = $month [3] + 2592000;
$month [5] = $month [4] + 2678400;
$month [6] = $month [5] + 2592000;
$month [7] = $month [6] + 2678400;
$month [8] = $month [7] + 2678400;
$month [9] = $month [8] + 2592000;
$month [10] = $month [9] + 2678400;
$month [11] = $month [10] + 2592000;
$month [12] = $month [11] + 2678400;
$time_thismonth = $month [date('n')-1];
$time_thisweek = $time_today - ((date('w',$time_today)-1)*86400);
$this_month = create_date('n',$time_thismonth,SERVER_TIME_ZONE);
$l_this_month = create_date('F',$time_thismonth,SERVER_TIME_ZONE);
$l_this_day = create_date('D',$time_today,SERVER_TIME_ZONE);
// This week top postes
$sql ='select u.user_id, u.username, count(u.user_id) as user_posts
FROM '.USERS_TABLE.' u,'.POSTS_TABLE.' p
WHERE u.user_id=p.poster_id AND p.post_time > "'.$time_thisweek.'"
GROUP BY user_id order by user_posts DESC
LIMIT ' . $return_limit;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't retrieve topposters data", "", __LINE__, __FILE__, $sql);
}
$user_count = $db->sql_numrows($result);
$user_data = $db->sql_fetchrowset($result);
$firstcount = $user_data[0]['user_posts'];
for ($i = 0; $i < $user_count; $i++)
{
$total_posts_thisweek += $user_data[$i]['user_posts'];
}
for ($i = 0; $i < $user_count; $i++)
{
$class = ($i % 2) ? $theme['td_class2'] : $theme['td_class1'];
do_math($firstcount, $user_data[$i]['user_posts'], $total_posts_thisweek);
$template->assign_block_vars('top_posters_week', array(
'RANK' => $i+1,
'CLASS' => $class,
'USERNAME' => $user_data[$i]['username'],
'PERCENTAGE' => $percentage,
'BAR' => $bar_percent,
'URL' => append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id']),
'POSTS' => $user_data[$i]['user_posts'])
);
}
$db->sql_freeresult($result);danke kolja