SMFShop - Shop MOD

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

Previous topic - Next topic

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

wynnyelle

Hi I am running this SMF Shop on my forum and what members wanted was to see how many coins they had from the front page. So I tried to add that information to the front page under the name and avatar area. It's displaying the suffix {coins} but nothing where the amount of money should be.

The code:


// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '<div class="userinfo">';

if (!empty($context['user']['avatar']))
echo '
<div class="floatleft" style="width: 80px;">
<div class="avatar" style="margin-left:15px; margin-top:15px;"><img src="', $context['user']['avatar']['href'], '" alt="avatar" style="max-width:80px; max-height:80px;" /></div>
</div>';
$greeting = $txt['hello_member_ndt'] . ', ' . $context['user']['name'];
echo '
<div style="position:absolute; top:14px; left:105px; width:330px; height:110px; white-space:nowrap; overflow:hidden;">
<span style="font-size:16px;"><strong>', $greeting, '</strong>', $context['subaccount_dropdown'], '</span>
<br /><br />
                                                <div style="margin-bottom:6px;"><span style="font-size:14px; width:100%;">', $modSettings['shopCurrencyPrefix'], $message['member']['money'], $modSettings['shopCurrencySuffix'], '</span></div>

<div style="margin-bottom:6px;"><span style="font-size:14px; width:100%;"><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></span></div>
';
// Is the forum in maintenance mode?


That's where I inserted the code to just display the member's amount of money into index.template.php

vbgamer45

Try this maybe
Change
$message['member']['money']
To
$context['user']['money']
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

wynnyelle

It worked!

Why did that change work, and why didn't the other one work? Thank you for such a prompt response by the way!!

vbgamer45

The other one referred to a message this one is general area.
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

wynnyelle

Then that must be why it did not work in the profile either when I tried it there the other day? Thank you very much for the information, I'm trying to understand as much as I can of this on my own.

Gwenwyfar

I have the credits active in this using word count, but some users decided to abuse it by quoting others whenever possible to add to the count. Would be a good change to disable this.

I tried adding it myself but its not working, can't find out why, the regex itself is working fine by online tests, to select anything between two quote tags.

I tried these:
// Strip whatever is inside quotes
$plaintext = preg_replace('(\[quote?(.+?)\][\s\S]+?quote\])', ' ', $_POST['message']);

// Strip whatever is inside quotes
$plaintext = preg_replace('(\[quote?(.+?)\][\s\S]+?quote\])', ' ', $plaintext);

// Strip whatever is inside quotes
$plaintext = preg_replace('[\[quote?(.+?)\][\s\S]+?quote\]]', ' ', $_POST['message']);


And I added it before the replace to strip BBcode.

I don't think I posted in this topic yet, buts its a great mod, thanks for making it! :)
"It is impossible to communicate with one that does not wish to communicate"

Gwenwyfar

Found the problem, since the second one (strip BBcode) was also using the original message it replaced the quote replacement, just had to change that part to :

// Strip whatever is inside quotes
$plaintext = preg_replace('(\[quote?(.+?)\][\s\S]+?quote\])', ' ', $_POST['message']);
// Strip out all BBCode
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $plaintext);


And if anyone wants to do the same, this is on Post.php  ;)
"It is impossible to communicate with one that does not wish to communicate"

Playertrade

I have a problem, i can not find where i can remove:
View Inventory
Send Money To "name"


Under everyone profile picture when posting, i have removed the mod but this wont go away.. help thanks :)

Gluz

I just installed this MOD and I think that the package in the MOD area is wrong, the shopVersion.php says:
$shopVersion['version'] = "3.1 (SMF 2.0 branch)";
$shopVersion['build'] = "5";
$shopVersion['date'] = "23th November 2009";


And the code and edits seems to be that version, as I have to do some manual edits to package-info.xml because some of the fixes that the changelog says it was fixed in the package it doesn't.

Finally, the last update says:
QuoteVersion 3.3.2
!Fixed sending money on Shop-Send.php for users allowing both real_name,member_name instead of just member_name.

but the other admin can't send me anything, as my Display Name is not my Username.

Can you check that please, and update the package in MOD area.

josx2

I'm trying to install this for the first time on 2.0.9, but it kicks up a "test Failed" at two places for "Load.php"

Fail #1 - can't find "IFNULL(pg.group_name, {string:blank_string}) AS post_group, mem.is [nofollow]_activated, mem.warning,"
Fail #2 - can't find "CASE WHEN mem.id [nofollow]_group = 0 OR mg.stars = {string:blank_string} THEN pg.stars ELSE mg.stars END AS stars,"

I tried searching for them myself & no luck. 

TIA!

josx2

just wanted to follow up on my issue reported above.....  Thx

vbgamer45

I would look at the original SMF code and see what is changed then compared it to your modified files.
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

Kindred

Сл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."

josx2

oh geezus

*FACEPALM*

I dunno why I didn't think of comparing to the default load.php.  Dunno how/when I modified those particular sections that were throwing the error, but somehow/someway they were removed from Load.php.   Strange, cause I've been keeping a log of all changes I've made to the code and have nothing about these.   

thanks for the help :)

Gwenwyfar

There's another major flaw in the credits system that can be easily abused: Editing your post to remove a lot of spam content to get the maximum credits per post. Would be nice if you could fix that.

Was hoping nobody would find out, but someone always does...
"It is impossible to communicate with one that does not wish to communicate"

vbgamer45

If it is an issue on the forum try disabling editing of posts. That is a new policy they do here on this SMF forum and seems to help here.
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

Gwenwyfar

Disable editing posts would be a horrible solution. Disabling earning credits would be less harmful. It wouldn't even be like here which you can edit for a period of time, but it would need to be completely disabled to avoid this.

Anyways, for now I've just installed a post history mod, so if anyone is caught cheating they'll receive warns and get credits reduced, thinking of trying a fix at recounting the credits on edit, if I get enough time for that before the mod author can fix it I'll post it here.

"It is impossible to communicate with one that does not wish to communicate"

Goss

Is there a way to disable the ability to earn points when posting in a specific board?

Gwenwyfar

I don't think it has any option like that. But shouldn't be too hard to disable the mod in that board in the code, if you're not planning on modifying it again.

Now I don't remember if this worked only from post.php, but you could try adding an exception for $current_board
"It is impossible to communicate with one that does not wish to communicate"

Advertisement: