News:

Want to get involved in developing SMF, then 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

If you want me to upload any more files. just tell me :)

ElectricSquid

Here's an easy one for ya :P

I would like to make the icon/logo/badge a clickable link to some other page on my forum. Basically I have a few member groups that are based off of donorship to the site. I would like to promote this action through making the Site Donor and Gold Member icons (created through this mod) to be links to a page where other users can get info on how to also donate and/or become Gold Members.

Here is the code you created for Display.template.php that I custom modded as discribed in a previous reply. This code is placed in a different place to make the icons show up just above the users signature in posts and messages.

I also took the first two lines of code and placed them at the end due to a slight issue getting the Gold Member icon to show. the code rearangement took care of that issue (for now). just figured I'd let you know, just in case there was an issue, or if you thought your code looked a little different here :P

The link for Gold Member info and Site Donor info are the same page, so am I correct in thinking that all I would need to do is add the <a href> to the existing < td> opening and closing tags?



// start STARS and BADGES
echo '
<tr>
<td>
<table><tr>';


      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 '<td>', $message['member']['additional_groups']['stars'][$i], '</td>';
      }           

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

echo '
</tr></table>
</td>
</tr>
';

// end STARS and BADGES



bros

Problem solved.

Did a clean install of SMf

ALl works

Bulakbol

@BurkeKnight
  That's one way to learn. Do it yourself. :)

@Sheeree
   I have your files. I'll look into them. I'll get back to you.

@∑£ℓ¢†®¡¢ §ợų¡đ
  Try like this. Change the 2 with your Gold Member additional group ID.
Quote
if ($message['member']['additional_groups']['id'] == 2)
   echo '<td><a href="', $scripturl, ...">', $message['member']['additional_groups']['stars'][$i], '</a></td>';
else
   echo '<td>', $message['member']['additional_groups']['stars'][$i], '</td>';
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ElectricSquid

#304
Quote from: JohnyB on July 11, 2008, 08:55:29 PM

  Try like this. Change the 2 with your Gold Member additional group ID.
Quote
if ($message['member']['additional_groups']['id'] == 2)
   echo '<td><a href="', $scripturl, ...">', $message['member']['additional_groups']['stars'][$i], '</a></td>';
else
   echo '<td>', $message['member']['additional_groups']['stars'][$i], '</td>';


I couldn't get that to work. I think if I knew php a little bit more, I could have gotten it. But I reverted to the simple way for now. I just added the "a href" to each "td".

I did change the 2 to the proper member group number (12), and I'm pretty sure I replaced the correct code. Not exacly sure why it didn't work. But it's OK, I was able to get it good enough for now.

In the future I may need the ability for each user group to have it's own seperate link, but for now this works fine.

Thanks for your help and time :D

Bulakbol

#305
@∑£ℓ¢†®¡¢ §ợų¡đ
  Ok. I'll check it too when I have time.


@Sheree
  Could you try this Display.template.php if it's the one you want. It's attached.

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Sheree

just what i wanted .. Thanks JohnyB   :-* :-*

Bulakbol

 8) You're welcome Sheree.  ;)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

reo4ua

Where can we find the icons/buttons to use with this mod???

Bulakbol

You have to create it yourself southeastsportsforum.com. That's the hard part. :)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Burke ♞ Knight

There are plenty of places that have some great free rank images for forums.
Easy to find using Google. :)

Eliana Tamerin

Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Anub1s

Quote from: JohnyB on July 09, 2008, 06:58:37 PM
@Anub1s and BurkeKnight
   Attach an image of what you want to be displayed and I'll see what I can do.


@bros
   The mod was improperly installed. Try this version of Load.php attached.

Hi dude ok wat i was after was the following

Anub1s
postgroupe image
Postgroup image
Member groupe
Membergroup image
avatar
whatereve comes next lol

is this posible and if so what do i have to eddit in 2.0.3.1

thanks dude

Bulakbol

@Eliana
  Thanks for the link.

@Anub1s
   I'm a bit busy right now but I'll look into it soon.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Acans

hey johny, is it to much to ask if you could edit my display.template so that it lists as

Name
Custom title
Primary Membergroup
Additale Membergrougs
post count
Primary Member goup image


Atm since i edited it so it lists the group names and not the image its

Name
Custom title
Primary membergroup
post count
primary membergroup image
addinatle membergroups names

thanks if you can.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Acans

dont worry about my last post, now i have problems installing this mod on my main forum, it install ok on my test forum, but when i try install on my main the test for load.php fails???
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Bulakbol

Ok, I am not downloading your file then  вαѕι¢αℓℓу ι'м נєѕυѕ.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Acans

mmmk, but how do i fix the load.php file then?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Bulakbol

Quote from: вαѕι¢αℓℓу ι'м נєѕυѕ on July 19, 2008, 09:59:29 PM
mmmk, but how do i fix the load.php file then?

My understanding is that you are not going to install this mod because there is an error. If you need help, attach the file in question and I'll look at it.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Acans

but isnt it "bad" to install a mod that a test fails, or how do i make a backup of my forum first?
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Advertisement: