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

Contents of /fenglin/manage/gen_ex_daily.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations)
Wed Mar 19 15:14:52 2025 UTC (11 months, 4 weeks ago) by sysadm
Branch: MAIN
Changes since 1.6: +44 -36 lines
Refact

1 <?
2 if (!isset($_SERVER["argc"]))
3 {
4 echo ("Invalid usage");
5 exit();
6 }
7
8 chdir(substr($_SERVER["argv"][0], 0, strrpos($_SERVER["argv"][0], "/")));
9
10 require_once "../lib/common.inc.php";
11
12 $db_conn = include "./db_open.inc.php";
13
14 $sql = "SELECT section_config.SID, section_config.title AS s_title FROM section_config
15 INNER JOIN section_class ON section_config.CID = section_class.CID
16 WHERE section_config.enable AND section_class.enable AND ex_update
17 ORDER BY section_class.sort_order, section_config.sort_order";
18
19 $rs = mysqli_query($db_conn, $sql);
20 if ($rs == false)
21 {
22 echo ("Query section error: " . mysqli_error($db_conn));
23 exit();
24 }
25
26 $new = false;
27
28 while ($row = mysqli_fetch_array($rs))
29 {
30 echo ("更新 [".$row["s_title"]."] 中...\n");
31
32 $buffer = shell_exec($PHP_bin . " ./gen_ex_section.php " . $row["SID"]);
33 echo ($buffer . "\n");
34
35 $new = true;
36 }
37
38 mysqli_free_result($rs);
39 mysqli_close($db_conn);
40
41 if ($new)
42 {
43 echo ("生成目录中...\n");
44
45 $buffer = shell_exec($PHP_bin . " gen_ex_index.php");
46 if (!$buffer || file_put_contents("../gen_ex/index.html", $buffer) == false)
47 {
48 echo ("Open output error!");
49 exit();
50 }
51 }
52 ?>

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