Stars and Badges

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

Previous topic - Next topic

hcfwesker

I found this link, that will Install on SMF 2.0 with no install errors, and I have over 40 MODs installed.

http://www.simplemachines.org/community/index.php?topic=225743.msg2644620#msg2644620


To Remove the double badges, I found out that REMOVING the line from Themes/default/Display.template.php will get rid of the duplicate.


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

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 '
<li class="postgroup">', $message['member']['additional_groups']['stars'][$i], '</li>';

jestism

BTT for a possible method of doing this.
(Know it can be done, as 3 years ago I had my SMF 1.1.xx modified by a person to do it. Unfortunately, I never knew which file or what he modified)



Quote from: jestism on July 05, 2011, 07:58:26 PM
OK.. Installed and working.

My question is.. "IS" there a way to have the badges display in columns of (3) instead of a single column like in the image below.
(the way it is below is taking up a lot of vertical space)



Thank-you for any advice, help or directions in advance.

Mike

Dai Li

#842
Alright um, I had it working and then it randomly stopped showing the extra badge things in threads. I have no idea why. I was moving stuff around, pretty sure, basic copy paste-a-few-lines-down type stuff, altered some HTML, it shouldn't have broken so I have no idea why it did.

echo '
<p class="stars" style="padding-bottom: 2px;">', $message['member']['group_stars'], '</p>';

// Show the member's extra groups if they have them.
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 '
<p class="stars" style="padding-bottom: 2px;">', $message['member']['additional_groups']['stars'][$i], '</p>';
elseif (!empty($message['member']['additional_groups']['id']))
for ($i = 0; $i < count($message['member']['additional_groups']['id']); $i++)
echo '
<p class="stars" style="padding-bottom: 2px;">', $message['member']['additional_groups']['stars'][$i], '</p>';


Added the commentary for my own reference, but this is what the section that should affect this looks like. All it shows is the primary badges, not the additional badges. I'm running the altered one for RC3 a few posts back on a 2.0.

Edit: Never mind, I just replaced it with the default display.template and manually remade the changes.

jestism

In "which" of the many .php files is this found or this modification placed.?

jestism

Bump back to top. Still looking for a way (or how to) accomplish this.
(Know it can be done, as 3 years ago I had my SMF 1.1.xx modified by a person to do it. Unfortunately, I never knew which file or what he modified)

Quote from: jestism on July 05, 2011, 07:58:26 PM
My question is.. "IS" there a way to have the badges display in columns of (3) instead of a single column like in the image below.
(the way it is below is taking up a lot of vertical space)



Thank-you for any advice, help or directions in advance.

Mike


jestism

#845
I am also running into the issue that admin and moderators can see all of the badges of the members in posts, however members are not seeing all of their badges while running the 2.3 version of "Stars and Badges" that was posted (http://www.simplemachines.org/community/index.php?topic=225743.msg2644620#msg2644620) with SMF 2.0

jeronij

Quote from: MalikCarr on November 30, 2010, 10:52:37 PM
Don't worry about it - I actually figured out how to fix it, and it was pure user error (on my part).

I was under the mistaken impression that the group numbers were sequential, rather than just random - so when I input 1,2,3,4,5, etc into the list of groups to show, it showed my Administrator and Moderator badges (1 and 2) but no others, since those were various 18,12,14,9 and 16. Har.

Hello,

Using V2.3 (in zip, but installed it says 2.2)

I am having a problem with the Arrange additional Groups ID. It does not matter what I put in it, it does not work. It shows always all the badges.

This list of ID I want to use:
1,2,9,10,11,13,14,15,23,25,26,27,29,37,40,43,47,50,51,53,54,55,56,57,64,65,74,75,77,84,89,90
Doesnt work :(

I tried with:
1,2
Doesnt work either :(

It shows always all the badges.

It seems that MalikCarr had the same problem and figured out how to fix it, but I am sorry, I cant understand how he did. I cant see how to set up this list in the comment he posted, so I hope someone can help me to clear this and solve the problem.

Thanks in advance ¡¡


EDIT: The numbers series are being correctly saved in the database.

jestism

I had the opposite problem to begin with, and that was some members were only seeing some of their badges, but not all of them.

Don't remember which file it is (but it in this thread is where I found it) you had to change the base quantity of from the default number of badges/stars from "20" to as large of a number as you needed to handle all of the ones you have.
--------------------------------
Our members seeing ones that are "not" assigned to them?


-----------------
Side note:
I got the rows and columns working... ;D (again from hunting and trying different things that I found in this thread)



jeronij

Hello and thanks for pointing me in the right direction  :D . There is only one "20" in the code, and it was easy to find. I changed it to "90" and it solved the problem, and now only the wanted labels are showing.

I used the 2.1 version from the beggining, and I tried version 2.3 found in this thread. However 2.3 didnt work for me with or without this modification thus I use a self-modified 2.1 version, which installs and works fine in SMF 2.0 . Dont think it is worth to attach it here, but if someday someone would need it, just send me a PM  :)

Again thanks for the help ¡¡

jestism

You are welcome... (glad that my little knowledge of just hunting this thread helped)

I am down to just figuring out "HOW" to get the badge name to "appear" when the mouse is hovered over it.

Something had been modified on the old SMF 1.1.xx version that made it work, but the person who did it is no longer involved with the site.

I am sure it is something "simple" ... but knowing "ZERO, ZIP, NADA" about how to write script isn't helping me to figure it out.

So I search threads in hopes of finding something that will point me to the solution.

jeronij

#850
Well, you helped me, I help you ;)

I would recommend you to unistall the mod, make the modifications in install-2.xml and upload and install the mod again. The IDs list (if you use it) is saved in the database and you'll recover it automatically.

You can also make the modifications directly in your forums files, <!-- Sources/Load.php -->, but I would not recommend that because you'll have errors when unistalling the mod, and if you want to install it again the trick wont work ;)   


Search:


$memberContext[$user]['additional_groups']['stars'][] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row_stars['stars'][1]) ? $settings['images_url'] . '/' . $smcFunc['substr']($row_stars['stars'], 2, strlen($row_stars['stars'])) : '') . '" alt="*" border="0" />', empty($row_stars['stars'][0]) || empty($row_stars['stars'][1]) ? 0 : $row_stars['stars'][0]);


and change it to:



$memberContext[$user]['additional_groups']['stars'][] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($row_stars['stars'][1]) ? $settings['images_url'] . '/' . $smcFunc['substr']($row_stars['stars'], 2, strlen($row_stars['stars'])) : '') . '" alt="*" title="' . $row_stars['group_name'] . '" border="0" />', empty($row_stars['stars'][0]) || empty($row_stars['stars'][1]) ? 0 : $row_stars['stars'][0]);


This should make the trick. It took me sometime to make it work, because the "alt" tag does not show in the browsers, so I had to use "title" instead.

jestism

Thanks...

I just went in (first on one of my test sites) and edited the sources/load.php file.
It worked perfectly.

So did the same on my live site and everything is doing what it is suppose to do.

When a member "hoovers" their mouse over a badge (award) that they or someone else has, it now shows them the "name" of it.

Thank-you again.

H3lioz

Anyone that can make this for 2.0 final for 8$-10$.

jestism

I used the 2.3.3 zip version (though it shows up in the packages screen as 2.2) and it loaded in SMF 2.0 Gold without any problems.

The issues I ran into were:

#1   The total number of badges that I have exceeded the default quantity of (20)... {file to mod noted in one of my previous posts}

#2   I wanted "3 columns" of badges (thus creating rows) and that required mod is found early in this thread (don't remember the page or post number)

#3   I wanted the "names" of the badges to appear when the mouse hoovered over it. {file to mod noted by another member just a few posts back}

I do not know "ANYTHING" about writing script for php.... but everything is here in this thread to have it running flawlessly on SMF 2.0 Gold.

"IF" you have 20 or less badges and just want them in a single column, then you can (if the theme you are using doesn't have an issue with it) just install the 2.3.3 zip version that can be found in this thread on SMF 2.0 Gold. (Or at least I did and didn't have any problems or issues that were not related to "extra" features I wanted.

jeronij

Quote from: strafe on August 06, 2011, 10:22:09 AM
Anyone that can make this for 2.0 final for 8$-10$.

You can try this if you want, at your own risk  ;)

If you get any errors when you go to install it, dont do it, and post here the code that is giving the error. I have a somehow customized installation but this should work in a clean as well. Only 2.0

If it works and you still want to give these 8-10$, just pay a visit here:  http://sc4devotion.com/forums/index.php?page=5 [nofollow] and support my site  8)   (<-- if it is not allowed to post this sort of links,  I am sorry. Please a mod delete it :) )

Hope this helps

ambrosiavenus

I am running SMF 2.0, and while I can get this to work here's my small noobish question...

I want the Admin Stars to show, but I would also like the Post Groups to show to, is this possible?

The reason I ask is because, when I install this mod, I keep getting two Admin Badges one where the badge is supposed to be and one as my Post Group.  I am sure it's something I'm doing I'm just not sure what it is at this point, so any help would be awesome :D

jestism

It is a pain to do, but if you have the time to manage it (which is the method we have had to use since the version for SMF 1.1.XX), is this.

"Post Count" groups can be a pain, especially if you have other badges that are "non-post count" driven.

The "ONLY" solution we have came up with (again in 3 years across both SMF 1.1.XX and now SMF 2.0) is to just create standard membership groups.

Then in a members profile, (your example is Admin, which should have the primary group set to Admin), you would just select the other groups from the additional list.
This would then list them "under" the original.

You just have to remember to "Manually" add a member (even an admin) to each additional membership group you want listed.

Side Note:
Once you create separate "member-groups", hover your mouse over the member-group name. It will end with a number (that is the group number).
"IF" you want badges to show up in a specific (and consitant) order under the members names, the list of group numbers will have to be entered in the same order that you want them to appear in the Admin feature/layout screen.

ambrosiavenus

Yeah! That's just a bit of a pain!  Thank you very much :D

H3lioz

http://prntscr.com/2kyu4

Cant find the text in display.template.php please help.

Biology Forums

How many badges could you give someone before it starts crashing. For some reason, after 5 badges, the user's stars (which signify post count membergroup) disappear >:( :( Could some explain why this is?

Advertisement: