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

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

Unknown User
2008-10-21 19:13:36
thanc for very fast reply,

ok, in next day i try again without this condition
Unknown User
2008-10-22 11:33:43
I have carried out several tests, but to my opinion something does not work. CleanTime, in the config file, must be set up various from default?it is any formulation detail to set?

i have tested with 2 pc's and 2 account

with a tranfer to 80k, in 5 hour, only in one torrent, i have take only 0.3 seed point
Unknown User
2008-10-22 17:09:13
Thanks for the mod and time creating it M8 but can you ot someone else please attach or upload a already created Create mybonus.php file.

The code in the first file is formated incorrectly and its providing me with a error message due to the way its being copied and paisted.

Hope you dont mind me asking.

Regards
Unknown User
2008-10-28 09:21:55
today have a big problem...

this is my cleanup:

<?php

function do_cleanup() {

global $site_config;



//LOCAL TORRENTS - GET PEERS DATA AND UPDATE BROWSE STATS

$torrents = array();

$res = mysql_query("SELECT torrent, seeder, COUNT(*) AS c FROM peers GROUP BY torrent, seeder");

while ($row = mysql_fetch_assoc($res)) {

if ($row["seeder"] == "yes")

$key = "seeders";

else

$key = "leechers";

$torrents[$row["torrent"]][$key] = $row["c"];

}



$fields = explode(":", "comments:leechers:seeders");

$res = mysql_query("SELECT id, seeders, leechers FROM torrents WHERE external !='yes'");

while ($row = mysql_fetch_assoc($res)) {

$id = $row["id"];

$torr = $torrents[$id];

foreach ($fields as $field) {

if (!isset($torr[$field]))

$torr[$field] = 0;

}

$update = array();

foreach ($fields as $field) {

if ($torr[$field] != $row[$field])

$update[] = "$field = " . $torr[$field];

}

if (count($update))

mysql_query("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id AND external !='yes'");

}



// DELETE DOUBLE PEERS, (Toglie i peers morti da 1ora=3600 - 30min=1800)

// mysql_query("DELETE FROM peers WHERE ".gmtime()."-UNIX_TIMESTAMP(last_action) >= 1800");



// DELETE IP HISTORY, (Rimuove gli IP inutilizzati da 14 gg)

// mysql_query("DELETE FROM iplog WHERE lastused >= FROM_UNIXTIME(".(gmtime() - 1209600).")");



//LOCAL TORRENTS - MAKE NON-ACTIVE/OLD TORRENTS INVISIBLE

$deadtime = gmtime() - $site_config["max_dead_torrent_time"];

mysql_query("UPDATE torrents SET visible='no' WHERE visible='yes' AND last_action < FROM_UNIXTIME($deadtime) AND external !='yes'");



//PROMOTE USERS TO UPLOADER

//IF YOUR DEFAULT USERS CLASS IS NOT 1, CHANGE IT

//IF YOUR DEFAULT POWER USER CLASS IS NOT 2, CHANGE IT

//10 GB = 10737418240

//1 GB = 1073741824

//This variable containes the needed amount of uploaded data

$up = 134217728000;

mysql_query("UPDATE users SET class = '2' WHERE uploaded > '$up' AND class = '1'");





/////////Update Seederbonus by speed/////////

/// MOD from TBDEV - dottor

/// edited and adapted by MasterRoot

/// www.maniatorrent.org

/////////////////////////////////////////////////////

$res = mysql_query("SELECT DISTINCT userid FROM peers WHERE seeder = 'yes'") or sqlerr(__FILE__, __LINE__);



if (mysql_num_rows($res) > 0)

{

while ($arr = mysql_fetch_assoc($res))

{

$work = mysql_query("select count(*) from peers WHERE seeder ='yes' AND userid = $arr[userid]");

$row_count = mysql_result($work,0,"count(*)");

$speedu = mysql_query("SELECT sum(((p.uploaded - p.uploadoffset )) / (unix_timestamp(p.last_action) - unix_timestamp(p.started))) AS speed FROM peers p INNER JOIN users u ON p.userid=u.id WHERE u.id=$arr[userid]");



if($speeduu > "100.00")

$bonuspay="0.750"; //// if over 100kbs = 3 per hr

elseif($speeduu > "75.00")

$bonuspay="0.500"; //// if over 75 but less than 100 = 2.0 per hr

elseif($speeduu > "50.00")

$bonuspay="0.375"; //// if over 50kbs but under 75kbs = 1.5 per hr

elseif($speeduu > "30.00")

$bonuspay="0.250"; /// if over 30kbs but under 50 kbs = 1.0 an hr

elseif($speeduu > "15.00")

$bonuspay="0.1875"; //// if over 15 kbs but less than 30kbs = .75 per hr

elseif($speeduu > "1.00")

$bonuspay="0.125"; //// if over 1kbs but less than 15kbs = .5 per hr

elseif($speeduu < "1.00")

$bonuspay="0.0225"; //// less than kb/s = 1/4 per hr





mysql_query("UPDATE users SET seedbonus = seedbonus+$bonuspay*$row_count WHERE id = $arr[userid]") or sqlerr(__FILE__, __LINE__);

}

}

/////////End Update Seederbonus by speed/////////

/// MOD from TBDEV - dottor

/// edited and adapted by MasterRoot

/// www.maniatorrent.org

/////////////////////////////////////////////////////



//DELETE OLD NON-ACTIVE PEERS

$res = mysql_query("DELETE FROM peers WHERE ".gmtime()."-UNIX_TIMESTAMP(last_action) >= 1800");



//DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE

$deadtime = gmtime() - $site_config["signup_timeout"];

mysql_query("DELETE FROM users WHERE status = 'pending' AND added < FROM_UNIXTIME($deadtime)");



//LEECHWARN USERS WITH LOW RATIO



if ($site_config["ratiowarn_enable"]){

$minratio = $site_config["ratiowarn_minratio"];

$downloaded = $site_config["ratiowarn_mingigs"]*1024*1024*1024;

$length = $site_config["ratiowarn_daystowarn"];



//ADD WARNING

$res = mysql_query("SELECT id,username FROM users WHERE class = 1 AND warned = 'no' AND enabled='yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");



if (mysql_num_rows($res) > 0){

$timenow = get_date_time();

$reason = "You have been warned because of having low ratio. You need to get a ".$minratio." before next ".$length." days or your account may be banned.";



$expiretime = gmdate("Y-m-d H:i:s", gmtime() + (86400 * $length));



while ($arr = mysql_fetch_assoc($res)){

mysql_query("INSERT INTO warnings (userid, reason, added, expiry, warnedby, type) VALUES ('".$arr["id"]."','".$reason."','".$timenow."','".$expiretime."','0','Poor Ratio')");

mysql_query("UPDATE users SET warned='yes' WHERE id='".$arr["id"]."'");

mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES ('0', '".$arr["id"]."', '".$timenow."', '".$reason."', '0')");

write_log("Auto Leech warning has been <B>added</B> for: <a href=account-details.php?id=".$arr["id"].">".$arr["username"]."</a>");

}

}



//REMOVE WARNING

$res1 = mysql_query("SELECT id,username FROM users WHERE warned = 'yes' AND enabled='yes' AND uploaded / downloaded >= $minratio AND downloaded >= $downloaded");



if (mysql_num_rows($res1) > 0){

$timenow = get_date_time();

$reason = "Your warning of low ratio has been removed. We highly recommend you to keep a your ratio up to not be warned again.\n";



while ($arr1 = mysql_fetch_assoc($res1)){

write_log("Auto Leech warning has been removed for: <a href=account-details.php?id=".$arr1["id"].">".$arr1["username"]."</a>");



mysql_query("UPDATE users SET warned = 'no' WHERE id = '".$arr1["id"]."'");

mysql_query("UPDATE warnings SET expiry = '".$timenow."' WHERE userid = '".$arr1["id"]."'");

mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES ('0', '".$arr1["id"]."', '".$timenow."', '".$reason."', '0')");

}

}



//BAN WARNED USERS

$res = mysql_query("SELECT id,username FROM users WHERE class = 1 AND enabled='yes' AND warned = 'yes' AND uploaded / downloaded < $minratio AND downloaded >= $downloaded");



if (mysql_num_rows($res) > 0){

$timenow = get_date_time();

$expires = (86400 * $length);



while ($arr = mysql_fetch_assoc($res)){

$r = mysql_query("SELECT id, UNIX_TIMESTAMP(expiry) as expiry FROM warnings WHERE userid=$arr[id]");

$row = mysql_fetch_assoc($r);



if (gmtime() - $row["expiry"] >= 0) {

mysql_query("UPDATE users SET enabled='no', warned='no' WHERE id='".$arr["id"]."'");

write_log("User <a href=account-details.php?id=".$arr["id"].">".$arr["username"]."</a> has been banned (Auto Leech warning).");

}

}

}



}//check if warning system is on

//END//



//TOTAL SEED TIME

$res = mysql_query("SELECT DISTINCT userid FROM peers WHERE seeder = 'yes'") or sqlerr(__FILE__, __LINE__);

  if (mysql_num_rows($res) > 0)

  {

  while ($arr = mysql_fetch_assoc($res))

  {

  mysql_query("UPDATE users SET seed_time = seed_time+$site_config[autoclean_interval]");

  }

  }





//OPTIMISE TABLES

mysql_query("OPTIMIZE TABLE `peers` , `torrents` , `tasks` , `guests` , `users` , `messages`; ");



}//end func



