From 00db603073685770bb17c59ce65a7f49a3236329 Mon Sep 17 00:00:00 2001 From: Luis Mas Date: Mon, 16 May 2016 12:38:24 +0200 Subject: [PATCH] Add search in file extension --- wp-downloadmanager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-downloadmanager.php b/wp-downloadmanager.php index 8c54d26..abf493e 100644 --- a/wp-downloadmanager.php +++ b/wp-downloadmanager.php @@ -511,7 +511,7 @@ function downloads_page($category_id = 0) { if(!empty($search)) { $search_words_array = explode(' ', $search_word); foreach($search_words_array as $search_word_array) { - $search_sql .= " AND ((file_name LIKE('%$search_word_array%') OR file_des LIKE ('%$search_word_array%')))"; + $search_sql .= " AND ((file_name LIKE('%$search_word_array%') OR file_des LIKE ('%$search_word_array%') OR file LIKE ('%$search_word_array%')))"; } } // Calculate Categories And Total Stats @@ -637,7 +637,7 @@ function downloads_page($category_id = 0) { $template_download_listing = str_replace("%FILE_ID%", $file->file_id, $template_download_listing); $template_download_listing = str_replace("%FILE%", stripslashes($file->file), $template_download_listing); $template_download_listing = str_replace("%FILE_NAME%", download_search_highlight($search, stripslashes($file->file_name)), $template_download_listing); - $template_download_listing = str_replace("%FILE_EXT%", file_extension(stripslashes($file->file)), $template_download_listing); + $template_download_listing = str_replace("%FILE_EXT%", download_search_highlight($search, file_extension(stripslashes($file->file))), $template_download_listing); $template_download_listing = str_replace("%FILE_ICON%", file_extension_image(stripslashes($file->file), $file_extensions_images), $template_download_listing); $template_download_listing = str_replace("%FILE_DESCRIPTION%", download_search_highlight($search, stripslashes($file->file_des)), $template_download_listing); $template_download_listing = str_replace("%FILE_SIZE%", format_filesize($file->file_size), $template_download_listing);