SMF Shop

SMFShop => Completed Additions => Items => Topic started by: Masterhand on November 17, 2006, 09:49:19 am

Title: New items: Red Balls
Post by: Masterhand on November 17, 2006, 09:49:19 am
Here are the 2 files for the Redball items - There fun,
I had fun making them too.

Redball
Code: [Select]
<?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..";
    }

}

?>

Redball 2
Code: [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 $
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($resultMYSQL_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($resultMYSQL_ASSOC);


            }

  }
  }

?>

Title: Re: New item: Red Ball
Post by: Basil Beard on November 17, 2006, 12:49:59 pm
You should change the code to make the target have a change to catch (and keep) the ball instead of missing. =)
Title: Re: New item: Red Ball
Post by: Masterhand on November 17, 2006, 09:32:17 pm
See First Post For Files
Title: Re: New item: Red Ball
Post by: Basil Beard on November 18, 2006, 02:05:34 pm
Cool. =).

(Be warned, this code won't work, hoever, because you used a quote mark for the "can't", thus throwing off the rest of the code. Use '`' instead =P.)
Title: Re: New item: Red Ball
Post by: Masterhand on November 18, 2006, 07:46:07 pm
 :D No, won't work, says: Prase Error: enespected T_IF ....*sigh*
Title: Re: New item: Red Ball
Post by: Basil Beard on November 19, 2006, 12:34:51 am
"$user = $row[‘memberName’]" doesn't have a semi colon ;-) (it should)
Title: Re: New item: Red Ball
Post by: Masterhand on November 19, 2006, 02:00:27 am
$user = $row["memberName"], Ok, i'll try that.

EDIT: Nope, Parse error: syntax error, unexpected T_IF in /home/***/public_html/forum/Sources/shop/items/Redball2.php on line 59

 
Title: Re: New item: Red Ball
Post by: Basil Beard on November 19, 2006, 10:25:14 am
So you added the semi colon after that? Strange. You shouldn't be getting that error. =(
Title: Re: New item: Red Ball
Post by: Masterhand on November 19, 2006, 09:21:55 pm
Yea, it is...
Title: Re: New item: Red Ball
Post by: Lucid_Dream on December 19, 2006, 08:27:52 am
I tried to sort this out for you but only got this far

Code: [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($resultMYSQL_ASSOC);
$user $row["memberName"];
       
       if (
$user == $_POST[&#8216;stealfrom&#8217;]) {
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[&#8216;stealfrom&#8217;]}'", __FILE__, __LINE__);

global $sourcedir;
require_once(
$sourcedir '/Subs-Post.php');

$result db_query("SELECT ID_MEMBER
       FROM 
{$db_prefix}members
                           WHERE memberName = '
{$_POST[&#8216;stealfrom&#8217;]}'", __FILE__, __LINE__);
$row mysql_fetch_array($resultMYSQL_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);                                           
            }


  }
  }

?>


Can add the item to the shop and buy but when i go to use it does this

Quote
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.lngfile
LIMIT 0' at line 8
File: /home/sites/opiate2.com/public_html/forum/Sources/Subs-Post.php
Line: 739

Will look at it again l8r, ur only problem was some syntax errors from wat i saw.    Sorry if i overstepped myself but i wanted this item on my site and thought i'd give it a tinker.
Title: Re: New item: Red Ball
Post by: Daniel15 on December 20, 2006, 05:29:17 pm
Code: [Select]
WHERE memberName = '{$_POST[‘stealfrom’]}'"That doesn't look right... That ‘ and ’ should probably be single quotes ( ' )
Title: Re: New item: Red Ball
Post by: Lucid_Dream on December 20, 2006, 10:09:14 pm
Got it working.  Full code below

Code: [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($resultMYSQL_ASSOC);
$user $row["memberName"];
       
       if (
$user == $_POST[&#8216;stealfrom&#8217;]) {
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($resultMYSQL_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
Title: Re: New item: Red Ball
Post by: Masterhand on December 21, 2006, 01:15:06 am
Got it working.  Full code below

Code: [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($resultMYSQL_ASSOC);
$user $row["memberName"];
       
       if (
$user == $_POST[&#8216;stealfrom&#8217;]) {
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($resultMYSQL_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

Your welcome xD, and thank you!  :)
Title: Re: New items: Red Balls
Post by: Lucid_Dream on December 21, 2006, 02:06:34 am
Its no problem man, no need to give me credit, ur the one that coded it i just found the syntax error. 
Title: Re: New items: Red Balls
Post by: Masterhand on December 21, 2006, 05:19:18 am
Ok, but thanks anyway.
Title: Re: New items: Red Balls
Post by: jdv on December 24, 2006, 12:55:51 am
i got the following error after i tried using your shop item.

Parse error: parse error, unexpected '&', expecting ']'
Title: Re: New items: Red Balls
Post by: jdv on December 24, 2006, 01:15:58 am
line 59 is where the parse error was or indicated.
Title: Re: New items: Red Balls
Post by: Masterhand on December 31, 2006, 10:42:20 am
Sorry about that, old browser added it, and its fixed.
Title: Re: New items: Red Balls
Post by: jdv on December 31, 2006, 11:59:53 am
thanks.

redball one basically took 100 posts away from the person i threw it too.

as for redball2, i passed the ball and it said the person may or may not catch it. does anything happen beside that? they didnt get no pm or nothing and nothing follows whether the person caught it or not? i dont think redball2 is working.
Title: Re: New items: Red Balls
Post by: Lucid_Dream on January 03, 2007, 12:23:36 pm
Hmm still works on my site.  Will have a quick look at it again
Title: Re: New items: Red Balls
Post by: cheesenub on January 06, 2007, 02:37:42 am
I don't think this is working. When I throw the ball, the person I throw it to doesn't receive it or gets a message about receiving it.

Also, when I try to throw the ball to myself, it doesn't give me the "You can't throw it to yourself tbh!!!" return.


This part looks a little weird to me:

$pmfrom = array(
'id' => 1,
'name' => 'Masterhand',
'username' => 'Masterhand'
);


Should this be changed to something else?
Title: Re: New items: Red Balls
Post by: Masterhand on January 12, 2007, 03:11:49 am
Cheesenub; When your enter your username, it has to be the exact way you see it, not your display name..I think.

2: The reason why the PM isn't working is because this bit of code is disabled:

Code: [Select]
/*global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
*/
Because it gives errors.

If you want to try it, remove the /* and the */ .
Works fine for me....

Title: Re: New items: Red Balls
Post by: babylonking on January 22, 2007, 09:31:09 am
Same problem here the PM is not working, I also added the code below and still is not sending PM.

Code: [Select]
global $sourcedir;
require_once($sourcedir . '/Subs-Post.php');
Title: Re: New items: Red Balls
Post by: mikemotorcade on January 31, 2007, 04:42:58 am
So how do I download it?
Title: Re: New items: Red Balls
Post by: Masterhand on March 06, 2007, 01:01:54 am
Create a file called redball.php in your /shop/items directory. Then copy the code into the file.
After that, you add the item in your Shot ACP.
(Sorry about being away for a while, i was busy alot).
I will take a look at the code and see why the pm function is not working in Redball 2...
Title: Re: New items: Red Balls
Post by: babylonking on March 13, 2007, 11:14:50 pm
with the PM code below the RedBall is sending PM now  :)

Code: [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 $
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($resultMYSQL_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($resultMYSQL_ASSOC);


            }

  }
  }

?>
Title: Re: New items: Red Balls
Post by: Lew_Cipher on March 15, 2007, 11:29:31 pm
Great item! I changed it around and turned it into passing a football for my sports-themed board. Thanks! O0
Title: Re: New items: Red Balls
Post by: Masterhand on March 17, 2007, 02:10:46 am
Thanks Bl; I'll update the first post right away.
@Lew_Cipher: Sounds great, could i have a link? (Im a sports fan)
Title: Re: New items: Red Balls
Post by: Lew_Cipher on March 17, 2007, 06:16:54 am
Thanks Bl; I'll update the first post right away.
@Lew_Cipher: Sounds great, could i have a link? (Im a sports fan)

You have a PM.

My members have been using this mod like crazy since I installed it.
Title: Re: New items: Red Balls
Post by: Jamie on April 21, 2007, 06:20:06 am
Its not working for me. I get "ERROR: Could not create instance of 'redball' item!" when I open the add/edit/delete items page
Title: Re: New items: Red Balls
Post by: David on April 21, 2007, 08:39:39 am
Its not working for me. I get "ERROR: Could not create instance of 'redball' item!" when I open the add/edit/delete items page

 Check that you have given the item the right file name...look for a line in the file like:

//File: Redball2.php

That file would be named Redball2.php
Title: Re: New items: Red Balls
Post by: perplexed on April 21, 2007, 06:42:28 pm
are there images that go with this item, I saw 'assist.gif' mentioned in the code but no image, or a ball maybe?

Title: Re: New items: Red Balls
Post by: David on April 21, 2007, 08:00:05 pm
I made this one:

Title: Re: New items: Red Balls
Post by: perplexed on April 21, 2007, 08:02:52 pm
so what happens with this?  The members get a PM with this ball in it, and then have to respond?

is this what the 'assist.gif' is or is that something else?
Title: Re: New items: Red Balls
Post by: David on April 21, 2007, 08:56:17 pm
The image I gave you just gets used in the shop buy screens...makes it look pretty.

 To see what redball does why not just put it in your test forum and play with it?

 assist.gif is a standard part of your forum...it's used all over the show. I'll post it for you and I'm sure you'll recognise it right away.
Title: Re: New items: Red Balls
Post by: perplexed on April 21, 2007, 09:21:59 pm
The image I gave you just gets used in the shop buy screens...makes it look pretty.

 To see what redball does why not just put it in your test forum and play with it?

 assist.gif is a standard part of your forum...it's used all over the show. I'll post it for you and I'm sure you'll recognise it right away.

lol yes that would be easier wouldnt it, rather than asking a bunch of dumb questions... but I can't access it at the moment unfortunately.  :(

I had in my head that this had some kind of bouncing ball effect  :D
Title: Re: New items: Red Balls
Post by: David on April 21, 2007, 09:42:50 pm
I've got it (and redball 2) on a test forum of mine and you're welcome to play about with it there if that would help...holler via PM and I'll give you the details.
Title: Re: New items: Red Balls
Post by: dumbelljunkie on May 23, 2007, 06:36:11 pm
One of my members asked why they didn't receive any notification about the redball2. The one you throw it at get's the PM but the one who threw it doesn't know if he lost or wins ?

Could that be fixed in anyway ?
The items gets bought a lot so they must like it :)
Title: Re: New items: Red Balls
Post by: Joker Grafix on June 11, 2007, 07:35:10 am
With Redball 1 instead of it dropping the person's post count by 100 (like it says it goes) it gives them like 16,000 post counts.

I can't see where to adjust this in the php coding as it says it only does "100", and it adds the "I am a geek" in the post count itself. So what exactly is with this one?
Title: Re: New items: Red Balls
Post by: Xarcell on June 13, 2007, 05:19:46 am
I like this item alot. Very cool...
Title: Re: New items: Red Balls
Post by: kenotia on June 24, 2007, 05:48:17 am
can someone please help me?
the redball.php is not sending any pms when my members use it = /
Title: Re: New items: Red Balls
Post by: David on June 24, 2007, 06:30:05 am
Redball doesn't send a PM (isn't meant to)...Redball 2 does...perhaps you're getting confused between them?
Title: Re: New items: Red Balls
Post by: dumbelljunkie on June 29, 2007, 04:49:04 am
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying

so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?
Title: Re: New items: Red Balls
Post by: Stalyn on July 02, 2007, 11:59:16 am
cool stuff
Title: An idea of Item Redball
Post by: zsw007 on October 16, 2007, 07:14:08 am
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying

so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?

FIND:
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";


And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.

Think that could be done?
Title: Re: New items: Red Balls
Post by: dothacker on December 26, 2007, 10:40:20 am
Looks like you worked hard on this but I want to know, what does this do exactly? Screenshots too please? Thanks.
Title: Re: New items: Red Balls
Post by: David on December 26, 2007, 02:37:48 pm
Just like any mod the best way for you to know what it does is to put it on a test forum and try it out...you'll know more that way than any explanation or screenshot could give you.
Title: Re: New items: Red Balls
Post by: dothacker on December 26, 2007, 03:19:42 pm
Sorry, I've only got one forum. If you have a test forum setup I would like to see, if not oh well.
Title: Re: An idea of Item Redball
Post by: Bandit on December 30, 2007, 11:03:56 am
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying

so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?

FIND:
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";


And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.

Think that could be done?

I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.
Title: Re: An idea of Item Redball
Post by: zsw007 on December 31, 2007, 09:53:36 am
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying

so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?

FIND:
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";


And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.

Think that could be done?

I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.

what do u mean?

do u mean you want it  just say  he gain

or just say  he

or if he gain it says  he gain  and if he lost,  it says  he lost

can u give an example?
Title: Re: New items: Red Balls
Post by: Bandit on December 31, 2007, 01:41:56 pm
That's exactly what I mean. If the recipient lost credits, it should say he lost XX credits. If he gained credits, then it should say he gained XX credits. The message I get after I throw the ball should say that as well as the PM the recipient gets should also tell them whether they won or lost.
Title: Re: New items: Red Balls
Post by: zsw007 on January 01, 2008, 06:15:44 am
That's exactly what I mean. If the recipient lost credits, it should say he lost XX credits. If he gained credits, then it should say he gained XX credits. The message I get after I throw the ball should say that as well as the PM the recipient gets should also tell them whether they won or lost.

well... im not a PHP person, im more of a VB person.

Probaly there can be a check where if the number is negative it says lots, and if is positive it says gain. But i don't know how to do that yet. sorry.
Title: Re: New items: Red Balls
Post by: Ricardo-san on March 25, 2008, 01:55:56 am
I got a problem here. Says:
Parse error: syntax error, unexpected T_STRING in /home/*****/public_html/phorum/Sources/shop/items/Redball2.php on line 81 :(
Title: Re: New items: Red Balls
Post by: Masterhand on April 08, 2008, 07:11:57 am
Wow. I haven't really been here / coded with SMF in a long time. I have a few things I need to sort out first. Then I can fix up the code.
Title: Re: New items: Red Balls
Post by: City Builder on May 19, 2008, 04:29:53 am
I think this would be more interesting to our users if instead of reducing their post count it took away xx amount of credits from them.  Our users all tell me the same thing about karma and post count, "They mean nothing to us" is what they tell me, and "if anybody judges me and my writings by my post count or my karma then they are a fool" is also what they say.

So anyway, I wonder if there is a way to take away credits from user instead of dropping post count.
Title: Re: New items: Red Balls
Post by: spearfish on May 19, 2008, 08:25:34 am
Should be easy enough.... replace "posts" with "money" or something like that.
Title: Re: New items: Red Balls
Post by: bgwebmistress on June 15, 2008, 02:15:52 am
Hi!  I am getting this error with both of the redball scripts.
Quote
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2

AND....

Quote
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2
Title: Re: New items: Red Balls
Post by: Masterhand on June 25, 2008, 02:00:18 am
Hi!  I am getting this error with both of the redball scripts.
Quote
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/RedBall.php on line 2

AND....

Quote
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2

Parse error: syntax error, unexpected T_STRING in /home/.elvee/bgwebmistress/www.burn-gorman.com/smf/Sources/shop/items/Redball2.php on line 2

Warning: Unexpected character in input: '\' Means that you put an invalid character into the input field. [I think]. Does that error happen after you hit submit? Also, what is the name of the user you're putting in if you are?

I think this would be more interesting to our users if instead of reducing their post count it took away xx amount of credits from them.  Our users all tell me the same thing about karma and post count, "They mean nothing to us" is what they tell me, and "if anybody judges me and my writings by my post count or my karma then they are a fool" is also what they say.

So anyway, I wonder if there is a way to take away credits from user instead of dropping post count.

Redball2 does that  :P.
Title: Re: New items: Red Balls
Post by: triforceguy1 on August 07, 2009, 08:03:18 pm
Hi,

This may not be possible but I'll ask anyway, I was wondering if it's possible for members that catch it have the choice to throw it to someone else and so forth until someone drops the ball and every time someone catches the ball they earn money and every time it's dropped that member looses money and it has a different pm message when it's cached or dropped.

Thanks
Leon J. Fletcher
Title: Re: An idea of Item Redball
Post by: marching elite on September 15, 2009, 07:38:33 pm
Redball2 does sent a PM but only to the one you threw it to, if I sent the ball to some one i don't know what it did, of the receiver of theball, and that's annoying

so if I throw a ball at my victim, I too want to know if I win or lose... how can this be done ?

FIND:
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} if he catches it he'll gain money, else he'll lose it!!!";
REPLACE WITH
Code: [Select]
return "You've thrown the ball to {$_POST['stealfrom']} he gain/lost ".formatMoney($amount)." credit!!!";


And you know what would be really nice? is if when the ball is thrown to someone, a PM well be send, BUT there is a xx second wait, and if the person reply the PM with in the xx second wait, he catchs the ball, he gain money and the ball. if he dosn't, he loses money and no one get the ball.

Think that could be done?

I used this code in my site, and it works great, but is there a way for it to say whether the credits were gained or lost instead of "...gained/lost xxx credits"? It tells me the number of credits, but it doesn't say whether or not the credits were given to the recipient or taken from them.

I too would also like to know how you change the code so it either says you gain the credits or you lose instead of both?
Title: Re: New items: Red Balls
Post by: steve51184 on February 08, 2010, 02:28:13 pm
does this work on smf 2.0 rc2?
Title: Re: New items: Red Balls
Post by: steve51184 on August 22, 2010, 08:02:48 am
6.5 month bump ;)