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
[ADDON] Teams
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-07-29 13:03:52
Strange, the code wasn't right in the original post.  I've just updated it though.

Cheers

Simon
Unknown User
2009-07-06 04:04:59
Great work! You happen to have a team-stats.php page? :)
Unknown User
2009-07-17 09:44:39
Thanks!

I have no Search.php, where can I find?
Unknown User
2009-07-17 12:43:35
it's torrents-search.php
2009-08-16 18:59:59
Dear Simon,

I have downloaded the latest SVN code of torrenttrader v2, and it already has the following things included:

- Teams table in SQL

- A create teams option in the admincp

- and two files, teams-create.php and teams-view.php

Is this the same as your mod?

Or is this something which is developed separately...

This is the teams-create.php

<?php

//

//  TorrentTrader v2.x

// This file was last updated: 7/Sept/2007

//

// http://www.torrenttrader.org

//

//

require_once ("backend/functions.php");

require_once ("backend/bbcode.php");

dbconn(false);



loggedinonly();



if (!$CURUSER || $CURUSER["control_panel"]!="yes"){

show_error_msg("Error","Sorry you do not have the rights to access this page!",1);

}





foreach($_POST as $key=>$value) $$key=$value;

foreach($_GET as $key=>$value) $$key=$value;



$sure = $_GET['sure'];

$del = $_GET['del'];

$team = htmlspecialchars($_GET['team']);

$edited = (int)$_GET['edited'];

$id = (int)$_GET['id'];

$team_name = $_GET['team_name'];

$team_info = $_GET['team_info'];

$team_image = $_GET['team_image'];

$team_description = $_GET['team_description'];

$teamownername = $_GET['team_owner'];

$editid = $_GET['editid'];

$editmembers = $_GET['editmembers'];

$name = $_GET['name'];

$image = $_GET['image'];

$owner = $_GET['owner'];

$info = $_GET['info'];

$add = $_GET['add'];







stdhead("Teams");

begin_frame("Teams Management");





//Delete Team

if($sure == "yes") {



$query = "UPDATE users SET team=0 WHERE team=" .sqlesc($del) . "";

$sql = mysql_query($query);



$query = "DELETE FROM teams WHERE id=" .sqlesc($del) . " LIMIT 1";

$sql = mysql_query($query);

echo("Team Successfully Deleted![<a href='teams-create.php'>Back</a>]");

write_log($CURUSER['username']." has deleted team id:$del");

end_frame();

stdfoot();

die();

}



if($del > 0) {

echo("You and in the truth wish to delete team? ($team) ( <b><a href='teams-create.php?del=$del&team=$team&sure=yes'>Yes!</a></b> / <b><a href='teams-create.php'>No!</a></b> )");

end_frame();

stdfoot();

die();

}



//Edit Team

if($edited == 1) {

$aa = mysql_query("SELECT class, id FROM users WHERE username='$teamownername'");

$ar = mysql_fetch_assoc($aa);

$team_owner = $ar["id"];

$query = "UPDATE teams SET name = '$team_name', info = '$team_info', owner = '$team_owner', image = '$team_image' WHERE id=".sqlesc($id);

$sql = mysql_query($query);



mysql_query("UPDATE users SET team = '$id' WHERE id= '$team_owner'");



if($sql) {

echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");

echo("<tr><td><div align='center'><b>Successfully Edited</b>[<a href='teams-create.php'>Back</a>]</div></tr>");

echo("</table>");

write_log($CURUSER['username']." has edited team ($team_name)");

end_frame();

stdfoot();

die();

}

}



if($editid > 0) {

echo("<form name='smolf3d' method='get' action='teams-create.php'>");

echo("<CENTER><table cellspacing=0 cellpadding=5 width=50%>");

echo("<div align='center'><input type='hidden' name='edited' value='1'></div>");

echo("<br>");

echo("<input type='hidden' name='id' value='$editid'<table class=main cellspacing=0 cellpadding=5 width=50%>");

echo("<tr><td>Team Name: </td><td align='right'><input type='text' size=50 name='team_name' value='$name'></td></tr>");

echo("<tr><td>Team Logo URL: </td><td align='right'><input type='text' size=50 name='team_image' value='$image'></td></tr>");

echo("<tr><td>Owner Name: </td><td align='right'><input type='text' size=50 name='team_owner' value='$owner'></td></tr>");

echo("<tr><td valign=top>Description: </td><td align='right'><textarea name=team_info cols=35 rows=5>$info</textarea><BR>(BBCode is allowed)</td></tr>");

echo("<tr><td></td><td><div align='right'><input type='Submit' value=Update></div></td></tr>");

echo("</table></CENTER></form>");

end_frame();

stdfoot();

die();

}



