Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 30th October 2009, 14:35
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 171
Default Reset Invites
PHP Code:
<?php

/*******************************************\
|* Reset Invites by Alex2005 for TBDEV.NET *|
\*******************************************/

include('include/bittorrent.php');
dbconn();
loggedinorreturn();

if (
get_user_class() != UC_SYSOP)
    
stderr('Error''Access Denied!');

if (
$_GET['confirm'] != 1)
    
stderr('Sanity check!''Click <a href='.$_SERVER['PHP_SELF'].'?confirm=1>here</a> if you are sure you want to reset all users invites to 0.');
else
{
    
$res mysql_query('SELECT id FROM users WHERE invites > 0 AND enabled = \'yes\' AND status = \'confirmed\'') or sqlerr(__FILE____LINE__);
    
    if (
mysql_num_rows($res) > 0)
    {
        
$ids = array();
        
        while (
$arr mysql_fetch_assoc($res))
            
$ids[] = $arr['id'];
        
        
mysql_query('UPDATE users SET invites = 0 WHERE id IN ('.implode(' ,'$ids).')') or sqlerr(__FILE____LINE__);
        
        
stderr('Success'mysql_affected_rows().' user\'s invites reseted.');
    }
    else
        
stderr('Sorry''Nothing to reset.');
}
?>
Reply With Quote
The Following 2 Users Say Thank You to elvira For This Useful Post:
kalwin (19th January 2012), Tibys08 (29th May 2011)
Reply

Tags
invites , reset

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invites mod Subzero Mods & Themes 19 1st March 2017 06:14
Lockerz.com Invites DrNet Community Cafe 6 24th February 2010 14:41
Any Torrent Invites? 1only Community Cafe 0 20th December 2009 01:57
ICTorrents Invites kooldre Tracker Invites 2 14th March 2009 18:39
Invites in PR7 zerovz Yuna Scatari Edition (YSE) 3 27th January 2009 03:38



All times are GMT +2. The time now is 23:51. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.