Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: khamseen - marraskuu 18, 2008, 08:32:27 IP

Otsikko: User information not always showing in posts.
Kirjoitti: khamseen - marraskuu 18, 2008, 08:32:27 IP
Just upgraded to SMF 2.0 Beta 4 and I've noticed quite a lot of my members don't have all their information shown on their posts. Things like Rep Bar and Location, PM buttons etc are missing all they have is their Email button.

I've attached a screenshot of a member who does have it showing and a member who doesn't so you can better see what it is.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: Oldiesmann - marraskuu 18, 2008, 09:07:06 IP
Are you sure the second post isn't from a guest or a user who deleted their account? That's the only time you'd just see an email link with no profile or IM links...
Otsikko: Re: User information not always showing in posts.
Kirjoitti: khamseen - marraskuu 18, 2008, 09:12:59 IP
Nope it's registered members that it's doing it with.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: Nathaniel - marraskuu 24, 2008, 11:12:17 IP
Odd, can you please post your '/Themes/{themename}/Display.template.php' file as an attachment? So that we can have look at it.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: khamseen - marraskuu 25, 2008, 08:51:10 AP
I think we've narrowed it down to the Mood Bobel system causing it. We've found that if people have a mood set, then it displays all info alright, but if they don't it's acting like they are a guest and only displaying their Username, Membergroup and an email link.

I've included two attatchments, one "b4mddisplay.template.php" which is the file as it is causing the problem.

The second file "display.template.php" is a file I've been playing with to try and sort the problem. In this file I've moved the bobel display to be the last thing displayed on a post. Now it displays peoples info all the time, but if they don't have a mood set it still displays a second email button acting like they are a guest.

I am hopeful you will be able to see how to get around this problem. The creator of the mod told me to add a } to the end of the mood display coding, but when I do that I get a Syntax error with unexpected T_elseif (I think that was the error I got).

If you search "mood" in the php file it takes you straight to the area that I think is causing the problem.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: Antechinus - joulukuu 07, 2008, 04:30:59 IP
Try this file.

By the way, I hate mood bobels.  :D
Otsikko: Re: User information not always showing in posts.
Kirjoitti: khamseen - joulukuu 07, 2008, 08:40:33 IP
Hey that works brilliantly, thanks very much indeed.

Also, I'm not a great fan of them myself but they add a bit of colour and the members like them ;D
Otsikko: Re: User information not always showing in posts.
Kirjoitti: khamseen - tammikuu 29, 2009, 10:06:25 AP
I really hate to bump topics but this is directly related to this so it seemed more practical than having to explain all the problems again.

I have changed from using the Reputation system to the Karma Description Mod and because of the modifications to the display.template for my theme I am unable to get things to display correctly.

When I try to remove the Reputation system from display and replace it with the standard Karma it crashes the forums when people try to look at threads. Could someone please help me with my display.template file?

The file I've attached has the reputation code:


// Is karma display enabled?
if ($modSettings['karmaMode'] != '0'){
echo '
<li class="margintop">', $txt['karma_power'], ': ', $message['member']['karma']['power'], '</li>
<li class="margintop repbars">
';
foreach($message['member']['karma']['bars'] as $karma_bar)
echo '<img src="', $settings['images_url'], '/karma_', $karma_bar['type'], '.gif" title="', $message['member']['name'], ' ', $karma_bar['desc'], '" alt="', $message['member']['name'], ' ', $karma_bar['desc'], '" />';
echo '
</li>';
}


And according to the file I need to replace it with the original which is:



// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<li class="margintop">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
elseif ($modSettings['karmaMode'] == '2')
echo '
<li class="margintop">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '
<li>
<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
<a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
</li>';


When I do that though it causes the crash, I'm not very good at understanding how this works yet but I suspect it may have something to do with mine reading with <br /> instead of <li> could someone please help me with this?

Thank you in advance.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: greyknight17 - helmikuu 08, 2009, 01:54:59 IP
Is this issue resolved now? I'm not sure what the first part of the code you posted is for, but it looks like you have to replace the following:

// Is karma display enabled?
if ($modSettings['karmaMode'] != '0'){
echo '
<br />

', $txt['karma_power'], ': ', $message['member']['karma']['power'], '<br />
<span class="repbars">
';
foreach($message['member']['karma']['bars'] as $karma_bar)
echo '<img src="', $settings['images_url'], '/karma_', $karma_bar['type'], '.gif" title="', $message['member']['name'], ' ', $karma_bar['desc'], '" alt="', $message['member']['name'], ' ', $karma_bar['desc'], '" />';
echo '
</span>
<br />';


With the second code section that you posted.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: khamseen - helmikuu 08, 2009, 09:50:14 IP
Hey, the problem hasn't been solved yet. The first piece of coding I put there is what is currently in my display.template and the second is what the "original" karma coding was. However when I replaced that it crashes out.

I believe what you've posted is for Reputation, which is actually what I'm trying to remove in favour of the Karma Description Mod.
Otsikko: Re: User information not always showing in posts.
Kirjoitti: Rumbaar - helmikuu 22, 2009, 08:13:33 IP
Can you try and upgrade to RC1, the one by one add the mod code to the new template files.  Are you sure all those mods are fully compatible with BETA 4, at the time?