//View Members

if($editmembers > 0) {

echo("<CENTER><table class=table_table cellspacing=0 cellpadding=3>");

echo("<td class=table_head>Username</td><td class=table_head>Uploaded</td><td class=table_head>Downloaded</td></tr>");

$query = "SELECT id,username,uploaded,downloaded FROM users WHERE team=$editmembers";

$sql = mysql_query($query);

while ($row = mysql_fetch_array($sql)) {

$username = htmlspecialchars($row['username']);

$uploaded = mksize($row['uploaded']);

$downloaded = mksize($row['downloaded']);



echo("<tr><td class=table_col1><a href=account-details.php?id=$row[id]>$username</a></td><td class=table_col2>$uploaded</td><td class=table_col1>$downloaded</td></tr>");

}

echo "</table></CENTER>";

end_frame();

stdfoot();

die();

}





//Add Team

if($add == 'true') {

$aa = mysql_query("SELECT id FROM users WHERE username='$teamownername'");

$ar = mysql_fetch_assoc($aa);

$team_owner = $ar["id"];

$query = "INSERT INTO teams SET name = '$team_name', owner = '$team_owner' ,info = '$team_description', image = '$team_image'";

$sql = mysql_query($query);



$tid = mysql_insert_id();



mysql_query("UPDATE users SET team = '$tid' WHERE id= '$team_owner'");



if($sql) {

write_log($CURUSER['username']." has created new team ($team_name)");

$success = TRUE;

}else{

$success = FALSE;

}

}



print("<b>Add new team:</b>");

print("<br>");

print("<br>");

echo("<form name='smolf3d' method='get' action='teams-create.php'>");

echo("<CENTER><table cellspacing=0 cellpadding=5 width=50%>");

echo("<tr><td>Team: </td><td align='left'><input type='text' size=50 name='team_name'></td></tr>");

echo("<tr><td>Owner Name: </td><td align='left'><input type='text' size=50 name='team_owner'></td></tr>");

echo("<tr><td valign=top>Description: </td><td align='left'><textarea name=team_description cols=35 rows=5></textarea><BR>(BBCode is allowed)</td></tr>");

echo("<tr><td>Teams Logo URL: </td><td align='left'><input type='text' size=50 name='team_image'><input type='hidden' name='add' value='true'></td></tr>");

echo("<tr><td></td><td><div align='left'><input value='Create Team' type='Submit'></div></td></tr>");

echo("</table></CENTER>");

if($success == TRUE) {

print("<b>team successfully added!</b>");

}

echo("<br>");

echo("</form>");



//ELSE Display Teams

print("<b>Current Teams:</b>");

print("<br>");

print("<br>");

echo("<CENTER><table class=table_table cellspacing=0 cellpadding=3>");

echo("<td class=table_head>ID</td><td class=table_head>Logo</td><td class=table_head>Name</td><td class=table_head>Owner</td><td class=table_head>Description</td><td class=table_head>Other</td>");

$query = "SELECT * FROM teams";

$sql = mysql_query($query);

while ($row = mysql_fetch_array($sql)) {

$id = (int)$row['id'];

$name = htmlspecialchars($row['name']);

$image = htmlspecialchars($row['image']);

$owner = (int)$row['owner'];

$info = format_comment($row['info']);

$OWNERNAME1 = mysql_query("SELECT username, class FROM users WHERE id=$owner");

$OWNERNAME2 = mysql_fetch_array($OWNERNAME1);

$OWNERNAME = $OWNERNAME2['username'];



echo("<tr><td class=table_col1><b>$id</b> </td> <td class=table_col2 align=center><img src='$image'></td> <td class=table_col1><b>$name</b></td><td class=table_col2><a href=account-details.php?id=$owner>$OWNERNAME</a></td><td class=table_col1>$info</td><td class=table_col2><a href=teams-create.php?editmembers=$id>[Members]</a>&nbsp;<a href='teams-create.php?editid=$id&name=$name&image=$image&info=$info&owner=$OWNERNAME'>[Edit]</a>&nbsp;<a href='teams-create.php?del=$id&team=$name'>[Delete]</a></td></tr>");

}

echo "</table></CENTER>";



end_frame();

stdfoot();



?>





And this is the teams-view.php





<? 

//

//  TorrentTrader v2.x

// This file was last updated: 7/Sept/2007

//

// http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn(false);



stdhead("Teams");

begin_frame("Teams");



echo "<br><B><CENTER>Please <a href=staff.php>contact</a> a member of staff if you would like a new team creating</CENTER></B><BR><BR>";





$query = "SELECT * FROM teams";

$sql = mysql_query($query);



$numres = mysql_num_rows($sql);

if($numres == 0) {

echo "<BR><B>No Teams</b><BR>\n";

}else{

while ($row = mysql_fetch_array($sql)) {

$image = $row['image'];



$OWNERNAME1 = mysql_query("SELECT id,username FROM users WHERE id=$row[owner]");

$OWNERNAME2 = mysql_fetch_array($OWNERNAME1);



echo("<table cellspacing=0 cellpadding=3 width=100% class=table_table>");

echo("<td width=10% class=table_head><b>Group:</b></td><td width=90% class=table_head><b>Owner:</b> <a href=account-details.php?id=$OWNERNAME2[id]>$OWNERNAME2[username]</a>&nbsp;-&nbsp;<b>Info:</b></td>");

echo "<tr><td width=10% class=table_col1><b><img src='".htmlspecialchars($image)."' border='0'></b></td><td valign=top class=table_col1 align=left width=90%>".format_comment($row["info"])."</td></tr><tr><td width=100% colspan=2 class=table_col2><b>Members:&nbsp;&nbsp;</b>";



$res2 = mysql_query("SELECT id, username FROM users WHERE team = ".$row["id"]."") or die(mysql_error());

while ($row2 = mysql_fetch_array($res2)) {

echo "<a href=account-details.php?id=".$row2["id"].">".$row2["username"]."</a>, ";

}

echo "</td></tr>";

echo "</table><BR>";

}

}

end_frame();

stdfoot();

?>

If It Ain't Dutch, It Ain't Much!!
2009-10-29 00:52:12
yea, im curous about what this is also. What are we supposed to do with the "teams" that we can create in TT 2.05? It dont look anything like what I see in some of the screenshots I see in this thread. I understand what its "supposed" to do, but I dont see it in the torrent uploads. Am I missing something lol.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Unknown User
2010-11-09 05:25:57
Thank you working good with v2.5
Unknown User
2012-07-31 19:14:21
I would like to know whether to post the torrents with the team and works with v2.08
Unknown User
2012-09-16 11:35:48
How add a new membre in the team ?
Unknown User
2012-12-24 09:10:03
Does this actually work with v2.08?

What purpose does the Teams in Staffcp serve?

U cant add members, u cant set a torrent to be for a teams use only, is it incomplete?

Is there somewhere that we can find a code (mod) that works for v2.08?

Thanks....
Unknown User
2012-12-24 15:24:30
this current code prob will not work in 2.08.... it looks like old code with multi querys inside each other..  The 2.08 teams is very basic and it dont do alot LOL.. People have extended it do other things i guess but none posts there code!!!

The admincp part is mostly for creating teams and what not, people can request to join an team i think so you really adding to it is useless via admincp....
Unknown User
2012-12-24 20:12:34
lol thats why I asked.... cos atm it sorta is a white elephant lol.... COME ON guys, the chaps that have it modded an workin on v2.08, share with us the code?

This could be a very very handy add-on if done right......
Unknown User
2012-12-25 03:49:50
Guys, this was written 4 years ago; highly doubt you will get any update. You're better off trying to update tbis yourselves for the latest TT.
Unknown User
2012-12-25 08:31:27
So what do you want this to do LOL??? I might take an stab at it if bored.. and knew what direction people wanted it go!!!
Unknown User
2012-12-25 15:26:21
Obviously this would be for v2.08 or svn....

Well... I want to for example be able to have certain members to be part of a team, and certain torrents that they upload to be able to be marked so that those torrents will only be visible/accessible to that team.....

e.g. we were discussing having a group, where the material would only be of a type suitable for ermmm... broad-minded people.... not pron as such, but similar, and it would really not do to have this floating around openly on site.

Similar would be where  we may have a group that is really only interested in for example horror, and we could then limit all their uploads so that only they have access to it. Any person that wants to join a team can then simply ask Admin and aplly... but it would only work if Admin and only Admin has creation rights for teams and the rights to add members to teams. it would also then give the ability to block entire sections of site content from casual members for example, and almost be able to create a section for people that donate for example?

just some ideas....but that is what I think would work nicely....
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