/[LeafOK_CVS]/fenglin/www/load_doc_list.inc.php
ViewVC logotype

Diff of /fenglin/www/load_doc_list.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 by sysadm, Sat Mar 1 09:08:07 2025 UTC Revision 1.14 by sysadm, Mon Apr 14 05:09:58 2025 UTC
# Line 1  Line 1 
1  <?  <?
2  require_once "./gen_top.inc.php";          require_once "../lib/str_process.inc.php";
3    ?>
4  function load_doc_list($section_name,$num,$length,$style,$subtitle,$db_conn)  <?
5    function load_doc_list(string $sid, int $num, int $length, int $style, bool $subtitle, mysqli $db_conn) : bool
6  {  {
7          $rs=mysql_query("select SID,title from section_config where sname=".          $sql = "SELECT SID, title FROM section_config WHERE SID = $sid";
8                  "'$section_name'",$db_conn)  
9                  or die("Query section error!");          $rs = mysqli_query($db_conn, $sql);
10          if ($row=mysql_fetch_array($rs))          if ($rs == false)
11          {          {
12                  $sid=$row["SID"];                  return false;
                 $title=$row["title"];  
13          }          }
14          else  
15            if ($row = mysqli_fetch_array($rs))
16          {          {
17                  $sid=0;                  $title = $row["title"];
                 $title="";  
18          }          }
         mysql_free_result($rs);  
         if ($subtitle)  
                 echo (" <tr class=title_list><td height=20 valign=bottom><a href=\"/bbs/bbs.php?".  
                         "sid=$sid&switch_view=ex\" target=_blank><b>$title</b></a></td></tr>\n");  
19          else          else
20                  echo (" <tr class=title_bar_$style><td><a class=guide href=\"/bbs/bbs.php?".          {
21                          "sid=$sid&switch_view=ex\" target=_blank>$title&gt;&gt;</a></td></tr>\n");                  $sid = 0;
22          echo ("<tr class=title_list><td height=8></td></tr>\n");                  $title = "";
23          $rs=mysql_query("select AID,title from bbs where TID=0 and SID=$sid and excerption".          }
24                  " and visible order by ontop desc, AID desc limit $num")          mysqli_free_result($rs);
                 or die("Query article error!");  
         while($row=mysql_fetch_array($rs))  
         {  
                 echo ("<tr class=title_list><td height=18>·<a href=\"show_article.php?aid=".  
                         $row["AID"]."\" target=_blank>".mb_substr($row["title"],0,$length,'UTF-8')." </a></td></tr>\n");  
         }  
         mysql_free_result($rs);  
         echo ("<tr class=title_list><td height=8 align=right><a href=\"rss.php?sid=$sid\"".  
                 " target=_blank><img src=\"images/xml.gif\" border=0></a></td></tr>\n");  
 }  
25    
26  function load_class_list($class_name,$section_name_list,$num,$length,$style,$db_conn)          if ($subtitle)
 {  
         $rs=mysql_query("select CID,title from section_class where cname=".  
                 "'$class_name'",$db_conn)  
                 or die("Query class error!");  
         if ($row=mysql_fetch_array($rs))  
27          {          {
28                  $cid=$row["CID"];  ?>
29                  $title=$row["title"];          <tr class=title_list>
30                    <td height="25" valign=bottom>
31                            <a href="..//bbs/list.php?sid=<? echo $sid; ?>&ex=1" target=_blank>
32                                    <b><? echo $title; ?></b>
33                            </a>
34                    </td>
35            </tr>
36    <?              
37          }          }
38          else          else
39          {          {
40                  $cid=0;  ?>
41                  $title="";          <tr class=title_bar_<? echo $style; ?>>
42                    <td>
43                            <a class="guide" href="../bbs/list.php?sid=<? echo $sid; ?>&ex=1" target=_blank>
44                                    <? echo $title; ?>&gt;&gt;
45                            </a>
46                    </td>
47            </tr>
48    <?
49          }          }
50          mysql_free_result($rs);  ?>
51            <tr class="title_list">
52                    <td height="8">
53                    </td>
54            </tr>
55    <?
56    
57          echo (" <tr class=title_bar_$style><td><a class=guide href=\"/bbs/class.php?".          $sql = "SELECT AID, title FROM bbs WHERE TID = 0 AND SID = $sid AND excerption
58                  "cid=$cid\" target=_blank>$title&gt;&gt;</a></td></tr>\n");                          AND visible ORDER BY ontop DESC, AID DESC LIMIT $num";
59    
60          $rs_s=mysql_query("select sname from section_config where CID=".          $rs = mysqli_query($db_conn, $sql);
61                  $cid." and enable order by sort_order",$db_conn)          if ($rs == false)
                 or die("Query section error!");  
         while ($row_s=mysql_fetch_array($rs_s))  
62          {          {
63                  if (in_array($row_s["sname"],$section_name_list))                  return false;
                         load_doc_list($row_s["sname"],$num,$length,$style,true,$db_conn);  
64          }          }
         mysql_free_result($rs_s);  
 }  
65    
66  function load_top($num,$length,$db_conn)          while($row = mysqli_fetch_array($rs))
 {  
         gen_top_article(10,$db_conn);  
   
         $rs=mysql_query("select * from bbs_top_list limit $num",$db_conn)  
                 or die("Query data error!");  
   
         echo ("<tr><td height=8></td></tr>\n");  
         while ($row=mysql_fetch_array($rs))  
67          {          {
68                  echo ("<tr><td height=18>·[".$row["section_title"].  ?>
69                          "]<a href=\"show_article.php?aid=".          <tr class="title_list">
70                          $row["AID"]."\" target=_blank>".mb_substr($row["bbs_title"],0,$length,'UTF-8')." </a></td></tr>\n");                  <td height="18">
71                            ·<a href="../bbs/view_article.php?tn=portal&id=<? echo $row["AID"]; ?>" target=_blank>
72                                    <? echo htmlspecialchars(split_line($row["title"], "", $length, 1), ENT_HTML401, 'UTF-8'); ?>
73                            </a>
74                    </td>
75            </tr>
76    <?
77          }          }
78          echo ("<tr><td height=8></td></tr>\n");          mysqli_free_result($rs);
79    ?>
80            <tr class="title_list">
81                    <td height="8" align="right">
82                    </td>
83            </tr>
84    <?
85    
86          mysql_free_result($rs);          return true;
87  }  }
88    
89  function load_recommend($num,$length,$db_conn)  function load_top(int $num, int $length, mysqli $db_conn) : bool
90  {  {
91          $rs=mysql_query("select AID,title".          $sql = "SELECT AID, bbs.title AS title, section_config.title as s_title
92                  " from bbs where TID=0 and recommend and visible".                          FROM bbs INNER JOIN section_config ON bbs.SID = section_config.SID
93                  " order by sub_dt desc limit $num",$db_conn)                          WHERE section_config.recommend AND TID = 0 AND visible AND view_count >= 10
94                  or die("Query data error!");                          AND (sub_dt >= SUBDATE(NOW(), INTERVAL 7 DAY))
95                            ORDER BY excerption DESC, (view_count + reply_count) DESC, transship
96                            LIMIT 10";
97    
98          echo ("<tr class=title_list><td height=8></td></tr>\n");          $rs = mysqli_query($db_conn, $sql);
99          while ($row=mysql_fetch_array($rs))          if ($rs == false)
100            {
101                    return false;
102            }
103    ?>
104            <tr>
105                    <td height="8">
106                    </td>
107            </tr>
108    <?
109            while ($row = mysqli_fetch_array($rs))
110          {          {
111                  echo ("<tr class=title_list><td height=18>·<a href=\"show_article.php?aid=".  ?>
112                          $row["AID"]."\" target=_blank>".mb_substr($row["title"],0,$length,'UTF-8')." </a></td></tr>\n");          <tr>
113                    <td height="18">
114                            ·<a href="../bbs/view_article.php?tn=portal&id=<? echo $row["AID"]; ?>" target=_blank>
115                                    <? echo htmlspecialchars(split_line("[" . $row["s_title"] . "] " . $row["title"], "", $length, 1), ENT_HTML401, 'UTF-8'); ?>
116                            </a>
117                    </td>
118            </tr>
119    <?
120          }          }
121          echo ("<tr class=title_list><td height=8></td></tr>\n");          mysqli_free_result($rs);
122    
         mysql_free_result($rs);  
 }  
123  ?>  ?>
124            <tr>
125                    <td height="8">
126                    </td>
127            </tr>
128    <?
129    
130            return true;
131    }
132    
133    ?>


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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