Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

[ADDON] Teams — 2008-07-29 13:03:52 in v2 Only Mods Complete
Strange, the code wasn't right in the original post.  I've just updated it though.

Cheers

Simon
[ADDON] Teams — 2008-07-12 21:47:36 in v2 Only Mods Complete
You're welcome. :mellow:
[ADDON] Teams — 2008-07-12 17:43:58 in v2 Only Mods Complete
Badly placed  :mellow:   I've edited your code so try this version;

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=2594"]torrents_upload.php[/url]
[ADDON] Teams — 2008-07-12 08:17:45 in v2 Only Mods Complete
"ZTk, post: 44295":
Thanks for help  :mellow:
functions.php and search fixed and work  :o

But the selection of TEAM is still not visible at the time of the upload torrent, the member forms part of the TEAM well and cannot choose with the upload so that it is visible only by his TEAM

On the other hand, if it publishes the torrent, it can choose the TEAM

Why?

Thanks a lot.

It seems that I missed a couple of bits from torrents-upload.php

Find

 $langid = (0 + $_POST["lang"]);

After add

 $team = (0 + $_POST["teams"]);


Find

//end requests

After Add

//teams

if ($CURUSER["team"] != 0)

{

$userteam = $CURUSER["team"];

$teams = "--- None selected ----\n";

$sashok = mysql_query("SELECT id,name FROM teams WHERE id = $userteam ORDER BY name") or die;

while ($sasha = mysql_fetch_array($sashok))

$teams .= "

print("Team\n$teams\n");

}

I think that should do it.

Cheers

SImon
[ADDON] Teams — 2008-07-07 18:08:04 in v2 Only Mods Complete
"ZTk, post: 44084":
Hi, thanks for Addon but me have problems... (TTV2.04)
For edit torrents, error: Fatal error: Call to undefined function teamslist() in /****/****/*****/******/*****/******/torrents-edit.php on line 203

It sounds as though you haven't included the teamslist function in backend/functions.php.  You need to have;

function teamslist() {

$ret = array();

$res = mysql_query("SELECT id, name FROM teams ORDER BY name");

while ($row = mysql_fetch_array($res))

$ret[] = $row;

return $ret;

}

"ZTk, post: 44084":
And for upload, impossible to choose if torrent parks will be visible in the team or for everybody  :mellow:

You need to fix the above problem first, then you can only make a torrent available to a team, if you are a member of that team.  If you are not a member of a team, you don't see anything.  I do it this way so that users can't see what teams are available, it keeps them private.

"ZTk, post: 44084":
And me clik on "Search" --> error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '== 7) AND visible = 'yes'' at line 1

That one's my fault, i've changed it in the original posting now.  Change '== 7' to '= 7'

Cheers

Simon
[ADDON] Teams — 2008-06-22 18:29:39 in v2 Only Mods Complete
"zape, post: 43751":
Thanks a lot, he works very well.
There is some way from which the torrents did not go out in Latest Posters, the image goes out and that by themselves that of the team saw it would like.

Greetings and pardon by my Englihs

Not a block I use, but this should do it.

latestuploads_block.php

Find

 $latestuploadsquery = mysql_query("SELECT id, name FROM torrents WHERE banned='no' ORDER BY id DESC LIMIT 5")or die(mysql_error());


Replace with

 $latestuploadsquery = mysql_query("SELECT id, name FROM torrents WHERE banned='no' AND (team = 0 OR team = ".$CURUSER['team']." OR ".$CURUSER['class']." = 7) ORDER BY id DESC LIMIT 5")or die(mysql_error());


Cheers

Simon
[ADDON] Teams — 2008-06-18 08:32:55 in v2 Only Mods Complete
"rodriguesp, post: 43660":
hi
i've got some errors...

1) Unknown column 'torrents.anon' in 'field list'

This was based on 2.04 - the anon field is in the torrents table in that version.  If it's not in your version then either remove references to the anon field from the hack or upgrade your table structure.  The anon field isn't used by this hack.

Cheers

