SimplePortal

Support => English Support => Topic started by: iain sherriff on May 01, 2009, 06:54:56 PM

Title: not really problem with SP......... its me really!
Post by: iain sherriff on May 01, 2009, 06:54:56 PM
I want to have a block at the top of my board
[take a look
http://uklows.com/forum/index.php?action=forum
where I have the untitled block at the moment]
with the same information as is in the Member block.
I think I can sort the layout of it but I cant locate the coding for the standard block ?

My knowledge is limited to html so need to cut and paste the php bits.................

where do I look please ?

thanks
Title: Re: not really problem with SP......... its me really!
Post by: willerby on May 02, 2009, 04:05:03 AM
.../Sources/SPortal2.php

From:

Code: [Select]
function sp_userInfo($parameters, $id, $return_parameters = false)

Until next function / block
Title: Re: not really problem with SP......... its me really!
Post by: iain sherriff on May 02, 2009, 05:36:13 AM
 :nervous-happy:
thanks, I'll see what I can make of that !
Title: Re: not really problem with SP......... its me really!
Post by: iain sherriff on May 02, 2009, 12:50:13 PM
slight change of plan..........what I now want is a top block with the user info as I have above my banner

http://uklows.com/forum/index.php

The code there is

Code: [Select]
<div id="welcome">';
if ($context['user']['is_logged'])
{
echo '
<b>', $txt['hello_member_ndt'], ' ', $context['user']['name'], '</b><br />';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
}

// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

echo '
<br />', $context['current_time'],'<br />';
}

echo '
</div>

I can remove that or move it around the page a bit but if I put that code in a block I get nothing   :0

I'm guessing that I need some other bits of coding there but am completely lost now.........................................

Any help much apreciated  :thumbsup:
Title: Re: not really problem with SP......... its me really!
Post by: Nathaniel on May 04, 2009, 01:14:52 AM
That code block you have used PHP code, so you have to use a PHP block with the correct PHP syntax.

Try putting this code into a Custom PHP block:
Code: [Select]
echo '<div id="welcome">';
            if ($context['user']['is_logged'])
            {
            echo '
               <b>', $txt['hello_member_ndt'], ' ', $context['user']['name'], '</b><br />';

            // Only tell them about their messages if they can read their messages!
            if ($context['allow_pm'])
               echo $txt['msg_alert_you_have'], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.<br />';

               echo '
                  <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
                  <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
            }

            // Otherwise they're a guest - so politely ask them to register or login.
            else
            {
               echo sprintf($txt['welcome_guest'], $txt['guest_title']);

            echo '
               <br />', $context['current_time'],'<br />';
            }

      echo '
         </div>';
SimplePortal 2.3.8 © 2008-2024, SimplePortal