Example #1
0
        case "alphabetical":
            $query['ORDER BY'] = $db->escape($_GET['search_in']);
            break;
        case "alphabetical_reversed":
            $query['ORDER BY'] = $db->escape($_GET['search_in']) . " DESC";
            break;
        case "newest_first":
            $query['ORDER BY'] = 'id DESC';
            break;
        case "oldest_first":
            $query['ORDER BY'] = 'id ASC';
            break;
    }
    // Search query
    $start_limit = $settings['number_of_search_results_per_page'] * ($req_page - 1);
    ($hook = get_hook('search_before_sql')) ? eval($hook) : null;
    $query_limit = $query;
    $query_limit['LIMIT'] = $start_limit . ", " . $settings['number_of_search_results_per_page'];
    ($hook = get_hook('search_sql')) ? eval($hook) : null;
    //for both $sql_string_limit and $search_results
    $sql_string_limit = $db->query_build($query_limit) or error("Couldn't run the search query sql_string_num", __FILE__, __LINE__);
    $search_results = $db->query_build($query) or error("Couldn't run the search query", __FILE__, __LINE__);
    ($hook = get_hook('search_after_sql')) ? eval($hook) : null;
    //link_pagination() cannot be used, since it relies on the $settings['number_of_links_per_page'] setting
    $num_rows = $db->num_rows($search_results);
    $num_pages = ceil($num_rows / $settings['number_of_search_results_per_page']);
    $pagination = paginate($num_pages, $req_page, openld_link('search_page', se_search($_GET)));
}
$page = 'search.php';
($hook = get_hook('search_before_page')) ? eval($hook) : null;
require "footer.php";
Example #2
0
        ?>
						<?php 
        ($hook = get_hook('search_result_rows_footer')) ? eval($hook) : null;
        ?>
					</td>
				</tr>
				<?php 
    }
    ?>
				<?php 
    ($hook = get_hook('search_results_tbody_footer')) ? eval($hook) : null;
    ?>
			</tbody>
		</table>
		<?php 
    echo link_pagination($search_results, $req_page, 'search_page', se_search($_GET));
    ?>
	</div>
</div>
<?php 
} elseif (isset($_GET['term']) && $db->num_rows($search_results) == 0) {
    ?>
<div class="openld-block openld-form">
	<h2>
		<span>
			<?php 
    echo SERCHED_FOR_LABEL;
    ?>
 "<?php 
    echo openld_htmlspecialchars($_GET['term']);
    ?>