<?php
/**
*
* @package ppkBB3cker
* @version $Id: taselfstopped.php 1.000 2009-03-21 14:37:00 PPK $
* @copyright (c) 2008, 2009 PPK
* http://ppkbb3cker.rx22.ru, http://protoneutron.narod.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

		$result = my_sql_query("UPDATE ". TRACKER_SNATCHED_TABLE ." SET seeder = 'no', connectable='no'".($updatesnatch ? ', '.implode(', ', $updatesnatch) : '')." WHERE torrent = '$torrentid' AND userid = '$userid'");

		$result = my_sql_query("DELETE FROM ". TRACKER_PEERS_TABLE ." tp WHERE $selfwhere");
		if (mysql_affected_rows())
		{
			if ($attachment['seeder'] == 'yes')
			{
				$updateset[] = isset($t_seeders) ? "seeders = '".($t_seeders - 1 > 0 ? $t_seeders - 1 : 0)."'" : "seeders = '".($user['seeders'] - 1 > 0 ? $user['seeders'] - 1 : 0)."'";
				$t_updated=1;
			}
			else
			{
				$updateset[] = isset($t_leechers) ? "leechers = '".($t_leechers - 1 > 0 ? $t_leechers - 1 : 0)."'" : "leechers = '".($user['leechers'] - 1 > 0 ? $user['leechers'] - 1 : 0)."'";
				$t_updated=1;
			}
		}
?>