include('config.php') ?>
0) {
$ret = mysql_result($result, 0, "copy");
return $ret;
}
else {
return $result;
}
}
function decodecat($input)
{
global $cat_link_table_name, $db_name;
$submit = "select category from $cat_link_table_name where id = '$input'";
$result = mysql_db_query($db_name,$submit);
$row = mysql_fetch_array($result);
$cat_list_item = $row['category'];
return $cat_list_item;
}
$db = mysql_connect($db_server,$db_user,$db_password);
mysql_select_db($db_name,$db);
#############################################################
#############################################################
#############################################################
if (isset($lnk))
{
$ok = htmlid(33);
echo stripslashes($ok);
$ok = decodecat($lnk);
echo "
$ok |
";
$db = mysql_connect($db_server,$db_user,$db_password);
mysql_select_db($db_name,$db);
$submit = "select * from $link_table_name where category = '$lnk' order by URL,sort";
$result = mysql_db_query($db_name,$submit);
while ($row = mysql_fetch_array($result))
{
if (substr($row['URL'],0,4) != "http") $URL = "http://".$row['URL'];
else $URL = $row['URL'];
echo "
| $row[title] - $row[description] |
";
}
echo "
Add Your Link
";
$ok = htmlid(34);
echo stripslashes($ok);
$skip = "Y";
}
#############################################################
#############################################################
#############################################################
elseif (isset($store))
{
if ($URL == "http://" || $URL == "")
{
$nc = 1;
$error = "You forgot to enter the URL of the link.
";
}
if (!$title)
{
$nc = 1;
$error .= "You forgot to choose a title for the link.
";
}
if (!$category)
{
$nc = 1;
$error .= "You forgot to choose a category for the link.
";
}
if (!$email)
{
$nc = 1;
$error .= "You forgot to enter your email address.
";
}
if (!$rec_link)
{
$nc = 1;
$error .= "You forgot to enter your reciprocal link.
";
}
if ($nc)
{
$ok = htmlid(33);
echo stripslashes($ok);
echo "
$error
Please use your browser back key and enter the proper information.
";
$skip = "yes";
$footer = get_config("link_foot",$site);
$ok = htmlid($footer);
echo stripslashes($ok);
}
else
{
$description = addslashes($description);
$URL = trim($URL);
$dacat = decodecat($category);
$link_list = "NEW LINK:\n\nURL: $URL\nCategory: $dacat\nDescription: $description\n\nEmail: $email\n\nReciprocal link: $rec_link";
$submit = "INSERT LOW_PRIORITY INTO $link_table_name SET title = '$title', URL = '$URL', description = '$description', category = '$category', active='', rec_link= '$rec_link'";
$result = mysql_db_query($db_name,$submit);
if ($result)
{
$add_text = "
We Have Added Your Link
";
mail($email_recip, "Automatic Link Submission", $link_list, "From: $email\nReply-To: $email");
}
else
{
$add_text = "
Sorry, your link can't be added at this time.
";
mail($email_recip, "Failure: Automatic Link Submission", "FAILURE!!\n\n".$link_list, "From: $email\nReply-To: $email");
}
}
}
#############################################################
#############################################################
#############################################################
elseif(isset($add))
{
$ok = htmlid(33);
echo stripslashes($ok);
$ok = htmlid(35);
echo "
";
$ok = htmlid(34);
echo stripslashes($ok);
$skip = "Y";
}
#############################################################
#############################################################
#############################################################
if (!isset($skip))
{
$item_in_row = 0;
$ok = htmlid(33);
echo stripslashes($ok);
if(isset($add_text))echo $add_text;
echo " Links |
";
$db = mysql_connect($db_server,$db_user,$db_password);
mysql_select_db($db_name,$db);
$submit = "select * from $cat_link_table_name where active = '1' order by sort,category";
$result = mysql_db_query($db_name,$submit);
while($row = mysql_fetch_array($result)) {
echo "| ";
echo "$row[category] |
";
}
echo "
Add Your Link |
";
$ok = htmlid(34);
echo stripslashes($ok);
}
?>