News:

Wondering if this will always be free?  See why free is better.

Main Menu

Stars and Badges

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

Previous topic - Next topic

Bulakbol

#520
Sheree, try this Load.php. If no problem, I will update the package. I think I was mixed up with the 2.0 beta version.

I'll look into your Display.template.php and see what I can do.

<edit>
I added your Display.template.php. Try this one.
</edit>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Sheree

hi johnny
I tried the files and the good news is there are no errors but the problem is there are no badge showing





Highbuzz

Hey Johny B,

I Aa New Damage v2 and I noticed it wasn't on the supported list, so I followed your instructions on non-supported themes. There was one difference and that was:

                        <li>', $message['member']['group_stars'], '</li>';

The only difference was that it uses <li> instead of <br> so I did this:

', $message['member']['group_stars'], '<li />';

if (!empty($message['member']['additional_groups']['id']))
   for ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)
      echo $message['member']['additional_groups']['stars'][$i], '<li />';


Once I uploaded it, all the badges of my additional member groups appeared on my members. I didn't even tell what ones I wanted it to display.. I figured maybe since it was blank I had to tell it at least one so I find a group and entered it's number alone. Still displays all of them.

I am okay with all of them displaying but it would be nice to have control in case that turns to be untrue one time.

I've uploaded my Display.template.php here incase you want it.

Bulakbol

@Sheree
Could you please try the attached Display.template.php?


@Highbuzz
You are missing a block of code. I'll see what I can do with your Display.template.php.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Highbuzz

Truly appreciated, I'll be waiting!

Sheree

hi johnny , I tried the last dispalytemplate.php

but still no badges are showing  :'( 

Highbuzz

Quote from: Sheree on January 04, 2009, 07:27:44 PM
hi johnny , I tried the last dispalytemplate.php

but still no badges are showing  :'( 
You need to upload your display.template.php from your custom theme that you are using first, so he has something to work with.

I don't know if that display.template.php was for me since you said you would be working on it (as opposed to 'try this'), if it was, didn't work for me.

spiros

#527
Quote- In post - display additional stars and or badges.

Is it possible to simply display the additional membergroup name instead of an image?

Also, is it possible if one uses an image, for that image to have a URL?

Bulakbol

@Sheree
Try removing all the additional groups id's from Admin -> Features and Options -> Basic Features -> Arrange additional groups ...

@HighBuzz
Try this one. Edited Display.template.php attached.

@spiros
Yes, it it possible to display additional groups' name only. Edit your Display.template.php. Find and replace. Two of them.
echo $message['member']['additional_groups']['stars'][$i], '<br />';
Code (replace) Select
echo $message['member']['additional_groups']['name'][$i], '<br />';
Sorry, I don't know if it is possible to add url.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

spiros

Many thanks!

Yes, I kept trying to embed a link somehow to the image, but it is not possible for gif -:)

Bulakbol

Maybe you can but only one url for all of your additional groups stars/badges unless you detect the id number before adding the url. You can try though. Find
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 />';

replace
Quotefor ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)   
         {
            if ($message['member']['additional_groups']['id'][$i] == 11)
               echo '<a href="http://www.mysql.com/" target="_blank">', $message['member']['additional_groups']['stars'][$i], '</a><br />';
            else
               echo $message['member']['additional_groups']['stars'][$i], '<br />';
         }
where 11 is the id number of additional group. Replace the www.mysql.com with your own.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

funcouldron

johnyB  i intalled this 2.1 version on my smf2.0b4 ,, this time it worked fine and gave no errors (if you remember last time erros were there).. but the problem is  all badges comes 2 time i mean site admin badge come 2 mite   modretor badge come 2 times ,, y is this?
Visit us at  ww.4moreFun.com

spiros

Brilliant, Bulakbol, it works like magic!

Perhaps this could be considered as extra functionality; it is useful, for example, when you want to have a link pointing to more info regarding the type of status/membership the badge stands for. I.e. I am sure the "Charter member" badge would result in more people becoming charter members, it it was linked to the  "Charter member" page.

chris345

Hi there quick question, I have several additional groups that users can join freely. However I have members that persist on joining 10 -15 groups, is there any way to only display 3 of their groups oppose to the 15?

Highbuzz

Worked like a charm JohnyB, thanks for all your help!

Truly a great mod with a great creator! ;)

Bulakbol

@funcouldron
It was probably installed twice. You can edit your Display.template.php and delete the duplicate code. Or attache your Display.template.php and I'll delete it for you when i have time.

@chris345
You can try. In Display.template.php, find
if (!empty($context['badges']['ownline']))
{
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 />';

Replace
Quote$counter = 0;
      if (!empty($context['badges']['ownline']))      
      {
         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 && $counter < 3)
               {
                  echo $message['member']['additional_groups']['stars'][$i], '<br />';
                  $counter++;
               }

      }          
      elseif (!empty($message['member']['additional_groups']['id']))
         for ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)
         {
            if ($counter == 3)
               continue;

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

Change the 3 to whatever number of badges you want to display. Codes in red are the additional codes.

@spiros
You can create a topic complete with anchors and add the topic link to every displayed badges. That might work. :)

@Highbuzz
Thanks for the compliment.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

chris345

Thank you so much JohnyB, it worked perfectly!  :)

chickenwing

#537
This is a great MOD!  Works like a champ.  The post with the code to allow mouseover/hover text did the trick for our needs as well.  I did install twice and had to clean up by hand, but that was no biggie.

Now that we are using this, we would like to know if someone has a mod that would allow "badges" to show below the post itself, horizontally, above or below the signature line.  We have up to 6 member groups we show on the left side, along with the regular stars and such which relate to  specific forum activities (like rank), but we want to have badges we can give to folks for other activities.  these secondary activities would overload the left side of the posting area, but would show perfectly as a horizontal line(s) along the bottom.

Any ideas here?  Thanks in advance for your input.

Bulakbol

You're welcome chris345.

@chickenwing
If you can show me a sample image of what you want, maybe we can do something. But no promises of course.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

chickenwing

#539
Quote from: Bulakbol on January 17, 2009, 03:16:34 PM
You're welcome chris345.

@chickenwing
If you can show me a sample image of what you want, maybe we can do something. But no promises of course.

hopefully this attachments show what i would like to have.  On the bottom of my post, I have added 3 ribbons and one star to  simulate what are are after.  We could have any number of ribbons or other icons, hopefully of similar shape and size, but not necessarily.  Someone could get 10, 20, or more of these so doing on the left side would get way too large to show all of them. 

Again, we are using the mod to show up to 6 on the left side, those 6 being "primary" badges.  the ones we would like to show on the bottom would be "secondary" badges.  It would be nice if we could select, for each member group's badge, whether to show vertically on the left, or horizontally on the bottom.

Thanks for your considerating this.  Whether doable or not, thanks again for the cool mod!

Advertisement: