e=$module_name\">
"._VOTE4THISSITE."

"._HTMLCODE3."

<form method=\"post\" action=\"$nukeurl/modules.php?name=$module_name\">
<table align=\"center\" border=\"0\" width=\"175\" cellspacing=\"0\" cellpadding=\"0\">
<tr><td align=\"center\"><b>"._VOTE4THISSITE."</b></a></td></tr>
<tr><td>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr><td valign=\"top\">
<select name=\"rating\">
<option selected>--</option>
<option>10</option>
<option>9</option>
<option>8</option>
<option>7</option>
<option>6</option>
<option>5</option>
<option>4</option>
<option>3</option>
<option>2</option>
<option>1</option>
</select>
</td><td valign=\"top\">
<input type=\"hidden\" name=\"ratinglid\" value=\"$lid\">
<input type=\"hidden\" name=\"ratinguser\" value=\"outside\">
<input type=\"hidden\" name=\"d_op\" value=\"addrating\">
<input type=\"submit\" value=\""._DOWNLOADVOTE."\">
</td></tr></table>
</td></tr></table>
</form>


"._PROMOTE05."

- $sitename "._STAFF."

"; CloseTable(); include("footer.php"); } function brokendownload($lid) { global $prefix, $db, $user, $cookie, $module_name; include("header.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } menu(1); echo "
"; ns_mod_title2("report_broken",""._REPORTBROKEN.""); OpenTable(); OpenTable2(); echo "
"; echo "
"; echo ""; echo "
"._THANKSBROKEN."
"._SECURITYBROKEN."

"; echo ""; echo ""; echo "
"; CloseTable2(); CloseTable(); include("footer.php"); } function brokendownloadS($lid, $modifysubmitter) { global $prefix, $db, $user, $anonymous, $cookie, $module_name; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } $db->sql_query("insert into ".$prefix."_downloads_modrequest values (NULL, $lid, 0, 0, '', '', '', '$ratinguser', 1, '$auth_name', '$email', '$filesize', '$version', '$homepage', '$ns_compat', 'ns_des_img')"); include("header.php"); menu(1); echo "
"; ns_mod_title2("report_broken",""._REPORTBROKEN.""); OpenTable(); OpenTable2(); echo "
"._THANKSFORINFO."

"._LOOKTOREQUEST."

"; echo "[
"._DOWNLOADSMAIN." ] "; echo "- "._GOBACK2."

