otes($url)); $description = stripslashes(FixQuotes($description)); $db->sql_query("insert into ".$prefix."_links_modrequest values (NULL, $lid, $cat[0], $cat[1], '$title', '$url', '$description', '$ratinguser', 0)"); include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._THANKSFORINFO." "._LOOKTOREQUEST."
"; CloseTable(); include("footer.php"); } } // ###################################################################### // SWITCHBOARD // ###################################################################### switch($l_op) { case "menu": menu($mainlink); break; case "AddLink": AddLink(); break; case "NewLinks": require_once("new.php"); NewLinks($newlinkshowdays); break; case "NewLinksDate": require_once("new.php"); NewLinksDate($selectdate); break; case "TopRated": require_once("top.php"); TopRated($ratenum, $ratetype); break; case "MostPopular": require_once("pop.php"); MostPopular($ratenum, $ratetype); break; case "RandomLink": RandomLink(); break; case "viewlink": require_once("view.php"); viewlink($cid, $min, $orderby, $show); break; case "brokenlink": brokenlink($lid); break; case "modifylinkrequest": modifylinkrequest($lid); break; case "modifylinkrequestS": modifylinkrequestS($lid, $cat, $title, $url, $description, $modifysubmitter); break; case "brokenlinkS": brokenlinkS($lid,$cid, $title, $url, $description, $modifysubmitter); break; case "visit": visit($lid); break; case "Add": Add($title, $url, $auth_name, $cat, $description, $email); break; case "search": require_once("search.php"); search($query, $min, $orderby, $show); break; case "rateinfo": rateinfo($lid, $user, $title); break; case "ratelink": ratelink($lid, $user, $ttitle); break; case "addrating": addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments, $user); break; case "viewlinkcomments": require_once("comments.php"); viewlinkcomments($lid, $ttitle); break; case "outsidelinksetup": require_once("outside.php"); outsidelinksetup($lid); break; case "viewlinkeditorial": require_once("editorial.php"); viewlinkeditorial($lid, $ttitle); break; case "viewlinkdetails": require_once("details.php"); viewlinkdetails($lid, $ttitle); break; default: index(); break; } ?>ire_once("modules/Web_Links/l_config.php"); $index = $viewrightblocks; // Fluffy's Scanner if (!function_exists('ac_Get_Title_From_Page')) { function getpagetitle($file, $bytes) { $filename = @fopen("$file", "r"); $data = @fread($filename, $bytes); @fclose($filename); preg_match_all ("/ (.*?)/i", $data, $remotetitle); $ptitle = $remotetitle[1][0]; return $ptitle; } } // // ###################################################################### // FUNCTIONS :: START // ###################################################################### // ###################################################################### // FUNCTION : switchColor($color) // ###################################################################### function switchColor($color) { global $bgcolor1; if ($color == $bgcolor1) { $outColor = $bgcolor1; } else { $outColor = $bgcolor1; } return $outColor; } // ###################################################################### // FUNCTION : getparent($parentid,$title) // ###################################################################### function getparent($parentid,$title) { global $prefix, $db; $result = $db->sql_query("select cid, title, parentid from ".$prefix."_links_categories where cid=$parentid order by title "); list($cid, $ptitle, $pparentid) = $db->sql_fetchrow($result); if ($ptitle!="") $title=$ptitle."/".$title; if ($pparentid!=0) { $title=getparent($pparentid,$ptitle); } return $title; } // ###################################################################### // FUNCTION : getparentlink($parentid,$title) // ###################################################################### function getparentlink($parentid,$title) { global $prefix, $db; $result=$db->sql_query("select cid, title, parentid from ".$prefix."_links_categories where cid=$parentid"); list($cid, $ptitle, $pparentid) = $db->sql_fetchrow($result); if ($ptitle!="") $title="$ptitle/".$title; if ($pparentid!=0) { $title=getparentlink($pparentid,$ptitle); } return $title; } // ###################################################################### // FUNCTION : menu($mainlink) // ###################################################################### function menu($mainlink) { global $module_name; OpenTable(); echo "
" ."
" ."
"; echo "[ "; if ($mainlink>0) { echo ""._LINKSMAIN." | "; } echo ""._ADDLINK."" ." | "._NEW."" ." | "._POPULAR."" ." | "._TOPRATED."" ." | "._RANDOM." ]" .""; CloseTable(); } // ###################################################################### // FUNCTION : SearchForm() // ###################################################################### function SearchForm() { echo "
" ."" ."" ."
" ."
"; } // ###################################################################### // FUNCTION : linkinfomenu($lid, $ttitle) // ###################################################################### function linkinfomenu($lid, $ttitle) { global $module_name, $user; $ttitle = stripslashes($ttitle); echo "
[ " .""._LINKCOMMENTS."" ." | "._ADDITIONALDET."" ." | "._EDITORREVIEW."" ." | "._MODIFY.""; if (is_user($user)) { echo " | "._REPORTBROKEN.""; } echo " ]"; } // ###################################################################### // FUNCTION : index() // ###################################################################### function index() { global $prefix, $db, $bgcolor1, $bgcolor3, $user, $admin, $db, $show_links_num, $show_links_info, $show_links_inum, $admin_file; include("header.php"); title("$sitename: "._WEBLINKS.""); $mainlink = 0; menu($mainlink); echo "
"; OpenTable(); echo "
"._LINKSMAINCAT."

"; echo ""; $result = $db->sql_query("select cid, title, cdescription from ".$prefix."_links_categories where parentid=0 order by title"); $count = 0; while(list($cid, $title, $cdescription) = $db->sql_fetchrow($result)) { if ($show_links_num == 1) { $cnumrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_links WHERE cid='$cid'")); $cnumm = " ($cnumrows)"; } else { $cnumm = ""; } if ($cnumrows > 0) { $folder = "modules/Web_Links/images/openfolder.gif"; } else { $folder = "modules/Web_Links/images/closedfolder.gif"; } if (is_admin($admin)) { $folderImg = ""; } else { $folderImg = ""; } echo ""; $dum = 1; } $count++; if ($count==2) { echo ""; $count = 0; $dum = 0; } } if ($dum == 1) { echo "
$folderImg $title$cnumm"; categorynewlinkgraphic($cid); if ($cdescription) { echo "
$cdescription
"; } else { echo "
"; } $result2 = $db->sql_query("select cid, title from ".$prefix."_links_categories where parentid=$cid order by title"); $space = 0; while(list($cid, $stitle) = $db->sql_fetchrow($result2)) { if ($space>0) { echo "
"; } if ($show_links_num == 1) { $cnumrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_links_links WHERE cid='$cid'")); $cnum = " ($cnumrows2)"; } else { $cnumrows2 = ""; } echo "$stitle$cnum"; $space++; } if ($count
????
"; } elseif ($dum == 0) { echo " "; } $result=$db->sql_query("select * from ".$prefix."_links_links"); $numrows = $db->sql_numrows($result); $result=$db->sql_query("select * from ".$prefix."_links_categories"); $catnum = $db->sql_numrows($result); echo "

"._THEREARE." $numrows "._LINKS." "._AND." $catnum "._CATEGORIES." "._INDB."
"; CloseTable(); if ($show_links_info == 1) { echo "
"; OpenTable(); echo "" ."" ."" ."
"; // OpenTable2(); echo "
"._NEWLINKS."
"; // CloseTable2(); echo "
"; // OpenTable2(); echo "
"._MOSTPOPULAR." $show_links_inum
"; // CloseTable2(); echo "
"; OpenTable2(); $content = ""; $content .= ""; $color = $bgcolor3; $sql = "SELECT lid, title, hits FROM ".$prefix."_links_links ORDER BY date DESC LIMIT 0, $show_links_inum"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row[title]); $color = switchColor($color); $content .= ""; $content .= ""; } echo "$content
$title2 $row[hits]
"; CloseTable2(); echo "[ "._NEWLINKS." ]
"; OpenTable2(); $content = ""; $content .= ""; $color = $bgcolor3; $sql = "SELECT lid, title, hits FROM ".$prefix."_links_links ORDER BY hits DESC LIMIT 0, $show_links_inum"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $title2 = ereg_replace("_", " ", $row[title]); $color = switchColor($color); $content .= ""; $content .= ""; } echo "$content
$title2 $row[hits]
"; CloseTable2(); echo "[ "._MOSTPOPULAR." "._LINKS." ]
"; CloseTable(); } include("footer.php"); } // ###################################################################### // FUNCTION : AddLink() // ###################################################################### function AddLink() { // Fluffy's Scanner (+ , $url, $cookie) global $prefix, $db, $user, $links_anonaddlinklock, $url, $cookie; // include("header.php"); title("$sitename: "._WEBLINKS.""); $mainlink = 1; menu(1); // Fluffy's Scanner if ($url != "") { $meta = get_meta_tags($url); $pdescription = $meta['description']; $ptitle = getpagetitle($url, 2048); } $result = $db->sql_query("SELECT user_email FROM ".$prefix."_users WHERE username='$cookie[1]'"); list($umail) = $db->sql_fetchrow($result); // echo "
"; OpenTable(); echo "
"._ADDALINK."


"; if (is_user($user) || $links_anonaddlinklock == 1) { /* 06-24-01 Bug fix : changed $links_anonaddlinklock != 1 to $links_anonaddlinklock == 1 */ // Fluffy's Scanner CloseTable(); OpenTable(); echo "
" . _SCANURL . "

" ."" . _SCANURLINFO . "" ."
" .""._PAGEURL.":

" ."


" .""; CloseTable(); OpenTable(); // echo ""._INSTRUCTIONS.":
" ."? "._SUBMITONCE."
" ."? "._POSTPENDING."
" ."? "._USERANDIP."
" ."
" // Fluffy's Scanner (+ value=\"$ptitle\") .""._PAGETITLE.":
" // Fluffy's Scanner (replaced 'value=\"http://\"' with 'value=\"$url\"') .""._PAGEURL.":
"; echo ""._CATEGORY.":

" // Fluffy's Scanner (+ $pdescription) .""._LDESCRIPTION."



" // Fluffy's Scanner (+ value=\"$cookie[1]\") .""._YOURNAME.":
" // Fluffy's Scanner (+ value=\"$umail\") .""._YOUREMAIL.":

" ."" ." "._GOBACK."

" ."
"; }else { echo "
"._LINKSNOTUSER1."
" .""._LINKSNOTUSER2."

" .""._LINKSNOTUSER3."
" .""._LINKSNOTUSER4."
" .""._LINKSNOTUSER5."
" .""._LINKSNOTUSER6."
" .""._LINKSNOTUSER7."

" .""._LINKSNOTUSER8.""; } CloseTable(); include("footer.php"); } // ###################################################################### // FUNCTION : Add($title, $url, $auth_name, $cat, $description, $email) // ###################################################################### function Add($title, $url, $auth_name, $cat, $description, $email) { global $prefix, $db, $user; $result = $db->sql_query("select url from ".$prefix."_links_links where url='$url'"); $numrows = $db->sql_numrows($result); if ($numrows>0) { include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._LINKALREADYEXT."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } else { if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $submitter = $cookie[1]; } // Check if Title exist if ($title=="") { include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._LINKNOTITLE."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } // Check if URL exist if ($url=="") { include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._LINKNOURL."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } // Check if Description exist if ($description=="") { include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._LINKNODESC."

" .""._GOBACK.""; CloseTable(); include("footer.php"); } $cat = explode("-", $cat); if ($cat[1]=="") { $cat[1] = 0; } $title = stripslashes(check_html(FixQuotes($title, "nohtml"))); $url = stripslashes(check_html($url, "nohtml")); $description = stripslashes(check_html(FixQuotes($description, "html"))); $auth_name = stripslashes(check_html($auth_name, "nohtml")); $email = stripslashes(check_html($email, "nohtml")); $db->sql_query("insert into ".$prefix."_links_newlink values (NULL, '$cat[0]', '$cat[1]', '$title', '$url', '$description', '$auth_name', '$email', '$submitter')"); include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._LINKRECEIVED."
"; if ($email != "") { echo _EMAILWHENADD; } else { echo _CHECKFORIT; } CloseTable(); include("footer.php"); } } // ###################################################################### // FUNCTION : RandomLink() // ###################################################################### function RandomLink() { global $prefix, $db; $result = $db->sql_query("select * from ".$prefix."_links_links"); $numrows = $db->sql_numrows($result); if ($numrows == 1) { $random = 1; } else { srand((double)microtime()*1000000); $random = rand(1,$numrows); } $result2 = $db->sql_query("select url from ".$prefix."_links_links where lid='$random'"); list($url) = $db->sql_fetchrow($result2); $db->sql_query("update ".$prefix."_links_links set hits=hits+1 where lid=$random"); Header("Location: $url"); } // ###################################################################### // FUNCTION : newlinkgraphic($datetime, $time) // ###################################################################### function newlinkgraphic($datetime, $time) { global $module_name; echo "?"; setlocale (LC_TIME, $locale); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); $startdate = time(); $count = 0; while ($count "; } if ($count1) { echo ""; } if ($count3) { echo ""; } } $count++; $startdate = (time()-(86400 * $count)); } } // ###################################################################### // FUNCTION : categorynewlinkgraphic($cat) // ###################################################################### function categorynewlinkgraphic($cat) { global $prefix, $db, $module_name; $newresult = $db->sql_query("select date from ".$prefix."_links_links where cid=$cat order by date desc limit 1"); list($time)=$db->sql_fetchrow($newresult); echo "?"; setlocale (LC_TIME, $locale); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); $startdate = time(); $count = 0; while ($count "; } if ($count1) { echo ""; } if ($count3) { echo ""; } } $count++; $startdate = (time()-(86400 * $count)); } } // ###################################################################### // FUNCTION : popgraphic($hits) // ###################################################################### function popgraphic($hits) { global $module_name; include("modules/Web_Links/l_config.php"); if ($hits>=$popular) { echo "?"; } } // ###################################################################### // FUNCTION : convertorderbyin($orderby) // ###################################################################### function convertorderbyin($orderby) { if ($orderby == "titleA") $orderby = "title ASC"; if ($orderby == "dateA") $orderby = "date ASC"; if ($orderby == "hitsA") $orderby = "hits ASC"; if ($orderby == "ratingA") $orderby = "linkratingsummary ASC"; if ($orderby == "titleD") $orderby = "title DESC"; if ($orderby == "dateD") $orderby = "date DESC"; if ($orderby == "hitsD") $orderby = "hits DESC"; if ($orderby == "ratingD") $orderby = "linkratingsummary DESC"; return $orderby; } // ###################################################################### // FUNCTION : convertorderbytrans($orderby) // ###################################################################### function convertorderbytrans($orderby) { if ($orderby == "hits ASC") $orderbyTrans = ""._POPULARITY1.""; if ($orderby == "hits DESC") $orderbyTrans = ""._POPULARITY2.""; if ($orderby == "title ASC") $orderbyTrans = ""._TITLEAZ.""; if ($orderby == "title DESC") $orderbyTrans = ""._TITLEZA.""; if ($orderby == "date ASC") $orderbyTrans = ""._DATE1.""; if ($orderby == "date DESC") $orderbyTrans = ""._DATE2.""; if ($orderby == "linkratingsummary ASC") $orderbyTrans = ""._RATING1.""; if ($orderby == "linkratingsummary DESC") $orderbyTrans = ""._RATING2.""; return $orderbyTrans; } // ###################################################################### // FUNCTION : convertorderbyout($orderby) // ###################################################################### function convertorderbyout($orderby) { if ($orderby == "title ASC") $orderby = "titleA"; if ($orderby == "date ASC") $orderby = "dateA"; if ($orderby == "hits ASC") $orderby = "hitsA"; if ($orderby == "linkratingsummary ASC") $orderby = "ratingA"; if ($orderby == "title DESC") $orderby = "titleD"; if ($orderby == "date DESC") $orderby = "dateD"; if ($orderby == "hits DESC") $orderby = "hitsD"; if ($orderby == "linkratingsummary DESC") $orderby = "ratingD"; return $orderby; } // ###################################################################### // FUNCTION : visit($lid) // ###################################################################### function visit($lid) { global $prefix, $db; $db->sql_query("update ".$prefix."_links_links set hits=hits+1 where lid=$lid"); $result = $db->sql_query("select url from ".$prefix."_links_links where lid=$lid"); list($url) = $db->sql_fetchrow($result); Header("Location: $url"); } // ###################################################################### // FUNCTION : detecteditorial($lid, $ttitle) // ###################################################################### function detecteditorial($lid, $ttitle) { global $prefix, $db; $resulted2 = $db->sql_query("select adminid from ".$prefix."_links_editorials where linkid=$lid"); $recordexist = $db->sql_numrows($resulted2); if ($recordexist != 0) { echo " | "._EDITORIAL.""; } } // ###################################################################### // FUNCTION : linkfooter($lid,$ttitle) // ###################################################################### function linkfooter($lid,$ttitle) { $ttitle = stripslashes($ttitle); echo "[ "._VISITTHISSITE." | "._RATETHISSITE." ]

