SMFShop > SMFShop Announcements

How to get shop working in other themes

(1/4) > >>

Daniel15:
Well, if you use a theme other than the default, you'll be upset to find out that SMFShop doesn't put a shop button in that theme. Also, it doesn't display the amount of credits a user has next to posts that they make. But, don't worry! We can fix that!

The first thing to do is request a shop button. Please read the topic entitled 'How to request a Shop button for your theme', and once you have done that, make a new post in the 'Shop Button Requests' subforum. Please, read the How-to topic first!

Next, we need to edit the theme to put the amount of credits next to every post a user makes. To do so, just follow these steps:
Open /themes/[themename]/Display.template.php
Find:

--- Code: (php) ---                        // Show how many posts they have made.
                        echo '
                                                                ', $txt[26], ': ', $message['member']['posts'], '<br />
                                                                <br />';

--- End code ---

SMFShop 3.0 or higher, or development version (revision 37 or higher), replace with:

--- Code: (php) ---            // BEGIN SMFShop MOD New Version Code
// Removed one <br /> from end of post count line.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
';

echo '
', $modSettings['shopCurrencyPrefix'], $message['member']['money'], $modSettings['shopCurrencySuffix'], '<br /><br />
<a href="', $scripturl, '?action=shop;do=invother2;member=', $message['member']['username'], '">View Inventory</a><br />
<a href="', $scripturl, '?action=shop;do=sendmoney;member=', $message['member']['username'], '">Send Money to ', $message['member']['name'], '</a><br />';
//END SMFShop code

--- End code ---

SMFShop 2.3 or lower, replace with:

--- Code: (php) --- // Show how many posts they have made.
// echo '
// ', $txt[26], ': ', $message['member']['posts'], '<br />
// <br />';

            //BEGIN Shop MOD 0.2 Code
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
';

            //I couldn't find where all these $message['member'][whatever] variables
            //are set, so I just send an extra database query to get the member's
            //money. Can someone tell me where (file and line) the $message variables
            //are set?
            global $ID_MEMBER, $db_prefix;

            $result_money = db_query("SELECT money
                                      FROM {$db_prefix}members
                                      WHERE ID_MEMBER = {$message['member']['id']}
                                      LIMIT 1", __FILE__, __LINE__);
            $row_money = mysql_fetch_array($result_money, MYSQL_ASSOC);

            echo $modSettings['shopCurrencyPrefix'].$row_money['money'].$modSettings['shopCurrencySuffix']."<br><br>";
            //END SHOP MOD
           

//BEGIN SMFShop MOD 1.31 (Build 7) CODE
echo "<a href='$scripturl?action=shop;do=invother2;member={$message['member']['username']}'>View Inventory</a><br>";
//END SMFShop MOD 1.31 code

//BEGIN SMFShop MOD 2.2 (Build 10) code
echo "<a href='$scripturl?action=shop;do=sendmoney;member={$message['member']['username']}'>Send Money to {$message['member']['name']}</a><br />";
//END SMFShop code

--- End code ---

Then, the amount of credits a user has, as well as a link to their inventory, will be seen next to every post they make.

If you can't find this segment of code, please make a new post here, stating the name of your theme, and a link to your forum
Thanks for reading! :D
 --daniel15

cpg:
Daniel-
Thank you for the hard work...I love the mod you made..

One thing. I added the shop button..no problem so the shop is functional as I tested it. But as for the script you supplied above- I found the script to be replaced and did so but was greeted with a parsed error.

I removed it and replaced it with the original script for function.

Is there something I am missing here?

I copy and pasted exactly the code you have listed.

I am running smf 106 and have Helios_Multi_TP so that includes my Tiny Portal. I don't know if that has anything to do with it.

again..Thanks for everything
Andy

cpg:
Okay- I redid the fix and everything worls great for me...thanks fo rthe hard work

Daethian:
I don't have that file?
I'm using RC 2 with Tiny Portal installed
Oxygen theme
www.foreverpurple.com/bb

Daethian:
Okay that's fixed.  The guys at Tiny Portal told me to use the file from the default theme and edit it and that worked!

Navigation

[0] Message Index

[#] Next page

Go to full version