News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMFShop - Shop MOD

Started by SMFHacks.com Team, December 27, 2004, 06:46:17 AM

Previous topic - Next topic

InfoStrides

Quote from: vbgamer45 on April 05, 2012, 11:35:08 AM
That item appears to be an example item doesn't do anything. Basically an example if you want to build custom items.

How do I got about it? Because I added the items.

vbgamer45

There is a coding forum on smfshop.com that talks about coding custom items and has examples
http://smfshop.com/forum/index.php/board,14.0.html?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

InfoStrides

Thanks. I have visited the website but did not answer my issue.

I used send email to Admin feature under Add Items and configure it accordingly. I tested with an account and it indicated success message sent but I did not receive email in the specified email. Do I need to set any other thing?


wynnyelle

Hello! I have this installed on my site, the 2.0 version. There is more than one problem with it; one problem is that we need to change the desctiptions that happen when a player tries to use a custom made item. They all say "This is a test item!" and they don't explain anything so the members all get confused.

Can I go somewhere in the code and put in the descritions for when they click on the item to use it?

vbgamer45

Yes you can change the description inside the item itself

Found in
Sources/items/youritemname.php
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Ascot

#2726
can someone help me on adapt this item to smf 2.0.2 ?
i'm having the following error on parsing

Quote
Fatal error: Call to undefined function db_query() in /home/lucas/public_html/forum/Sources/shop/items/AddMemberGroup.php on line 30


here's the item code

<?php
//File: AddMembergroup.php
//      Item

//DATE: Mar 07, 2007
//Author Taj

class item_AddMembergroup extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Taj";

$this->authorWeb "http://www.hostadore.com/";

$this->authorEmail "[email protected]";

        
$this->name "Add Membergroup";
        
$this->desc "Allows you to add yourself to a membergroup!";
        
$this->price 1;

        
$this->require_input false;
        
$this->can_use_item true;
    }

    function 
getAddInput() {
global $db_prefix;

$selectBox '<select name="info1">';

// Get all non post-based membergroups
$result db_query("SELECT ID_GROUP, groupName
FROM 
{$db_prefix}membergroups
WHERE minPosts = -1"
,
__FILE____LINE__);

// For each membergroup, add it to the list
while ($row mysql_fetch_assoc($result)) {
$selectBox .= "<option value='{$row['ID_GROUP']}'>{$row['groupName']}</option>";
}

$selectBox .= "</select>";
        return 
"Membergroup: ".$selectBox;
    }
    

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

$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'].", ".$item_info[1];
} else {
$additionalGroups['additionalGroups'] = $item_info[1];
}


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

        return 
"You have joined new membergroup {$item_info[1]}!!";
    }
}
?>


This came from http://smfshop.com/forum/index.php/topic,316.msg3491.html#msg3491

I tried to change table names to right actual ones but i still have the parse error. (do i need to clean my cache or something?)
If you're so kind, can you test it before posting back ?
Thanks in advance.  :)

Biology Forums

Quote from: Ascot on May 01, 2012, 06:49:10 PM
can someone help me on adapt this item to smf 2.0.2 ?
i'm having the following error on parsing

Quote
Fatal error: Call to undefined function db_query() in /home/lucas/public_html/forum/Sources/shop/items/AddMemberGroup.php on line 30


here's the item code

<?php
//File: AddMembergroup.php
//      Item

//DATE: Mar 07, 2007
//Author Taj

class item_AddMembergroup extends itemTemplate {
    function 
getItemDetails() {
    
$this->authorName "Taj";

$this->authorWeb "http://www.hostadore.com/";

$this->authorEmail "[email protected]";

        
$this->name "Add Membergroup";
        
$this->desc "Allows you to add yourself to a membergroup!";
        
$this->price 1;

        
$this->require_input false;
        
$this->can_use_item true;
    }

    function 
getAddInput() {
global $db_prefix;

$selectBox '<select name="info1">';

// Get all non post-based membergroups
$result db_query("SELECT ID_GROUP, groupName
FROM 
{$db_prefix}membergroups
WHERE minPosts = -1"
,
__FILE____LINE__);

// For each membergroup, add it to the list
while ($row mysql_fetch_assoc($result)) {
$selectBox .= "<option value='{$row['ID_GROUP']}'>{$row['groupName']}</option>";
}

$selectBox .= "</select>";
        return 
"Membergroup: ".$selectBox;
    }
    

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

$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'].", ".$item_info[1];
} else {
$additionalGroups['additionalGroups'] = $item_info[1];
}


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

        return 
"You have joined new membergroup {$item_info[1]}!!";
    }
}
?>


This came from http://smfshop.com/forum/index.php/topic,316.msg3491.html#msg3491

I tried to change table names to right actual ones but i still have the parse error. (do i need to clean my cache or something?)
If you're so kind, can you test it before posting back ?
Thanks in advance.  :)

Doesn't have to do with Cache, you're simply coding it wrong. Not too sure how though.

Ascot

#2728
DONE! tnx

wynnyelle

Quote from: vbgamer45 on April 30, 2012, 10:30:36 PM
Yes you can change the description inside the item itself

Found in
Sources/items/youritemname.php

I went in there and there were no files with any of my items in there. Only stuff we don't use. We created our game items by using the test item as a template. I really need this descriptions changed to fit each one becaue it is telling my membres the item doesnt do anything and they are not understanding it, and they are then getting upset. I am dealing with several upset people a day I have to explain to. Please help.

RoCKeT-88

Is there some way to show on stats the top ten currency holders that I am not seeing?  Or could it be so easily?  My users are really into this mod and seeing who's ahead and who's not. 

TYIA~

P.S.  This is such an awesome mod!
Insert Witty Signature Here.

InfoStrides

This mod do not work with post moderation. When a post moderation is set on. Credits are awarded to the posts yet to be approved. Can you help look into this?

Thank you.

SPKuja

#2732
I've installed this mod, and it all installed okay with no errors, but I cannot access the admin panel for it, it hasn't installed any links "On the left" or any where else inside of my admin panel.... Any ideas?

Okay, I have sorted that problem, you acutally have to be set as an Admin to view it not just a user that can use the admin panel...

I now have a different problem. I am trying to use the "EMail and Admin" as an item, which once set up, and used, does not send an e-mail out that I can find! Is there a way to set which e-mail address it comes from, or is there an actual way to make sure it's sending emails out!

stormiecub

Only administrator can access my shop. What do I need to fix this? Any member who doesn't have administrative capabilities can't buy or trade at all, and my forum is heavily reliant on a shop system!

vbgamer45

Admin -> Permissions -> then modify each group and give them shop permissions
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

stormiecub

Thanks! I had tried to go through the usergroups to do it but that was going around my elbow to get to my ear apparently. Easy. Thanks!

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Ascot

Does links to buy an object works in posts?
this could be dangerous
cause there's no "buy or not?" alert or similar. 
It just buy.

bearstreet

is there a subscriptions system that I can integrate with this shop mod where users can buy themselves subscriptions for a particular usergroup,
Like I list membership to a particular usergroup as an item and users can get upgraded to that particular membergroup once they buy that item, I hope I made clear what I want
Dont do drugs, coz if you get caught u will go to prison, and drugs are real expensive in prison
:P

Ask me Maths Questions

Kindred

SMF 2.x has joinable and subscription member groups
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: