Location: PHPKode > scripts > Linker IMG > linker-img/manage/set_search.php
<?php

//=====================================
// LINKER Category Engine
//=====================================
// Filename : set_search.php
// Path  : Manage directory
// last update : 2002/07/13
// Desc : User search configuration
//=====================================

//=====================================
// File include part
//=====================================

include ("./authen.php");
include ("../function/search_info.php");
include ("../function/emphasis_info.php");
include ("../$Slang/m_common.php"); 

//======================================
// User input form parts
//======================================

if (!$switch) { 


// make select box
switch ($c_order) 
{
    case "ASC" : $order1="selected";	break;
    case "DESC": $order2="selected";	break;
    default: $order1="selected";
}

switch ($c_sort) 
{
    case "title": $sort1="selected";	break;
    case "url": $sort2="selected";	break;
    case "name": $sort3="selected";	break;
    case "email": $sort4="selected";	break;
    case "scont": $sort5="selected";	break;
    case "count": $sort6="selected";	break;
    case "uptime": $sort8="selected";	break;
    case "user1": $sort9="selected";	break;
    case "user2": $sort10="selected";	break;
    case "user3": $sort11="selected";	break;
    case "user4": $sort12="selected";	break;
    case "user5": $sort13="selected";	break;
    default: $sort1="selected";
}

switch ($c_sep) 
{
    case "and": $septer1 = "selected";	break;
    case "or": $septer2 = "selected";	break;
    default:$septer1 = "selected";
}

//======================================
// Print form
//======================================

print <<<EOF

<html>
<head>
<LINK rel='stylesheet' type='text/css' href='./linker.css'>
<meta http-equiv='Content-Type' content='text/html; charset=$Scharset'>
</head>

<body bgcolor="#E9E9E9">

<div align='left'>
<form action='set_search.php' method='post' name='myform'>
<input type="hidden" name="switch" value="save1">


<table border=0 cellpadding=0 cellspacing=1>
<tr>
<td colspan=2>

	<table width="100%" border="1"><tr><td bgcolor="#000066" align="center">
	<b><font color="white" size="2">$l_config_search</font></b>
	</td></tr></table>

</td>	</tr>

<tr><td colspan=2 width=500>&nbsp;</td></tr>


<tr>
<td height='20' colspan='2'  bgcolor='#E0E0E0'>&nbsp;<font  size='2'><b>$l_emphasis</b></font></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_pre_tag</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='text' name='highpre' size=15 value="$c_highpre">
<font size=2>$l_nopermit_extra</font></td>
</tr>


<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_next_tag</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='text' name='highnext' size=15 value="$c_highnext">
<font size=2>$l_nopermit_extra</font></td>
</tr>

<tr bgcolor='#E0E0E0'>
<td colspan='2' align=center>
<input type='submit' value=' $l_submit ' class=cinput>
<input type='reset' value=' $l_reset ' class=cinput></td>
</tr>
</form>

<tr><td colspan=2>&nbsp;</td></tr>

<form action='set_search.php' method='post' name='myform'>
<input type="hidden" name="switch" value="save2">

<tr>
<td height='20' colspan='2' bgcolor='#E0E0E0'>&nbsp;<font  size='2'><b>$l_search_base</b></font></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_title</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='title' $c_title> </td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_source</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='url' $c_url></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_name</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='name' $c_url></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_email</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox'  name='email' $c_email></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_scont</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='scont' $c_scont></td>
</tr>


<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_review</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox'  name='lcont' $c_lcont></td>
</tr>

<tr>
<td height='20' colspan='2' bgcolor='#E0E0E0'>&nbsp;<font  size='2'><b>$l_search_userfiled</b></font></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;USER1</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='user1' $c_user1></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;USER2</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='user2' $c_user2></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;USER3</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='user3' $c_user3></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;USER4</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='user4' $c_user4></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;USER5</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='checkbox' name='user5' $c_user5></td>
</tr>

<tr>
<td height='20' colspan='2' bgcolor='#E0E0E0'>&nbsp;<font  size='2'><b>$l_sort_order</b></font></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_search_type</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<font size=2><select name="sep">
<option $septer1>and</option>
<option $septer2>or</option>
</select></font></td>

</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_page_num</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<input type='text' class=input  name='pagenum' value='$c_pagenum' size='5'></td>
</tr>

<tr>
<td width='150' bgcolor='#F6F6F6'><font size='2'>&nbsp;$l_sort</font></td>
<td width='350' bgcolor='#F6F6F6'>&nbsp;<font size=2><select name="sort">
<option value='title' $sort1>$l_title</option>
<option value='url' $sort2>URL</option>
<option value='name' $sort3>$l_name</option>
<option value='email' $sort4>$l_email</option>
<option value='scont' $sort5>$l_scont</option>
<option value='count' $sort6>$l_count</option>
<option value='uptime' $sort8>$l_uptime</option>
<option value='user1' $sort9>USER1</option>
<option value='user2' $sort10>USER2</option>
<option value='user3' $sort11>USER3</option>
<option value='user4' $sort12>USER4</option>
<option value='user5' $sort13>USER5</option>
</select>


<select name="order">
<option value='ASC' $order1>$l_asc_order</option>
<option value='DESC' $order2>$l_desc_order</option>
</select></font>

</td>
</tr>

<tr bgcolor='#E0E0E0'>
<td colspan='2' align=center>
<input type='submit' value=' $l_submit ' class=cinput>
<input type='reset' value=' $l_reset ' class=cinput></td>
</tr>
</table></div></form>

</body>
</html>   
EOF;

}


//======================================
// Write emphasis_info.php
//======================================


if ($switch=="save1") {

$config = <<<EOF

<?

\$c_highpre = "$highpre";
\$c_highnext = "$highnext";


?>
EOF;

$fp=fopen("../function/emphasis_info.php",w);
fputs($fp,$config);
fclose($fp);
echo("<meta http-equiv='refresh' content='0; url=set_search.php'>");


}
if ($switch=="save2") {


if ($title) $title = "checked";
if ($url) $url = "checked";
if ($name) $name = "checked";
if ($email) $email = "checked";
if ($scont) $scont = "checked";
if ($lcont) $lcont = "checked";
if ($user1) $user1 = "checked";
if ($user2) $user2 = "checked";
if ($user3) $user3 = "checked";
if ($user4) $user4 = "checked";
if ($user5) $user5 = "checked";

//======================================
// Write set_search.php
//======================================

$config = <<<EOF

<?

\$c_title = "$title";
\$c_url = "$url"; 
\$c_name = "$name"; 
\$c_email = "$email"; 
\$c_scont = "$scont";
\$c_lcont =  "$lcont";
\$c_user1 = "$user1";
\$c_user2 = "$user2";
\$c_user3 = "$user3";
\$c_user4 = "$user4";
\$c_user5 = "$user5";
\$c_sep = "$sep";
\$c_pagenum = "$pagenum";
\$c_sort = "$sort";
\$c_order = "$order";

?>
EOF;


$fp=fopen("../function/search_info.php",w);
fputs($fp,$config);
fclose($fp);
echo("<meta http-equiv='refresh' content='0; url=set_search.php'>");
}

?>
Return current item: Linker IMG