"; linkfooterchild($lid); } // ###################################################################### // FUNCTION : linkfooterchild($lid) // ###################################################################### function linkfooterchild($lid) { include("modules/Web_Links/l_config.php"); if ($useoutsidevoting = 1) { echo "
"._ISTHISYOURSITE." "._ALLOWTORATE.""; } } // ###################################################################### // FUNCTION : completevoteheader() // ###################################################################### function completevoteheader() { menu(1); echo "
"; OpenTable(); } // ###################################################################### // FUNCTION : completevotefooter($lid, $ttitle, $ratinguser) // ###################################################################### function completevotefooter($lid, $ttitle, $ratinguser) { global $prefix, $db; include("modules/Web_Links/l_config.php"); $result=$db->sql_query("select url FROM ".$prefix."_links_links WHERE lid=$lid"); list($url)=$db->sql_fetchrow($result); echo ""._THANKSTOTAKETIME." $sitename. "._LETSDECIDE."


"; if ($ratinguser=="outside") { echo "
".WEAPPREACIATE." $sitename!
"._RETURNTO." $ttitle


"; $result=$db->sql_query("select title FROM ".$prefix."_links_links where lid=$lid"); list($title)=$db->sql_fetchrow($result); $ttitle = ereg_replace (" ", "_", $title); } echo "
"; linkinfomenu($lid,$ttitle); echo "
"; CloseTable(); } // ###################################################################### // FUNCTION : completevote($error) // ###################################################################### function completevote($error) { include("modules/Web_Links/l_config.php"); if ($error == "none") echo "
"._COMPLETEVOTE1."
"; if ($error == "anonflood") echo "
"._COMPLETEVOTE2."

