Sveiki,
Turiu kodą, jis rodo apsilankymo statistika. Šiandienos, savaitės, mėnesio ir t.t.
Bet ar eitu padaryti, kad rodytu šios savaitės nuo pirmadienio iki sekmadienio, visų šių metų mėnesių, bei šių metų. Kaip tai padaryti?
ESAMO KODO REZULTATAS
Last year : 0
Yesterday : 0
Today : 0
In this week : 0
In this month : 0
In this year : 0
Guests online : 0
NORIMO KODO REZULTATAS
2010 : 0
Monday : 0
Tuesday : 0
Wednesday : 0
Thursday : 0
Friday : 0
Saturday : 0
Sunday : 0
January : 0
February : 0
March : 0
April : 0
May : 0
June : 0
July : 0
August : 0
September : 0
October : 0
November : 0
December : 0
Esamas kodas
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
include (INFUSIONS."user_info_panel/settings.php");
if($statistics){
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_lastactive<".(time()-60)."");
$result = dbquery("SELECT * FROM ".DB_ONLINE." WHERE online_user='0'");
$guest = dbrows($result)."<br />\n";
$result = dbquery("SELECT ton.*, user_id,user_name FROM ".DB_ONLINE." ton LEFT JOIN ".DB_USERS." tu ON ton.online_user=tu.user_id WHERE online_user!='0'");
if($members){
$result = dbquery("SELECT user_lastvisit FROM ".DB_USERS." ORDER BY user_lastvisit DESC ");
$visitedtoday1=0; $visitedyesterday1=0; $visitedweek1=0; $visitedyear1=0; $visitedmonth1=0; $visitedyear2=0;
$today=showdate("%j/%y", time());
$yesterday=$today-1;
$week=showdate("%W/%y", time());
$month=showdate("%m/%y", time());
$year=showdate("%y", time());
$lastyear=$year-1;
while ($data = dbarray($result)) {
$time1=showdate("%j/%y", $data['user_lastvisit']);
$time2=showdate("%W/%y", $data['user_lastvisit']);
$time3=showdate("%y", $data['user_lastvisit']);
$time4=showdate("%m/%y", $data['user_lastvisit']);
if ($time1==$today) $visitedtoday1++;
if ($time1==$yesterday) $visitedyesterday1++;
if ($time2==$week) $visitedweek1++;
if ($time3==$year) $visitedyear1++;
if ($time4==$month) $visitedmonth1++;
if ($time3==$lastyear) $visitedyear2++;
}
echo "".$locale['UIP_0317']." : ".$visitedyear2."<br>\n";
echo "".$locale['UIP_0318']." : ".$visitedyesterday1."<br>\n";
echo "".$locale['UIP_0319']." : ".$visitedtoday1."<br>\n";
echo "".$locale['UIP_0320']." : ".$visitedweek1."<br>\n";
echo "".$locale['UIP_0321']." : ".$visitedmonth1."<br>\n";
echo "".$locale['UIP_0322']." : ".$visitedyear1."<br>\n";
}
echo "".$locale['UIP_0315']." : $guest\n";
echo "</div>";
}
require_once THEMES."templates/footer.php";
?>
|