/[LeafOK_CVS]/fenglin/manage/article_daily_stat_gen.php
ViewVC logotype

Contents of /fenglin/manage/article_daily_stat_gen.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Jun 30 04:47:24 2004 UTC (21 years, 8 months ago) by sysadm
Branch: MAIN
Changes since 1.1: +19 -3 lines
Add support for invoked as web page

1 <?
2 switch($_SERVER["argc"])
3 {
4 case 2:
5 $begin_date = strtotime($_SERVER["argv"][1])-60*60*24*7;
6 $end_date = strtotime($_SERVER["argv"][1]);
7 break;
8 case 3:
9 $begin_date = strtotime($_SERVER["argv"][1]);
10 $end_date = strtotime($_SERVER["argv"][2]);
11 break;
12 default:
13 if (isset($_POST["begin_date"]))
14 {
15 $begin_date = strtotime($_POST["begin_date"]);
16 }
17 else
18 {
19 $begin_date = time();
20 }
21 if (isset($_POST["end_date"]))
22 {
23 $end_date = strtotime($_POST["end_date"]);
24 }
25 else
26 {
27 $end_date = $begin_date;
28 $begin_date -= 60*60*24*7;
29 }
30 }
31
32 if (isset($_SERVER["argv"][0]))
33 chdir(substr($_SERVER["argv"][0],0,strrpos($_SERVER["argv"][0],"/")));
34
35 require_once "./session_init.inc.php";
36
37 //Set data for session
38 $_SESSION["MNG_uid"]=-1;
39 $_SESSION["MNG_priv"]["article_audit"]=1;
40
41 //Set $date for article_daily_stat.php
42 for($date=$begin_date;$date<=$end_date;$date+=(60*60*24))
43 {
44 echo ("Generating <".strftime("%Y-%m-%d",$date).".xml> ...\n");
45 include "./article_daily_stat.php";
46 }
47
48 session_unset();
49 session_destroy();
50 ?>

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1