"; if ($error == "regflood") echo "
"._COMPLETEVOTE3."

"; if ($error == "postervote") echo "
"._COMPLETEVOTE4."

"; if ($error == "nullerror") echo "
"._COMPLETEVOTE5."

"; if ($error == "outsideflood") echo "
"._COMPLETEVOTE6."

"; } // ###################################################################### // FUNCTION : addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments) // ###################################################################### function addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments) { global $prefix, $db, $cookie, $user; $passtest = "yes"; include("header.php"); include("modules/Web_Links/l_config.php"); title("$sitename: "._WEBLINKS.""); completevoteheader(); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else if ($ratinguser=="outside") { $ratinguser = "outside"; } else { $ratinguser = "$anonymous"; } $results3 = $db->sql_query("SELECT title FROM ".$prefix."_links_links WHERE lid=$ratinglid"); while(list($title)=$db->sql_fetchrow($results3)) $ttitle = $title; /* Make sure only 1 anonymous from an IP in a single day. */ $ip = $_SERVER["REMOTE_HOST"]; if (empty($ip)) { $ip = $_SERVER["REMOTE_ADDR"]; } /* Check if Rating is Null */ if ($rating=="--") { $error = "nullerror"; completevote($error); $passtest = "no"; } /* Check if Link POSTER is voting (UNLESS Anonymous users allowed to post) */ if ($ratinguser != $anonymous && $ratinguser != "outside") { $result=$db->sql_query("select submitter from ".$prefix."_links_links where lid=$ratinglid"); while(list($ratinguserDB)=$db->sql_fetchrow($result)) { if ($ratinguserDB==$ratinguser) { $error = "postervote"; completevote($error); $passtest = "no"; } } } /* Check if REG user is trying to vote twice. */ if ($ratinguser!=$anonymous && $ratinguser != "outside") { $result=$db->sql_query("select ratinguser from ".$prefix."_links_votedata where ratinglid=$ratinglid"); while(list($ratinguserDB)=$db->sql_fetchrow($result)) { if ($ratinguserDB==$ratinguser) { $error = "regflood"; completevote($error); $passtest = "no"; } } } /* Check if ANONYMOUS user is trying to vote more than once per day. */ if ($ratinguser==$anonymous){ $yesterdaytimestamp = (time()-(86400 * $anonwaitdays)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=$db->sql_query("select * FROM ".$prefix."_links_votedata WHERE ratinglid=$ratinglid AND ratinguser='$anonymous' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) sql_numrows($result); if ($anonvotecount >= 1) { $error = "anonflood"; completevote($error); $passtest = "no"; } } /* Check if OUTSIDE user is trying to vote more than once per day. */ if ($ratinguser=="outside"){ $yesterdaytimestamp = (time()-(86400 * $outsidewaitdays)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=$db->sql_query("select * FROM ".$prefix."_links_votedata WHERE ratinglid=$ratinglid AND ratinguser='outside' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) sql_numrows($result); if ($outsidevotecount >= 1) { $error = "outsideflood"; completevote($error); $passtest = "no"; } } /* Passed Tests */ if ($passtest == "yes") { $comment = stripslashes(FixQuotes($comment)); /* All is well. Add to Line Item Rate to DB. */ $db->sql_query("INSERT into ".$prefix."_links_votedata values (NULL,'$ratinglid', '$ratinguser', '$rating', '$ip', '$ratingcomments', now())"); /* All is well. Calculate Score & Add to Summary (for quick retrieval & sorting) to DB. */ /* NOTE: If weight is modified, ALL links need to be refreshed with new weight. */ /* Running a SQL statement with your modded calc for ALL links will accomplish this. */ $voteresult = $db->sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_links_votedata WHERE ratinglid = $ratinglid"); $totalvotesDB = $db->sql_numrows($voteresult); include ("modules/Web_Links/voteinclude.php"); $db->sql_query("UPDATE ".$prefix."_links_links SET linkratingsummary=$finalrating,totalvotes=$totalvotesDB,totalcomments=$truecomments WHERE lid = $ratinglid"); $error = "none"; completevote($error); } completevotefooter($ratinglid, $ttitle, $ratinguser); include("footer.php"); } // ###################################################################### // FUNCTION : ratelink($lid, $user, $ttitle) // ###################################################################### function ratelink($lid, $user, $ttitle) { include("header.php"); menu(1); echo "
"; OpenTable(); $transfertitle = ereg_replace ("_", " ", $ttitle); $transfertitle = stripslashes($transfertitle); $displaytitle = $transfertitle; global $prefix, $db, $cookie, $datetime; $ip = $_SERVER["REMOTE_HOST"]; if (empty($ip)) { $ip = $_SERVER["REMOTE_ADDR"]; } echo "$displaytitle" ."
    " ."
  • "._RATENOTE1."" ."
  • "._RATENOTE2."" ."
  • "._RATENOTE3."" ."
  • "._RATENOTE4."" ."
  • "._RATENOTE5.""; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); echo "
  • "._YOUAREREGGED."" ."
  • "._FEELFREE2ADD.""; cookiedecode($user); $auth_name = $cookie[1]; } else { echo "
  • "._YOUARENOTREGGED."" ."
  • "._IFYOUWEREREG.""; $auth_name = "$anonymous"; } echo "
