@@ -398,21 +398,21 @@ discard block |
||
| 398 | 398 | $message = $query_error_override; |
| 399 | 399 | } else { |
| 400 | 400 | switch ($view_mode) { |
| 401 | - case "unread": |
|
| 402 | - $message = __("No unread articles found to display."); |
|
| 403 | - break; |
|
| 404 | - case "updated": |
|
| 405 | - $message = __("No updated articles found to display."); |
|
| 406 | - break; |
|
| 407 | - case "marked": |
|
| 408 | - $message = __("No starred articles found to display."); |
|
| 409 | - break; |
|
| 410 | - default: |
|
| 411 | - if ($feed < LABEL_BASE_INDEX) { |
|
| 412 | - $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter."); |
|
| 413 | - } else { |
|
| 414 | - $message = __("No articles found to display."); |
|
| 415 | - } |
|
| 401 | + case "unread": |
|
| 402 | + $message = __("No unread articles found to display."); |
|
| 403 | + break; |
|
| 404 | + case "updated": |
|
| 405 | + $message = __("No updated articles found to display."); |
|
| 406 | + break; |
|
| 407 | + case "marked": |
|
| 408 | + $message = __("No starred articles found to display."); |
|
| 409 | + break; |
|
| 410 | + default: |
|
| 411 | + if ($feed < LABEL_BASE_INDEX) { |
|
| 412 | + $message = __("No articles found to display. You can assign articles to labels manually from article header context menu (applies to all selected articles) or use a filter."); |
|
| 413 | + } else { |
|
| 414 | + $message = __("No articles found to display."); |
|
| 415 | + } |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
@@ -874,29 +874,29 @@ discard block |
||
| 874 | 874 | // TODO: all this interval stuff needs some generic generator function |
| 875 | 875 | |
| 876 | 876 | switch ($mode) { |
| 877 | - case "1day": |
|
| 878 | - if (DB_TYPE == "pgsql") { |
|
| 879 | - $date_qpart = "date_entered < NOW() - INTERVAL '1 day' "; |
|
| 880 | - } else { |
|
| 881 | - $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 DAY) "; |
|
| 882 | - } |
|
| 883 | - break; |
|
| 884 | - case "1week": |
|
| 885 | - if (DB_TYPE == "pgsql") { |
|
| 886 | - $date_qpart = "date_entered < NOW() - INTERVAL '1 week' "; |
|
| 887 | - } else { |
|
| 888 | - $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 WEEK) "; |
|
| 889 | - } |
|
| 890 | - break; |
|
| 891 | - case "2week": |
|
| 892 | - if (DB_TYPE == "pgsql") { |
|
| 893 | - $date_qpart = "date_entered < NOW() - INTERVAL '2 week' "; |
|
| 894 | - } else { |
|
| 895 | - $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 2 WEEK) "; |
|
| 896 | - } |
|
| 897 | - break; |
|
| 898 | - default: |
|
| 899 | - $date_qpart = "true"; |
|
| 877 | + case "1day": |
|
| 878 | + if (DB_TYPE == "pgsql") { |
|
| 879 | + $date_qpart = "date_entered < NOW() - INTERVAL '1 day' "; |
|
| 880 | + } else { |
|
| 881 | + $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 DAY) "; |
|
| 882 | + } |
|
| 883 | + break; |
|
| 884 | + case "1week": |
|
| 885 | + if (DB_TYPE == "pgsql") { |
|
| 886 | + $date_qpart = "date_entered < NOW() - INTERVAL '1 week' "; |
|
| 887 | + } else { |
|
| 888 | + $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 WEEK) "; |
|
| 889 | + } |
|
| 890 | + break; |
|
| 891 | + case "2week": |
|
| 892 | + if (DB_TYPE == "pgsql") { |
|
| 893 | + $date_qpart = "date_entered < NOW() - INTERVAL '2 week' "; |
|
| 894 | + } else { |
|
| 895 | + $date_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 2 WEEK) "; |
|
| 896 | + } |
|
| 897 | + break; |
|
| 898 | + default: |
|
| 899 | + $date_qpart = "true"; |
|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if (is_numeric($feed)) { |
@@ -1212,28 +1212,28 @@ discard block |
||
| 1212 | 1212 | |
| 1213 | 1213 | static function getFeedIcon($id) { |
| 1214 | 1214 | switch ($id) { |
| 1215 | - case 0: |
|
| 1216 | - return "archive"; |
|
| 1217 | - case -1: |
|
| 1218 | - return "star"; |
|
| 1219 | - case -2: |
|
| 1220 | - return "rss_feed"; |
|
| 1221 | - case -3: |
|
| 1222 | - return "whatshot"; |
|
| 1223 | - case -4: |
|
| 1224 | - return "inbox"; |
|
| 1225 | - case -6: |
|
| 1226 | - return "restore"; |
|
| 1227 | - default: |
|
| 1228 | - if ($id < LABEL_BASE_INDEX) { |
|
| 1229 | - return "label"; |
|
| 1230 | - } else { |
|
| 1231 | - $icon = self::getIconFile($id); |
|
| 1215 | + case 0: |
|
| 1216 | + return "archive"; |
|
| 1217 | + case -1: |
|
| 1218 | + return "star"; |
|
| 1219 | + case -2: |
|
| 1220 | + return "rss_feed"; |
|
| 1221 | + case -3: |
|
| 1222 | + return "whatshot"; |
|
| 1223 | + case -4: |
|
| 1224 | + return "inbox"; |
|
| 1225 | + case -6: |
|
| 1226 | + return "restore"; |
|
| 1227 | + default: |
|
| 1228 | + if ($id < LABEL_BASE_INDEX) { |
|
| 1229 | + return "label"; |
|
| 1230 | + } else { |
|
| 1231 | + $icon = self::getIconFile($id); |
|
| 1232 | 1232 | |
| 1233 | 1233 | if ($icon && file_exists($icon)) { |
| 1234 | - return ICONS_URL . "/" . basename($icon) . "?" . filemtime($icon); |
|
| 1235 | - } |
|
| 1234 | + return ICONS_URL . "/" . basename($icon) . "?" . filemtime($icon); |
|
| 1236 | 1235 | } |
| 1236 | + } |
|
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | return false; |
@@ -2201,102 +2201,102 @@ discard block |
||
| 2201 | 2201 | $commandpair = explode(":", mb_strtolower($k), 2); |
| 2202 | 2202 | |
| 2203 | 2203 | switch ($commandpair[0]) { |
| 2204 | - case "title": |
|
| 2205 | - if ($commandpair[1]) { |
|
| 2206 | - array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE ". |
|
| 2207 | - $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%') ."))"); |
|
| 2208 | - } else { |
|
| 2209 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2204 | + case "title": |
|
| 2205 | + if ($commandpair[1]) { |
|
| 2206 | + array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE ". |
|
| 2207 | + $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%') ."))"); |
|
| 2208 | + } else { |
|
| 2209 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2210 | 2210 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2211 | - array_push($search_words, $k); |
|
| 2212 | - } |
|
| 2213 | - break; |
|
| 2214 | - case "author": |
|
| 2215 | - if ($commandpair[1]) { |
|
| 2216 | - array_push($query_keywords, "($not (LOWER(author) LIKE ". |
|
| 2217 | - $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))"); |
|
| 2218 | - } else { |
|
| 2219 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2211 | + array_push($search_words, $k); |
|
| 2212 | + } |
|
| 2213 | + break; |
|
| 2214 | + case "author": |
|
| 2215 | + if ($commandpair[1]) { |
|
| 2216 | + array_push($query_keywords, "($not (LOWER(author) LIKE ". |
|
| 2217 | + $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))"); |
|
| 2218 | + } else { |
|
| 2219 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2220 | 2220 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2221 | - array_push($search_words, $k); |
|
| 2222 | - } |
|
| 2223 | - break; |
|
| 2224 | - case "note": |
|
| 2225 | - if ($commandpair[1]) { |
|
| 2226 | - if ($commandpair[1] == "true") |
|
| 2227 | - array_push($query_keywords, "($not (note IS NOT NULL AND note != ''))"); |
|
| 2228 | - else if ($commandpair[1] == "false") |
|
| 2229 | - array_push($query_keywords, "($not (note IS NULL OR note = ''))"); |
|
| 2230 | - else |
|
| 2231 | - array_push($query_keywords, "($not (LOWER(note) LIKE ". |
|
| 2232 | - $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))"); |
|
| 2233 | - } else { |
|
| 2234 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2221 | + array_push($search_words, $k); |
|
| 2222 | + } |
|
| 2223 | + break; |
|
| 2224 | + case "note": |
|
| 2225 | + if ($commandpair[1]) { |
|
| 2226 | + if ($commandpair[1] == "true") |
|
| 2227 | + array_push($query_keywords, "($not (note IS NOT NULL AND note != ''))"); |
|
| 2228 | + else if ($commandpair[1] == "false") |
|
| 2229 | + array_push($query_keywords, "($not (note IS NULL OR note = ''))"); |
|
| 2230 | + else |
|
| 2231 | + array_push($query_keywords, "($not (LOWER(note) LIKE ". |
|
| 2232 | + $pdo->quote('%' . mb_strtolower($commandpair[1]) . '%')."))"); |
|
| 2233 | + } else { |
|
| 2234 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2235 | 2235 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2236 | - if (!$not) array_push($search_words, $k); |
|
| 2237 | - } |
|
| 2238 | - break; |
|
| 2239 | - case "star": |
|
| 2236 | + if (!$not) array_push($search_words, $k); |
|
| 2237 | + } |
|
| 2238 | + break; |
|
| 2239 | + case "star": |
|
| 2240 | 2240 | |
| 2241 | - if ($commandpair[1]) { |
|
| 2242 | - if ($commandpair[1] == "true") |
|
| 2243 | - array_push($query_keywords, "($not (marked = true))"); |
|
| 2244 | - else |
|
| 2245 | - array_push($query_keywords, "($not (marked = false))"); |
|
| 2246 | - } else { |
|
| 2247 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2241 | + if ($commandpair[1]) { |
|
| 2242 | + if ($commandpair[1] == "true") |
|
| 2243 | + array_push($query_keywords, "($not (marked = true))"); |
|
| 2244 | + else |
|
| 2245 | + array_push($query_keywords, "($not (marked = false))"); |
|
| 2246 | + } else { |
|
| 2247 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2248 | 2248 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2249 | - if (!$not) array_push($search_words, $k); |
|
| 2250 | - } |
|
| 2251 | - break; |
|
| 2252 | - case "pub": |
|
| 2253 | - if ($commandpair[1]) { |
|
| 2254 | - if ($commandpair[1] == "true") |
|
| 2255 | - array_push($query_keywords, "($not (published = true))"); |
|
| 2256 | - else |
|
| 2257 | - array_push($query_keywords, "($not (published = false))"); |
|
| 2249 | + if (!$not) array_push($search_words, $k); |
|
| 2250 | + } |
|
| 2251 | + break; |
|
| 2252 | + case "pub": |
|
| 2253 | + if ($commandpair[1]) { |
|
| 2254 | + if ($commandpair[1] == "true") |
|
| 2255 | + array_push($query_keywords, "($not (published = true))"); |
|
| 2256 | + else |
|
| 2257 | + array_push($query_keywords, "($not (published = false))"); |
|
| 2258 | 2258 | |
| 2259 | - } else { |
|
| 2260 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2259 | + } else { |
|
| 2260 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') |
|
| 2261 | 2261 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2262 | - if (!$not) array_push($search_words, $k); |
|
| 2263 | - } |
|
| 2264 | - break; |
|
| 2265 | - case "unread": |
|
| 2266 | - if ($commandpair[1]) { |
|
| 2267 | - if ($commandpair[1] == "true") |
|
| 2268 | - array_push($query_keywords, "($not (unread = true))"); |
|
| 2269 | - else |
|
| 2270 | - array_push($query_keywords, "($not (unread = false))"); |
|
| 2262 | + if (!$not) array_push($search_words, $k); |
|
| 2263 | + } |
|
| 2264 | + break; |
|
| 2265 | + case "unread": |
|
| 2266 | + if ($commandpair[1]) { |
|
| 2267 | + if ($commandpair[1] == "true") |
|
| 2268 | + array_push($query_keywords, "($not (unread = true))"); |
|
| 2269 | + else |
|
| 2270 | + array_push($query_keywords, "($not (unread = false))"); |
|
| 2271 | 2271 | |
| 2272 | - } else { |
|
| 2273 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2272 | + } else { |
|
| 2273 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2274 | 2274 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2275 | - if (!$not) array_push($search_words, $k); |
|
| 2276 | - } |
|
| 2277 | - break; |
|
| 2278 | - default: |
|
| 2279 | - if (strpos($k, "@") === 0) { |
|
| 2275 | + if (!$not) array_push($search_words, $k); |
|
| 2276 | + } |
|
| 2277 | + break; |
|
| 2278 | + default: |
|
| 2279 | + if (strpos($k, "@") === 0) { |
|
| 2280 | 2280 | |
| 2281 | - $user_tz_string = get_pref('USER_TIMEZONE', $_SESSION['uid']); |
|
| 2282 | - $orig_ts = strtotime(substr($k, 1)); |
|
| 2283 | - $k = date("Y-m-d", convert_timestamp($orig_ts, $user_tz_string, 'UTC')); |
|
| 2281 | + $user_tz_string = get_pref('USER_TIMEZONE', $_SESSION['uid']); |
|
| 2282 | + $orig_ts = strtotime(substr($k, 1)); |
|
| 2283 | + $k = date("Y-m-d", convert_timestamp($orig_ts, $user_tz_string, 'UTC')); |
|
| 2284 | 2284 | |
| 2285 | - //$k = date("Y-m-d", strtotime(substr($k, 1))); |
|
| 2285 | + //$k = date("Y-m-d", strtotime(substr($k, 1))); |
|
| 2286 | 2286 | |
| 2287 | - array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')"); |
|
| 2288 | - } else { |
|
| 2287 | + array_push($query_keywords, "(".SUBSTRING_FOR_DATE."(updated,1,LENGTH('$k')) $not = '$k')"); |
|
| 2288 | + } else { |
|
| 2289 | 2289 | |
| 2290 | - if (DB_TYPE == "pgsql") { |
|
| 2291 | - $k = mb_strtolower($k); |
|
| 2292 | - array_push($search_query_leftover, $not ? "!$k" : $k); |
|
| 2293 | - } else { |
|
| 2294 | - array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2290 | + if (DB_TYPE == "pgsql") { |
|
| 2291 | + $k = mb_strtolower($k); |
|
| 2292 | + array_push($search_query_leftover, $not ? "!$k" : $k); |
|
| 2293 | + } else { |
|
| 2294 | + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER(".$pdo->quote("%$k%").") |
|
| 2295 | 2295 | OR UPPER(ttrss_entries.content) $not LIKE UPPER(".$pdo->quote("%$k%")."))"); |
| 2296 | - } |
|
| 2297 | - |
|
| 2298 | - if (!$not) array_push($search_words, $k); |
|
| 2299 | 2296 | } |
| 2297 | + |
|
| 2298 | + if (!$not) array_push($search_words, $k); |
|
| 2299 | + } |
|
| 2300 | 2300 | } |
| 2301 | 2301 | } |
| 2302 | 2302 | |