News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Stars and Badges

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

Previous topic - Next topic

bros

Quote from: JohnyB on July 09, 2008, 08:30:03 PM
Try this. Sources/Load.php, look for

pg.onlineColor AS post_group_color, IFNULL(pg.groupName, '') AS post_group, mem.is_activated,


add after

IF(mem.ID_GROUP > 0, pg.stars, '') AS stars1,


look for

pg.onlineColor AS post_group_color, IFNULL(pg.groupName, '') AS post_group,


and add below

IF(mem.ID_GROUP > 0, pg.stars, '') AS stars1,


look for

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


and add below it

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


look for

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


and add below it.

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


In the default/Display.template.php, find a place for the following lines.

if (isset($message['member']['post_group_stars']) && $message['member']['post_group_stars'] != '')
echo $message['member']['post_group_stars'], '<br />';





Is this for me, or for the other person who asked for assistance above?

Bulakbol

Try it too bros. That might be the one you wanted because this Stars and Badges mod will display additional membergroup stars. The snippet of code I posted will display post group stars for primary groups.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

bros

Quote from: JohnyB on July 09, 2008, 09:20:29 PM
Try it too bros. That might be the one you wanted because this Stars and Badges mod will display additional membergroup stars. The snippet of code I posted will display post group stars for primary groups.

That will make it show in topics.

Since you gave me some code for it to work on my SMF 2.0 beta 3 forums, and it worked perfectly.

This is what you told me then:
Quote from: JohnyB on May 13, 2008, 09:53:59 PM
To add space between additional stars/badges, in Display.template.php
Code (find) Select

echo $message['member']['additional_groups']['stars'][$i], '<br />';


Code (replace) Select

echo '<div style="padding-top: 4px;"></div>', $message['member']['additional_groups']['stars'][$i], '<br />';


Replace the 4px with the number of pixels you want. Thanks for trying/using this mod.

I don't know if it would work on SMF 1.1.5 though.

Bulakbol

Try it bros. It should work on both versions.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

bros

Quote from: JohnyB on July 09, 2008, 10:06:53 PM
Try it bros. It should work on both versions.

Nope.

Only shows the Administration red stars.

Bulakbol

Quote from: bros on July 09, 2008, 10:19:23 PM
Quote from: JohnyB on July 09, 2008, 10:06:53 PM
Try it bros. It should work on both versions.

Nope.

Only shows the Administration red stars.


What was the issue again? I am a little confused. :P
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

bros

Quote from: JohnyB on July 09, 2008, 10:28:32 PM
Quote from: bros on July 09, 2008, 10:19:23 PM
Quote from: JohnyB on July 09, 2008, 10:06:53 PM
Try it bros. It should work on both versions.

Nope.

Only shows the Administration red stars.


What was the issue again? I am a little confused. :P

Here, pictures for example :D

We want this:


To be able to diplay the stars/badges like this:

Burke ♞ Knight

I want to show both member groups, and post rank groups. :)

Bulakbol

@BurkeKnight
   Try the codes that I posted. Edit your BoardIndex.php and Display.template,php


@bros
   If you installed this mod and badges aren't displayed, then your Display.template.php wasn't properly edited. Attach your Display.template,php. I'll take a look at it.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ElectricSquid

Wow, theres great support for this mod! Thanks again.

Burke ♞ Knight

#290
Ok, it shows, yet the post rank name is under the member group name, above the member group image...


Is there a way for this:

Member group name
Member group image

Member group name
Member group image

Member group name
Member group image

Post rank name
Post rank image

(if in 3 member groups)

???

Thanks. :)

PS: go to the forum to see what I mean, please:

http://www.bkgta.co.cc/

Bulakbol

Yes, you can arrange the display like what you want. Attach your Display.template.php and Sources/Load.php. What custom theme are you using?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Burke ♞ Knight

My own. :)

It's the default theme, with some modding done. :)

I will still be able to swap back to the original stars for post rank, right?
I mean, it will still show the 6 stars if a post rank has 6 set?

Here are the 2 files.

Bulakbol

Yes of course. I'll get back to you later for your files. A bit busy.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

bros

Quote from: JohnyB on July 09, 2008, 11:23:20 PM
@BurkeKnight
   Try the codes that I posted. Edit your BoardIndex.php and Display.template,php


@bros
   If you installed this mod and badges aren't displayed, then your Display.template.php wasn't properly edited. Attach your Display.template,php. I'll take a look at it.

Yeah, it shows the badges in the profile, but not in the topics. Here is my display.template.php

Bulakbol

lol bros, what is this?
echo '<div style="padding-top: 21000px;">

21000 pixels?

Your Display.template.php is fine if you'll change the 21000px with 4px :)

Can I take a look at your forum?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

bros

#296
Quote from: JohnyB on July 10, 2008, 12:12:32 AM
lol bros, what is this?
echo '<div style="padding-top: 21000px;">

21000 pixels?

Your Display.template.php is fine if you'll change the 21000px with 4px :)

Can I take a look at your forum?

I did that to make it appear, Since if it was gonna work, why not set it to a page-stretching limit? :D

http://thecastlehall.com/brostest

edit: i'm going to sleep, so if I don't respond to your helping, don't worry :D

Bulakbol

@BurkeKnight
  Here are your files attached. Load.php and Display.template.php. Backup first before you use them.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Burke ♞ Knight

#298
Perfect, except one thing, can you add line breaks between them?

Thank you :)
This is going to be great on this forum, since the post ranks are basically right out of the games. :)


EDIT:

Got it! :)

I might actually have this coding thing down pat.... at least for entering line breaks....LOL

Thanks again, Johnny!

Great mod and terrific support! :)

Sheree

hi johnyB

This is a great mod nice job.

I was wondering if you could help me seperate the badges from the post rank with a label

something like this


only the word Badges is after the word certified member
I've attached my Display.template.php

Thanks in advance

Advertisement: