1
Items / [New Item] Bolsa/Saco de creditos (Spanish)
« on: May 13, 2008, 08:27:37 am »
¿Querias saber como hacer bolsas y sacos de dinero?
Pues aquí te dejo el código.
El item debe llamarse Dinero.php para que funcione.
Se aceptan +
Fuente Solotrades
SldS!
Pues aquí te dejo el código.
El item debe llamarse Dinero.php para que funcione.
Code: [Select]
<?php
/**********************************************************************************
* SMFShop item - Takes additional fields when adding to admin panel *
***********************************************************************************
* 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:: AddToPostCount.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_Dinero extends itemTemplate
{
function getItemDetails()
{
$this->authorName = 'Hermalon';
$this->authorWeb = 'http://www.solotrades.com/';
$this->authorEmail = 'hermalon@hotmail.com';
$this->name = 'Bolsa con XXX cantidad';
$this->desc = 'Bolsa de XXX créditos';
$this->price = 50;
$this->require_input = false;
$this->can_use_item = true;
$this->addInput_editable = true;
}
// This is the best bit of this item. When you add the item into the admin panel, you
// can set additional variables (up to 4). Make sure to call them info1, info2, info3
// and info4.
function getAddInput()
{
global $item_info;
if ($item_info[1] == 0) $item_info[1] = 1000;
return 'Cantidad del cheque: <input type="text" name="info1" value="' . $item_info[1] . '" />';
}
// The additional parameters (see 'getAddInput' above) are in the $item_info array.
// Make sure to make it global (like shown here) otherwise you won't be able to access
// its contents. THE ARRAY IS 1-BASED (1 IS THE FIRST ITEM) NOT 0-BASED!
function onUse()
{
global $db_prefix, $ID_MEMBER, $item_info;
db_query("
UPDATE {$db_prefix}members
SET money = money + {$item_info[1]}
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return 'La transacción ha sido realizada con éxito. Ahora usted tiene ' . $item_info[1] . ' créditos en su monedero.';
}
}
?>
Se aceptan +
Fuente Solotrades
SldS!