$v){ $arr[$k]=addslashes($v); } $queryarray=$arr; } $sql = "SELECT `note_sn` , `note_title` , `note_date` , `uid` FROM ".$xoopsDB->prefix("tad_notes")." WHERE `note_public`='1' "; if ( $userid != 0 ) { $sql .= " AND uid=".$userid." "; } if ( is_array($queryarray) && $count = count($queryarray) ) { $sql .= " AND ((`note_title` LIKE '%{$queryarray[0]}%' OR `note_content` LIKE '%{$queryarray[0]}%' OR `note_date` LIKE '%{$queryarray[0]}%')"; for($i=1;$i<$count;$i++){ $sql .= " $andor "; $sql .= "( `note_title` LIKE '%{$queryarray[$i]}%' OR `note_content` LIKE '%{$queryarray[$i]}%' OR `note_date` LIKE '%{$queryarray[$i]}%')"; } $sql .= ") "; } $sql .= "ORDER BY `note_sort` DESC"; $result = $xoopsDB->query($sql,$limit,$offset); $ret = array(); $i = 0; while($myrow = $xoopsDB->fetchArray($result)){ $ret[$i]['image'] = "images/note.png"; $ret[$i]['link'] = "view.php?note_sn=".$myrow['note_sn']; $ret[$i]['title'] = $myrow['note_title']; $ret[$i]['time'] = strtotime($myrow['note_date']); $ret[$i]['uid'] = $myrow['uid']; $i++; } return $ret; } ?> ```
進階搜尋
60人線上 (17人在瀏覽線上書籍)
會員: 0
訪客: 60