%include:header%>
function highlight($x,$var) {//$x is the string, $var is the text to be highlighted
if ($var != "") {
$xtemp = "";
$i=0;
while($i";
$i += strlen($var);
}
else {
$xtemp .= $x{$i};
$i++;
}
}
$x = $xtemp;
}
return $x;
}
if (!$search_in)
$search_in = "link_name";
?>
include 'leaderboard.php'; ?>
This advanced file search is brand new and still in beta, many features will be added to it over the coming week, if you have any suggestions please let us know!
If you're looking for adult software & games, click here. We don't allow adult/mature content on <%insert_title%>
if (!$keyword){
echo "Please type in a keyword to begin your search.";
} else {
if (strlen($keyword) < 3){
echo "Your search must be atleast 3 characters.";
} else {
$limit=20; // rows to return
if (!$offset)
$offset = 0;
$goodcounter = $offset + 1;
if ($type)
$type = "AND cust1 = '$type'";
include 'subcats_catmap.php';
$numrows = mysql_num_rows(mysql_query("SELECT link_name, link_desc, inl_links.link_id, cust1, cust7, link_rating, link_votes, link_hits, cat_id FROM inl_links LEFT JOIN inl_custom ON inl_links.link_cust=inl_custom.cust_id LEFT JOIN inl_lc ON inl_links.link_id=inl_lc.link_id where $search_in like '%$keyword%' $type $catdrop group by link_name order by link_name"));
if ($numrows < 1) {
echo "no results, try again";
}
else {
$sqlquery = "SELECT link_name, link_desc, inl_links.link_id, cust1, cust7, link_rating, link_votes, link_hits, cat_id FROM inl_links LEFT JOIN inl_custom ON inl_links.link_cust=inl_custom.cust_id LEFT JOIN inl_lc ON inl_links.link_id=inl_lc.link_id where $search_in like '%$keyword%' $type $catdrop group by link_name order by link_name ASC LIMIT $offset,$limit";
$result = mysql_query($sqlquery);
$numcounter = ($offset + $limit);
if ($numcounter > $numrows)
{
$numcounter = $numrows;
}
$pages=intval($numrows/$limit);
if ($numrows%$limit){
$pages++;}
$pagenumber = ($offset / $limit) + 1;
$middle = ($offset + $limit) - 9;
?>
| |
Product |
License |
User Rating |
Votes |
Downloads |
$i = 0;
while ($row = mysql_fetch_array($result)) {
$id = mysql_result($result,$i,"link_id");
$pulledcat = mysql_result($result,$i,"cat_id");
$product = mysql_result($result,$i,"link_name");
$desc = mysql_result($result,$i,"link_desc");
$fproduct = ereg_replace(' ','_',$product);
$fproduct = ereg_replace('\'','',$fproduct);
if ($highlight == 'true') {
$product = highlight($product, "$keyword");
$desc = highlight($desc, "$keyword");
}
$version = mysql_result($result,$i,"cust7");
$license = mysql_result($result,$i,"cust1");
$rating = mysql_result($result,$i,"link_rating");
$votes = mysql_result($result,$i,"link_votes");
$downloads = mysql_result($result,$i,"link_hits");
$rating = number_format($rating,2);
if ($rating == '0.00')
$rating = "Not Rated";
else
$rating = "$rating/5.00";
$count = $i + $goodcounter;
?>
| =$count?>. |
=$product?> =$version?> if ($aff){ ?>EDITOR'S PICK } ?> |
=$license?> |
=$rating?> |
=$votes?> |
=$downloads?> |
 |
| =$desc?> |
$i++; }?>
}}} ?>
|
<%include:footer%>