Author Topic: SMFShop- Version 3.1.4 Now SMF 2.0 RC2 Support!  (Read 424246 times)

Offline vbgamer45

  • Customizer
  • Simple Machines Hero
  • *
  • Posts: 7,675
    • SMF For Free
SMFShop- Version 3.1.4 Now SMF 2.0 RC2 Support!
« on: December 27, 2004, 06:46:17 AM »
Link to MOD

SMF Shop Development Plans

Any bugs, feature request please post on the forums located at
http://www.smfshop.com


Version 3.1.4 for SMF 2.0 RC2
+Added support for SMF 2.0 RC2

Version 3.1.1 for SMF 1.1.X
+Added checking if the username already exists when using the Change Username item.
+Edited several item files to use updateMemberData() instead of using a database query
+Added support for board-specific credit amounts, based off request at http://www.daniel15.com/forum/index.php/topic,554.html. This may not be fully functional at the moment.
![Shop.template.php] Fixed bug on View Other Members' Inventory page (reported by Sakuragi - http://www.daniel15.com/forum/index.php/topic,525.45.html)
![install_SMF1-1.xml] Fixed bug regarding Load.php edit (reported by feeble - http://www.daniel15.com/forum/index.php/topic,635.html)
![Steal.php] Fixed bug reported by jdv (thanks to Sakuragi) - http://www.daniel15.com/forum/index.php/topic,559.0.html
![Shop-Inventory.php] Fixed bug when viewing member's inventory, reported by thelastkiss (http://www.daniel15.com/forum/index.php/topic,532.msg2772.html#msg2772)
![Shop.template.php] Removed unneeded (commented) code
![Shop.template.php] Fixed 'Buy Stuff' display issue in Firefox


Version 3.1 for SMF 1.1.X
!Fixed missing global in ChangeDisplayName item
!Fixed missing global IncreaseKarma item
!Fixed issues with mod_security with ;id= in the url
!Fixed two broken link trees action=shop;do=invother and action=shop missing ?
!Fixed some joins for better mysql 5 support
+Added Shop.english-utf8.php if you are using utf8 on your board
!Fixed some spelling bugs in Shop.english.php
!Removed ` from queries in the installScript file for Shop which could fail in some setups.
« Last Edit: November 14, 2009, 06:25:23 PM by vbgamer45 »
SMF For Free -Free Simple Machines Forum hosting.
SMFHacks.com -  Upload and download Modifications, and Themes

Latest Mod:
EzPortal - A Portal System for SMF
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Offline Midgard

  • Jr. Member
  • **
  • Posts: 347
  • Gender: Male
Re: SMFShop - Shop MOD
« Reply #1 on: December 27, 2004, 06:50:44 AM »
Good work, i'm previewing...

Offline Daniel15

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 4,141
  • Gender: Male
  • http://d15.biz/
    • Daniel15
Re: SMFShop - Shop MOD
« Reply #2 on: December 27, 2004, 06:58:22 AM »
hold on, i'm just getting some screenshots...
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Jerry

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 2,356
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • Solarian Order
Re: SMFShop - Shop MOD
« Reply #3 on: December 27, 2004, 07:04:02 AM »
daniel it works fine so far, but when you have no items in inventory the menu spans the whole page, is there a way to make a box eqaul size to the inventory box (when you have items) show text that says no items?

And:
Code: [Select]
Fatal error: shop(): Failed opening required 'Sources/shop/items/ChangeUsername.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /xxx/xxx/public_html/test/Sources/shop/Shop.php on line 238
- Jerry
Find me on:
Facebook
Twitter


Offline Daniel15

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 4,141
  • Gender: Male
  • http://d15.biz/
    • Daniel15
Re: SMFShop - Shop MOD
« Reply #4 on: December 27, 2004, 07:12:44 AM »
oh damn case sensitive files... rename Sources/shop/items/ChangeUserName.php to ChangeUsername.php (note different case of the 'N').

and to fix the inventory problem, open /Themes/default/Shop.template.php, look for line like this:

{$context['shop_items_list']}

and replace with:
 {$context['shop_items_list']}

that should work. i'm uploading a fixed ZIP file now

--daniel15
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Jerry

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 2,356
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • Solarian Order
Re: SMFShop - Shop MOD
« Reply #5 on: December 27, 2004, 08:29:44 AM »
thanks for the update :) I think it may also have given my display.template.php a parse error :-\
« Last Edit: December 27, 2004, 08:32:13 AM by Jerry »
- Jerry
Find me on:
Facebook
Twitter


Offline akabugeyes

  • Doc Coordinator
  • Simple Machines Super Hero
  • *
  • Posts: 13,853
  • Gender: Male
Re: SMFShop - Shop MOD
« Reply #6 on: December 27, 2004, 11:15:35 AM »
Hey great mod! I am just looking for more items in the future as there aren't that many in the first release. So far it looks quite good!  :)
Please do not ask for support via personal message, unless asked.
SMF Online Manual

Offline [Unknown]

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 35,696
  • Gender: Male
Re: SMFShop - Shop MOD
« Reply #7 on: December 27, 2004, 11:15:56 AM »
From install.xml:
> SET money = money + {$modSettings['shopPointsPerTopic']}
> SET money = money + {$modSettings['shopPointsPerPost']}

I suggest using $modSettings[shopPointsPerTopic], as it will parse ever so very slightly faster.

> $context['admin_areas']['shop'] = array (

You should probably check permissions.  It's possible a moderator could get into this section (and have permission to do other things, but not manage the shop...)

if (allowedTo('shop_admin'))
   $context['admin_areas']['shop'] = array(
...


> "{$txt['shop_admin_items']}"

Erm... why not just $txt['shop_admin_items']?  Forcing interpolation will end up wasting memory.

> echo "dode";

Typo?  Note that this section is only for converting template.php's, so you won't see it active at all.

The $message['member'] array is set in Load.php.  Look for loadMemberData() and loadMemberContext().

> <br><br>

XHTML -> <br /><br />.

Code: [Select]
        $newSettings['shopPointsPerTopic'] = $_POST['pertopic'];
        $newSettings['shopPointsPerPost'] = $_POST['perpost'];

You should probably cast pertopic and perpost to ints, just to make sure they typed numbers... like so:

Code: [Select]
        $newSettings['shopPointsPerTopic'] = (int) $_POST['pertopic'];
        $newSettings['shopPointsPerPost'] = (int) $_POST['perpost'];

I notice you use several different templates, Invision-style.  The general method in SMF is to use one larger template and use sub templates.  For example, you might change this:

    loadTemplate('ShopAdminInventory');

To:

    loadTemplate('ShopAdmin');
    $context['sub_template'] = 'inventory';

And then instead of:

function template_main() {

Use:

function template_inventory() {

You may, from your experience with Invision, prefer the other way - and that's fine, this is of course only a suggestion... but I would say that staying with "the way SMF works" will make things easier for those who use your mod.

And, lastly, db_stuff.php uses smf_ hardcoded.  I strongly suggest you use $db_prefix instead, because this forum, as an example, uses a different prefix than smf_.

And, personally, I might replace this:

Code: [Select]
//give admin money :-)
db_query("UPDATE `smf_members` SET `money` = '10000' WHERE `ID_MEMBER` = '1' LIMIT 1", __FILE__, __LINE__);

With:
Code: [Select]
// Reward whoever's installing this with a lot of money :-).
updateMemberData(empty($ID_MEMBER) ? 1 : $ID_MEMBER, array('money' => 10000));

Don't take these suggestions the wrong way, or anything, I'm just trying to give you some helpful advice on integrating into SMF; I know there are not a whole ton of examples available quite yet.

-[Unknown]

Offline Daniel15

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 4,141
  • Gender: Male
  • http://d15.biz/
    • Daniel15
Re: SMFShop - Shop MOD
« Reply #8 on: December 27, 2004, 09:17:39 PM »
thanks for your comments [Unknown] ;) Since i have no previous knowledge of modding SMF, most of the code is rough

Quote
The $message['member'] array is set in Load.php.  Look for loadMemberData() and loadMemberContext().
Thanks for that.

Quote
I notice you use several different templates, Invision-style.  The general method in SMF is to use one larger template and use sub templates.  For example, you might change this:

    loadTemplate('ShopAdminInventory');

To:

    loadTemplate('ShopAdmin');
    $context['sub_template'] = 'inventory';

And then instead of:

function template_main() {

Use:

function template_inventory() {

You may, from your experience with Invision, prefer the other way - and that's fine, this is of course only a suggestion... but I would say that staying with "the way SMF works" will make things easier for those who use your mod.

i've never actually looked through the code of Invision Board MODS, i was just guessing that's how to do templates... i'll fix that in the next version

Quote
And, lastly, db_stuff.php uses smf_ hardcoded.  I strongly suggest you use $db_prefix instead, because this forum, as an example, uses a different prefix than smf_.
I was going to do that, but then i forgot to... I just grabbed the database stuff using phpMyAdmin, and dumped it into the php file.


The new version should be ready in a couple of days... or maybe tomorrow? i don't know yet.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline WebPlanetHost.com

  • Semi-Newbie
  • *
  • Posts: 26
Re: SMFShop - Shop MOD
« Reply #9 on: December 27, 2004, 09:43:18 PM »
Oh thankyou Daniel!!!! I love you!!!!! I have been waiting for a mod like this for ages!!! If you want a free .com, .net or .org domain please contact me on my forum www.webplanethost.com/forum

I am so happy now  ;D

Offline [Unknown]

  • SMF Friend
  • Simple Machines Super Hero
  • *
  • Posts: 35,696
  • Gender: Male
Re: SMFShop - Shop MOD
« Reply #10 on: December 28, 2004, 07:27:19 PM »
http://stickboarder.info/forum/index.php?action=shop

I suggest you use the is_not_guest function to ensure guests don't use the shop (or try to buy things, at least) like so:

is_not_guest($optional_error_message);

> You have credits

I suggest you cast that to an int so it always shows a number.  E.g. (int) $credits (psuedo code.)

http://stickboarder.info/forum/index.php?action=shop;do=buy

Personally I'd add a titlebg to the top something along the lines of:

Item   Description   Price/Stock

And, further, I suggest you consider adding the cabability to display icons for the items.  Then, you want to have ones that do... nothing.  Just note in the member's profile that they own that item (or one more of it, that is.)  Then, you want to load a list of items they own - I suggest into $message['member']['shop_items'] or similar.

This would allow items to be listed like "Sword", "Well crafted sword made of Mythril", "$50"... which would only be shown in your profile and next to your posts as a little sword icon.  People will go nuts, and hearald you as the bringer of the shop mod :P ;).  There's more expansion to be done even after that, but it's a big step in the direction a lot of people (seem) to want.

Again, this is something someone made my promise I would work on when I could/when SMF was released.  So I'm helping you work on it, which counts ;). (or... I think I'm helping?)

-[Unknown]

Offline SkyFlyer

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
    • *CF* Clanless Fraggers *CF*
Re: SMFShop - Shop MOD
« Reply #11 on: December 29, 2004, 12:04:21 AM »
Thanks man this is awesome... I cant wait until its in the public stages. I will definately be using it.

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: SMFShop - Shop MOD
« Reply #12 on: December 29, 2004, 12:40:34 AM »
Yes! I can't wait!

I'm not familiar with how IPB shops work. Can someone either show me a link to one or give me a brief run down on how they work?


Offline Daniel15

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 4,141
  • Gender: Male
  • http://d15.biz/
    • Daniel15
Re: SMFShop - Shop MOD
« Reply #13 on: December 29, 2004, 01:03:57 AM »
Version 0.2 is now out!!! This fixes a whole heap of bugs! for everyone that has 0.1, please download the new version

and to [Unknown]: Thanks, you're really helping a lot! I'll do all the updates you said, but unfortunately i'm busy during the next couple of days... maybe i'll fix the shop on the weekend? ;)

--daniel15

oh man these christmas smilies are really annoying me now...  ;) <--- that smilie looks weird
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Jerry

  • SMF Friend
  • Simple Machines Hero
  • *
  • Posts: 2,356
  • Gender: Male
  • What? I can't hear you over my awesomeness!!
    • Solarian Order
Re: SMFShop - Shop MOD
« Reply #14 on: December 29, 2004, 01:50:08 AM »
you can choose your smileys in your profile ;)
- Jerry
Find me on:
Facebook
Twitter


Offline SkyFlyer

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
    • *CF* Clanless Fraggers *CF*
Re: SMFShop - Shop MOD
« Reply #15 on: December 29, 2004, 03:21:50 AM »
In the readme, where it says...
Copy the file 'shop_install.php' to your forum's directory. Then go to http://www.yourname.tld/forum/shop_install.php (eg. if your forum is located at http://mysite.webplanethost.com/forum then you should go to http://mysite.webplanethost.com/forum/shop_install.php) Understand? 

I'm done, right? Or do I need to do step 3? Or is that just for updating?

Offline KuraWeb

  • Semi-Newbie
  • *
  • Posts: 14
Re: SMFShop - Shop MOD
« Reply #16 on: December 29, 2004, 09:33:14 AM »
Orale Muchas Gracias, me ah servido de mucho el mod, me gustaria saber como agregar  items osea uno  que le ponga Glow o Shadow en el nick. eres un Semi Dios de SMF  :).


Traslate by http://traductor.ya.com [nofollow]

Thank you very much, me ah served as a lot of the mod, I Like add  articles to be able Glow or Shadow in the nick. you are SMF's Semi God:).

In the Nick Or In The Nick

johnm

  • Guest
Re: SMFShop - Shop MOD
« Reply #17 on: December 29, 2004, 11:34:54 AM »
getting an error

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 smf_shop_inventory.id' at line 8
File: /home/user/public_html/forum/Sources/shop/ShopAdmin.php
Line: 74

this only seems to happen if you try to see a members inventory and they are also an admin

???

****edit****

its ok i was entering some ones display name and not actually their username!!! 

great mod
« Last Edit: December 30, 2004, 08:57:38 AM by johnm »

Offline SkyFlyer

  • Jr. Member
  • **
  • Posts: 122
  • Gender: Male
    • *CF* Clanless Fraggers *CF*
Re: SMFShop - Shop MOD
« Reply #18 on: December 30, 2004, 04:13:11 AM »
error here too...

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in blah/blah/forum/Sources/Subs.php on line 1548

Here is the code.
Code: [Select]
// Gotta be special for the javascript.
$context['fader_news_lines'][$i] = strtr(addslashes($context['news_lines'][$i]), array('/' => '\/', '<a href=' => '<a hre" + "f='));
}
$context['random_news_line'] ']']']= $context['news_lines'][rand(0, count($context['news_lines']) - 1)];

This is the error the editor gives me.
"Marked invalid because it contains a duplicate attribute."


Offline trenchteam

  • Sr. Member
  • ****
  • Posts: 996
  • Gender: Male
    • SHOYOROLL
Re: SMFShop - Shop MOD
« Reply #19 on: December 30, 2004, 05:23:43 AM »
^^ i had the exact error. I just put back the original subs.php and it works fine ??? NOw how do you edit the store? admin the store? I cannot find the panel on the left!  Is that in the subs.php file that I did not edit!
« Last Edit: December 30, 2004, 05:27:49 AM by trenchteam »

Over the Edge Kennels Forums is back online!  www.otekguam.com Come check us out! www.shoyoroll.com just got revamped! We are back and better than ever for 2007!