Show Posts

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.


Messages - Sakuragi

Pages: 1 [2]
16
Coding / Re: Need help with making an Item
« on: January 08, 2007, 09:42:11 pm »
now I need to integrate this querie on the BuyMembergroup item

Code: [Select]
<?php
/**********************************************\
| SMFSHOP (Shop MOD for Simple Machines Forum) |
|         (c) 2005 DanSoft Australia           |
|      http://www.dansoftaustralia.com/        |
\**********************************************/

//File: BuyMembergroup.php
//      Item

//VERSION: 1.0 (Build 1)
//DATE: Oct 22, 2006
//Author Chad

class item_BuyMembergroup extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Chad";

$this->authorWeb "http://www.aviary.info/";

$this->authorEmail "generalchad@gmail.com";

        
$this->name "Buy Membergroup";
        
$this->desc "Allows you to buy your way into a membergroup!";
        
$this->price 1500;

        
$this->require_input false;
        
$this->can_use_item true;
    }
    
function 
getAddInput() {
global $db_prefix$item_info;

            
$result db_query("SELECT groupName 
                                FROM 
{$db_prefix}membergroups"__FILE____LINE__);
            
$row mysql_fetch_array($resultMYSQL_ASSOC);

while (
$row mysql_fetch_array($resultMYSQL_NUM)) {
   
$groups.=("<OPTION id='x{$i}' value='{$row[0]}'>{$row[0]}");
   
$i++; 
}
           
return "Which Membergroup ID do you want to grant users access to?: <SELECT name='info1'>{$groups}</SELECT>";

}


    function 
onUse() {
        global 
$db_prefix$ID_MEMBER$item_info$user$sourcedir;

/////////////NOTICE  change the following ID or your item will fail.
$shophistoryID=0;//Set this to 0 if you don't have a shop history forum

//Begin Shop history
if ($shophistoryID)
{
require_once($sourcedir '/Subs-Post.php');
$topicOptions['board'] = $shophistoryID//SHOP history forum
$topicOptions['id']=0//NEW topic
$msgOptions['subject'] = "I just bought my way into the {$item_info[1]} membergroup!"//Subject
$msgOptions['body'] = "Yep!"
$posterOptions['id']=$ID_MEMBER//Current user's ID
createPost(&$msgOptions, &$topicOptions, &$posterOptions); //create the post using the SMF posting function
}
//End Shop history

$groupID mysql_fetch_array(db_query("SELECT `ID_GROUP` FROM {$db_prefix}membergroups WHERE groupName = '{$item_info[1]}'"__FILE____LINE__),MYSQL_ASSOC);
$additionalGroups mysql_fetch_array(db_query("SELECT `additionalGroups` FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__),MYSQL_ASSOC);

if(
$additionalGroups['additionalGroups']) {
$additionalGroups['additionalGroups'] = $additionalGroups['additionalGroups'].", ".$groupID['ID_GROUP'];
} else {
$additionalGroups['additionalGroups'] = $groupID['ID_GROUP'];
}

echo 
$groupID['ID_GROUP'].":";
echo 
$additionalGroups['additionalGroups'];     


$result db_query("UPDATE {$db_prefix}members SET additionalGroups = '{$additionalGroups['additionalGroups']}'
         WHERE ID_MEMBER=
{$ID_MEMBER}",__FILE____LINE__);


$result db_query("
INSERT INTO `
{$db_prefix}awards_members` VALUES (20003, 2, {$ID_MEMBER}, 2007-01-07, 0)
"
);



        return 
"You're in the new group, {$item_info[1]}!!";
    }
}
?>

but when a user use this item, the second querie doesn't work :(
$result = db_query("
      INSERT INTO `{$db_prefix}awards_members` VALUES (20003, 2, {$ID_MEMBER}, 2007-01-07, 0)
         ");

17
Coding / Re: Need help with making an Item
« on: January 08, 2007, 07:52:56 pm »
thank you!

18
Coding / Need help with making an Item
« on: January 08, 2007, 06:40:50 am »
Hi,
I need help making a item.

with this item members can purchase an award to display it on this profile
members awards mod

function onUse:

Code: [Select]
         function onUse() {


        global $db_prefix, $ID_MEMBER, $item_info;

       $result = db_query("
INSERT INTO `{$db_prefix}awards_members` VALUES (20003, 2, {$ID_MEMBER}, 2007-01-07, 0);
");
        return "Success!";
    }

when I use this item I see this error

Hacking attempt... 


here is the table structure:
Code: [Select]
ID_AWARD_MEMBER int(8) unsigned NOT NULL DEFAULT '0',
ID_AWARD BIGINT(10) UNSIGNED NOT NULL DEFAULT '0',
ID_MEMBER INT(8) UNSIGNED NOT NULL DEFAULT '0',
dateReceived DATE NOT NULL DEFAULT '0001-01-01',
favorite TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
UNIQUE KEY ID_AWARD_MEMBER (ID_AWARD_MEMBER),
KEY ID_AWARD (ID_AWARD)

Thanks for your help!

20
General SMFShop Discussion / Re: Lotto
« on: June 21, 2006, 01:50:07 am »

22
General SMFShop Discussion / Re: Shop Ideas
« on: May 02, 2006, 02:29:38 am »
Quote
-multiple shops: The ability to create multiple shops. This would be good in forum that makes lots of items. This will help organize them.

I've already planned to add category support in SMFShop.

any recent news about this??

23
General SMFShop Discussion / Re: Shop Ideas
« on: April 15, 2006, 09:21:46 pm »
Quote
-multiple shops: The ability to create multiple shops. This would be good in forum that makes lots of items. This will help organize them.
I've already planned to add category support in SMFShop.

I am also very interested by this

24
General SMFShop Discussion / Re: filedownload.php
« on: April 15, 2006, 08:26:27 pm »
it works now!
thank you

25
General SMFShop Discussion / filedownload.php
« on: April 15, 2006, 04:13:33 am »
I have a problem with filedownload's item , when I try to download a file which makes more than 10Mo I obtain an empties file!!
this is what I see when I open this file
<br />
<b>Fatal error</b>:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 27852800 bytes) in <b>/home/Saku/domains/Saku.com/public_html/smf/Sources/shop/items/filedownload.php</b> on line <b>43</b><br />

26
General SMFShop Discussion / Suggestion
« on: March 22, 2006, 04:00:24 am »
Each post must be grater than X characters to get credit
is there anyway to make this possible??

or maybe you could integrate SMFShop mod  with the Affiliate mod...Could you do that?It would be cool if you could!

27
General SMFShop Discussion / Re: bug on trade center
« on: January 03, 2006, 06:38:02 am »
ok thank you

28
General SMFShop Discussion / Re: bug on trade center
« on: January 03, 2006, 06:32:47 am »
apologize
the admin receive the notification via email and not the money ;D

Code: [Select]
Congratulations! test has purchased your 'Loterie' item from you for crédit:  200  .

Have a good day,
 --Forum Management

29
General SMFShop Discussion / bug on trade center
« on: January 03, 2006, 06:19:45 am »
hello daniel
when a member buys item from another member, it's the admin who receive the money!

Pages: 1 [2]