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] Parked Accounts
Controls ·  Search New posts · Mark unread

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

Unknown User
2008-05-11 10:55:57
Credit goes to psor @ tbdev

ALTER TABLE users ADD(parked enum ('yes','no') NOT NULL default 'no');


announce.php

find

$userfields = "id, class, uploaded, downloaded, ip, passkey"; //user details to get
Replace with


$userfields = "id, class, uploaded, downloaded, ip, passkey, parked"; //user details to get





find:



err("Cannot locate a user with that passkey!");



add after:



if ($user["parked"] == "yes")

err("Error, your account is parked! Please read the FAQ!");







functions.php

add



function parked() {

  global $CURUSER;

  if ($CURUSER["parked"] == "yes")

show_error_msg("Error", "your account is parked.", 1);

}





open torrents.php, comments.php, download.php, torrents-search.php and mailbox.php

after



loggedinonly();





add:



parked();





account.php



Before:



$acceptpms = $CURUSER["acceptpms"] == "yes";



Add:



print ("<TR><TD align=right class=table_col2><B>Account Parked:</B> </td><td class=table_col2><input type=radio name=parked" . ($CURUSER["parked"] == "yes" ? " checked" : "") . " value=yes><B>Yes</B> <input type=radio name=parked" .  ($CURUSER["parked"] == "no" ? " checked" : "") . " value=no><B>No</B><br><i>You can park your account to prevent it from being deleted because of inactivity if you go away on for example a vacation. When the account has been parked limits are put on the account, for example you cannot use the tracker and browse some of the pages.</i></td></tr>");





Before:



$acceptpms = $_POST["acceptpms"];



Add:



$parked = $_POST["parked"];





Before:



$updateset[] = "acceptpms = " . sqlesc($acceptpms);



Add:



$updateset[] = "parked = " . sqlesc($parked);







add in admincp.php:





print "<td align=center><a href=admincp.php?action=parked><img src=images/admin/confirmaccounts.gif border=0 width=32 height=32><br><center><b>Parked<BR>Users</center></b></a><BR></td>";





also add in admincp.php:





#======================================================================#

#   Parked users

#======================================================================#



if ($action == "parked") {

if ($CURUSER["class"] < "6"){

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

}

stdhead("Parked Users Management");

navmenu();





$res2 = mysql_query("SELECT COUNT(*) FROM users WHERE parked='yes'");

$row = mysql_fetch_array($res2);

$count = $row[0];



$perpage = 50;



list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=parked&");



begin_frame("Parked Users Management");



echo $pagertop;

?>

<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">

<tr>

<td class=table_head align=center>Username</td>

<td class=table_head align=center>Added</td>

<td class=table_head align=center>Last Visit</td>

<td class=table_head align=center>Uploaded</td>

<td class=table_head align=center>Downloaded</td>

<td class=table_head align=center>Edit?</td>

</tr>

<?



$rqq = "SELECT id, username, last_access, added, uploaded, downloaded FROM users WHERE parked='yes' ORDER BY username $limit ";

$resqq = mysql_query($rqq);



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

extract ($row);



echo "<tr><td class=table_col1><a href=account-details.php?id=$row[id]>$row[username]</a></td><td class=table_col2>".utc_to_tz($row['added'])."</td><td class=table_col1>$row[last_access]</td><td class=table_col2>".mksize($row["uploaded"])."</td><td class=table_col1>".mksize($row["downloaded"])."</td><td class=table_col2><a href=account-details.php?id=$row[id]>EDIT</a></td></tr>\n";

}



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



print($pagerbottom);



end_frame();

stdfoot();

}

#======================================================================#

#  End Parked users

#======================================================================#



Upload this image to images/admin as confirmaccounts.gif

confirmaccounts.gif
confirmaccounts.gif
Unknown User
2008-05-12 02:53:41
for me it's working great and i have TT2.02!

just added

parked();
to some other pages like torrents-search.php.....

just one thing:

in the account.php code you gave us you need to take a " in

Quote:
.....</td><td class=table_col2>"<input type=radio......

and erase a 'no' in

Quote:
....value=no>no<B>No</B><br><i>....

btw is it possible to have something in admincp to see the users that have the account parked?

cumps
Unknown User
2008-05-12 10:04:11
Thanks, I didn't see that (original post updated)

I don't have time to do an admincp part so if someone else wants to, I'll add it the my post.

