Exemplo n.º 1
0
             break;
         case "body":
             $wherea = " WHERE body LIKE '%{$query}%' ";
             break;
         case "both":
             $wherea = " WHERE body LIKE '%{$query}%' or title LIKE '%{$query}%'";
             break;
     }
     $addparam = "search=" . rawurlencode($search) . "&query=" . rawurlencode($query) . "&";
 } else {
     $wherea = "";
     $addparam = "";
 }
 logmenu("news");
 $opt = array(title => $lang_log['text_title'], body => $lang_log['text_body'], both => $lang_log['text_both']);
 searchtable($lang_log['text_search_news'], 'news', $opt);
 $res = sql_query("SELECT COUNT(*) FROM news" . $wherea);
 $row = mysql_fetch_array($res);
 $count = $row[0];
 $perpage = 20;
 list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "log.php?action=news&" . $addparam);
 $res = sql_query("SELECT id, added, body, title FROM news {$wherea} ORDER BY added DESC {$limit}") or sqlerr(__FILE__, __LINE__);
 if (mysql_num_rows($res) == 0) {
     print $lang_log['text_news_empty'];
 } else {
     //echo $pagertop;
     while ($arr = mysql_fetch_assoc($res)) {
         $date = gettime($arr['added'], true, false);
         print "<table width=940 border=1 cellspacing=0 cellpadding=5>\n";
         print "<tr><td class=rowhead width='10%'>" . $lang_log['col_title'] . "</td><td class=rowfollow align=left>" . $arr["title"] . "</td></tr><tr><td class=rowhead width='10%'>" . $lang_log['col_date'] . "</td><td class=rowfollow align=left>" . $date . "</td></tr><tr><td class=rowhead width='10%'>" . $lang_log['col_body'] . "</td><td class=rowfollow align=left>" . format_comment($arr["body"], false, false, true) . "</td></tr>\n";
         print "</table><br />";
Exemplo n.º 2
0
 $wherea = "";
 if (!empty($query)) {
     switch ($search) {
         case "username":
             $wherea = " WHERE user_name LIKE '%" . $query . "%'";
             break;
         case "userid":
             $wherea = " WHERE user_id LIKE '%" . $query . "%'";
             break;
         case "reson":
             $wherea = " WHERE detail LIKE '%" . $query . "%'";
             break;
     }
 }
 $opt = array(username => $lang_log['text_username'], userid => $lang_log['text_userid'], reson => $lang_log['text_reson']);
 searchtable($lang_log['text_search_log'], 'userlog', $opt);
 $res = sql_query("SELECT COUNT(*) FROM users_log" . $wherea);
 $row = mysql_fetch_array($res);
 $count = $row[0];
 $perpage = 50;
 list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "?" . $addparam);
 $res = sql_query("SELECT * FROM users_log {$wherea} ORDER BY id DESC {$limit}") or sqlerr(__FILE__, __LINE__);
 if (mysql_num_rows($res) == 0) {
     print $lang_log['text_log_empty'];
 } else {
     //echo $pagertop;
     print "<table width=940 border=1 cellspacing=0 cellpadding=5>\n";
     print "<tr><td class=colhead align=center width=150px><img class=\"time\" src=\"pic/trans.gif\" alt=\"time\" title=\"" . $lang_log['title_time_added'] . "\" /></td><td class=colhead align=left>" . $lang_log['col_log'] . "</td><td class=colhead align=left>" . $lang_log['col_reson'] . "</td></tr>\n";
     while ($arr = mysql_fetch_assoc($res)) {
         $color = "";
         if ($arr['op'] == 'del') {