\n"; $date_search = (Search_Engine::get_param('datelimit') != 0 ? ' AND download_datestamp>='.(TIME - Search_Engine::get_param('datelimit')) : ''); if (Search_Engine::get_param('stype') == 'downloads' || Search_Engine::get_param('stype') == 'all') { $sort_by = [ 'datestamp' => "download_datestamp", 'subject' => "download_title", 'author' => "download_user", ]; $order_by = [ '0' => ' DESC', '1' => ' ASC', ]; $sortby = !empty(Search_Engine::get_param('sort')) ? "ORDER BY ".$sort_by[Search_Engine::get_param('sort')].$order_by[Search_Engine::get_param('order')] : ''; $limit = (Search_Engine::get_param('stype') != "all" ? " LIMIT ".Search_Engine::get_param('rowstart').",10" : ''); switch (Search_Engine::get_param('fields')) { case 2: Search_Engine::search_column('download_title', 'downloads'); Search_Engine::search_column('download_description', 'downloads'); Search_Engine::search_column('download_user', 'downloads'); break; case 1: Search_Engine::search_column('download_description', 'downloads'); Search_Engine::search_column('download_title', 'downloads'); break; default: Search_Engine::search_column('download_title', 'downloads'); } if (!empty(Search_Engine::get_param('search_param'))) { $query = "SELECT td.*,tdc.* FROM ".DB_DOWNLOADS." td INNER JOIN ".DB_DOWNLOAD_CATS." tdc ON td.download_cat=tdc.download_cat_id ".(multilang_table("DL") ? "WHERE ".in_group('tdc.download_cat_language', LANGUAGE)." AND " : "WHERE ") .groupaccess('download_visibility')." AND ".Search_Engine::search_conditions('downloads').$date_search; $result = dbquery($query, Search_Engine::get_param('search_param')); $rows = dbrows($result); } else { $rows = 0; } if ($rows != 0) { $item_count = "".$rows." ".($rows == 1 ? $locale['d401'] : $locale['d402'])." ".$locale['522']."
\n"; $result = dbquery("SELECT td.*, tdc.*, user_id, user_name, user_status, user_avatar, user_joined, user_level FROM ".DB_DOWNLOADS." td INNER JOIN ".DB_DOWNLOAD_CATS." tdc ON td.download_cat=tdc.download_cat_id LEFT JOIN ".DB_USERS." tu ON td.download_user=tu.user_id ".(multilang_table("DL") ? "WHERE ".in_group('tdc.download_cat_language', LANGUAGE)." AND " : "WHERE ").groupaccess('td.download_visibility')." AND ".Search_Engine::search_conditions('downloads').$date_search.$sortby.$limit, Search_Engine::get_param('search_param')); $search_result = ''; while ($data = dbarray($result)) { $timeoffset = timezone_offset_get(timezone_open($settings['timeoffset']), new \DateTime()); if ($data['download_datestamp'] + 604800 > time() + ($timeoffset * 3600)) { $new = " ".$locale['d403'].""; } else { $new = ""; } $text_all = $data['download_description']; $text_all = Search_Engine::search_striphtmlbbcodes($text_all); $text_frag = Search_Engine::search_textfrag($text_all); // $subj_c = Search_Engine::search_stringscount($data['download_title']); // $text_c = Search_Engine::search_stringscount($data['download_description']); $context = ''; if ($text_frag != "") { $context .= "
".$text_frag."

"; } $meta = "".$locale['d404']." ".$data['download_license']." |\n"; $meta .= "".$locale['d405']." ".$data['download_os']." |\n"; $meta .= "".$locale['d406']." ".$data['download_version']."
\n"; $meta .= "".$locale['global_070'].profile_link($data['user_id'], $data['user_name'], $data['user_status'])."\n"; $meta .= "".$locale['d407']." ".showdate("%d.%m.%y", $data['download_datestamp'])." |\n"; $meta .= "".$locale['d408']." ".$data['download_count'].""; $search_result .= strtr(Search::render_search_item(), [ '{%item_url%}' => DOWNLOADS."downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id'], '{%item_image%}' => "", '{%item_title%}' => $data['download_title'].' - '.$data['download_filesize'].' '.$new, '{%item_description%}' => $meta, '{%item_search_criteria%}' => '', '{%item_search_context%}' => $context ] ); } // Pass strings for theme developers $formatted_result = strtr(Search::render_search_item_wrapper(), [ '{%image%}' => "".$locale[", '{%icon_class%}' => "fa fa-cloud-download fa-lg fa-fw", '{%search_title%}' => $locale['d400'], '{%search_result%}' => $item_count, '{%search_content%}' => $search_result ]); } Search_Engine::search_navigation($rows); Search_Engine::search_globalarray($formatted_result); Search_Engine::append_item_count($item_count); } }