/[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.11 - (show annotations)
Wed Apr 23 05:13:57 2025 UTC (10 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.10: +1 -1 lines
Refine deprecated PHP short tags

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

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