SMFShop > Items

[New Item] Bolsa/Saco de creditos (Spanish)

(1/1)

Production:
¿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.


--- Code: ---<?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&eacute;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&oacute;n ha sido realizada con &eacute;xito. Ahora usted tiene ' . $item_info[1] . ' cr&eacute;ditos en su monedero.'; }}?>

--- End code ---

Se aceptan +

Fuente Solotrades

SldS!

pablo24:
No me funciona, hay alguna forma de que funcione en la shop 3.1.6 con smf 2.0rc3
Ya que quiero tener el item :(

dhayzon:
como funciona esto exactamente?

Navigation

[0] Message Index

Go to full version