SMFShop > Modifications
Remove bad karma
Alundra:
i want something that lets users shake off some bad karma for a fee...
i have the karma separated as 10/-10 and i wish for the -10 side to change lol
i think it would be great
Alundra:
LOL!!
im sorry...i put this in the wrong topic :-\
now i feel REALLY blonde lol
zsw007:
--- Quote from: Alundra on September 27, 2007, 07:52:25 am ---i want something that lets users shake off some bad karma for a fee...
i have the karma separated as 10/-10 and i wish for the -10 side to change lol
i think it would be great
--- End quote ---
you could just do
--- Code: ---SET karmaBad = karmaBad - {$item_info[1]}
--- End code ---
ect
Alundra:
i dont know how to make a mod..
???
zsw007:
--- Quote from: Alundra on October 09, 2007, 06:24:07 am ---i dont know how to make a mod..
???
--- End quote ---
im not an expert either, but try this:
name the file RemoveBadKarma.php
--- Code: ---<?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:: IncreaseKarma.php 79 2007-01-18 08:26:55Z daniel15 $ *
* 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_RemoveBadKarma extends itemTemplate
{
function getItemDetails()
{
$this->authorName = 'zsw';
$this->authorWeb = 'http://www1.freewebs.com/sgasquad/joinsga.htm';
$this->authorEmail = 'zsw007@hotmail.com';
$this->name = 'Remove Bad Karma by xxx';
$this->desc = 'Remove your Bad Karma by xxx';
$this->price = 200;
$this->require_input = false;
$this->can_use_item = true;
$this->addInput_editable = true;
}
// See 'AddToPostCount.php' for info on how this works
function getAddInput()
{
global $user_info;
if ($item_info[1] == 0) $item_info[1] = 5;
return 'Amount to remove bad Karma by: <input type="text" name="info1" value="' . $item_info[1] . '" />';
}
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info;
db_query("
UPDATE {$db_prefix}members
SET karmaBad = karmaBad - {$item_info[1]}
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return 'Successfully removed your bad Karma by ' . $item_info[1] . '!';
}
}
?>
--- End code ---
if this is not right, someone please correct me :)
Navigation
[0] Message Index
[#] Next page
Go to full version