?>


every time i force a clean, my seed point add + 0.3

and not count a speed!

if i seed to 1k i force clean and my point +0.3

if i seed to 60k i froce clean and my point +0.3

if i force a clean 3 times my point +0.3 +0.3 +0.3 everytime!!!

HELP!!!
Unknown User
2008-10-28 20:20:35
Here, try my cleanup and mybonus file.

The other editing for the rest of the files is simple, so just follow what it says on the very first post.

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=3107"]mybonus.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=3108"]cleanup.php[/url]
mybonus.php
Download
cleanup.php
Download
Unknown User
2008-10-29 07:33:45
ok thanx..

I have understood only now as the system to points works. I have a question, as I can visualize in login_block the value of $bonuspay and $speeduu? thanks.
Unknown User
2008-11-02 14:38:29
the mysql is wrong!

this is the right

ALTER TABLE `users` ADD `seedbonus` DECIMAL( 10, 1 ) NOT NULL;



DROP TABLE IF EXISTS `bonus`;

CREATE TABLE `bonus` (

`id` int(5) NOT NULL auto_increment,

`bonusname` varchar(50) NOT NULL default '',

`points` decimal(4,1) NOT NULL default '000.0',

`description` text NOT NULL,

`art` varchar(10) NOT NULL default 'traffic',

`menge` bigint(20) unsigned NOT NULL default '0',

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=11;



INSERT INTO `bonus` VALUES (1, '1.0GB Uploaded', 75.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 1073741824);

INSERT INTO `bonus` VALUES (2, '2.5GB Uploaded', 150.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 2684354560);

INSERT INTO `bonus` VALUES (3, '5GB Uploaded', 250.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 5368709120);

INSERT INTO `bonus` VALUES (7, '3 Invites', 20.0, 'Trade your points in for invites to the site.', 'invite', 3);

INSERT INTO `bonus` VALUES (6, '1 Invite', 10.0, 'Trade your points in for invites to the site.', 'invite', 1);

INSERT INTO `bonus` VALUES (8, '10 Invites', 50.0, 'Trade your points in for invites to the site.', 'invite', 10);

INSERT INTO `bonus` VALUES (9, '15 Invites', 75.0, 'Trade your points in for invites to the site.', 'invite', 15);

INSERT INTO `bonus` VALUES (10, '25 Invites', 100.0, 'Trade your points in for invites to the site.', 'invite', 25);

INSERT INTO `bonus` VALUES (4, '10GB Uploaded', 400.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 10737418240);

INSERT INTO `bonus` VALUES (5, '25GB Uploaded', 1000.0, 'If you reach the points for this case, you can exchange these points on the fly into traffic, we take off the points and you receive the traffic.', 'traffic', 26843545600);
Unknown User
2008-11-05 08:25:19
what is the difference?
Unknown User
2009-01-16 13:47:57
Here you can exchange your Seeder-Bonus (currently: ).

(If the button's deactivated, you do not have enough to trade.)

Fatal error: Call to undefined function phpprint()  ????
Unknown User
2009-02-07 18:15:46
thanks works great for me ;)
Unknown User
2009-02-07 22:42:23
this mod is not complete.

this part can't be right calculate

$speedu = mysql_query("SELECT sum(((p.uploaded - p.uploadoffset )) / (unix_timestamp(p.last_action) - unix_timestamp(p.started))) AS speed FROM peers p INNER JOIN users u ON p.userid=u.id WHERE u.id=$arr[userid]");


cause uploadoffset is not in v2 peers fields
Unknown User
2009-03-27 19:02:05
hello

How buy the class VIP for 30 day please

thanks
Unknown User
2009-05-29 09:39:38
Any way to make an extra option so that a user can use points to upgrade his class to VIP?

This would be very handy.
Unknown User
2009-05-29 23:06:07
i know of someon who has coded this for there own purpose but its not relased on here. yes it can be done.
Unknown User
2009-06-04 21:20:05
If i want give some point with uplaod and download rate.

Exemple :

i have send 300Mb, I received 30points.

I download a movie (700mb), I received 70 pts

(0.10 pt / 1mb in up)

Thx a lot
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