News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Need Small Help

Started by Vonotna, September 01, 2015, 07:43:44 PM

Previous topic - Next topic

Vonotna

Hello, I am using SimplePortal and UltimateProfile mods. (I am pretty sure all of you are familiar with them)
I have User info section on my home page (posts,massages,profile,log out..)
Now, I want in this user info section to have a certain profile field from ultimateprofile added.
Here is a silly example of what i need :D thanks

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Vonotna

I was just looking into that, figured that I don't need the ultimate profile mod. Made a profile filed with it but still It doesnt show on the home page, only in the profile. I guess I need to change something in the SimplePortal mod. I have no problems with adding fields I just don't know how to make it show on the homepage and this is crutial for my forum.

margarett

I would suggest you check SimplePortal's site for advice.

* margarett has 0 experience with SP
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Vonotna

I have found people on SimplePortals forum asking this and it isn't resolved :( I tried playing with the code with no success
Thanks for trying to help me  :D

br360

Actually [sinan] has answered that before when asked- http://simpleportal.net/index.php?topic=13102.msg65008#msg65008

I'm looking at the Sources/PortalBlocks.php file now. Look for-

echo '
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';


What you want to add would probably go right under there. I just tested it and added a link and it worked- but back up first. ;)

Here is an example of what I did with my forum. I added this part after the above code to look like this-



                echo '
<li>', sp_embed_image('dot'), '<a href=http://genxcommunity.com/index.php?topic=18435.0>testing something here</a></li>';

Vonotna

hmm I understand you untill the part where I need to put my own forum link, how to find the code/link for my costum profile field.
I dont just want something writen, I need when I change the profile field also the field on homepage in user info to be changed.
That sounded confusing hope you understood can't explain better :D

br360

Sorry, it is a little confusing and not exactly sure what you are trying to do. ;)

How are you setting up the profile field, and will there be any sort of html link at all for your members in their profiles?

Vonotna

Nope, no links sorry for the confusion
I just want a profile field to be shown in the user info.
Looking at the source/portalblocks file I guess I need to add something here:

         echo '
                           ', $member_info['group'], '<br />';
      else
         echo '
                           ', $member_info['post_group'], '<br />';

      echo '
                           ', $member_info['group_stars'], '<br />';


Something like
member_info [costum field/points]

Hope you understood me now  :)

Vonotna

oow and I didn't asnwer your question, am setting up the profie field just from the Advanced Profile Fields in smf.

br360

So you want a member's points they get to be shown in that user info area? How do members get points to begin with, who adds the points, and how would it be shown in their own profile?

Vonotna

costum field, points will be added manually by the admin.
In their own profile there is a costum field named "Points"
Thanks for your assistence.

Kindred

I don't know that SimplePortal ever exposes any of the user's advanced profile fields for use...  You really need to ask them.

If they don't then you are going to have to code it yourself -- a full query to the user's record plus then joining the advanced profile fields -- then display.


In short -- this is actually a coding request...

Also - please note: "need small help" is basically a useless title for your question thread. You should clearly state a summary of the question/problem instead of something generic like "need help"
Сл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."

Vonotna

Meaning this would be a lot more harder to do then I expected :(
I will try emailing SimplePortal's staff.
And yes for the title sorry, really didn't know what to write and now it ended up not beeing such a small help.

Pipke

You need a query that grabs the profile field info wich you have setup with smf's Core_Features, Advanced_Profile_Fields, from the db and add the outcome on the userinfo block from the simpleprotal mod right?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

margarett

Actually, loadMemberContext should already be doing it for him.

I think he "just" needs to expand the user info block template to actually show the custom profile fields, because the data should already be available...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

Is the data available in the member context array?  because it's not in the members table
(note: I have not actually looked at that function recently)
Сл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."

Pipke

Quote from: margarett on September 02, 2015, 07:42:17 AM
Actually, loadMemberContext should already be doing it for him.

I think he "just" needs to expand the user info block template to actually show the custom profile fields, because the data should already be available...

I wouldn't bother calling loadMemberContext and wasting space in memory and extra CPU cycles computing the information, the custom fields input fields are placed in the smf_themes table, i prefer to load only that field what is needed (as the OP wants only one field to be shown?), a simple query will do the job.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Vonotna

Yes its already shown in the member context array. And yes I only need one field to be shown.
I have researched a little bit about what you guys mean by simple query means.
But whenever I try changing something in the source/SimplePortal the whole forum gives error.
Example:
echo '
                           ', $member_info['group'], '<br />';
      else
         echo '
                           ', $member_info['post_group'], '<br />';

      echo '
                           ', $member_info['group_stars'], '<br />';


If I delete one of this lines since lets say  don't want members info for stars to be shown it gives eror.
Maybe I am just too new for this stuff and need more proper knowledge :D

Kindred

well, you would need to delete TWO lines there in most cases
both the echo and the content.

Additionally, the start of that code is part of an conditions (if/else) clause and youwould need to make sure that is not left hanging by deleting the wrong bit of it.
Сл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."

Pipke

Ok here we go..

Go to Admin->Configuration->Features and Options->Profile Fields

Then scroll down on the page, there is the costum field you have (already) setup!

There you see Field Name! (see my attachment image)

We need the field name ie: test2 (yours will be different, i guess?)

Go to the file in Sources/PortalBlocks.php

About on line 217/218 you find this:

<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';

change it to this:
Code (replace with) Select

<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';
if (!empty($member_info['options']['cust_test2']))
echo'<li>', sp_embed_image('dot'), ' <strong>Example:</strong> ', $member_info['options']['cust_test2'], '</li>';


As you see in my code there is two times in the code the text 'cust_test2' you need to change that with your profile field name

so $member_info['options']['cust_test2'] to $member_info['options']['cust_your profile field name']

The text between <strong> and </strong> ie: 'Example' is hardcoded text, and i will know for sure Kindred wil say something about it, so you should check this to fix that with a string!

so <strong>Example:</strong> to <strong> ', $txt['this_is_text'], '</strong> '

Good luck with the edit ;)



"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Vonotna

Thank you for the nice instruction but am sure I followed them all right but it didn't change anything.
I made it like this
                              <li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
                              <li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';
                              if (!empty($member_info['options']['cust_points']))
                                 echo'<li>', sp_embed_image('dot'), ' <strong>Example:</strong> ', $member_info['options']['cust_points'], '</li>';


It doenst add anything nor does it give any error no idea what mastake did I make.

Kindred

is your custom field actually named JUST "points"?
Сл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."

Pipke

Just to check something else, did you entered something on your forum profile in the profile field wich you have setup?
The field 'points' must have a value?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Vonotna

yes its named just points
and yes there is a value if I understood what you meant by it
"Points: 32"

Illori

echo'<pre>';
print_r($member_info['options']);die();


can you add that code and post the results? afterwards you can delete the code.

Vonotna

Yey, the last code made me realise that I have changed the profile field name in the past, and I needed to type in the field name that was originaly created by.
It works now. THANK YOU ALL SO MUCH.
Sorry about this but now I have another question (this will probbly be easier :D )
Now i have this:


I have tried for like an hour to delete the

Posts
Recent Unread Topics
Updated Topics

but everytime I get error on my whole forum.
How should I do it or if its easier delete it for me I have attached the code in notepad.
I can't express how grateful I am at the moment  O:)

Vonotna

In short I want to have:

Total Messages:
New Massages:
Points:

Would do it myself but seems like I just can't figure out which paragraphs to delete

margarett

Delete this
echo '
<li>', sp_embed_image('dot'), ' <strong>', $txt['posts'], ':</strong> ', $member_info['posts'], '</li>';


And this
echo '
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
<li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';


Should work ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Vonotna

THe posts were deleted
But when I delete the second code I get the 500 internal server error :(

Pipke

The complete function  (without posts/unread/updated, with karma, if you turned this option on)

function sp_userInfo($parameters, $id, $return_parameters = false)
{
global $context, $txt, $scripturl, $memberContext, $modSettings, $user_info, $color_profile, $settings;

$block_parameters = array();

if ($return_parameters)
return $block_parameters;

echo '
<div class="sp_center sp_fullwidth">';

if ($context['user']['is_guest'])
{
echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', ' >
<table>
<tr>
<td class="sp_right"><label for="sp_user">', $txt['username'], ':</label>&nbsp;</td>
<td><input type="text" id="sp_user" name="user" size="9" value="', !empty($user_info['username']) ? $user_info['username'] : '', '" /></td>
</tr><tr>
<td class="sp_right"><label for="sp_passwrd">', $txt['password'], ':</label>&nbsp;</td>
<td><input type="password" name="passwrd" id="sp_passwrd" size="9" /></td>
</tr><tr>
<td>
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
</td>
<td><input type="submit" value="', $txt['login'], '" class="button_submit" /></td>
</tr>
</table>
<input type="hidden" name="hash_passwrd" value="" />
</form>', sprintf($txt['welcome_guest'], $txt['guest_title']);
}
else
{
loadMemberData($user_info['id']);
loadMemberContext($user_info['id'], true);

$member_info = $memberContext[$user_info['id']];

if (sp_loadColors($member_info['id']) !== false)
$member_info['colored_name'] = $color_profile[$member_info['id']]['colored_name'];

$member_info['karma']['total'] = $member_info['karma']['good'] - $member_info['karma']['bad'];

echo '
', strtolower($member_info['name']) === 'okarin' ? 'Okae-Rin, ' : $txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
<br /><br />';

if (!empty($member_info['avatar']['image']))
echo '
<a href="', $scripturl, '?action=profile;u=', $member_info['id'], '">', $member_info['avatar']['image'], '</a><br /><br />';

if (!empty($member_info['group']))
echo '
', $member_info['group'], '<br />';
else
echo '
', $member_info['post_group'], '<br />';

echo '
', $member_info['group_stars'], '<br />';

echo '
<br />
<ul class="sp_list">';

if (!empty($modSettings['karmaMode']))
{
echo '
<li>', sp_embed_image('dot'), ' <strong>', $modSettings['karmaLabel'], '</strong> ';

if ($modSettings['karmaMode'] == 1)
echo $member_info['karma']['total'];
elseif ($modSettings['karmaMode'] == 2)
echo '+', $member_info['karma']['good'], '/-', $member_info['karma']['bad'];

echo '</li>';
}

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>';
}

if (!empty($member_info['options']['cust_test2']))
echo'<li>', sp_embed_image('dot'), ' <strong>Example:</strong> ', $member_info['options']['cust_test2'], '</li>';

echo '
</ul>
<br />';

echo '
', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=profile">', $txt['profile'], '</a> ', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt['logout'], '</a>';
}

echo '
</div>';
}


without posts/unread/updated/karma


function sp_userInfo($parameters, $id, $return_parameters = false)
{
global $context, $txt, $scripturl, $memberContext, $modSettings, $user_info, $color_profile, $settings;

$block_parameters = array();

if ($return_parameters)
return $block_parameters;

echo '
<div class="sp_center sp_fullwidth">';

if ($context['user']['is_guest'])
{
echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', ' >
<table>
<tr>
<td class="sp_right"><label for="sp_user">', $txt['username'], ':</label>&nbsp;</td>
<td><input type="text" id="sp_user" name="user" size="9" value="', !empty($user_info['username']) ? $user_info['username'] : '', '" /></td>
</tr><tr>
<td class="sp_right"><label for="sp_passwrd">', $txt['password'], ':</label>&nbsp;</td>
<td><input type="password" name="passwrd" id="sp_passwrd" size="9" /></td>
</tr><tr>
<td>
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
</td>
<td><input type="submit" value="', $txt['login'], '" class="button_submit" /></td>
</tr>
</table>
<input type="hidden" name="hash_passwrd" value="" />
</form>', sprintf($txt['welcome_guest'], $txt['guest_title']);
}
else
{
loadMemberData($user_info['id']);
loadMemberContext($user_info['id'], true);

$member_info = $memberContext[$user_info['id']];

if (sp_loadColors($member_info['id']) !== false)
$member_info['colored_name'] = $color_profile[$member_info['id']]['colored_name'];

$member_info['karma']['total'] = $member_info['karma']['good'] - $member_info['karma']['bad'];

echo '
', strtolower($member_info['name']) === 'okarin' ? 'Okae-Rin, ' : $txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
<br /><br />';

if (!empty($member_info['avatar']['image']))
echo '
<a href="', $scripturl, '?action=profile;u=', $member_info['id'], '">', $member_info['avatar']['image'], '</a><br /><br />';

if (!empty($member_info['group']))
echo '
', $member_info['group'], '<br />';
else
echo '
', $member_info['post_group'], '<br />';

echo '
', $member_info['group_stars'], '<br />';

echo '
<br />
<ul class="sp_list">';

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>';
}

if (!empty($member_info['options']['cust_test2']))
echo'<li>', sp_embed_image('dot'), ' <strong>Example:</strong> ', $member_info['options']['cust_test2'], '</li>';

echo '
</ul>
<br />';

echo '
', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=profile">', $txt['profile'], '</a> ', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt['logout'], '</a>';
}

echo '
</div>';
}
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Vonotna

Nope.. tried both of the codes even tought I have karma disabled didn't work still error :(

Pipke

what error? and can you give your site link so we can take a look.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Vonotna

Sorry I can't post the link, but its the common 500 internal page erorr.

Kindred

a 500 error is an server error...  possibly because of a bad chmod permissions on the file when you save.   How are you editing the file?
Сл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."

Vonotna

Directly in the file manager on my hosting
But everything before worked so I don't see why this removal won't. :(
And i have full permissions on the file just checked.

Illori

try

function sp_userInfo($parameters, $id, $return_parameters = false)
{
global $context, $txt, $scripturl, $memberContext, $modSettings, $user_info, $color_profile, $settings;

$block_parameters = array();

if ($return_parameters)
return $block_parameters;

echo '
<div class="sp_center sp_fullwidth">';

if ($context['user']['is_guest'])
{
echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', ' >
<table>
<tr>
<td class="sp_right"><label for="sp_user">', $txt['username'], ':</label>&nbsp;</td>
<td><input type="text" id="sp_user" name="user" size="9" value="', !empty($user_info['username']) ? $user_info['username'] : '', '" /></td>
</tr><tr>
<td class="sp_right"><label for="sp_passwrd">', $txt['password'], ':</label>&nbsp;</td>
<td><input type="password" name="passwrd" id="sp_passwrd" size="9" /></td>
</tr><tr>
<td>
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
</td>
<td><input type="submit" value="', $txt['login'], '" class="button_submit" /></td>
</tr>
</table>
<input type="hidden" name="hash_passwrd" value="" />
</form>', sprintf($txt['welcome_guest'], $txt['guest_title']);
}
else
{
loadMemberData($user_info['id']);
loadMemberContext($user_info['id'], true);

$member_info = $memberContext[$user_info['id']];

if (sp_loadColors($member_info['id']) !== false)
$member_info['colored_name'] = $color_profile[$member_info['id']]['colored_name'];

$member_info['karma']['total'] = $member_info['karma']['good'] - $member_info['karma']['bad'];

echo '
', strtolower($member_info['name']) === 'okarin' ? 'Okae-Rin, ' : $txt['hello_member'], ' <strong>', !empty($member_info['colored_name']) ? $member_info['colored_name'] : $member_info['name'], '</strong>
<br /><br />';

if (!empty($member_info['avatar']['image']))
echo '
<a href="', $scripturl, '?action=profile;u=', $member_info['id'], '">', $member_info['avatar']['image'], '</a><br /><br />';

if (!empty($member_info['group']))
echo '
', $member_info['group'], '<br />';
else
echo '
', $member_info['post_group'], '<br />';

echo '
', $member_info['group_stars'], '<br />';

echo '
<br />
<ul class="sp_list">';

if (!empty($modSettings['karmaMode']))
{
echo '
<li>', sp_embed_image('dot'), ' <strong>', $modSettings['karmaLabel'], '</strong> ';

if ($modSettings['karmaMode'] == 1)
echo $member_info['karma']['total'];
elseif ($modSettings['karmaMode'] == 2)
echo '+', $member_info['karma']['good'], '/-', $member_info['karma']['bad'];

echo '</li>';
}

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>';
}

if (!empty($member_info['options']['cust_earned']))
echo'<li>', sp_embed_image('dot'), ' <strong>Points:</strong> ', $member_info['options']['cust_earned'], '</li>';

echo '
</ul>
<br />';

echo '
', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=profile">', $txt['profile'], '</a> ', sp_embed_image('arrow'), ' <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt['logout'], '</a>';
}

echo '
</div>';
}


that should work although it is untested.

Vonotna

Nope that isnt neccesery.
I fixed it.
THANK YOU ALL FOR THE HELP.
If someone needs an answer it was really simple.
I replaced:
      echo '
                              <li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unread">', $txt['unread_topics_visit'], '</a></li>
                              <li>', sp_embed_image('dot'), ' <a href="', $scripturl, '?action=unreadreplies">', $txt['unread_replies'], '</a></li>';
                              if (!empty($member_info['options']['cust_earned']))
                                 echo'<li>', sp_embed_image('dot'), ' <strong>Points:</strong> ', $member_info['options']['cust_earned'], '</li>';


With:

      if (!empty($member_info['options']['cust_earned']))
         echo '
                              <li>', sp_embed_image('dot'), ' <strong>Points:</strong> ', $member_info['options']['cust_earned'], '</li>';

Advertisement: