"Koekje7, post: 72427":I have the approval mod that XxBeliaLxX posted for TTv2 [url="http://www.torrenttrader.org/index.php?showtopic=8066&hl=approval+mod"]http://www.torrenttrader.org/index.php?sho...hl=approval+mod[/url]
The problem I have is that the image shows up on unapproved torrents before there approved is there something that can be added to imageflow.php to prevent this ? :lol:
$query = mysql_query ("SELECT * From torrents WHERE image1 ORDER BY id DESC LIMIT 50");
Change to
$query = mysql_query (" SELECT * FROM `torrents` WHERE image1 AND safe = 'yes' ORDER BY id DESC LIMIT 50 "); <?
header("Content-Type: text/plain");
require_once("backend/functions.php");
require_once("languages/english.lang");
dbconn(false);
function sqlwildcardesc($x){
return str_replace(array("%","_"), array("\\%","\\_"), mysql_real_escape_string($x));
}
$searchstr = unesc($_GET["search"]);
$cleansearchstr = searchfield($searchstr);
$char1 = 50; //cut length
$char1 = 50; //cut length
$shortname = CutName(htmlspecialchars($row["name"]), $char1);
if (!$_GET["orderby"])
$orderby = "ORDER BY torrents.id DESC";
else
$orderby = "ORDER BY ".$_GET["orderby"];
$wherea = array();
$wherea[] = "banned != 'yes'";
switch ($_GET["incldead"] ) {
case 1:
break;
case 2:
$wherea[] = "visible = 'no'";
default:
$wherea[] = "visible = 'yes'";
}
if (!$_GET["limit"])
$limit = "LIMIT 3";
else
$limit = "LIMIT {$_GET['limit']}";
if ($_GET["cat"] > 0) {
$wherea[] = "category = " . sqlesc($_GET["cat"]);
}
$wherebase = $wherea;
if (isset($cleansearchstr)) {
$wherea[] = "MATCH (torrents.name) AGAINST ('".mysql_real_escape_string($searchstr)."' IN BOOLEAN MODE)"; }
$where = implode(" AND ", $wherea);
if ($where != "")
$where = "WHERE $where";
$res = mysql_query("SELECT COUNT(*) FROM torrents $where $limit") or die(mysql_error());
$count = $row[0];
if (!$count && isset($cleansearchstr)) {
$wherea = $wherebase;
$searcha = explode(" ", $cleansearchstr);
$sc = 0;
foreach ($searcha as $searchss) {
if (strlen($searchss) <= 1)
continue;
$sc++;
if ($sc > 5)
break;
$ssa = array();
foreach (array("torrents.name") as $sss)
$ssa[] = "$sss LIKE '%" . sqlwildcardesc($searchss) . "%'";
$wherea[] = "(" . implode(" OR ", $ssa) . ")";
}
if ($sc) {
$where = implode(" AND ", $wherea);
if ($where != "")
$where = "WHERE $where";
$res = mysql_query("SELECT COUNT(*) FROM torrents $where") or die(mysql_error());
$row = mysql_fetch_array($res);
$count = $row[0];
}
}
if ($count) {
$query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.numfiles,torrents.filename,torrents.owner," .
"categories.name AS cat_name, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $orderby $limit";
$res = mysql_query($query) or die(mysql_error());
}
else
unset($res);
if ($count) {
while ($row=mysql_fetch_array($res)) {
echo chr(3)."9".chr(2)." $site_config[SITENAME] ".chr(2).chr(3)."10 ".chr(3)."13Name: ".chr(3)."10(".chr(3)."4 {$row['name']} ".chr(3)."10) ".chr(3)."13Size: ".chr(3)."10( ".chr(3)."09".mksize($row['size']).chr(3)."10 )".chr(3)."13 Category: ".chr(3)."10(".chr(3)."4 $row[cat_name] ".chr(3)."10) ".chr(3)."13Uploader: ".chr(3)."10(".chr(3)."04 $row[username] ".chr(3)."10)".chr(3)."13 Seeders: ".chr(3)."10(".chr(3)."09 $row[seeders] ".chr(3)."10)".chr(3)."13 Leechers: ".chr(3)."10(".chr(3)."04 $row[leechers] ".chr(3)."10) ".chr(3)."13Link: ".chr(3)."10(".chr(3)."15 $site_config[SITEURL]/torrents-details.php?id=$row[id]".chr(3)."10 )\n";
}
}
else {
if (!isset($cleansearchstr)) {
die(NO_UPLOADS);
}
else {
die(NO_RESULTS);
}
}
?>ircsearch.tcl:package require http
bind pub - !search search
proc search {n u h c a} {
if {[string tolower $c]==[string tolower "#channel"]} {
if {$a!=""} {
set a [::http::mapReply $a]
putquick "PRIVMSG $c :Searching... Please Wait..."
set data [::http::geturl http://yoursite.com/ircsearch.php?search=$a]
putquick "PRIVMSG $c :Search Results:"
foreach line [split [::http::data $data] \n] {
putquick "PRIVMSG $c :$line"
}
} else { putquick "PRIVMSG $c :Use: !search Search terms" }
}
}
if you want it to PM the results to the user, use this tcl instead:
package require http
bind pub - !search search
proc search {n u h c a} {
if {[string tolower $c]==[string tolower "#channel"]} {
if {$a!=""} {
set a [::http::mapReply $a]
putquick "PRIVMSG $n :Searching... Please Wait..."
set data [::http::geturl http://yoursite.com/ircsearch.php?search=$a]
putquick "PRIVMSG $n :Search Results:"
foreach line [split [::http::data $data] \n] {
putquick "PRIVMSG $n :$line"
}
} else { putquick "PRIVMSG $n :Use: !search Search terms" }
}
}
"walker1977, post: 70848":i would put the loggedinonly part below the dbconn and also the if ($CURUSER['class'] >= 7) is not best for everybody because if somebody adds a normal member group without changing the code then that group would be able to access it. so it is best to make it if ($CURUSER['class'] == 7) if you only want the owner to access it
"sonicvip, post: 70205":plz adjust anyone at top of code with
loggedinonly();
<td align="center"><a href=admincp.php?action=ipbans><img src="images/admin/blocked.gif" border=0 width=32 height=32><BR>Banned IPs</a><BR></td>underneath add <td align="center"><a href=admincp.php?action=upinfo&do=run><img src="images/upload.jpg" border=0 width=32 height=32><BR>Uploader Info</a><BR></td>
then find
f (!$action){
stdhead("Admin CP");
navmenu();
stdfoot();
}
Above add
if ($action=="upinfo" && $do=="run") {
stdhead("Admin CP");
navmenu();
echo '<div style="height:800px;overflow:scroll;">';
include ('uploaderinfo.php');
echo '</div>';
echo '</td></tr></table>'; stdfoot();
}
now make a new php file in your root dir and call it uploaderinfo.php
and add this to it
<?php
dbconn(true);
loggedinonly();
stdhead("Uploaders");
if ($CURUSER['class'] == 7)
{
$query = "SELECT id, username, added, uploaded, downloaded, donated, warned FROM users WHERE class = 4";
$result = mysql_query($query);
$num = mysql_num_rows($result); // how many uploaders
echo "<h2>Uploaders Info Panel</h2>";
echo "<p>We have " . $num . " uploaders</p>";
$zerofix = $num - 1; // remove one row because mysql starts at zero
if ($num > 0)
{
echo "<table cellpadding=4 align=left border=1>";
echo "<tr>";
echo "<td class=colhead>Num</td>";
echo "<td class=colhead>Username</td>";
echo "<td class=colhead>Uploaded/Downloaded</td>";
echo "<td class=colhead>Ratio</td>";
echo "<td class=colhead>Num torrents</td>";
echo "<td class=colhead>Last upload</td>";
echo "<td class=colhead>Send PM</td>";
echo "</tr>";
for ($i = 0; $i <= $zerofix; $i++)
{
$id = mysql_result($result, $i, "id");
$username = mysql_result($result, $i, "username");
$added = mysql_result($result, $i, "added");
$uploaded = mksize(mysql_result($result, $i, "uploaded"));
$downloaded = mksize(mysql_result($result, $i, "downloaded"));
$uploadedratio = mysql_result($result, $i, "uploaded");
$downloadedratio = mysql_result($result, $i, "downloaded");
$donor = mysql_result($result, $i, "donated");
$warned = mysql_result($result, $i, "warned");
// get uploader torrents activity
$upperquery = "SELECT added FROM torrents WHERE owner = $id";
$upperresult = mysql_query($upperquery);
$torrentinfo = mysql_fetch_array($upperresult);
$numtorrents = mysql_num_rows($upperresult);
if ($downloaded > 0)
{
$ratio = $uploadedratio / $downloadedratio;
$ratio = number_format($ratio, 3);
$color = get_ratio_color($ratio);
if ($color)
$ratio = "<font color=$color>$ratio</font>";
}
else
if ($uploaded > 0)
$ratio = "Inf.";
else
$ratio = "---";
// get donor
if ($donor == "yes")
$star = "<img src=images/star.gif>";
else
$star = "";
// get warned
if ($warned == "yes")
$klicaj = "<img src=images/warned.gif>";
else
$klicaj = "";
$counter = $i + 1;
echo "<tr>";
echo "<td align=center>$counter.</td>";
echo "<td><a href=/account-details.php?id=$id>$username</a> $star $klicaj</td>";
echo "<td>$uploaded / $downloaded</td>";
echo "<td>$ratio</td>";
echo "<td>$numtorrents torrents</td>";
if ($numtorrents > 0)
{
$lastadded = mysql_result($upperresult, $numtorrents - 1, "added");
echo "<td>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($lastadded)) . " ago (" . gmdate("d. M Y",strtotime($lastadded)) . ")</td>";
}
else
echo "<td>---</td>";
echo "<td align=center><a href=mailbox.php?compose&id=$id><img src=images/pm.png></a></td>";
echo "</tr>";
}
echo "</table>";
}
}
else
echo "Not permitted.";
stdfoot();
?>
"sonicvip, post: 66560":i quickly tried this and it never posted any info in my irc server ( channel) so took code out for now nice mod tho :D will watch for updates on this
<?
// IRC Stats v1.2 by TorrentialStorm
// DO NOT remove the credits.
// If you want to change the output, fine. Just don't come to me if you can't read my code.
require "backend/functions.php";
dbconn(false);
$search = sqlesc(trim($_GET['search']));
$b = chr(2);
$c = chr(3);
$res = @mysql_query("SELECT users.id, users.class, users.downloaded, users.uploaded, users.username, count(distinct torrents.id) as 'torrents', count(distinct comments.id) as comments, count(distinct forum_posts.id) as forumposts, count(distinct peers.id) as transfers FROM users LEFT JOIN torrents ON users.id = torrents.owner LEFT JOIN comments ON users.id = comments.user LEFT JOIN forum_posts ON users.id = forum_posts.userid LEFT JOIN peers ON users.id = peers.userid WHERE users.username = $search AND users.status = 'confirmed' GROUP by users.id") or die("Database error");
$num = @mysql_num_rows($res);
if($num < 1) {
echo $search." - No such user, please try again.";
die;
}
$arr = @mysql_fetch_assoc($res);
$seeders = get_row_count("peers", "WHERE userid={$arr['id']} AND seeder='yes'");
$leechers = get_row_count("peers", "WHERE userid={$arr['id']} AND seeder='no'");
if($arr[uploaded] == 0 && $arr[downloaded] == 0)
$ratio = "N/A";
elseif ($arr[downloaded] > 0)
$ratio = $arr[uploaded]/$arr[downloaded];
else
$ratio = 0.00;
if (is_numeric($ratio)) $ratio = number_format($ratio, 2);
$arr['downloaded'] = mksize($arr['downloaded']);
$arr['uploaded'] = mksize($arr['uploaded']);
$arr['class'] = get_user_class_name($arr['class']);
$out .= "$b{$c}09$arr[username]$b{$c}10 - {$c}13Downloaded: {$c}10({$c}04$arr[downloaded]{$c}10) - {$c}13Uploaded: {$c}10({$c}04$arr[uploaded]{$c}10)";
$out .= " - {$c}13Ratio: {$c}10({$c}04$ratio{$c}10) - {$c}13Class: {$c}04($arr[class]{$c}10)";
$out .= " - {$c}13Torrents Posted: {$c}10({$c}04$arr[torrents]{$c}10) - {$c}13Comments: {$c}10({$c}04$arr[comments]{$c}10)";
$out .= " - {$c}13Forum Posts: {$c}10({$c}04$arr[forumposts]{$c}10) - {$c}13Active Transfers: {$c}10({$c}04$arr[transfers]{$c}10)";
$out .= " - {$c}13Seeding: {$c}10({$c}04$seeders{$c}10) - {$c}13Leeching: {$c}10({$c}04$leechers{$c}10)";
print $out;
?>mIRC Script on !*:join:#your.channel.here:$hello(#,$nick)
on $*:text:/^!stats\s(\S+)$/iS:#your.channel.here:$hello(#,$regml(1))
alias -l hello {
if (!$sock(hello)) {
sockopen hello localhost 80
sockmark hello msg $1 $+(/ircstats.php?search=,$2)
}
}
on *:sockopen:hello:{
sockwrite -n $sockname GET $gettok($sock(hello).mark,3,32) HTTP/1.1
sockwrite -n $sockname Host: $+($sock(hello).addr,$str($crlf,2))
}
on *:sockread:hello:{
var %hello | sockread %hello
if ($regex(%hello,/(.+ $+ $gettok($sock(hello).mark,2,61) $+ .+)/)) {
$gettok($sock(hello).mark,1-2,32) $regml(1)
sockclose hello
}
}
"jr200747, post: 65138":You will need to replace "java script" with javascript"<<<<<< where do you make those changes at?