1
Items / Re: Help with my Item: Soul Eater
« on: December 20, 2006, 11:15:00 pm »
Nup.... just nothing happend XD
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
| (c) 2006 DanSoft Australia |
| http://www.dansoftaustralia.net/ |
\**********************************************/
//File: testitem.php
// Test Item (requires NO input)
// VERSION: 2.3 (Build 11)
// $Date: 2006-10-21 13:34:18 +1000 (Sat, 21 Oct 2006) $
// $Id: testitem.php 24 2006-10-21 03:34:18Z daniel15 $
// Your class should always be called item_filename, eg. if your file is
// myCoolItem.php then the class should be called 'item_myCoolItem'. This
// class should always extend itemTemplate.
class item_chupasangre extends itemTemplate {
// When this function is called, you should set all the item's
// variables (see inside this example)
function getItemDetails() {
// The author's name
$this->authorName = "Checho";
// The author's website
$this->authorWeb = "http://www.foro-qliao.cl.nu/";
// The author's email address
$this->authorEmail = "chechovacan@gmail.com";
//VALUES CHANGEABLE FROM WITHIN ADMIN PANEL:
// The name of the item
$this->name = "Chupasangre";
// The item's description
$this->desc = "Este item te permite robar cosmo y agregarlo al tuyo";
// The item's price
$this->price = 100000;
}
function getUseInput() {
global $context, $scripturl, $settings, $txt;
return "Nombre de usuario: <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']}' /> Burcar</a><br />";
}
function onUse() {
global $db_prefix, $ID_MEMBER, $item_info;
if (!isset($_POST['username']) || $_POST['username'] == '') die("ERROR: Debes ingresar un nombre de usuario!");
// if (!isset($ID_MEMBER == '(money < 30)') die("Debes tener almenos 30 de oro para usar este item");
$result = db_query("UPDATE {$db_prefix}members
SET karmaGood = karmaGood + 15, money = money - 30
WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$result = db_query("UPDATE {$db_prefix}members
SET karmaBad = karmaBad + 15
WHERE memberName = '{$_POST['username']}'",
__FILE__, __LINE__);
return "Le haz robado 15 puntos de cosmo a {$_POST['username']}!";
}
}
?>