// log Time $startTime = microtime(true); include 'include/db.php'; include 'include/db_func.php'; include 'include/functions.php'; //include 'include/tracking.php'; // * PAGES DISPLAYED - VAR * $pages_limit = 10; // * LISTINGS PER PAGE - VAR * $listings_per_page = 10; $title ='DNXE - Data Network Exchange - Search the Web'; include("templates/dnxev2/header.php"); ?>
DNXE
Data Network Exchange
$pg=intval($_GET['pg']);
if ($pg <1){
$pg=1;
}
$start = ($pg-1) * $listings_per_page;
// SELECT RESULTS IF QUERY STRING IS GREATER THAN 3 CHARACTERS
if (strlen(addslashes($_GET['search']))>3){
// search in the titles
$query = "SELECT 1 AS val,
com.domain AS domain, com.popularity AS popularity, extensions.extension AS ext, pages.content as content, pages.title AS title
FROM com, extensions, pages WHERE
pages.domain=com.id AND com.extension=extensions.id ";
$searchTerms = explode(" ", trim($_GET['search']));
for ($i=0; $i "; // * TOTAL PAGES - VAR * $total_pages = ceil(sizeof($res) / $listings_per_page); $total_pages =10; // * START PAGE - VAR * $start_page = floor($pg / $pages_limit) * $pages_limit + 1; // * LAST PAGE - VAR * if ( $start_page + $pages_limit >= $total_pages) $last_page = $total_pages; else $last_page = $start_page + $pages_limit-1; for ($i=0; $i<(($pg-1)*$listings_per_page); $i++){ unset($res[$i]); } $i=0; foreach($res AS $row){ echo "0) echo " title='".$row['title']."' "; echo "'>".$row['domain'].$row['ext']; if (strlen($row['title'])>0) echo " - ".substr($row['title'],0, 60); if (strlen($row['title'])>60) echo "..."; echo " "; echo substr(strip_tags ($row['content']),0, 100)." "; if ($i==9) break; $i++; } //Previous 20 if ($start_page > 1) { ?> << Prev echo $pages_limit; ?> }else{ ?> << Prev echo $pages_limit; ?> } ?> | // Previous Page if ($pg > 1) { ?> < Prev }else{ ?> < Prev } ?> | for ($i=$start_page; $i<=$last_page; $i++){ if ($pg == $i){ ?> echo $i; ?> }else{ ?> echo $i; ?> } } ?> | // Next Page if ($pg < $total_pages) { ?> Next > }else{ ?> Next > } ?> | //Next 20 if ($last_page < $total_pages) { ?> Next echo $pages_limit; ?> >> }else{ ?> Next echo $pages_limit; ?> >> } ?> }else{ echo "No results found"; } ?> |