" ."
" ."" ."" .""; } else { echo""; } echo "
" ."" ."" ."" .""._RATETHISSITE."" ."" ."" ."

"; if(is_user($user)) { echo ""._SCOMMENTS.":
" ."


" ."
"; echo "
"; linkfooterchild($lid); echo "
"; CloseTable(); include("footer.php"); } if (isset($ratinglid) && isset ($ratinguser) && isset ($rating)) { $ret = addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments); } // ###################################################################### // FUNCTION : rateinfo($lid) // ###################################################################### function rateinfo($lid) { global $prefix, $db; $db->sql_query("update ".$prefix."_links_links set hits=hits+1 where lid=$lid"); $result = $db->sql_query("select url from ".$prefix."_links_links where lid=$lid"); list($url) = $db->sql_fetchrow($result); Header("Location: $url"); } // ###################################################################### // FUNCTION : brokenlink($lid) // ###################################################################### function brokenlink($lid) { global $prefix, $db, $user, $module_name; if (is_user($user)) { include("header.php"); include("modules/Web_Links/l_config.php"); title("$sitename: "._WEBLINKS.""); $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; menu(1); echo "
"; $result = $db->sql_query("select cid, title, url, description from ".$prefix."_links_links where lid=$lid"); list($cid, $title, $url, $description) = $db->sql_fetchrow($result); OpenTable(); echo "
"._REPORTBROKEN."


