Stars and Badges

Started by Bulakbol, February 29, 2008, 11:59:19 PM

Previous topic - Next topic

bros

Server Settings, set the language to English, not English-utf8

BlackXBOX

Quote from: bros on October 07, 2008, 08:51:04 PM
Server Settings, set the language to English, not English-utf8

IT WORKED!!!!! That was the problem! It's supposed to be English not English-utf8!

THANKS MAN!


Bulakbol

It looks like it is working. Have you added additional groups to your self? If your member does not have additional group, of course there's nothing to display.

<edit>
Awww ok then. That's good. :)
</edit>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

BlackXBOX

Quote from: JohnyB on October 07, 2008, 08:56:20 PM
It looks like it is working. Have you added additional groups to your self? If your member does not have additional group, of course there's nothing to display.

I'm getting someone to make custom ones atm :)

Also, I put myself in the "Administrator" group and it displays two sets of stars which I don't want. If I take myself out of the administrator group, will I still be administrator of the forum?

Bulakbol

Take the additional Administrator membergroup out. Profile => Account Settings=> Additional Membergroups. Click the "[ show additional groups ]" link and untick the "Administrator" checkbox.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

twon

Hello,
To be honest i looked through 18 pages and didnt see my problem listed.
I am using SMF 1.1.6
The forum look great and showing additional groups fine but the PM's are showing double.
Any ideas.

Bulakbol

@twon
Are you using Firefox with Web Developer add-on installed?

Attach your PersonalMessage.template.php and I'll remove the extra codes added. Or find and delete it yourself. Look for
// Is karma display enabled? Total or +/-?
and remove the following lines of codes located above that line.
Code (delete) Select
if (!empty($context['badges']['ownline']) && !allowedTo('moderate_forum'))
{
foreach($context['badges']['ownline'] AS $key)
for ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)
if ($message['member']['additional_groups']['id'][$i] == $key)
echo $message['member']['additional_groups']['stars'][$i], '<br />';
}
elseif (!empty($message['member']['additional_groups']['id']))
for ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)
echo $message['member']['additional_groups']['stars'][$i], '<br />';
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

twon


Cal O'Shaw

Quote from: JohnyB on October 02, 2008, 01:13:11 AM
@Cal O'Shaw
This mod is only for additional groups. It won't display post groups' badges or stars.

Pity.  Any chance you might consider that?  Some of our moderators are quite proud of their post counts and want to see all their stars...

Bulakbol

@Cal O'Shaw
I thought I posted it already how to do that. Which version of SMF are you using and which custom theme?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Cal O'Shaw

I'm sorry, I must have missed it (still having a bit of jet lag).  Running 1.1.6 with the default theme.

Grazie

Bulakbol

@Cal O'Shaw
Attach your Sources/Load.php and default/Display.template.php and I'll edit them. I'll post the codes after.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Cal O'Shaw

Grazie!

At the moment I do not have the mod installed (as stars for moderators had been the goal).  Will that make a difference?

I (and my moderators) really appreciate this!

Thank you very much

Cal

Cal O'Shaw

Jonny,

Want to make sure I understand correctly (I really appreciate this help).  My moderators will display, next to their posts, the image for their management group (Moderator, Global Moderator, etc) and then their post-based image, right?

One of my Global Moderators pointed out that she is listed as a Moderator in a board (she started there and likes being listed on the Moderator list there, even if she's a Global Moderator.  Should she expect to still be listed that way?  I just want to let her know what it's going to look like.

Grazie mille!

tk2012

@ JohnyB

I did a fresh install of b4.0 and it installed correctly and is working!  Something must have happened during the upgrade from b3.1 to b4.0.  Anyway, just wanted to say THANKS for your help.


Bulakbol

@Cal O'Shaw
This mod will add and not modify existing display. Install this mod and look at how additional groups are displayed. If you want to display your members post group stars, tell me where you want it and I'll edit your Load.php and Display.template.php. Here's what I am going to do to add the post group stars.

1.1.5 version. Load.php, look for
mem.karmaGood, mem.ID_POST_GROUP, mem.karmaBad, mem.lngfile, mem.ID_GROUP, mem.timeOffset, mem.showOnline,

add after
pg.stars AS pg_stars,

'post_group_color' => $profile['post_group_color'],

add after
    'post_group_stars' => empty($profile['member_group']) ? '' : str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['pg_stars'][1]) ? $settings['images_url'] . '/' . $profile['pg_stars'][1] : '') . '" alt="*" border="0" />', empty($profile['pg_stars'][0]) || empty($profile['pg_stars'][1]) ? 0 : $profile['pg_stars'][0]),


look for
$profile['stars'] = empty($profile['stars']) ? array('', '') : explode('#', $profile['stars']);

add after
$profile['pg_stars'] = empty($profile['pg_stars']) ? array('', '') : explode('#', $profile['pg_stars']);


And then add the following lines anywhere you want in Display.template.php.
if (!empty($message['member']['additional_groups']))
echo $message['member']['post_group_stars'] != '' ? $message['member']['post_group_stars'] : '', '<br />';



If you want to move the post group name and display it together with the post group stars, enable (tick the check box) the "Hide post group titles for grouped members?" from Admin => Current Theme => Themes and Settings.

Then use
if (!empty($message['member']['additional_groups']) && $message['member']['group'] != '')
echo $message['member']['post_group'], '<br />', $message['member']['post_group_stars'] != '' ? $message['member']['post_group_stars'] : '', '<br />';




@tk2012
Weird things happens sometimes.  ::)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Cal O'Shaw

Hello JonnyB,

I installed it, and unchecked "hide Post Group Titles".

It's now showing in the message view:
Personal Title
Group Title
Post Group Title
Group Star Image

What I am hoping to be able to see is

Personal Title
Group Title
Group Star Image
Post Group Star Image

Is that possible?

Grazie mille

And it appears my Moderator/Global Moderator will have to live with appearing to be a Moderator when she's in the board she has been defined as a Moderator.  Which is fine, unless it's possible to add the logic to say "if Moderator=true, display Moderator and other groups"

Many Thanks!

Bulakbol

@Cal O'Shaw
I'll get back to you.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Cal O'Shaw

Thank you, Jonny, greatly appreciated!

Ciao

Bulakbol

@Cal O'Shaw
Here are your edited files. Make a backup first before you use them. I added the post group image/stars right after the group image/stars. Line 291 - 293 of Display.template.php.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Advertisement: