SimplePortal

Customization => Custom Coding => Topic started by: KahneFan on April 03, 2009, 03:37:44 PM

Title: SP Shop showing info in userinfo block.
Post by: KahneFan on April 03, 2009, 03:37:44 PM
I saw that. Pretty cool  ;D

A similar question; do you know what I would use to put a line in the user info block for "(shop $ name) in pocket:"?
Title: Re: SP Shop showing info in userinfo block.
Post by: Nathaniel on April 03, 2009, 08:43:26 PM
Split from the other topic (http://simpleportal.net/index.php?topic=1467.0) and moved to the Custom Coding board.

I'll do this in a second. ;)
Title: Re: SP Shop showing info in userinfo block.
Post by: Nathaniel on April 03, 2009, 08:58:27 PM
Find this code in your 'SPortal1-1.php' file.
Code: [Select]
if (allowedTo('pm_read'))
{
echo '
<li>', sp_embed_image('dot'), ' <strong>', $txt['sp-usertmessage'], ':</strong> <a href="', $scripturl, '?action=pm">', $context['user']['messages'], '</a></li>
<li>', sp_embed_image('dot'), ' <strong>', $txt['sp-usernmessage'], ':</strong> ', $context['user']['unread_messages'], '</li>';
}

Add this code afterwards:
Code: [Select]
global $sourcedir;
static $mod;
if (!empty($mod) || file_exists($sourcedir . '/shop'))
{
echo '
<li>', sp_embed_image('dot'), ' <strong>In Pocket:</strong> ', $context['user']['money'], '</li>
<li>', sp_embed_image('dot'), ' <strong>In Bank:</strong> ', $context['user']['moneyBank'], '</li>';
}
Title: Re: SP Shop showing info in userinfo block.
Post by: KahneFan on April 04, 2009, 01:07:21 AM
Where would/should I find SPortal1-1.php? I'm only seeing Sportal2.php

(This is for SP2.2 + SMF 2.0RC1 btw)
Title: Re: SP Shop showing info in userinfo block.
Post by: Nathaniel on April 04, 2009, 01:29:19 AM
Ah sorry, the edit should be the same for your 'SPortal2.php' file if you are using SMF 2.

Notice that the code adds both 'In Pocket' and 'in Bank' values, you can remove the code for one if you only want the other. ;)
Title: Re: SP Shop showing info in userinfo block.
Post by: KahneFan on April 04, 2009, 02:26:23 AM
Perfect, thanks!! I just added my sites denomination in front.
SimplePortal 2.3.8 © 2008-2024, SimplePortal