Author Topic: User selected Post Reducer  (Read 2505 times)

pspmasterPRO

  • Guest
User selected Post Reducer
« on: September 02, 2007, 01:32:56 am »
this item will reduce the selected user's post count to 0 hahahahahah oh and I rushed in making this so Daniel can you check for snytax errors or so

enjoy  ;D


Code: [Select]
<?php
/**********************************************************************************
* SMFShop item                                                                    *
***********************************************************************************
* SMFShop: Shop MOD for Simple Machines Forum                                     *
* =============================================================================== *
* Software Version:           SMFShop 3.0 (Build 12)                              *
* $Date:: 2007-01-18 19:26:55 +1100 (Thu, 18 Jan 2007)                          $ *
* $Id:: postreducer.php 79 2007-01-18 08:26:55Z by: pspmasterpro                $ *
* Software by:                DanSoft Australia (http://www.dansoftaustralia.net/)*
* Copyright 2005-2007 by:     DanSoft Australia (http://www.dansoftaustralia.net/)*
* Support, News, Updates at:  http://www.dansoftaustralia.net/                    *
*                                                                                 *
* Forum software by:          Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2007 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version of the license can always be found at                        *
* http://www.simplemachines.org.                                                  *
**********************************************************************************/

if (!defined('SMF'))
die('Hacking attempt...');

class 
item_postreducer extends itemTemplate
{
function getItemDetails()
{
$this->authorName 'pspmasterpro';
$this->authorWeb 'http://pspmasterpro.phnet.us';
$this->authorEmail 'E-mail hidden';

$this->name 'postreducer';
$this->desc 'Decrease <i>Someone else\'s</i> post count to 0!!';
$this->price 999999999;

$this->require_input flase;
$this->can_use_item true;
$this->addInput_editable true;

}

function getUseInput()
{
global $context$scripturl$settings$txt;
return 'Member\'s Name: <input type="text" name="username" />
<a href="' 
$scripturl '?action=findmember;input=username;quote=0;sesc=' $context['session_id'] . '" onclick="return reqWin(this.href, 350, 400);"><img src="' $settings['images_url'] . '/icons/assist.gif" border="0" alt="' $txt['find_members'] . '" /> Find Member</a><br />';
}

function onUse()
{
global $db_prefix$ID_MEMBER$item_info;

if ($item_info[1] == 0$item_info[1] = 0;

if (!isset($_POST['username']) || $_POST['username'] == '')
die('ERROR: Please enter a victem!');

// This code from PersonalMessage.php5. It trims the " characters off the membername posted, 
// and then puts all names into an array
$_POST['username'] = strtr($_POST['username'], array('\\"' => '"'));
preg_match_all('~"([^"]+)"~'$_POST['username'], $matches);
$userArray array_unique(array_merge($matches[1], explode(','preg_replace('~"([^"]+)"~'''$_POST['username']))));

// We only want the first memberName found
$user $userArray[0];

$result db_query("
UPDATE 
{$db_prefix}members
SET posts = posts = 0
WHERE memberName = '
{$user}'"__FILE____LINE__);
return 'The power of pspmasterpro has successfully reduced ' $_POST['username'] . '\'s posts to 0 !';
}

}

?>




Offline Dark_Zero

Re: User selected Post Reducer
« Reply #1 on: September 02, 2007, 12:51:10 pm »
wow a watered down postkiller; why dont you just add it as an update to your other one?

pspmasterPRO

  • Guest
Re: User selected Post Reducer
« Reply #2 on: September 02, 2007, 11:23:13 pm »
cause the other one resets every bodys post counts to 0 while this one only resets the selected user's post count to 0  :P

Offline Daniel15

Re: User selected Post Reducer
« Reply #3 on: September 08, 2007, 12:45:46 pm »
Quote
SET posts = posts = 0
I think that should just be SET posts = 0 ;)