Also: does it work ok?
Unknown User
2008-05-12 16:54:02
yes it works....
Unknown User
2008-05-12 21:02:18
for staff panel. all I did was change the warned users code for this.

add in admincp.php:

print "<td align=center><a href=admincp.php?action=parked><img src=images/admin/confirmaccounts.gif border=0 width=32 height=32><br><center><b>Parked<BR>Users</center></b></a><BR></td>";
also add in admincp.php:




#======================================================================#

#   Parked users

#======================================================================#



if ($action == "parked") {

if ($CURUSER["class"] < "6"){

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

}

stdhead("Parked Users Management");

navmenu();





$res2 = mysql_query("SELECT COUNT(*) FROM users WHERE parked='yes'");

$row = mysql_fetch_array($res2);

$count = $row[0];



$perpage = 50;



list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=parked&");



begin_frame("Parked Users Management");



echo $pagertop;

?>

<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">

<tr>

<td class=table_head align=center>Username</td>

<td class=table_head align=center>Added</td>

<td class=table_head align=center>Last Visit</td>

<td class=table_head align=center>Uploaded</td>

<td class=table_head align=center>Downloaded</td>

<td class=table_head align=center>Edit?</td>

</tr>

<?



$rqq = "SELECT id, username, last_access, added, uploaded, downloaded FROM users WHERE parked='yes' ORDER BY username $limit ";

$resqq = mysql_query($rqq);



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

extract ($row);



echo "<tr><td class=table_col1><a href=account-details.php?id=$row[id]>$row[username]</a></td><td class=table_col2>".utc_to_tz($row['added'])."</td><td class=table_col1>$row[last_access]</td><td class=table_col2>".mksize($row["uploaded"])."</td><td class=table_col1>".mksize($row["downloaded"])."</td><td class=table_col2><a href=account-details.php?id=$row[id]>EDIT</a></td></tr>\n";

}



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



print($pagerbottom);



end_frame();

stdfoot();

}

#======================================================================#

#  End Parked users

#======================================================================#



upload this pic to images/admin

confirmaccounts.gif
confirmaccounts.gif
Unknown User
2008-05-12 21:54:46
hi walker i don't have

Quote:
utc_to_tz
cause i have 2.02 what do i need to change to have this function?
Unknown User
2008-05-12 21:57:52
this is what I have in my functions.php for the utc_to_tz maybe it will work if you stick that in your functions.

// Convert UTC to user's timezone

function utc_to_tz ($timestamp=0) {

GLOBAL $CURUSER;

if (!is_numeric($timestamp))

$timestamp = sql_timestamp_to_unix_timestamp($timestamp);

if ($timestamp == 0)

$timestamp = gmtime();



$timestamp = $timestamp + ($CURUSER['tzoffset']*60);

return date("Y-m-d H:i:s", $timestamp);

}



function utc_to_tz_time ($timestamp=0) {

GLOBAL $CURUSER;



if (!is_numeric($timestamp))

$timestamp = sql_timestamp_to_unix_timestamp($timestamp);

if ($timestamp == 0)

$timestamp = gmtime();



$timestamp = $timestamp + ($CURUSER['tzoffset']*60);

return $timestamp;

}
Unknown User
2008-05-13 04:00:17
yep that worked!!thanks....
Unknown User
2008-05-13 17:07:17
one small problem if you have most active block or other blocks that allow access to torrents then the users can get around this mod. also if they have the download link they can get around it. to fix this add the stuff below. of course there will be other places to put the parked(); but that depends on which hacks you have installed and what you want to block for example you may want to block the casino or the forums if you have these installed.

find in torrents-details.php:

dbconn();





add after:





parked();





now find in download.php:





dbconn();





add after:





parked();
Unknown User
2008-05-14 12:11:13
thank for the upadate....
Unknown User
2008-06-02 17:47:07
none of this mod works at all adding parked() in most files gives site errors every were
Unknown User
2008-06-02 17:50:02
then paste the error?
Unknown User
2008-06-02 17:55:39
Quote:
Fatal error: Call to undefined function parked() in /home/chrisf/domains/shackers-paradise.co.uk/public_html/mailbox.php on line 13

thats just mailbox
Unknown User
2008-06-02 18:12:37
either you didn't add the code to functions or you're not putting parked(); after loggedinonly();
Unknown User
2008-06-02 18:42:54
require_once("backend/functions.php");

require_once("mailbox-functions.php");

dbconn(false);

loggedinonly();

parked();
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728