本文整理汇总了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->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->News Archive</b>.</font></tr><td></br/>";
}
}
}
print "</table><br>";
}