Changeset 2090 in ExiteCMS
- Timestamp:
- 12/04/08 14:28:48 (3 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
administration/tools/language_pack_English.php (modified) (1 diff)
-
administration/tools/language_pack_Nederlands.php (modified) (3 diffs)
-
includes/search/search.articles.php (modified) (2 diffs)
-
includes/search/search.downloads.php (modified) (4 diffs)
-
includes/search/search.forumattachments.php (modified) (2 diffs)
-
includes/search/search.forumposts.php (modified) (3 diffs)
-
includes/search/search.members.php (modified) (1 diff)
-
includes/search/search.news.php (modified) (2 diffs)
-
includes/search/search.pm.php (modified) (1 diff)
-
includes/search/templates/search.downloads.tpl (modified) (1 diff)
-
includes/search/templates/search.forumattachments.tpl (modified) (1 diff)
-
includes/search/templates/search.forumposts.tpl (modified) (1 diff)
-
includes/search/templates/search.members.tpl (modified) (1 diff)
-
includes/templates/main.search.tpl (modified) (1 diff)
-
search.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/tools/language_pack_English.php
r2087 r2090 3768 3768 if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "us|gb|ca|au|nz|in|za|ir|mt|hk|pr"); 3769 3769 if (!defined('LP_VERSION')) define('LP_VERSION', "7.20"); 3770 if (!defined('LP_DATE')) define('LP_DATE', "122 7998521");3770 if (!defined('LP_DATE')) define('LP_DATE', "1228396456"); 3771 3771 $lp_date = LP_DATE; 3772 3772 -
trunk/administration/tools/language_pack_Nederlands.php
r2087 r2090 3382 3382 $localestrings['src402'] = "Zoeken"; 3383 3383 $localestrings['src403'] = "Zoeklocatie:"; 3384 $localestrings['src404'] = " Opties:";3384 $localestrings['src404'] = "Sorteren op:"; 3385 3385 $localestrings['src405'] = array(); 3386 3386 $localestrings['src405']['0'] = array(); … … 3420 3420 $localestrings['src416'] = "laatste zes maanden"; 3421 3421 $localestrings['src417'] = "Zoeken"; 3422 $localestrings['src418'] = " Sorteren op";3422 $localestrings['src418'] = "Resultaat filters:"; 3423 3423 $localestrings['src419'] = "score"; 3424 3424 $localestrings['src420'] = "plaatsingdatum"; … … 3768 3768 if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "nl|be|sr|aw|an"); 3769 3769 if (!defined('LP_VERSION')) define('LP_VERSION', "7.20"); 3770 if (!defined('LP_DATE')) define('LP_DATE', "122 7998517");3770 if (!defined('LP_DATE')) define('LP_DATE', "1228396459"); 3771 3771 $lp_date = LP_DATE; 3772 3772 -
trunk/includes/search/search.articles.php
r1935 r2090 43 43 44 44 } else { 45 // get the required variables (could be POST or GET vars!) 46 if (isset($stext)) { 47 $stext = stripinput($stext); 45 46 // make sure the sub search ID is defined 47 if (!isset($sub_search_id)) $sub_search_id = 0; 48 49 // retrieve the search criteria 50 if (isset($_SESSION['search'])) { 51 // from the session store (used when paging through the results) 52 $stext = $_SESSION['search']['stext']; 53 $qtype = $_SESSION['search']['qtype']; 54 $datelimit = $_SESSION['search']['datelimit']; 55 $boolean = $_SESSION['search']['boolean']; 56 $sortby = $_SESSION['search']['sortby']; 57 $order = $_SESSION['search']['order']; 58 $limit = $_SESSION['search']['limit']; 59 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 60 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 48 61 } else { 62 // from the search form 49 63 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 64 $stext = str_replace(',', ' ', $stext); 65 $boolean = isset($_POST['boolean']) ? 0 : 1; 66 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 67 if ($qtype != "OR" && $qtype != "AND") { 68 $qtype = "AND"; 69 } 70 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 71 if (!in_array($sortby, $select_filters)) { 72 $sortby = $select_filters[0]; 73 } 74 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 75 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 76 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 77 // add a forum filter if requested 78 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 79 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 80 } 81 // add an author if requested 82 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 83 $contentfilter_users = stripinput($_POST['contentfilter_users']); 84 } 50 85 } 51 $stext = str_replace(',', ' ', $stext);52 86 $variables['stext'] = $stext; 53 87 54 // note: qtype not used because of a fulltext query 55 if (!isset($qtype)) { 56 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 57 } 58 if ($qtype != "OR" && $qtype != "AND") { 59 $qtype = "AND"; 60 } 61 62 if (!isset($datelimit)) { 63 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 64 } 65 if (!isNum($datelimit)) { 66 $datelimit = 0; 67 } 68 if (!isset($sortby)) { 69 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 70 } 71 if (!in_array($sortby, $select_filters)) { 72 $sortby = $select_filters[0]; 73 } 74 if (!isset($order)) { 75 $order = isset($_POST['order']) ? $_POST['order'] : 1; 76 } 77 if (!isNum($order)) { 78 $order = 1; 79 } 80 if (!isset($limit)) { 81 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 82 } 83 if (!isNum($limit)) { 84 $limit = 0; 85 } 86 if (!isset($boolean)) { 87 $boolean = isset($_POST['boolean']) ? 0 : 1; 88 } 89 90 if (!isset($sub_search_id)) $sub_search_id = 0; 91 92 // construct the page navigator URL to allow paging 93 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 94 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 95 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 96 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 97 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 98 $variables['pagenav_url'] .= "order=".$order."&"; 99 $variables['pagenav_url'] .= "limit=".$limit."&"; 88 // store the search parameters in the session record 89 $_SESSION['search'] = array('stext' => $stext, 90 'qtype' => $qtype, 91 'datelimit' => $datelimit, 92 'boolean' => $boolean, 93 'sortby' => $sortby, 94 'order' => $order, 95 'limit' => $limit, 96 'contentfilter_forums' => $contentfilter_forums, 97 'contentfilter_users' => $contentfilter_users 98 ); 100 99 101 100 // basis of the query for this search … … 128 127 // add a datelimit if requested 129 128 if ($datelimit) { 130 $sql .= " AND article_datestamp >= ".(time() - $datelimit);129 $sql .= " AND ta.article_datestamp >= ".(time() - $datelimit); 131 130 } 131 132 132 // add an author if requested 133 if ( isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0) {134 $sql .= " AND (t p.post_author = '".$_POST['contentfilter_users']."'"." OR tp.post_edituser = '".$_POST['contentfilter_users']."')";133 if (!empty($contentfilter_users)) { 134 $sql .= " AND (ta.article_name = '".$contentfilter_users."'"." OR ta.article_name = '".$contentfilter_users."')"; 135 135 } 136 136 -
trunk/includes/search/search.downloads.php
r1935 r2090 32 32 } else { 33 33 34 // get the required variables (could be POST or GET vars!) 35 if (isset($stext)) { 36 $stext = stripinput($stext); 34 // make sure the sub search ID is defined 35 if (!isset($sub_search_id)) $sub_search_id = 0; 36 37 // retrieve the search criteria 38 if (isset($_SESSION['search'])) { 39 // from the session store (used when paging through the results) 40 $stext = $_SESSION['search']['stext']; 41 $qtype = $_SESSION['search']['qtype']; 42 $datelimit = $_SESSION['search']['datelimit']; 43 $boolean = $_SESSION['search']['boolean']; 44 $sortby = $_SESSION['search']['sortby']; 45 $order = $_SESSION['search']['order']; 46 $limit = $_SESSION['search']['limit']; 47 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 48 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 37 49 } else { 50 // from the search form 38 51 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 52 $stext = str_replace(',', ' ', $stext); 53 $boolean = isset($_POST['boolean']) ? 0 : 1; 54 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 55 if ($qtype != "OR" && $qtype != "AND") { 56 $qtype = "AND"; 57 } 58 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 59 if (!in_array($sortby, $select_filters)) { 60 $sortby = $select_filters[0]; 61 } 62 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 63 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 64 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 65 // add a forum filter if requested 66 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 67 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 68 } 69 // add an author if requested 70 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 71 $contentfilter_users = stripinput($_POST['contentfilter_users']); 72 } 39 73 } 40 $stext = str_replace(',', ' ', $stext);41 74 $variables['stext'] = $stext; 42 75 43 // note: qtype not used because of a fulltext query 44 if (!isset($qtype)) { 45 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 46 } 47 if ($qtype != "OR" && $qtype != "AND") { 48 $qtype = "AND"; 49 } 50 51 if (!isset($datelimit)) { 52 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 53 } 54 if (!isNum($datelimit)) { 55 $datelimit = 0; 56 } 57 if (!isset($sortby)) { 58 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 59 } 60 if (!in_array($sortby, $select_filters)) { 61 $sortby = $select_filters[0]; 62 } 63 if (!isset($order)) { 64 $order = isset($_POST['order']) ? $_POST['order'] : 1; 65 } 66 if (!isNum($order)) { 67 $order = 1; 68 } 69 if (!isset($limit)) { 70 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 71 } 72 if (!isNum($limit)) { 73 $limit = 0; 74 } 75 if (!isset($boolean)) { 76 $boolean = isset($_POST['boolean']) ? 0 : 1; 77 } 78 79 if (!isset($sub_search_id)) $sub_search_id = 0; 80 81 // construct the page navigator URL to allow paging 82 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 83 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 84 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 85 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 86 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 87 $variables['pagenav_url'] .= "order=".$order."&"; 88 $variables['pagenav_url'] .= "limit=".$limit."&"; 76 // store the search parameters in the session record 77 $_SESSION['search'] = array('stext' => $stext, 78 'qtype' => $qtype, 79 'datelimit' => $datelimit, 80 'boolean' => $boolean, 81 'sortby' => $sortby, 82 'order' => $order, 83 'limit' => $limit, 84 'contentfilter_forums' => $contentfilter_forums, 85 'contentfilter_users' => $contentfilter_users 86 ); 89 87 90 88 // basis of the query for this search … … 104 102 foreach($stext as $sstring) { 105 103 if (!empty($sstring)) { 106 $searchstring .= ($searchstring==""?"":(" ".$qtype))." ( download_title LIKE '%".trim($sstring)."%' ORdownload_description LIKE '%".trim($sstring)."%') ";104 $searchstring .= ($searchstring==""?"":(" ".$qtype))." (td.download_title LIKE '%".trim($sstring)."%' OR td.download_description LIKE '%".trim($sstring)."%') "; 107 105 } 108 106 } … … 115 113 // add a datelimit if requested 116 114 if ($datelimit) { 117 $sql .= " AND download_datestamp >= ".(time() - $datelimit);115 $sql .= " AND td.download_datestamp >= ".(time() - $datelimit); 118 116 } 119 117 … … 127 125 break; 128 126 case "subject": 129 $sql .= " ORDER BY download_title ".($order?"ASC":"DESC");127 $sql .= " ORDER BY td.download_title ".($order?"ASC":"DESC"); 130 128 break; 131 129 case "datestamp": 132 $sql .= " ORDER BY download_datestamp ".($order?"ASC":"DESC");130 $sql .= " ORDER BY td.download_datestamp ".($order?"ASC":"DESC"); 133 131 break; 134 132 case "count": -
trunk/includes/search/search.forumattachments.php
r1935 r2090 61 61 } else { 62 62 63 // get the required variables (could be POST or GET vars!) 64 if (isset($stext)) { 65 $stext = stripinput($stext); 63 // make sure the sub search ID is defined 64 if (!isset($sub_search_id)) $sub_search_id = 0; 65 66 // retrieve the search criteria 67 if (isset($_SESSION['search'])) { 68 // from the session store (used when paging through the results) 69 $stext = $_SESSION['search']['stext']; 70 $qtype = $_SESSION['search']['qtype']; 71 $datelimit = $_SESSION['search']['datelimit']; 72 $boolean = $_SESSION['search']['boolean']; 73 $sortby = $_SESSION['search']['sortby']; 74 $order = $_SESSION['search']['order']; 75 $limit = $_SESSION['search']['limit']; 76 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 77 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 66 78 } else { 79 // from the search form 67 80 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 68 } 69 $stext = str_replace(',', ' ', $stext); 81 $stext = str_replace(',', ' ', $stext); 82 $boolean = isset($_POST['boolean']) ? 0 : 1; 83 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 84 if ($qtype != "OR" && $qtype != "AND") { 85 $qtype = "AND"; 86 } 87 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 88 if (!in_array($sortby, $select_filters)) { 89 $sortby = $select_filters[0]; 90 } 91 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 92 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 93 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 94 // add a forum filter if requested 95 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 96 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 97 } 98 // add an author if requested 99 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 100 $contentfilter_users = stripinput($_POST['contentfilter_users']); 101 } 102 } 70 103 $variables['stext'] = $stext; 71 // note: qtype not used because of a fulltext query 72 if (!isset($qtype)) { 73 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 74 } 75 if ($qtype != "OR" && $qtype != "AND") { 76 $qtype = "AND"; 77 } 78 if (!isset($datelimit)) { 79 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 80 } 81 if (!isNum($datelimit)) { 82 $datelimit = 0; 83 } 84 if (!isset($sortby)) { 85 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 86 } 87 if (!in_array($sortby, $select_filters)) { 88 $sortby = $select_filters[0]; 89 } 90 if (!isset($order)) { 91 $order = isset($_POST['order']) ? $_POST['order'] : 1; 92 } 93 if (!isNum($order)) { 94 $order = 1; 95 } 96 if (!isset($limit)) { 97 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 98 } 99 if (!isNum($limit)) { 100 $limit = 0; 101 } 102 if (!isset($boolean)) { 103 $boolean = isset($_POST['boolean']) ? 0 : 1; 104 } 105 106 if (!isset($sub_search_id)) $sub_search_id = 0; 107 108 // construct the page navigator URL to allow paging 109 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 110 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 111 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 112 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 113 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 114 $variables['pagenav_url'] .= "order=".$order."&"; 115 $variables['pagenav_url'] .= "limit=".$limit."&"; 104 105 // store the search parameters in the session record 106 $_SESSION['search'] = array('stext' => $stext, 107 'qtype' => $qtype, 108 'datelimit' => $datelimit, 109 'boolean' => $boolean, 110 'sortby' => $sortby, 111 'order' => $order, 112 'limit' => $limit, 113 'contentfilter_forums' => $contentfilter_forums, 114 'contentfilter_users' => $contentfilter_users 115 ); 116 116 117 117 // basis of the query for this search … … 149 149 150 150 // add a forum filter if requested 151 if ( isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0) {152 $sql .= " AND tp.forum_id = '".$ _POST['contentfilter_forums']."'";151 if (!empty($contentfilter_forums)) { 152 $sql .= " AND tp.forum_id = '".$contentfilter_forums."'"; 153 153 } 154 154 // add an author if requested 155 if ( isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0) {156 $sql .= " AND (tp.post_author = '".$ _POST['contentfilter_users']."'"." OR tp.post_edituser = '".$_POST['contentfilter_users']."')";155 if (!empty($contentfilter_users)) { 156 $sql .= " AND (tp.post_author = '".$contentfilter_users."'"." OR tp.post_edituser = '".$contentfilter_users."')"; 157 157 } 158 158 -
trunk/includes/search/search.forumposts.php
r1935 r2090 61 61 } else { 62 62 63 // get the required variables (could be POST or GET vars!) 64 if (isset($stext)) { 65 $stext = stripinput($stext); 63 // make sure the sub search ID is defined 64 if (!isset($sub_search_id)) $sub_search_id = 0; 65 66 // retrieve the search criteria 67 if (isset($_SESSION['search'])) { 68 // from the session store (used when paging through the results) 69 $stext = $_SESSION['search']['stext']; 70 $qtype = $_SESSION['search']['qtype']; 71 $datelimit = $_SESSION['search']['datelimit']; 72 $boolean = $_SESSION['search']['boolean']; 73 $sortby = $_SESSION['search']['sortby']; 74 $order = $_SESSION['search']['order']; 75 $limit = $_SESSION['search']['limit']; 76 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 77 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 66 78 } else { 79 // from the search form 67 80 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 68 } 69 $stext = str_replace(',', ' ', $stext); 81 $stext = str_replace(',', ' ', $stext); 82 $boolean = isset($_POST['boolean']) ? 0 : 1; 83 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 84 if ($qtype != "OR" && $qtype != "AND") { 85 $qtype = "AND"; 86 } 87 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 88 if (!in_array($sortby, $select_filters)) { 89 $sortby = $select_filters[0]; 90 } 91 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 92 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 93 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 94 // add a forum filter if requested 95 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 96 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 97 } 98 // add an author if requested 99 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 100 $contentfilter_users = stripinput($_POST['contentfilter_users']); 101 } 102 } 70 103 $variables['stext'] = $stext; 71 104 72 // note: qtype not used because of a fulltext query 73 if (!isset($qtype)) { 74 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 75 } 76 if ($qtype != "OR" && $qtype != "AND") { 77 $qtype = "AND"; 78 } 79 if (!isset($datelimit)) { 80 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 81 } 82 if (!isNum($datelimit)) { 83 $datelimit = 0; 84 } 85 if (!isset($sortby)) { 86 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 87 } 88 if (!in_array($sortby, $select_filters)) { 89 $sortby = $select_filters[0]; 90 } 91 if (!isset($order)) { 92 $order = isset($_POST['order']) ? $_POST['order'] : 1; 93 } 94 if (!isNum($order)) { 95 $order = 1; 96 } 97 if (!isset($limit)) { 98 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 99 } 100 if (!isNum($limit)) { 101 $limit = 0; 102 } 103 if (!isset($boolean)) { 104 $boolean = isset($_POST['boolean']) ? 0 : 1; 105 } 106 107 if (!isset($sub_search_id)) $sub_search_id = 0; 108 109 // construct the page navigator URL to allow paging 110 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 111 $variables['pagenav_url'] .= "stext=".$stext."&"; 112 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 113 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 114 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 115 $variables['pagenav_url'] .= "order=".$order."&"; 116 $variables['pagenav_url'] .= "limit=".$limit."&"; 105 // store the search parameters in the session record 106 $_SESSION['search'] = array('stext' => $stext, 107 'qtype' => $qtype, 108 'datelimit' => $datelimit, 109 'boolean' => $boolean, 110 'sortby' => $sortby, 111 'order' => $order, 112 'limit' => $limit, 113 'contentfilter_forums' => $contentfilter_forums, 114 'contentfilter_users' => $contentfilter_users 115 ); 117 116 118 117 // basis of the query for this search … … 172 171 173 172 // add a forum filter if requested 174 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 175 $sql .= " AND tp.forum_id = '".$_POST['contentfilter_forums']."'"; 176 } 173 if (!empty($contentfilter_forums)) { 174 $sql .= " AND tp.forum_id = '".$contentfilter_forums."'"; 175 } 176 177 177 // add an author if requested 178 if ( isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0) {179 $sql .= " AND (tp.post_author = '".$ _POST['contentfilter_users']."'"." OR tp.post_edituser = '".$_POST['contentfilter_users']."')";178 if (!empty($contentfilter_users)) { 179 $sql .= " AND (tp.post_author = '".$contentfilter_users."'"." OR tp.post_edituser = '".$contentfilter_users."')"; 180 180 } 181 181 … … 201 201 // check if we have a rowstart value 202 202 if (!isset($rowstart)) $rowstart = 0; 203 203 204 204 // check how many rows this would output 205 205 $rptresult = mysql_query($sql.($limit?" LIMIT $limit":"")); -
trunk/includes/search/search.members.php
r1935 r2090 33 33 } else { 34 34 35 // get the required variables (could be POST or GET vars!) 36 if (isset($stext)) { 37 $stext = stripinput($stext); 35 // make sure the sub search ID is defined 36 if (!isset($sub_search_id)) $sub_search_id = 0; 37 38 // retrieve the search criteria 39 if (isset($_SESSION['search'])) { 40 // from the session store (used when paging through the results) 41 $stext = $_SESSION['search']['stext']; 42 $qtype = $_SESSION['search']['qtype']; 43 $datelimit = $_SESSION['search']['datelimit']; 44 $boolean = $_SESSION['search']['boolean']; 45 $sortby = $_SESSION['search']['sortby']; 46 $order = $_SESSION['search']['order']; 47 $limit = $_SESSION['search']['limit']; 48 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 49 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 38 50 } else { 51 // from the search form 39 52 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 53 $stext = str_replace(',', ' ', $stext); 54 $boolean = isset($_POST['boolean']) ? 0 : 1; 55 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 56 if ($qtype != "OR" && $qtype != "AND") { 57 $qtype = "AND"; 58 } 59 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 60 if (!in_array($sortby, $select_filters)) { 61 $sortby = $select_filters[0]; 62 } 63 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 64 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 65 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 66 // add a forum filter if requested 67 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 68 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 69 } 70 // add an author if requested 71 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 72 $contentfilter_users = stripinput($_POST['contentfilter_users']); 73 } 40 74 } 41 $stext = str_replace(',', ' ', $stext);42 75 $variables['stext'] = $stext; 43 76 44 if (!isset($qtype)) { 45 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 46 } 47 if ($qtype != "OR" && $qtype != "AND") { 48 $qtype = "AND"; 49 } 50 if (!isset($datelimit)) { 51 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 52 } 53 if (!isNum($datelimit)) { 54 $datelimit = 0; 55 } 56 if (!isset($sortby)) { 57 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 58 } 59 if (!in_array($sortby, $select_filters)) { 60 $sortby = $select_filters[0]; 61 } 62 if (!isset($order)) { 63 $order = isset($_POST['order']) ? $_POST['order'] : 1; 64 } 65 if (!isNum($order)) { 66 $order = 1; 67 } 68 if (!isset($limit)) { 69 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 70 } 71 if (!isNum($limit)) { 72 $limit = 0; 73 } 74 if (!isset($boolean)) { 75 $boolean = isset($_POST['boolean']) ? 0 : 1; 76 } 77 78 if (!isset($sub_search_id)) $sub_search_id = 0; 79 80 // construct the page navigator URL to allow paging 81 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 82 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 83 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 84 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 85 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 86 $variables['pagenav_url'] .= "order=".$order."&"; 87 $variables['pagenav_url'] .= "limit=".$limit."&"; 77 // store the search parameters in the session record 78 $_SESSION['search'] = array('stext' => $stext, 79 'qtype' => $qtype, 80 'datelimit' => $datelimit, 81 'boolean' => $boolean, 82 'sortby' => $sortby, 83 'order' => $order, 84 'limit' => $limit, 85 'contentfilter_forums' => $contentfilter_forums, 86 'contentfilter_users' => $contentfilter_users 87 ); 88 88 89 89 // basis of the query for this search -
trunk/includes/search/search.news.php
r1935 r2090 44 44 } else { 45 45 46 // get the required variables (could be POST or GET vars!) 47 if (isset($stext)) { 48 $stext = stripinput($stext); 49 } else { 50 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 51 } 52 $stext = str_replace(',', ' ', $stext); 53 $variables['stext'] = $stext; 54 // note: qtype not used because of a fulltext query 55 if (!isset($qtype)) { 56 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 57 } 58 if ($qtype != "OR" && $qtype != "AND") { 59 $qtype = "AND"; 60 } 61 if (!isset($datelimit)) { 62 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 63 } 64 if (!isNum($datelimit)) { 65 $datelimit = 0; 66 } 67 if (!isset($sortby)) { 68 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 69 } 70 if (!in_array($sortby, $select_filters)) { 71 $sortby = $select_filters[0]; 72 } 73 if (!isset($order)) { 74 $order = isset($_POST['order']) ? $_POST['order'] : 1; 75 } 76 if (!isNum($order)) { 77 $order = 1; 78 } 79 if (!isset($limit)) { 80 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 81 } 82 if (!isNum($limit)) { 83 $limit = 0; 84 } 85 if (!isset($boolean)) { 86 $boolean = isset($_POST['boolean']) ? 0 : 1; 87 } 88 46 // make sure the sub search ID is defined 89 47 if (!isset($sub_search_id)) $sub_search_id = 0; 90 48 91 // construct the page navigator URL to allow paging 92 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 93 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 94 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 95 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 96 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 97 $variables['pagenav_url'] .= "order=".$order."&"; 98 $variables['pagenav_url'] .= "limit=".$limit."&"; 49 // retrieve the search criteria 50 if (isset($_SESSION['search'])) { 51 // from the session store (used when paging through the results) 52 $stext = $_SESSION['search']['stext']; 53 $qtype = $_SESSION['search']['qtype']; 54 $datelimit = $_SESSION['search']['datelimit']; 55 $boolean = $_SESSION['search']['boolean']; 56 $sortby = $_SESSION['search']['sortby']; 57 $order = $_SESSION['search']['order']; 58 $limit = $_SESSION['search']['limit']; 59 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 60 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 61 } else { 62 // from the search form 63 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 64 $stext = str_replace(',', ' ', $stext); 65 $boolean = isset($_POST['boolean']) ? 0 : 1; 66 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 67 if ($qtype != "OR" && $qtype != "AND") { 68 $qtype = "AND"; 69 } 70 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 71 if (!in_array($sortby, $select_filters)) { 72 $sortby = $select_filters[0]; 73 } 74 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 75 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 76 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 77 // add a forum filter if requested 78 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 79 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 80 } 81 // add an author if requested 82 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 83 $contentfilter_users = stripinput($_POST['contentfilter_users']); 84 } 85 } 86 $variables['stext'] = $stext; 99 87 88 // store the search parameters in the session record 89 $_SESSION['search'] = array('stext' => $stext, 90 'qtype' => $qtype, 91 'datelimit' => $datelimit, 92 'boolean' => $boolean, 93 'sortby' => $sortby, 94 'order' => $order, 95 'limit' => $limit, 96 'contentfilter_forums' => $contentfilter_forums, 97 'contentfilter_users' => $contentfilter_users 98 ); 100 99 // basis of the query for this search 101 100 if ($boolean) { … … 128 127 $sql .= " AND news_datestamp >= ".(time() - $datelimit); 129 128 } 129 130 130 // add an author if requested 131 if ( isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0) {132 $sql .= " AND ( tp.post_author = '".$_POST['contentfilter_users']."'"." OR tp.post_edituser = '".$_POST['contentfilter_users']."')";131 if (!empty($contentfilter_users)) { 132 $sql .= " AND (news_name = '".$contentfilter_users."'"." OR news_name = '".$contentfilter_users."')"; 133 133 } 134 134 -
trunk/includes/search/search.pm.php
r1935 r2090 32 32 } else { 33 33 34 // get the required variables (could be POST or GET vars!) 35 if (isset($stext)) { 36 $stext = stripinput($stext); 34 // make sure the sub search ID is defined 35 if (!isset($sub_search_id)) $sub_search_id = 0; 36 37 // retrieve the search criteria 38 if (isset($_SESSION['search'])) { 39 // from the session store (used when paging through the results) 40 $stext = $_SESSION['search']['stext']; 41 $qtype = $_SESSION['search']['qtype']; 42 $datelimit = $_SESSION['search']['datelimit']; 43 $boolean = $_SESSION['search']['boolean']; 44 $sortby = $_SESSION['search']['sortby']; 45 $order = $_SESSION['search']['order']; 46 $limit = $_SESSION['search']['limit']; 47 $contentfilter_forums = $_SESSION['search']['contentfilter_forums']; 48 $contentfilter_users = $_SESSION['search']['contentfilter_users']; 37 49 } else { 50 // from the search form 38 51 $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : ""; 39 } 40 $stext = str_replace(',', ' ', $stext); 52 $stext = str_replace(',', ' ', $stext); 53 $boolean = isset($_POST['boolean']) ? 0 : 1; 54 $qtype = isset($_POST['qtype']) ? stripinput($_POST['qtype']) : "AND"; 55 if ($qtype != "OR" && $qtype != "AND") { 56 $qtype = "AND"; 57 } 58 $sortby = isset($_POST['sortby']) ? stripinput($_POST['sortby']) : "score"; 59 if (!in_array($sortby, $select_filters)) { 60 $sortby = $select_filters[0]; 61 } 62 $order = isset($_POST['order']) && isNum($_POST['order']) ? $_POST['order'] : 1; 63 $limit = isset($_POST['limit']) && isNum($_POST['limit']) ? $_POST['limit'] : 0; 64 $datelimit = isset($_POST['datelimit']) && isNum($_POST['datelimit']) ? $_POST['datelimit'] : 0; 65 // add a forum filter if requested 66 if (isset($_POST['contentfilter_forums']) && isNum($_POST['contentfilter_forums']) && $_POST['contentfilter_forums'] > 0 ) { 67 $contentfilter_forums = stripinput($_POST['contentfilter_forums']); 68 } 69 // add an author if requested 70 if (isset($_POST['contentfilter_users']) && isNum($_POST['contentfilter_users']) && $_POST['contentfilter_users'] > 0 ) { 71 $contentfilter_users = stripinput($_POST['contentfilter_users']); 72 } 73 } 41 74 $variables['stext'] = $stext; 42 // note: qtype not used because of a fulltext query 43 if (!isset($qtype)) { 44 $qtype = isset($_POST['qtype']) ? $_POST['qtype'] : "AND"; 45 } 46 if ($qtype != "OR" && $qtype != "AND") { 47 $qtype = "AND"; 48 } 49 if (!isset($datelimit)) { 50 $datelimit = isset($_POST['datelimit']) ? $_POST['datelimit'] : 0; 51 } 52 if (!isNum($datelimit)) { 53 $datelimit = 0; 54 } 55 if (!isset($sortby)) { 56 $sortby = isset($_POST['sortby']) ? $_POST['sortby'] : "score"; 57 } 58 if (!in_array($sortby, $select_filters)) { 59 $sortby = $select_filters[0]; 60 } 61 if (!isset($order)) { 62 $order = isset($_POST['order']) ? $_POST['order'] : 1; 63 } 64 if (!isNum($order)) { 65 $order = 1; 66 } 67 if (!isset($limit)) { 68 $limit = isset($_POST['limit']) ? $_POST['limit'] : 0; 69 } 70 if (!isNum($limit)) { 71 $limit = 0; 72 } 73 if (!isset($boolean)) { 74 $boolean = isset($_POST['boolean']) ? 0 : 1; 75 } 76 77 if (!isset($sub_search_id)) $sub_search_id = 0; 78 79 // construct the page navigator URL to allow paging 80 $variables['pagenav_url'] = FUSION_SELF."?action=search&search_id=".$search_id."&"; 81 $variables['pagenav_url'] .= "stext=".urlencode($stext)."&"; 82 $variables['pagenav_url'] .= "boolean=".$boolean."&"; 83 $variables['pagenav_url'] .= "datelimit=".$datelimit."&"; 84 $variables['pagenav_url'] .= "sortby=".$sortby."&"; 85 $variables['pagenav_url'] .= "order=".$order."&"; 86 $variables['pagenav_url'] .= "limit=".$limit."&"; 75 76 // store the search parameters in the session record 77 $_SESSION['search'] = array('stext' => $stext, 78 'qtype' => $qtype, 79 'datelimit' => $datelimit, 80 'boolean' => $boolean, 81 'sortby' => $sortby, 82 'order' => $order, 83 'limit' => $limit, 84 'contentfilter_forums' => $contentfilter_forums, 85 'contentfilter_users' => $contentfilter_users 86 ); 87 87 88 88 // basis of the query for this search -
trunk/includes/search/templates/search.downloads.tpl
r1935 r2090 24 24 {/if} 25 25 <a href='downloads.php?cat_id={$v[idx].download_cat}&download_id={$reportvars.output[idx].download_id}' target='_blank'>{$reportvars.output[idx].download_title}</a> - {$reportvars.output[idx].download_filesize} 26 <br />27 26 {if $reportvars.output[idx].download_description} 28 {$reportvars.output[idx].download_description}<br />27 · {$reportvars.output[idx].download_description}<br /> 29 28 {/if} 30 <span class='small'><font class='smallalt'>{$locale.433}</font> {$reportvars.output[idx].download_license}, 31 <font class='smallalt'>{$locale.434}</font> {$reportvars.output[idx].download_os}, 32 <font class='smallalt'>{$locale.435}</font> {$reportvars.output[idx].download_version} 33 <br /> 34 <font class='smallalt'>{$locale.436}</font>{$reportvars.output[idx].download_datestamp|date_format:"longdate"}, 35 <font class='smallalt'>{$locale.437}</font> {$reportvars.output[idx].download_count}</span> 29 <span class='small'><font class='smallalt'>{$locale.src433}</font> {$reportvars.output[idx].download_license}, 30 <font class='smallalt'>{$locale.src434}</font> {$reportvars.output[idx].download_os}, 31 <font class='smallalt'>{$locale.src435}</font> {$reportvars.output[idx].download_version} 32 <font class='smallalt'>{$locale.src436}</font>{$reportvars.output[idx].download_datestamp|date_format:"longdate"}, 33 <font class='smallalt'>{$locale.src437}</font> {$reportvars.output[idx].download_count}</span> 36 34 {/section} 37 35 {else} -
trunk/includes/search/templates/search.forumattachments.tpl
r1935 r2090 24 24 {/if} 25 25 {$reportvars.output[idx].relevance|string_format:"%u"}% - <a href='/forum/viewthread.php?forum_id={$reportvars.output[idx].forum_id}&thread_id={$reportvars.output[idx].thread_id}&pid={$reportvars.output[idx].post_id}#post_{$reportvars.output[idx].post_id}'>{$reportvars.output[idx].post_subject}</a>, 26 {$locale. 441} {$reportvars.output[idx].attach_realname}26 {$locale.src441} {$reportvars.output[idx].attach_realname} 27 27 <br /> 28 28 <span class='small'><font class='smallalt'>{$locale.040}</font> -
trunk/includes/search/templates/search.forumposts.tpl
r1935 r2090 31 31 {$reportvars.output[idx].user_name} 32 32 {/if} 33 <font class='smallalt'>{$locale. 436}</font> {$reportvars.output[idx].post_datestamp|date_format:"longdate"}</span>33 <font class='smallalt'>{$locale.src436}</font> {$reportvars.output[idx].post_datestamp|date_format:"longdate"}</span> 34 34 {/section} 35 35 {else} -
trunk/includes/search/templates/search.members.tpl
r1935 r2090 30 30 {/if} 31 31 <br /> 32 <span class='small'><font class='smallalt'>{$locale. 438}</font> {$reportvars.output[idx].user_joined|date_format:"forumdate"},33 <font class='smallalt'>{$locale. 439}</font> {if $reportvars.output[idx].user_lastvisit}{$reportvars.output[idx].user_lastvisit|date_format:"forumdate"}{else}{$locale.440}{/if}</span>32 <span class='small'><font class='smallalt'>{$locale.src438}</font> {$reportvars.output[idx].user_joined|date_format:"forumdate"}, 33 <font class='smallalt'>{$locale.src439}</font> {if $reportvars.output[idx].user_lastvisit}{$reportvars.output[idx].user_lastvisit|date_format:"forumdate"}{else}{$locale.src440}{/if}</span> 34 34 {/section} 35 35 {else} -
trunk/includes/templates/main.search.tpl
r1935 r2090 209 209 {include file="_closetable.tpl"} 210 210 {if $rows > $items_per_page} 211 {makepagenav start=$rowstart count=$items_per_page total=$rows range=$settings.navbar_range link=$ pagenav_url}211 {makepagenav start=$rowstart count=$items_per_page total=$rows range=$settings.navbar_range link=$smarty.const.FUSION_SELF|cat:"?action=search&search_id="|cat:$search_id|cat:"&"} 212 212 {/if} 213 213 {/if} -
trunk/search.php
r1936 r2090 41 41 if (!isset($action)) $action = ""; 42 42 $variables['action'] = $action; 43 44 // if this is a new search, wipe the search session variables 45 if (isset($_POST['search_id']) && isset($_SESSION['search'])) { 46 unset($_SESSION['search']); 47 } 43 48 44 49 if (!isset($search_id)) {
Note: See TracChangeset
for help on using the changeset viewer.
