<commit_before><?
   
require( "/www/freshports.org/_private/commonlogin.php3");
require( "/www/freshports.org/_private/getvalues.php3");
?>

<head>
<meta name="description" content="freshports - new ports, applications">
<meta name="keywords" content="FreeBSD, index, applications, ports">  
<!--// DVL Software is a New Zealand company specializing in database applications. //-->
<title>freshports - search</title>
</head>

<body bgcolor="#ffffff" link="#0000cc">

<html>
<body>
<? include("/www/freshports.org/_private/header.inc") ?>
<table width="100%">
<tr><td valign="top" td colspan="2">
OK, we have just a very simple search.  Eventually this will be extended. If you find any bugs, please
let <a href="http://freshports.org/phorum/list.php?f=3">me know</a>.
</td></tr>
<tr><td valign="top" width="100%">                    
<table width="100%" border="0">                       
  <tr>                                                
    <td colspan="2" bgcolor="#AD0040" height="30"><font color="#FFFFFF" size="+2">freshports - search</font></td>
  </tr>
<tr><td>
<?
if ($search) {
/*
   while (list($name, $value) = each($HTTP_POST_VARS)) {
      echo "$name = $value<br>\n";
   }

   echo "you submitted<br>\n";
*/

   echo "</td></tr>\n<tr><td>";

$sql = "select ports.id, ports.name as port, ports.last_update as updated, " .
       "categories.name as category, categories.id as category_id, ports.version as version, ".
       "ports.committer, ports.last_update_description as update_description, " .
       "ports.maintainer, ports.short_description, ".
       "ports.package_exists, ports.extract_suffix, ports.needs_refresh, ports.homepage, ports.status " .
       "from ports, categories  ".
       "WHERE ports.system = 'FreeBSD' ".
       "and ports.primary_category_id = categories.id ";

switch ($stype) {
   case "name":
      $sql .= "and ports.name like '%$query%'";
      break;

   case "text":
      $sql .= "and ports.short_description like '%$query%' or ports.long_description like '%$query%'";
      break;

   case "maintainer":
      $sql .= "and ports.maintainer like '%$query%'";
      break;

   case "requires":
      $sql .= "and (ports.depends_build like '%$query%' or ports.depends_run like '%$query%')";
      break;
}

$sql .= " order by ports.name";

//echo "$sql<br>\n";


$result = mysql_query($sql, $db); 
$NumRows = mysql_num_rows($result);

}
?>
<form METHOD="POST" ACTION="<? echo $PHP_SELF ?>">
  <p>Search for: <input NAME="query" size="20"  value="<? echo $query?>"> <select NAME="stype" size="1">
    <option VALUE="name"      <? if ($stype == "name")       echo 'selected'?>>Port Name</option>
    <option VALUE="text"      <? if ($stype == "text")       echo 'selected'?>>Description</option>
    <option VALUE="maintainer"<? if ($stype == "maintainer") echo 'selected'?>>Maintainer</option>
    <option VALUE="requires"  <? if ($stype == "requires")   echo 'selected'?>>Requires</option>
  </select> <input TYPE="submit" VALUE="search"> </p>
  <input type="hidden" name="search" value="1">
</form>

</td></tr><commit_msg>remove search on description until we get it right. Modified Files: 	search.php3<commit_after><?
   
require( "/www/freshports.org/_private/commonlogin.php3");
require( "/www/freshports.org/_private/getvalues.php3");

?>

<head>
<meta name="description" content="freshports - new ports, applications">
<meta name="keywords" content="FreeBSD, index, applications, ports">  
<!--// DVL Software is a New Zealand company specializing in database applications. //-->
<title>freshports - search</title>
</head>

<body bgcolor="#ffffff" link="#0000cc">

<html>
<body>
<? include("/www/freshports.org/_private/header.inc") ?>
<table width="100%">
<tr><td valign="top" td colspan="2">
OK, we have just a very simple search.  Eventually this will be extended. If you find any bugs, please
let <a href="http://freshports.org/phorum/list.php?f=3">me know</a>.
</td></tr>
<tr><td valign="top" width="100%">                    
<table width="100%" border="0">                       
  <tr>                                                
    <td colspan="2" bgcolor="#AD0040" height="30"><font color="#FFFFFF" size="+2">freshports - search</font></td>
  </tr>
<tr><td>
<?
if ($search) {
/*
   while (list($name, $value) = each($HTTP_POST_VARS)) {
      echo "$name = $value<br>\n";
   }

   echo "you submitted<br>\n";
*/

   echo "</td></tr>\n<tr><td>";

$sql = "select ports.id, ports.name as port, ports.last_update as updated, " .
       "categories.name as category, categories.id as category_id, ports.version as version, ".
       "ports.committer, ports.last_update_description as update_description, " .
       "ports.maintainer, ports.short_description, ".
       "ports.package_exists, ports.extract_suffix, ports.needs_refresh, ports.homepage, ports.status " .
       "from ports, categories  ".
       "WHERE ports.system = 'FreeBSD' ".
       "and ports.primary_category_id = categories.id ";

switch ($stype) {
   case "name":
      $sql .= "and ports.name like '%$query%'";
      break;

/*
   case "text":
      $sql .= "and ports.short_description like '%$query%' or ports.long_description like '%$query%'";
      break;
*/
   case "maintainer":
      $sql .= "and ports.maintainer like '%$query%'";
      break;

   case "requires":
      $sql .= "and (ports.depends_build like '%$query%' or ports.depends_run like '%$query%')";
      break;
}

$sql .= " order by ports.name";

//echo "$sql<br>\n";


$result = mysql_query($sql, $db); 
$NumRows = mysql_num_rows($result);

}
?>
<form METHOD="POST" ACTION="<? echo $PHP_SELF ?>">
  <p>Search for: <input NAME="query" size="20"  value="<? echo $query?>"> <select NAME="stype" size="1">
    <option VALUE="name"      <? if ($stype == "name")       echo 'selected'?>>Port Name</option>
    <option VALUE="maintainer"<? if ($stype == "maintainer") echo 'selected'?>>Maintainer</option>
    <option VALUE="requires"  <? if ($stype == "requires")   echo 'selected'?>>Requires</option>
  </select> <input TYPE="submit" VALUE="search"> </p>
  <input type="hidden" name="search" value="1">
</form>

</td></tr>
{'fraction_non_alphanumeric': 0.19064689587746456, 'fraction_numerical': 0.009939709956004562, 'mean_word_length': 3.4285714285714284, 'pattern_counts': {'":': 8, '<': 126, '<?xml version=': 0, '>': 126, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7020182', 'n_tokens_mistral': 2083, 'n_tokens_neox': 1972, 'n_words': 493}