<?php/**********************************************\| SMFSHOP (Shop MOD for Simple Machines Forum) || (c) 2006 DanSoft Australia || http://www.dansoftaustralia.net/ |\**********************************************///File: RedBall.php// Item// VERSION: 2.3 (Build 11)// $Date: 2006-10-21 13:34:18 +1000 (Sat, 21 Oct 2006) $// $Id: RedBall.php 24 2006-10-21 03:34:18Z MH $class item_RedBall extends itemTemplate { function getItemDetails() { $this->authorName = "Masterhand"; $this->authorWeb = "GAC"; $this->authorEmail = "austin.r.tanay@gmail.com"; $this->name = "RedBall"; $this->desc = "Bounce It And See What it Does!"; $this->price = 200; } function getUseInput() { global $context, $scripturl, $settings, $txt; return "Bounce to: <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; if (!isset($_POST['username']) || $_POST['username'] == '') die("ERROR: Please enter a username!"); $result = db_query("UPDATE {$db_prefix}members SET posts = posts - 100 WHERE memberName = '{$_POST['username']}'", __FILE__, __LINE__); return "Uh-Oh, The Ball Bounced around, and {$_POST['username']}Missed it and it knocked him out, and he lost some of his post count by 100..Whoops.."; }}?>
<?php/**********************************************\| SMFSHOP (Shop MOD for Simple Machines Forum) || (c) 2006 DanSoft Australia || http://www.dansoftaustralia.net/ |\**********************************************///File: Redball2.php// VERSION: 2.3 (Build 11)// $Date: 2006-11-17 13:34:18 +1000 (Fri, 17 Nov 2006) $// $Id: Redball2.php 24 2006-10-21 03:34:18Z Mh $global $sourcedir;require_once($sourcedir . '/Subs-Post.php');class item_Redball2 extends itemTemplate { function getItemDetails() { $this->authorName = "Masterhand"; $this->authorWeb = "http://www.gameandcoders.uni.cc"; $this->authorEmail = "austin.r.tanay@gmail.com"; $this->name = "RedBall2"; $this->desc = "Redball 2"; // The item's price $this->price = 100; $this->require_input = true; $this->can_use_item = true; } function getAddInput() { return "Max amount to give: <input type='text' name='info1' value='100'><br> Max amount to take: <input type='text' name='info2' value='-100'>"; } function getUseInput() { global $context, $scripturl, $settings, $txt; return "Bounce To: <input type='text' name='stealfrom' size='50'> <a href='{$scripturl}?action=findmember;input=stealfrom;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>"; } function onUse() { global $db_prefix, $ID_MEMBER, $user, $item_info; $pmfrom = array( 'id' => 1, 'name' => 'Admin', 'username' => 'Admin' ); $pmto = array( 'to' => array($_POST['stealfrom']), 'bcc' => array() ); $result = db_query("SELECT realName FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_array($result, MYSQL_ASSOC);$user = $row["realName"]; if ($user == $_POST['stealfrom']) {return "You cant throw it too yourself!";die(); }else {$amount = mt_rand($item_info[2], $item_info[1]);$result = db_query("UPDATE {$db_prefix}members SET money = money + {$amount} WHERE realName = '{$_POST['stealfrom']}'", __FILE__, __LINE__); sendpm($pmto, 'Heres a redball?', "<b>{$user}</b> Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); ; return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!"; $result = db_query("SELECT ID_MEMBER FROM {$db_prefix}members WHERE realName = '{$_POST['stealfrom']}'", __FILE__, __LINE__); $row = mysql_fetch_array($result, MYSQL_ASSOC); } } }?>
<?php/**********************************************\| SMFSHOP (Shop MOD for Simple Machines Forum) || (c) 2006 DanSoft Australia || http://www.dansoftaustralia.net/ |\**********************************************///File: Redball2.php// VERSION: 2.3 (Build 11)// $Date: 2006-11-17 13:34:18 +1000 (Fri, 17 Nov 2006) $// $Id: Redball2.php 24 2006-10-21 03:34:18Z Mh $class item_Redball2 extends itemTemplate { function getItemDetails() { $this->authorName = "Masterhand"; $this->authorWeb = "http://www.gameandcoders.uni.cc"; $this->authorEmail = "austin.r.tanay@gmail.com"; $this->name = "RedBall2"; $this->desc = "Redball 2"; // The item's price $this->price = 100; $this->require_input = true; $this->can_use_item = true; } function getAddInput() { return "Max amount to give: <input type='text' name='info1' value='100'><br> Max amount to take: <input type='text' name='info2' value='-100'>"; } function getUseInput() { global $context, $scripturl, $settings, $txt; return "Bounce To: <input type='text' name='stealfrom' size='50'> <a href='{$scripturl}?action=findmember;input=stealfrom;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>"; } function onUse() { global $db_prefix, $ID_MEMBER, $item_info; $result = db_query("SELECT memberName FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_array($result, MYSQL_ASSOC);$user = $row["memberName"]; if ($user == $_POST[‘stealfrom’]) {return "You cant throw it too yourself tbh!!!";die(); }else {$amount = mt_rand($item_info[2], $item_info[1]);$result = db_query("UPDATE {$db_prefix}members SET money = money + {$amount} WHERE memberName = '{$_POST[‘stealfrom’]}'", __FILE__, __LINE__);global $sourcedir;require_once($sourcedir . '/Subs-Post.php');$result = db_query("SELECT ID_MEMBER FROM {$db_prefix}members WHERE memberName = '{$_POST[‘stealfrom’]}'", __FILE__, __LINE__);$row = mysql_fetch_array($result, MYSQL_ASSOC);$pmfrom = array('id' => 1,'name' => 'Masterhand','username' => 'Masterhand');$pmto = array('to' => array($row['ID_MEMBER']),'bcc' => array());sendpm($pmto, 'Care For Some Ball?', "{$user} Bounces The Ball To You And You Lose ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); } } }?>
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')ORDER BY mem.lngfileLIMIT 0' at line 8File: /home/sites/opiate2.com/public_html/forum/Sources/Subs-Post.phpLine: 739
WHERE memberName = '{$_POST[‘stealfrom’]}'"
<?php/**********************************************\| SMFSHOP (Shop MOD for Simple Machines Forum) || (c) 2006 DanSoft Australia || http://www.dansoftaustralia.net/ |\**********************************************///File: Redball2.php// VERSION: 2.3 (Build 11)// $Date: 2006-11-17 13:34:18 +1000 (Fri, 17 Nov 2006) $// $Id: Redball2.php 24 2006-10-21 03:34:18Z Mh $class item_Redball2 extends itemTemplate { function getItemDetails() { $this->authorName = "Masterhand"; $this->authorWeb = "http://www.gameandcoders.uni.cc"; $this->authorEmail = "austin.r.tanay@gmail.com"; $this->name = "RedBall2"; $this->desc = "Redball 2"; // The item's price $this->price = 100; $this->require_input = true; $this->can_use_item = true; } function getAddInput() { return "Max amount to give: <input type='text' name='info1' value='100'><br> Max amount to take: <input type='text' name='info2' value='-100'>"; } function getUseInput() { global $context, $scripturl, $settings, $txt; return "Bounce To: <input type='text' name='stealfrom' size='50'> <a href='{$scripturl}?action=findmember;input=stealfrom;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>"; } function onUse() { global $db_prefix, $ID_MEMBER, $item_info; $result = db_query("SELECT memberName FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_array($result, MYSQL_ASSOC);$user = $row["memberName"]; if ($user == $_POST[‘stealfrom’]) {return "You cant throw it too yourself tbh!!!";die(); }else {$amount = mt_rand($item_info[2], $item_info[1]);$result = db_query("UPDATE {$db_prefix}members SET money = money + {$amount} WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!"; /*global $sourcedir;require_once($sourcedir . '/Subs-Post.php');*/$result = db_query("SELECT ID_MEMBER FROM {$db_prefix}members WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);$row = mysql_fetch_array($result, MYSQL_ASSOC);$pmfrom = array('id' => 1,'name' => 'Masterhand','username' => 'Masterhand');$pmto = array('to' => array($row['ID_MEMBER']),'bcc' => array());sendpm($pmto, 'Heres a redball?', "{$user} Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); ; } } }?>
Got it working. Full code belowCode: [Select]<?php/**********************************************\| SMFSHOP (Shop MOD for Simple Machines Forum) || (c) 2006 DanSoft Australia || http://www.dansoftaustralia.net/ |\**********************************************///File: Redball2.php// VERSION: 2.3 (Build 11)// $Date: 2006-11-17 13:34:18 +1000 (Fri, 17 Nov 2006) $// $Id: Redball2.php 24 2006-10-21 03:34:18Z Mh $class item_Redball2 extends itemTemplate { function getItemDetails() { $this->authorName = "Masterhand"; $this->authorWeb = "http://www.gameandcoders.uni.cc"; $this->authorEmail = "austin.r.tanay@gmail.com"; $this->name = "RedBall2"; $this->desc = "Redball 2"; // The item's price $this->price = 100; $this->require_input = true; $this->can_use_item = true; } function getAddInput() { return "Max amount to give: <input type='text' name='info1' value='100'><br> Max amount to take: <input type='text' name='info2' value='-100'>"; } function getUseInput() { global $context, $scripturl, $settings, $txt; return "Bounce To: <input type='text' name='stealfrom' size='50'> <a href='{$scripturl}?action=findmember;input=stealfrom;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>"; } function onUse() { global $db_prefix, $ID_MEMBER, $item_info; $result = db_query("SELECT memberName FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__); $row = mysql_fetch_array($result, MYSQL_ASSOC);$user = $row["memberName"]; if ($user == $_POST[‘stealfrom’]) {return "You cant throw it too yourself tbh!!!";die(); }else {$amount = mt_rand($item_info[2], $item_info[1]);$result = db_query("UPDATE {$db_prefix}members SET money = money + {$amount} WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!"; /*global $sourcedir;require_once($sourcedir . '/Subs-Post.php');*/$result = db_query("SELECT ID_MEMBER FROM {$db_prefix}members WHERE memberName = '{$_POST['stealfrom']}'", __FILE__, __LINE__);$row = mysql_fetch_array($result, MYSQL_ASSOC);$pmfrom = array('id' => 1,'name' => 'Masterhand','username' => 'Masterhand');$pmto = array('to' => array($row['ID_MEMBER']),'bcc' => array());sendpm($pmto, 'Heres a redball?', "{$user} Bounces The Ball To You And You Lose/Win ".formatMoney($amount)."! [i] You do not need to reply to this automated message", 0, $pmfrom); ; } } }?>Thanks to Masterhand for this great item