"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""._THANKSBROKEN."

"; echo "
"; CloseTable(); include("footer.php"); } else { Header("Location: modules.php?name=$module_name"); } } // ###################################################################### // FUNCTION : brokenlinkS($lid,$cid, $title, $url, $description, $modifysubmitter) // ###################################################################### function brokenlinkS($lid,$cid, $title, $url, $description, $modifysubmitter) { global $prefix, $db, $user, $module_name; if (is_user($user)) { include("modules/Web_Links/l_config.php"); $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; $db->sql_query("insert into ".$prefix."_links_modrequest values (NULL, $lid, $cid, 0, '$title', '$url', '$description', '$ratinguser', 1)"); include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._THANKSFORINFO."

"._LOOKTOREQUEST."

"; CloseTable(); include("footer.php"); } else { Hader("Location: modules.php?name=$module_name"); } } // ###################################################################### // FUNCTION : modifylinkrequest($lid) // ###################################################################### function modifylinkrequest($lid) { include("header.php"); include("modules/Web_Links/l_config.php"); title("$sitename: "._WEBLINKS.""); global $prefix, $db, $user; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } menu(1); echo "
"; OpenTable(); $blocknow = 0; if ($blockunregmodify == 1 && $ratinguser=="$anonymous") { echo "

"._ONLYREGUSERSMODIFY."
"; $blocknow = 1; } if ($blocknow != 1) { $result = $db->sql_query("select cid, sid, title, url, description from ".$prefix."_links_links where lid=$lid"); echo "
"._REQUESTLINKMOD."
"; while(list($cid, $sid, $title, $url, $description) = $db->sql_fetchrow($result)) { $title = stripslashes($title); $description = stripslashes($description); echo "
" .""._LINKID.": $lid



