当前位置: 首页>>代码示例>>PHP>>正文


PHP news::update_stats方法代码示例

本文整理汇总了PHP中news::update_stats方法的典型用法代码示例。如果您正苦于以下问题:PHP news::update_stats方法的具体用法?PHP news::update_stats怎么用?PHP news::update_stats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在news的用法示例。


在下文中一共展示了news::update_stats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: news

 function _news()
 {
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         $validuser = $arg_list[3];
         $isadmin = $arg_list[4];
         //print_r($arg_list);
     }
     $n = new news();
     mysql_query("ALTER TABLE `m_news` DROP PRIMARY KEY, ADD PRIMARY KEY(`news_id`)");
     $n->update_stats();
     print "<script type='text/javascript' src='../site/calendar/calendar.js'></script>";
     print "<form action = '" . $_SERVER["SELF"] . "' name='search_news' method='post'>";
     //print "<input type='text' name='searchDate'>";
     $setDate = isset($_REQUEST["date1"]) ? $_REQUEST["date1"] : "";
     if ($setDate == '0000-00-00') {
         $setDate = date('Y-m-d');
     }
     $n->_calendar($setDate);
     print "<input type='submit' name='submitDate' value='search' style='margin-left:8px'>";
     print "</form>";
     //$sql = "select news_id, date_format(news_timestamp, '%e %b %Y, %l:%i%p'), news_title, news_author, news_lead from m_news where date_format(news_timestamp,'%Y-%m-%d') = '".$_REQUEST["date1"]."'";
     print "<table width='350'>";
     print "<tr valign='top'><td>";
     print "<span class='library'>" . FTITLE_SITE_NEWS . "</span><br>";
     print "</td></tr>";
     if ($get_vars["news_id"]) {
         if (isset($_REQUEST['submitDate']) && $_REQUEST['submitDate'] == 'search') {
             $sql = "select news_id, date_format(news_timestamp, '%e %b %Y, %l:%i%p'), news_title, news_author, news_lead, news_text from m_news where date_format(news_timestamp,'%Y-%m-%d') = '" . $setDate . "'";
         } else {
             $sql = "select news_id, date_format(news_timestamp, '%e %b %Y, %l:%i%p'), news_title, news_author, news_lead, news_text from m_news where news_id = '" . $get_vars["news_id"] . "'";
         }
         if ($result = mysql_query($sql)) {
             if (mysql_num_rows($result)) {
                 while (list($id, $ts, $title, $author, $lead, $text) = mysql_fetch_array($result)) {
                     print "<tr valign='top'><td>";
                     if (!isset($menu_id)) {
                         $menu_id = module::get_menu_id("_news");
                     }
                     print "<a href='" . $_SERVER["SELF"] . "?page=CONTENT&menu_id={$menu_id}&news_id={$id}' class='newstitle'><b>" . strtoupper($title) . "</b></a><br />";
                     print "<span class='tiny'><b>{$ts} " . user::get_username($author) . "</b></span><br/><br/>";
                     print "<span class='newsbody'><b>" . nl2br(stripslashes($lead)) . "</b><br/><br/>";
                     print nl2br(stripslashes($text)) . "</span><br/><br/>";
                     print "<a href='" . $_SERVER["PHP_SELF"] . "'><img src='../images/back.png' border='0'/></a>";
                     print "</td></tr>";
                 }
             } else {
                 print "<tr><td><font color='red'>No content. You can post one in <br/><b>CONTENT-&gt;News Archive</b>.</font></tr></td><br/>";
             }
         }
     } else {
         if (isset($_REQUEST['submitDate']) && $_REQUEST['submitDate'] == 'search') {
             $sql = "select news_id, date_format(news_timestamp, '%e %b %Y, %l:%i%p'), news_title, news_author, news_lead from m_news where date_format(news_timestamp,'%Y-%m-%d') = '" . $setDate . "'";
         } else {
             $sql = "select news_id, date_format(news_timestamp, '%e %b %Y, %l:%i%p'), news_title, news_author, news_lead from m_news order by news_timestamp desc LIMIT 0,10";
         }
         if ($result = mysql_query($sql)) {
             if (mysql_num_rows($result)) {
                 while (list($id, $ts, $title, $author, $lead) = mysql_fetch_array($result)) {
                     print "<tr valign='top'><td>";
                     if (!isset($menu_id)) {
                         $menu_id = module::get_menu_id("_news");
                     }
                     print "<a href='" . $_SERVER["SELF"] . "?news_id={$id}' class='newstitle'><b>" . strtoupper($title) . "</b></a><br />";
                     print "<span class='tiny'><b>{$ts} " . user::get_username($author) . "</b></span><br/><br/>";
                     print "<span class='newsbody'>" . nl2br(stripslashes($lead)) . "</span> ";
                     print "<a href='" . $_SERVER["SELF"] . "?news_id={$id}' class='newstitle'><img src='../images/view.png' border='0'/></a><br/>";
                     print "</td></tr>";
                 }
             } else {
                 print "<tr><td><font color='red'>No content. You can post one in <br/><b>CONTENT-&gt;News Archive</b>.</font></tr><td></br/>";
             }
         }
     }
     print "</table><br>";
 }
开发者ID:wahgithub,项目名称:chits_wah_emr,代码行数:79,代码来源:class.news.php


注:本文中的news::update_stats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。