| |
$popular Most Popular Links";
echo " > Home > Popular Links ";
$sql_rqst="SELECT * FROM links WHERE approved='yes' ORDER BY clicks DESC LIMIT 0,".$popular;
}
else if($list_type=="date_added")
{
echo "$new Newest Links ";
echo " > Home > Newest Links ";
$sql_rqst="SELECT * FROM links WHERE approved='yes' ORDER BY id DESC LIMIT 0,".$new;
}
else
{
$catcont=$_GET["catcont"];
$formcatcont=$_GET["catcont"];
$sub_id=$catcont;
$trail_idarray="";
$trail_namearray="";
$trail_count=0;
$list_type="norm";
while($sub_id != 0)
{
$trail_result = MySQLQuery("SELECT * FROM links_cat WHERE id=$sub_id", $QueryError_Email,$QueryError_Browser);
while($trail_row = mysql_fetch_array($trail_result))
{
$desc=$trail_row["dsc"];
if($trail_count==0) {$add_ok=$trail_row["cadd"];}
if($trail_count > 0)
{
$trail_idarray.=",";
$trail_namearray.=",";
}
$trail_idarray.=$trail_row["id"];
$trail_namearray.=$trail_row["name"];
$sub_id=$trail_row["sub_cat"];
if($trail_count==0){$cat_name=$trail_row["name"];}
$trail_count=$trail_count+1;
}
}
$trail_idcheck=preg_split('/,/',$trail_idarray);
$trail_namecheck=preg_split('/,/',$trail_namearray);
$trail_run=sizeof($trail_idcheck);
$trail=" > Home";
while($trail_run > 0)
{
$trail_run=$trail_run-1;
$cur_id=$trail_idcheck[$trail_run];
$cur_name=$trail_namecheck[$trail_run];
if($trail_run==0)
{
$trail.=" > ".$cur_name."";
}
else
{
$trail.=" > ".$cur_name."";
}
}
$trail.=" ";
echo $trail;
// chande from $desc to $title
echo "$title ";
$result = MySQLQuery("SELECT id,sub_cat,name FROM links_cat WHERE sub_cat=$catcont ORDER BY name ASC", $QueryError_Email,$QueryError_Browser);
if(mysql_num_rows($result))
{
echo "";
while($row=mysql_fetch_array($result))
{
$id=$row["id"];
$name=$row["name"];
$link_count = MySQLQuery("SELECT * FROM links WHERE catcont='".$id."' AND approved='yes' ORDER BY name ASC", $QueryError_Email,$QueryError_Browser);
$link_count=mysql_num_rows($link_count);
if ($col=="") {
echo " \n";
$col="x";
}else{
if ($col=="x") {
echo " \n";
$col="y";
}else{
echo " \n";
$col="";
}
}
}
echo " ";
}
if(!isset($start)){$start = 0;}
$sql_rqst="SELECT * FROM links WHERE catcont=".$_GET["catcont"]." AND approved='yes' ORDER BY ".$list_by." ".$list_order." LIMIT ".$start.",".$category;
$page_result = MySQLQuery("SELECT * FROM links WHERE catcont=$catcont",$QueryError_Email,$QueryError_Browser);
$previous_page=$start - $category;
$next_page=$start + $category;
$numrows=mysql_num_rows($page_result);
if(($start > 0) || ($numrows > ($start + $category))){echo "";}
if($start > 0){echo "[ < < Previous ]\n";}
if($numrows > ($start + $category)){echo "[ Next > > ]\n";}
if(($start > 0) || ($numrows > ($start + $category))){echo " ";}
}
$result = MySQLQuery($sql_rqst,$QueryError_Email,$QueryError_Browser);
while($row = mysql_fetch_array($result))
{
$id=$row["id"];
$name=$row["name"];
$clicks=$row["clicks"];
$approved=$row["approved"];
$url=$row["url"];
$dsc=$row["dsc"];
$date_added=$row["date_added"];
$year = substr($date_added, 0, 4);
$month = substr($date_added, 5, 2);
$day = substr($date_added, 8, 2);
$date_added=date($display_format,mktime("00","00","00",$month,$day,$year));
$image=$row["image"];
$rating=$row["rating"];
$rates=$row["rates"];
if($image_enabled=="yes" && $image)
{
$image=" ";
}
else
{
$image="";
}
if($rates=="" || $rates=="0")
{
$rate_stat="Not rated";
}
else
{
$rating=$rating / $rates;
$rating=round($rating,1);
if ($rating >= 9) {$ratepic="";}
else if ($rating >= 7) {$ratepic="-";}
else if ($rating >= 5) {$ratepic="--";}
else if ($rating >= 3) {$ratepic="---";}
else if ($rating >= 1) {$ratepic="----";}
$rate_stat=$rating. "(" .$ratepic. ")";
}
if($clicks==""){$clicks="0";}
if($new_window=="yes")
{
$onclick="";
}
else
{
$onclick="";
}
?> >
|";}
if($show_date=="yes"){echo " Added: $date_added |";}
if($show_clicks=="yes"){echo " Total Clicks: $clicks |";}
if($show_rating=="yes"){echo " Rating: $rate_stat | Rate This Website |";}
if($show_deadlink=="yes"){echo " Notify of Dead Link |";}
if($show_date=="yes" || $show_clicks=="yes" || $show_rating=="yes" || $show_deadlink=="yes"){echo "";}
?>
0) || ($numrows > ($start + $category))){echo "";}
if($start > 0){echo "[ < < Previous ]\n";}
if($numrows > ($start + $category)){echo "[ Next > > ]\n";}
if(($start > 0) || ($numrows > ($start + $category))){echo " ";}
if ($add_ok =="y")
{
echo "[ Add a Link - Editor Controlled - ] ";
}
}
}
else if($ax=="out")
{
$result = MySQLQuery("SELECT id,url,clicks FROM links WHERE id=".$_GET["id"],$QueryError_Email,$QueryError_Browser);
while($row = mysql_fetch_array($result))
{
$id=$row["id"];
$url=$row["url"];
$clicks=$row["clicks"];
$clicks=$clicks+1;
$up_clicks = MySQLQuery("UPDATE links SET clicks='$clicks' WHERE id='$id'",$QueryError_Email,$QueryError_Browser);
ob_end_clean();
header("Location: ".$url);
}
}
else if($ax=="deadlink")
{
if($_POST["v"]=="y")
{
$result = MySQLQuery("SELECT id,name,url FROM links WHERE id=".$_POST["r_id"]."",$QueryError_Email,$QueryError_Browser);
while($row = mysql_fetch_array($result))
{
$id=$row["id"];
$url=$row["url"];
$name=$row["name"];
if(getenv(HTTP_X_FORWARDED_FOR)){$user_ip=getenv(HTTP_X_FORWARDED_FOR);}else{$user_ip=getenv(REMOTE_ADDR);}
$message="$name\n$url\nis being reported as a dead link in the links directory at $site_title.\n\nThe report was sent from $user_ip";
mail("$admin_mail","Dead Link Report from $site_title","$message","From: $admin_mail");
echo "Thank You ";
echo " > Home > Report Dead Link ";
echo "You have reported "$name" linked to $url as being a dead link in our directory. ";
echo "This message has been sent to the web site administrator, thank you for your help. ";
}
}
else
{
$result = MySQLQuery("SELECT id,name,url FROM links WHERE id=".$_GET["id"]."",$QueryError_Email,$QueryError_Browser);
while($row = mysql_fetch_array($result))
{
$id=$row["id"];
$url=$row["url"];
$name=$row["name"];
echo "Are You Sure? ";
echo " > Home > Are You Sure? ";
echo "Are you sure you want to report $name as being a dead link? You can try once more by clicking here (which will try to load the page once more in a new window). ";
echo "
";
}
}
}
else if($ax=="addrate")
{
$id=$_GET["id"];
$catcont=$_GET["catcont"];
$new_rating=$_POST["rating"];
$list_type=$_GET["l"];
$result = MySQLQuery("SELECT id,rating,rates FROM links WHERE id=$id;",$QueryError_Email,$QueryError_Browser);
while($row = mysql_fetch_array($result))
{
$rating=$row["rating"];
$rating=$rating + $new_rating;
$rates=$row["rates"];
$rates=$rates + 1;
$up_clicks = MySQLQuery("UPDATE links SET rating='$rating',rates='$rates' WHERE id='$id'",$QueryError_Email,$QueryError_Browser);
echo "Thanks for your input \n";
echo " > Home > Rating ";
echo "Your rating has been added, thank you. \n";
}
if($list_type=="norm")
{
$sub_result = MySQLQuery("SELECT id,sub_cat FROM links_cat WHERE id=".$catcont."",$QueryError_Email,$QueryError_Browser);
while($sub_row = mysql_fetch_array($sub_result))
{
$id=$sub_row["id"];
$subcat=$sub_row["sub_cat"];
if($subcat==0){$subcat=$id;}
echo "To return to the page you were at, click here. \n";
}
}
else if($list_type=="s")
{
echo "To return to the page you were at, click here. \n";
}
else
{
echo "To return to the page you were at, click here. \n";
}
}
//////////////////
// Search Function
//////////////////
else if ($ax=="search")
{
header("Location: indexs.htm");
}
///////////////////////////
// Add and Insert Functions
///////////////////////////
else if($ax=="add")
{
$catcont=$_GET["catcont"];
$date_added=date($date_format);
$result=MySQLQuery("select * from links_cat where id=$catcont order by name",$QueryError_Email,$QueryError_Browser);
while($row=mysql_fetch_array($result))
{
$catcont=$row["id"];
$cat_name=$row["name"];
}
?> Add a Link >
> ">Home
> Add a Link All Fields are required for link submission.
If the wrong category was chosen for your listing, browse to the category you
wish to add your listing to, and click the "Add a link" link in that
category. The Link Was Added";
echo "Home > Add a Link > Link Added ";
if($admin_approved=="no")
{
echo "Your link request has been sent to the site administrator for approval. ";
echo "An email has also been sent to you regarding your login information should you choose to edit your listing in the future. ";
}
else
{
echo "Your link has been added to the directory. ";
echo "An email has also been sent to you regarding your login information should you choose to edit your listing in the future. ";
}
}
else
{
echo "Home > Add a Link > Error Adding Link
Error Adding Link ";
}
}
//////////////////////////////
// Login and Editing Functions
//////////////////////////////
else if($ax=="login")
{
?> Edit Your Listing > ">Home
> Edit Login Edit a Link > ">Home
> ">Edit Login
> Edit No Records Found";
echo "No web site listing can be found with that URL, email address or password. ";
echo "Click here to get login info for all websites listed to your email address sent to you. ";
}
}
else if($ax=="update")
{
$catcont=$_POST["catcont"];
$name=$_POST["name"];
$dsc=$_POST["dsc"];
$url=$_POST["url"];
$email=$_POST["email"];
$password=$_POST["password"];
$image=$_POST["image"];
$result=MySQLQuery("update links set catcont='$catcont', name='$name', dsc='$dsc', url='$url', email='$email', password='$password', image='$image' where id=$id",$QueryError_Email,$QueryError_Browser);
if ($result)
{
mail($admin_mail, "Link was modified at ".$site_title."", "The link ".$name." has been modified at ".$site_title."", "From: ".$admin_mail);
if ($email && $password)
{
mail($email, "Link modified at ".$site_title."", "Your link has been modified.\n\nThanks for keeping it up to date.", "From: ".$noreply_mail);
}
echo "The Link Was Updated ";
echo "Home > Edit Login > Edit > $name Updated ";
echo "Your link update has been changed and the site administrator has been notified of the change. ";
echo "Your listing will remain in the directory during this time. ";
}
else
{
echo "Error Updating Link ";
}
}
//////////////////////////////
// Password Reminder Functions
//////////////////////////////
else if($ax=="remind")
{
?> Get Your Login Information This
will email you the login information for all URL's that have been submitted by
the requested email address Email SentYour Login Information has been sent to $email. ";
}
else
{
echo "No Records Found Sorry, no records were found registered to $email. ";
}
}
//////////////////
// Main Front Page
//////////////////
else
{
header("Location: index.htm");
}
?> |
|
|