"; CloseTable2(); CloseTable(); include("footer.php"); } function modifydownloadrequest($lid) { global $prefix, $db, $user, $module_name; $result = $db->sql_query("SELECT ns_dl_des_img, ns_dl_mod, ns_dl_mod_anon, ns_dl_allow_html, ns_dl_affiliate_links, ns_dl_add_email, ns_dl_add_filesize, ns_dl_add_compat from ".$prefix."_ns_downloads"); list($ns_dl_des_img, $ns_dl_mod, $ns_dl_mod_anon, $ns_dl_allow_html, $ns_dl_affiliate_links, $ns_dl_add_email, $ns_dl_add_filesize, $ns_dl_add_compat) = $db->sql_fetchrow($result); if ($ns_dl_mod != 1) { Header("Location: modules.php?name=$module_name"); die(); } include("header.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } menu(1); if ($ns_dl_mod_anon == 0 && $ratinguser=="$anonymous") { echo "
"; ns_mod_title2("modify_request",""._MODIFYDL.""); OpenTable(); OpenTable2(); echo "

"._DONLYREGUSERSMODIFY.""; echo "

"._GOBACK."

"; CloseTable2(); CloseTable(); include("footer.php"); die(); } echo "
"; ns_mod_title2("modify_request",""._MODIFYDL.""); OpenTable(); $result = $db->sql_query("select cid, title, url, description, name, email, filesize, version, homepage, ns_compat, ns_des_img from ".$prefix."_downloads_downloads where lid='$lid'"); echo "
"._REQUESTDOWNLOADMOD."

"; while(list($cid, $title, $url, $description, $auth_name, $email, $filesize, $version, $homepage, $ns_compat, $ns_des_img) = $db->sql_fetchrow($result)) { $cid = intval($cid); $filesize = intval($filesize); $title = stripslashes($title); $description = stripslashes($description); echo "
"; echo ""; echo ""; echo ""; echo ""; $result2=$db->sql_query("select cid, title from ".$prefix."_downloads_categories order by title"); echo ""; echo ""; echo ""; echo ""; if ($ns_dl_des_img == 1) { echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"._DOWNLOADID.": $lid
"._DOWNLOADNAME.": "; echo ""._NSDLREQUIRED.""; echo "
"._FILEURL.": "; echo ""._NSDLREQUIRED.""; echo "
"._CATEGORY.": "; echo ""._NSDLREQUIRED.""; echo "
"._LDESCRIPTION." "; echo ""._NSDLREQUIRED.""; echo "
"; if ($ns_dl_allow_html == 1) { echo "
"._HTMLISFINE.""; } else { echo "
"._HTMLOFF.""; } echo "
"._NSDESIMAGE.":"; echo "
"._AUTHORNAME.":"; echo "
"._AUTHOREMAIL.": "; if ($ns_dl_add_email == 1) { echo ""._NSDLREQUIRED.""; } echo "
"._NSCOMPAT.": "; if ($ns_dl_add_compat == 1) { echo ""._NSDLREQUIRED.""; } echo "
"._FILESIZE.": "; if ($ns_dl_add_filesize == 1) { echo ""._NSDLREQUIRED." "; } echo "
"; echo "("._INBYTES.")
"._VERSION.":"; echo "
"._HOMEPAGE.":"; echo "
 
"; echo "
"; } CloseTable(); include("footer.php"); } function modifydownloadrequestS($lid, $cat, $title, $url, $description, $modifysubmitter, $auth_name, $email, $filesize, $version, $homepage, $ns_compat, $ns_des_img) { global $prefix, $db, $user, $module_name; $result_mr = $db->sql_query("SELECT ns_dl_mod, ns_dl_mod_anon from ".$prefix."_ns_downloads"); list($ns_dl_mod, $ns_dl_mod_anon) = $db->sql_fetchrow($result_mr); if ($ns_dl_mod != 1) { Header("Location: modules.php?name=$module_name"); die(); } if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } $blocknow = 0; if ($ns_dl_mod_anon != 1 && (!is_user($user))) { $blocknow = 1; include("header.php"); menu(1); echo "
"; ns_mod_title2("modify_request",""._MODIFYDL.""); OpenTable(); OpenTable2(); echo "

"._DONLYREGUSERSMODIFY.""; echo "

"._GOBACK."

"; CloseTable2(); CloseTable(); include("footer.php"); die(); } include("ns_error.php"); if ($blocknow != 1) { $cat = explode("-", $cat); $cat[1] = intval($cat[1]); if ($cat[1]=="") { $cat[1] = 0; } $title = stripslashes(FixQuotes($title)); $url = stripslashes(FixQuotes($url)); // If no http:// is in front of URL, then it is auto added - NukeStyles if (strtolower(substr($url,0,7)) != "http://") { $url = "http://" . $url; } $description = stripslashes(FixQuotes($description)); // If no HTML allowed, then it gets stripped from Description with Fran's nohtml code - NukeStyles if ($ns_dl_allow_html == 0) { $description = FixQuotes(filter_text($description, "nohtml")); } $auth_name = stripslashes(FixQuotes($auth_name)); $email = stripslashes(FixQuotes($email)); $filesize = ereg_replace("\.","",$filesize); $filesize = ereg_replace("\,","",$filesize); $filesize = intval($filesize); $homepage = stripslashes(FixQuotes($homepage)); // If no http:// is in front of Homepage URL, then it is auto added - NukeStyles if ($homepage != "") { if (strtolower(substr($homepage,0,7)) != "http://") { $homepage = "http://". $homepage; } } $db->sql_query("insert into ".$prefix."_downloads_modrequest values (NULL, $lid, $cat[0], $cat[1], '$title', '$url', '$description', '$ratinguser', 0, '$auth_name', '$email', '$filesize', '$version', '$homepage', '$ns_compat', '$ns_des_img')"); include("header.php"); menu(1); echo "
"; echo "
"; ns_mod_title2("modify_submit",""._NSDLMODSUBMIT.""); OpenTable(); OpenTable2(); echo "
"._THANKSFORINFO2."
"; echo "
"._LOOKTOREQUEST."


"; echo "[
"._DOWNLOADSMAIN." ]"; echo "

"; CloseTable2(); CloseTable(); include ("footer.php"); } } function rateinfo($lid) { global $prefix, $db; $db->sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid='$lid'"); $result = $db->sql_query("select url from ".$prefix."_downloads_downloads where lid='$lid'"); list($url) = $db->sql_fetchrow($result); Header("Location: $url"); } function addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments) { global $prefix, $db, $cookie, $user, $module_name, $ns_dl_anon_wait_days, $ns_dl_outside_wait_days, $sitename; $result_gi = $db->sql_query("SELECT ns_dl_anon_wait_days, ns_dl_outside_wait_days from ".$prefix."_ns_downloads"); list($ns_dl_anon_wait_days, $ns_dl_outside_wait_days) = $db->sql_fetchrow($result_gi); $passtest = "yes"; include("header.php"); 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."_downloads_downloads 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 = getenv("REMOTE_HOST"); if (empty($ip)) { $ip = getenv("REMOTE_ADDR"); } /* Check if Rating is Null */ if ($rating=="--") { ns_mod_title2("rate_error",""._NSDLRERROR.""); OpenTable(); $error = "nullerror"; completevote($error); $passtest = "no"; } /* Check if Download POSTER is voting (UNLESS Anonymous users allowed to post) */ if ($ratinguser != $anonymous && $ratinguser != "outside") { $result=$db->sql_query("select submitter from ".$prefix."_downloads_downloads where lid='$ratinglid'"); while(list($ratinguserDB)=$db->sql_fetchrow($result)) { if ($ratinguserDB==$ratinguser) { ns_mod_title2("rate_error",""._NSDLRERROR.""); OpenTable(); $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."_downloads_votedata where ratinglid='$ratinglid'"); while(list($ratinguserDB)=$db->sql_fetchrow($result)) { if ($ratinguserDB==$ratinguser) { ns_mod_title2("rate_error",""._NSDLRERROR.""); OpenTable(); $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 * $ns_dl_anon_wait_days)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=$db->sql_query("select * FROM ".$prefix."_downloads_votedata WHERE ratinglid='$ratinglid' AND ratinguser='$anonymous' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) < $ns_dl_anon_wait_days"); $anonvotecount = $db->sql_numrows($result); if ($anonvotecount >= 1) { ns_mod_title2("rate_error",""._NSDLRERROR.""); OpenTable(); $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 * $ns_dl_outside_wait_days)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=$db->sql_query("select * FROM ".$prefix."_downloads_votedata WHERE ratinglid='$ratinglid' AND ratinguser='outside' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) < $ns_dl_outside_wait_days"); $outsidevotecount = $db->sql_numrows($result); if ($outsidevotecount >= 1) { ns_mod_title2("rate_error",""._NSDLRERROR.""); OpenTable(); $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."_downloads_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 downloads need to be refreshed with new weight. */ /* Running a SQL statement with your modded calc for ALL downloads will accomplish this. */ $voteresult = $db->sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_downloads_votedata WHERE ratinglid = '$ratinglid'"); $totalvotesDB = $db->sql_numrows($voteresult); $totalvotesDB = intval($totalvotesDB); include ("modules/$module_name/voteinclude.php"); $db->sql_query("UPDATE ".$prefix."_downloads_downloads SET downloadratingsummary=$finalrating,totalvotes=$totalvotesDB,totalcomments=$truecomments WHERE lid = '$ratinglid'"); ns_mod_title2("rate_ok",""._NSDLROK.""); OpenTable(); $error = "none"; completevote($error); echo "
"._THANKSTOTAKETIME." $sitename. "._DLETSDECIDE."


"; if ($ratinguser=="outside") { global $prefix, $db; $result2 = $db->sql_query("select title, url FROM ".$prefix."_downloads_downloads where lid='$lid'"); list($title, $url) = $db->sql_fetchrow($result2); $ttitle = ereg_replace (" ", "_", $title); echo "
".WEAPPREACIATE." $sitename!
"._RETURNTO."$ttitle


"; } } completevotefooter($ratinglid, $ttitle, $ratinguser); include("footer.php"); } function completevoteheader(){ menu(1); echo "
"; } function completevotefooter($lid, $ttitle, $ratinguser) { global $prefix, $db, $module_name, $sitename, $ns_details, $ns_comments, $ns_editorial; $ns_details = 1; $ns_comments = 1; $ns_editorial = 1; echo "
"; downloadinfomenu($lid,$ttitle); echo "

"; CloseTable(); } function completevote($error) { global $prefix, $db, $module_name; $result_i = $db->sql_query("SELECT ns_dl_anon_wait_days, ns_dl_outside_wait_days from ".$prefix."_ns_downloads"); list($ns_dl_anon_wait_days, $ns_dl_outside_wait_days) = $db->sql_fetchrow($result_i); if ($error == "none") { echo "
"._COMPLETEVOTE1."
"; } if ($error == "anonflood") { echo "
"._COMPLETEVOTE2." $ns_dl_anon_wait_days "; if ($ns_dl_anon_wait_days != 1) { echo ""._COMPLETEVOTE22.""; } else { echo ""._COMPLETEVOTE23.""; } echo "

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

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

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

"; } if ($error == "outsideflood") { echo "
"._COMPLETEVOTE6." $ns_dl_outside_wait_days "; if ($ns_dl_outside_wait_days != 1) { echo ""._COMPLETEVOTE22.""; } else { echo ""._COMPLETEVOTE23.""; } echo "

"; } } function ratedownload($lid, $user, $ttitle) { global $prefix, $db, $cookie, $datetime, $module_name, $ns_theme; include("header.php"); menu(1); echo "
"; ns_mod_title2("rate_download",""._NSDLRATEDL.""); OpenTable(); $transfertitle = ereg_replace ("_", " ", $ttitle); $displaytitle = $transfertitle; $ip = getenv("REMOTE_HOST"); if (empty($ip)) { $ip = getenv("REMOTE_ADDR"); } OpenTable2(); echo "
$displaytitle
"; CloseTable2(); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); echo ""; cookiedecode($user); $auth_name = $cookie[1]; } else { echo ""; echo ""; echo ""; $auth_name = "$anonymous"; } echo "
"._RATENOTE1."
"._RATENOTE2."
"._RATENOTE3."
"._RATENOTE4." "._NDDLTOPDL.".
"._RATENOTE5."
"._YOUAREREGGED."
"._YOUARENOTREGGED."
"._IFYOUWEREREG."
"._WHYNOTREGISTER."
"; echo "
" .""; } else { echo""; } echo "
" ."" ."" ."" .""._RATEDL."
" ."

"; echo ""; echo "

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


" ."
"; echo "
"; downloadfooterchild($lid); echo "
"; CloseTable(); include("footer.php"); } function CoolSize($size) { $mb = 1024*1024; if ( $size > $mb ) { $mysize = sprintf ("%01.2f",$size/$mb) . " MB"; } elseif ( $size >= 1024 ) { $mysize = sprintf ("%01.2f",$size/1024) . " Kb"; } else { $mysize = $size . " bytes"; } return $mysize; } if (isset($ratinglid) && isset ($ratinguser) && isset ($rating)) { $ret = addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments); } switch($d_op) { case "menu": menu($maindownload); break; case "AddDownload": AddDownload(); break; case "NewDownloads": NewDownloads($newdownloadshowdays); break; case "NewDownloadsDate": NewDownloadsDate($selectdate); break; case "CoolSize": CoolSize($size); break; case "TopRated": TopRated($ratenum, $ratetype); break; case "MostPopular": MostPopular($ratenum, $ratetype); break; case "viewdownload": viewdownload($cid, $min, $orderby, $show); break; /* case "viewsdownload": viewsdownload($sid, $min, $orderby, $show); break; */ case "brokendownload": brokendownload($lid); break; case "modifydownloadrequest": modifydownloadrequest($lid); break; case "modifydownloadrequestS": modifydownloadrequestS($lid, $cat, $title, $url, $description, $modifysubmitter, $auth_name, $email, $filesize, $version, $homepage, $ns_compat, $ns_des_img); break; case "brokendownloadS": brokendownloadS($lid, $modifysubmitter); break; case "getit": getit($lid); break; case "Add": Add($title, $url, $auth_name, $cat, $description, $email, $filesize, $version, $homepage, $ns_compat, $ns_des_img); break; case "search": search($query, $min, $orderby, $show); break; case "rateinfo": rateinfo($lid, $user, $title); break; case "ratedownload": ratedownload($lid, $user, $ttitle); break; case "addrating": addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments, $user); break; case "viewdownloadcomments": viewdownloadcomments($lid, $ttitle); break; case "outsidedownloadsetup": outsidedownloadsetup($lid); break; case "viewdownloadeditorial": viewdownloadeditorial($lid, $ttitle); break; case "viewdownloaddetails": viewdownloaddetails($lid, $ttitle); break; default: index(); break; } ?>