" .""._LINKTITLE.":


" .""._URL.":


" .""._DESCRIPTION.":


"; $result2=$db->sql_query("select cid, title from ".$prefix."_links_categories order by title"); echo "" ."" .""._CATEGORY.":

" ."" .""; } } CloseTable(); include("footer.php"); } // ###################################################################### // FUNCTION : modifylinkrequestS($lid, $cat, $title, $url, $description, $modifysubmitter) // ###################################################################### function modifylinkrequestS($lid, $cat, $title, $url, $description, $modifysubmitter) { include("modules/Web_Links/l_config.php"); global $prefix, $db, $user; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } $blocknow = 0; if ($blockunregmodify == 1 && $ratinguser=="$anonymous") { include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); //@RJR-Pwmg@Rncvkpwo@-@Eqratkijv@(e)@VgejIHZ.eqo echo "
"._ONLYREGUSERSMODIFY."
"; $blocknow = 1; CloseTable(); include("footer.php"); } if ($blocknow != 1) { $cat = explode("-", $cat); if ($cat[1]=="") { $cat[1] = 0; } $title = stripslashes(FixQuotes($title)); $url = stripslashes(FixQuotes($url)); $description = stripslashes(FixQuotes($description)); $db->sql_query("insert into ".$prefix."_links_modrequest values (NULL, $lid, $cat[0], $cat[1], '$title', '$url', '$description', '$ratinguser', 0)"); include("header.php"); title("$sitename: "._WEBLINKS.""); menu(1); echo "
"; OpenTable(); echo "
"._THANKSFORINFO." "._LOOKTOREQUEST."
"; CloseTable(); include("footer.php"); } } // ###################################################################### // SWITCHBOARD // ###################################################################### switch($l_op) { case "menu": menu($mainlink); break; case "AddLink": AddLink(); break; case "NewLinks": require_once("new.php"); NewLinks($newlinkshowdays); break; case "NewLinksDate": require_once("new.php"); NewLinksDate($selectdate); break; case "TopRated": require_once("top.php"); TopRated($ratenum, $ratetype); break; case "MostPopular": require_once("pop.php"); MostPopular($ratenum, $ratetype); break; case "RandomLink": RandomLink(); break; case "viewlink": require_once("view.php"); viewlink($cid, $min, $orderby, $show); break; case "brokenlink": brokenlink($lid); break; case "modifylinkrequest": modifylinkrequest($lid); break; case "modifylinkrequestS": modifylinkrequestS($lid, $cat, $title, $url, $description, $modifysubmitter); break; case "brokenlinkS": brokenlinkS($lid,$cid, $title, $url, $description, $modifysubmitter); break; case "visit": visit($lid); break; case "Add": Add($title, $url, $auth_name, $cat, $description, $email); break; case "search": require_once("search.php"); search($query, $min, $orderby, $show); break; case "rateinfo": rateinfo($lid, $user, $title); break; case "ratelink": ratelink($lid, $user, $ttitle); break; case "addrating": addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments, $user); break; case "viewlinkcomments": require_once("comments.php"); viewlinkcomments($lid, $ttitle); break; case "outsidelinksetup": require_once("outside.php"); outsidelinksetup($lid); break; case "viewlinkeditorial": require_once("editorial.php"); viewlinkeditorial($lid, $ttitle); break; case "viewlinkdetails": require_once("details.php"); viewlinkdetails($lid, $ttitle); break; default: index(); break; } ?>