Simon
[ADDON] Teams — 2008-06-17 12:23:57 in v2 Only Mods Complete
I did a load of work on VIP only torrents (http://www.torrenttrader.org/index.php?showtopic=3913) a couple of years ago for TT1.x and now that I'm moving to 2.x, I needed to re-engineer it. I noticed that some of the code for Teams was there, but this wasn't working at all. I believe this code is functioning OK so I thought I'd put it up here. I've modded my site in other ways too, but I think I've managed to remove those bits of code.

BACKUP FIRST!

This is the way it works;

- Teams are created via the teams button in Control Panel

- User can be a member of one and only one team

- User cannot change their team membership

- Only Admins (class 7) can change a users' team membership (from the users details page)

- Team torrents are hidden from non-team members

- A user who is a team member can choose to make their upload available to anyone or just their team

- A torrent can only belong to either one team, or no team

- Admins can see all torrents, either public or belonging to any team

- A user can change their torrents team settings after upload

- A supermod who is a team member can change a torrents team settings if they are a member of that team

- A users' team membership can only be seen by Admins and another member of that team

And here is the code....

SQL

ALTER TABLE `torrents` ADD `team` VARCHAR( 10 ) NULL DEFAULT '0';


account.php

Find

<? print("<B>IP:</b> " . $CURUSER["ip"] . "\n"); ?><br>

Below add

 <? $res = mysql_query("SELECT name,image FROM teams WHERE id=$CURUSER[team] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1) {

$arr = mysql_fetch_assoc($res);

echo "<tr><td colspan=2 align=left><B>Team Member Of:</B><BR>";

echo"<img src='".htmlspecialchars($arr["image"])."'><BR>".sqlesc($arr["name"])."</td></tr>";

} ?><br>

Find and remove (or comment out)

 if ($CURUSER["class"] > 1)
print("<TR><TD align=right class=table_col1><B>Team:</b> </td><TD align=left class=table_col1><select name=teams>\n$teams\n</select></td></tr>");

Find

 <? print("<B>IP:</b> " . $CURUSER["ip"] . "\n"); ?><br>



Below Add

 <? $res = mysql_query("SELECT name,image FROM teams WHERE id=$CURUSER[team] LIMIT 1") or die(mysql_error());
if (mysql_num_rows($res) == 1) {

$arr = mysql_fetch_assoc($res);

echo "<tr><td colspan=2 align=left><B><center>Team Member Of:</B><BR>";

echo"<img src='".htmlspecialchars($arr["image"])."'><BR>".sqlesc($arr["name"])."</center></td></tr>";

} ?><br>

Account-details.php

Find

 if ($CURUSER["class"] > $user["class"]){
print("<tr><td>Class</td><td align=left><select name=class>\n");

$maxclass = $CURUSER["class"];

for ($i = 1; $i < $maxclass; ++$i)

print("<option value=$i" . ($user["class"] == $i ? " selected" : "") . ">$prefix" . get_user_class_name($i) . "\n");

print("</select></td></tr>\n");

}

After Add

 if ($CURUSER['class'] == 7)
{

$teams = "<option value=0>--- None selected ----</option>\n";

$sashok = mysql_query("SELECT id,name FROM teams ORDER BY name") or die;

while ($sasha = mysql_fetch_array($sashok))

$teams .= "<option value=$sasha[id]" . ($user["team"] == $sasha['id'] ? " selected" : "") . ">$sasha[name]</option>\n";

print("<TR><TD>Team</td><TD align=left><select name=teams>\n$teams\n</select></tr>");

}

else

print("<input type=hidden name=teams value=$user[team]>");

Find

 $res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid='$id' AND seeder='yes'");
if (mysql_num_rows($res) > 0)

$seeding = peerstable($res);

$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers WHERE userid='$id' AND seeder='no'");

if (mysql_num_rows($res) > 0)

$leeching = peerstable($res);

Replace with

 $res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers LEFT JOIN torrents ON torrent = torrents.id WHERE userid='$id' AND seeder='yes' AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 7)");
if (mysql_num_rows($res) > 0)

$seeding = peerstable($res);

$res = mysql_query("SELECT torrent,uploaded,downloaded FROM peers LEFT JOIN torrents ON torrent = torrents.id WHERE userid='$id' AND seeder='no' AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 7)");

if (mysql_num_rows($res) > 0)

$leeching = peerstable($res);

Find

 $res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner='$id' $where") or die(mysql_error());


Replace With

 $res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner='$id' $where AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 7)") or die(mysql_error());


Find

 $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, torrents.anon, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.announce FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE owner = $id $orderby $limit";


Replace with

 $query = "SELECT teams.name AS teamname, teams.image AS teamimage, torrents.team, torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, torrents.anon, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.announce FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN teams ON torrents.team = teams.id WHERE torrents.owner = $id AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 7) $orderby $limit";



Find

 <a href=report.php?user=<?=$user["id"]?>>Report Member</a><BR>
</td>

</tr>

After Add

<?
//team

if (($CURUSER['team'] == $user['team']) OR ($CURUSER['class'] ==7))

{

$res = mysql_query("SELECT name,image FROM teams WHERE id=$user[team] LIMIT 1") or die(mysql_error());

if (mysql_num_rows($res) == 1) {

$arr = mysql_fetch_assoc($res);

echo "<tr><td colspan=2 align=left><B>Team Member Of:</B><BR>";

echo"<img src='".htmlspecialchars($arr["image"])."'><BR>".sqlesc($arr["name"])."<BR><BR><a href=teams-view.php>[View Teams]</a></td></tr>";

}

}

?>

Find

 $res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner=$id") or die(mysql_error());


Replace with

 $res = mysql_query("SELECT COUNT(*) FROM torrents WHERE owner=$id AND (torrents.team = 0 OR torrents.team = ".$CURUSER['team']. " OR ".$CURUSER['class']." = 7)") or die(mysql_error());


Admin-modtasks.php

Find

 $class = (int)$_POST["class"];


After Add

 $teams = $_POST["teams"];


Find

 mysql_query("UPDATE users SET title='$title', downloaded='$downloaded', uploaded='$uploaded', signature='$signature', avatar='$avatar', ip='$ip', donated='$donated', forumbanned='$forumbanned', warned='$warned', modcomment='$modcomment', enabled='$enabled', invites='$invites' WHERE id=$userid");


Replace with

 mysql_query("UPDATE users SET title='$title', downloaded='$downloaded', uploaded='$uploaded', signature='$signature', avatar='$avatar', ip='$ip', donated='$donated', forumbanned='$forumbanned', warned='$warned', modcomment='$modcomment', enabled='$enabled', invites='$invites', team='$teams' WHERE id=$userid");



Torrents-upload.php

Find

 $ret = mysql_query("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$type."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon')");


Replace With

 $ret = mysql_query("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, team) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$type."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon','".$team."')");



Find

 $langid = (0 + $_POST["lang"]);

After add

 $team = (0 + $_POST["teams"]);


Find

//end requests

After Add

//teams

if ($CURUSER["team"] != 0)

{

$userteam = $CURUSER["team"];

$teams = "<option value=0>--- None selected ----</option>\n";

$sashok = mysql_query("SELECT id,name FROM teams WHERE id = $userteam ORDER BY name") or die;

while ($sasha = mysql_fetch_array($sashok))

$teams .= "<option value=$sasha[id]" . ($user["team"] == $sasha['id'] ? " selected" : "") . ">$sasha[name]</option>\n";

print("<TR><td align=right>Team</td><TD align=left><select name=teams>\n$teams\n</select></tr>");

}

Index.php

Find

 $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE visible = 'yes' AND banned = 'no' ORDER BY id DESC LIMIT 25";


Replace with

 $query = "SELECT users.team AS userteam, teams.id AS teamsid, teams.name AS teamname, teams.image AS teamimage, torrents.team, torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN users ON torrents.owner = users.id WHERE (".$CURUSER['team']." = torrents.team OR torrents.team = 0 OR ".$CURUSER['class']." = 7) AND visible = 'yes' AND banned = 'no' ORDER BY id DESC LIMIT 25";



functions.php

Find

 $dispname = "<b>".$smallname."</b>";


Below add

 if ($row["team"]!= 0)
$dispname .= " <img src='".$row["teamimage"]."' border='0' alt = '".$row["teamname"]."'>";

Find

 function langlist() {
$ret = array();

$res = mysql_query("SELECT id, name, image FROM torrentlang ORDER BY sort_index, id");

while ($row = mysql_fetch_array($res))

$ret[] = $row;

return $ret;

}

Below Add

 function teamslist() {
$ret = array();

$res = mysql_query("SELECT id, name FROM teams ORDER BY name");

while ($row = mysql_fetch_array($res))

$ret[] = $row;

return $ret;

}

Mostactivetorrents_block.php

Find

 //$where = "WHERE external !='yes'" 


Below Add

 $where = "WHERE team = 0";



Seedwanted_block.php

Find

 $seederswantedquery = mysql_query("SELECT id,name,seeders,leechers FROM torrents WHERE seeders ='0' and external !='yes' ORDER BY leechers DESC LIMIT 5")or die(mysql_error());


Replace with

 $seederswantedquery = mysql_query("SELECT id,name,seeders,leechers FROM torrents WHERE seeders ='0' and external !='yes' AND team = 0 ORDER BY leechers DESC LIMIT 5")or die(mysql_error());



Torrents-edit.php

Find

$updateset[] = "torrentlang = " . (0 + $language);

After add

$updateset[] = "team = " . (0 + $team);


Find

/END TORRENTLANG

After Add

 //UPDATE TEAM DROPDOWN
$teamsdropdown = "<select name=\"team\"><option value=0>--- None Selected ---</option>\n";

$teams = teamslist();

foreach ($teams as $teams) {

if (($CURUSER['class'] == 7) OR ($teams["id"] == $CURUSER['team']))

{

$teamsdropdown .= "<option value=\"" . $teams["id"] . "\"";

if ($teams["id"] == $row["team"])

$teamsdropdown .= " selected=\"selected\"";

$teamsdropdown .= ">" . htmlspecialchars($teams["name"]) . "</option>\n";

}

}

$teamsdropdown .= "</select>\n";

//END team

Find

echo "<tr><td align=right><B>Language: </b></TD><TD>".$langdropdown."</TD></TR>";

After Add

 if (($CURUSER['class'] == 7) OR ($CURUSER['id'] == $row['owner'] AND $CURUSER['team'] != 0))
{

echo "<tr><td align=right><B>Team: </b></TD><TD>".$teamsdropdown."</TD></TR>";

}

rss.php (if you have one)

Find

 // by category ? 
if (!$cat){

$catvar ="WHERE visible='yes'"; //just show last visible

}else{

$catvar ="WHERE categories.id ='$cat' AND visible='yes'";

}

Replace with

 // by category ? 
if (!$cat){

$catvar ="WHERE visible='yes' AND torrents.team = 0"; //just show last visible

}else{

$catvar ="WHERE categories.id ='$cat' AND visible='yes' AND torrents.team = 0";

}

Torrents-today.php

Find

 $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where AND torrents.added>='$date_time' $orderby $limit";


Replace With

 $query = "SELECT users.team AS userteam, teams.id AS teamsid, teams.name AS teamname, teams.image AS teamimage, torrents.team, torrents.id, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN users ON torrents.owner = users.id $where AND torrents.added>='$date_time' $orderby $limit";



torrents.php

Find

 if ($where != "")
$where = "WHERE $where";

Replace With

 if ($where != "")
$where = "WHERE $where AND (".$CURUSER['team']." = torrents.team OR torrents.team = 0 OR ".$CURUSER['class']."= 7)";

Find

 $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $parent_check $orderby $limit";


Replace with

 $query = "SELECT users.team AS userteam, teams.id AS teamsid, teams.name AS teamname, teams.image AS teamimage, torrents.team, torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $parent_check $orderby $limit";



Search.php

find

$wherea[] = "banned = 'no'"

Replace with

 $wherea[] = "banned = 'no' AND (".$CURUSER['team']." = torrents.team OR torrents.team = 0 OR ".$CURUSER['class']."= 7)";


Find

 $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $parent_check $orderby $limit";


Replace with

$query = "SELECT users.team AS userteam, teams.id AS teamsid, teams.name AS teamname, teams.image AS teamimage, torrents.team, torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN teams ON torrents.team = teams.id LEFT JOIN users ON torrents.owner = users.id $where $parent_check $orderby $limit";


download.php

Find

 $res = mysql_query("SELECT filename, external, announce FROM torrents WHERE id =".intval($id));


Replace with

 $res = mysql_query("SELECT filename, external, announce, team FROM torrents WHERE id =".intval($id));


Find

 show_error_msg("File not found", "The ID and torrent were found, but the torrent is NOT readable!",1);

After add

 if (($CURUSER['team'] != $row['team']) AND ($CURUSER['class'] < 7) AND ($row['team'] != 0))
show_error_msg("Restricted torrent", "The torrent you are attempting to download is restricted.",1);

Hope it works for you!

Cheers

Simon
Good spot!
Just a one-liner to enable user searching on email address from admin control panel

FIND

$where = "WHERE username LIKE " . sqlesc("%$search%") . " AND status='confirmed'";

REPLACE WITH

$where = "WHERE username LIKE " . sqlesc("%$search%") . " OR email LIKE " . sqlesc("%$search%") . " AND status='confirmed'";
I have a link to this page just below my news block on the main page, but it can go wherever you like.

Create a file news-archive.php and add this code

<?

require_once "backend/functions.php";

dbconn(false);

loggedinonly();

stdhead();

begin_frame("News Archive");

$query = 'SELECT news.id, news.title, news.userid, news.added, news.body, users.username FROM news INNER JOIN users ON users.id = news.userid ORDER BY added DESC';

$resu = mysql_query($query) or die(mysql_error());

while ($row = mysql_fetch_array($resu))

{

$numcomm = number_format(get_row_count("comments", "WHERE news='".$row['id']."'"));

begin_frame("" . $row['title'] . "");

print("<I>Posted By " . $row['username'] . "</i> On " . $row['added'] . "\n");

echo"<BR>" . format_comment($row["body"],0) ." <BR><BR>Comments (<a href=comments.php?type=news&id=".$row['id'].">".$numcomm."</a>)";

end_frame();

}

end_frame();

stdfoot();

?>

Then link to that page using normal <a href...> from wherever you want.  This code formats the news items and includes the comment links as on the main page.

Cheers

Simon
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728