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

bwyard


bwyard

i did the donator badge but it stsill not working

IdanC

just to let everyone know - with a few changes left to be done manually after installation, this mod is compatible with rc3

Keeper

Can someone please update this mod for RC3? And maybe add option to display badges either horizontally or vertically.

Mists

Quote from: IdanC on March 18, 2010, 08:22:45 PM
just to let everyone know - with a few changes left to be done manually after installation, this mod is compatible with rc3

What exactly has to be done after for RC3?

IdanC

nothing special, just follow the installing instructions for any code change that the normal package installer fails to perform...

Bruno36

Bruno36 the French
SMF 2.0.9


Bruno36

/Sources/Load.php

Find:

return true;
}

// Load a theme, by ID


Replace With:
   $context['badges']['ownline'] = !empty($modSettings['badge_ownline']) ? explode(',', $modSettings['badge_ownline'], 20) : '';
 
$groups = $profile['additional_groups'];
// Load additional membergroups
if (!empty($groups))
{
$result_stars = $smcFunc['db_query']('', '
SELECT id_group, group_name, stars, online_color
FROM {db_prefix}membergroups
WHERE id_group IN (' . $groups . ')
',
array()
);

// additional groups
while ($row_stars = $smcFunc['db_fetch_assoc']($result_stars))
if (!empty($row_stars['stars']))
{
$memberContext[$user]['additional_groups']['id'][] = $row_stars['id_group'];
$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]);
$memberContext[$user]['additional_groups']['name'][] = $row_stars['group_name'];
$memberContext[$user]['additional_groups']['ag_color'][] = $row_stars['online_color'];
}
$smcFunc['db_free_result']($result_stars);
}

return true;
}

// Load a theme, by ID.



/Sources/ManageSettings.php
Find:

// Stats, compression, cookies.... server type stuff.

Add Before:

// Stars and badges
array('text', 'badge_ownline'),
'',

Bruno36 the French
SMF 2.0.9

ZarPrime


On my SMF 1.1.x site, I have been using the following Mod for quite awhile ...
vMulticolor-Stars Mod by Valodim (http://custom.simplemachines.org/mods/index.php?mod=191)


I am sort of looking for a replacement for that Mod that will work with SMF 2.0 RC3, as I am getting ready to upgrade soon.


It allows me to do what is shown in the attached image.  In that image, Speaker's primary Group is Kirduin, and he is also in 3 secondary groups (Counsilor, Sovereign, and FAQMaster).  Each of those membergroups has it's own badge.  The Stars below the 4 badges are, of course, from his post group only.


So, the question is,  can I do the same thing with this Mod?  If so, this is good news as this has been one of the things that has kept me from upgrading to RC3.  The bad news seems to be that the author of this Mod has not been on since November 27, 2009 and, for that reason, this Mod seems to be dead in the water at this point, at least WRT an upgrade for SMF 2.0 RC3 (curve) being available.


Does anyone have any news on this?


ZarPrime

dekay

QuoteSo, the question is,  can I do the same thing with this Mod?
Yes, I think so.

QuoteDoes anyone have any news on this?
Browse a few pages backwards in this thread. You'll find a 'patched' version for RC2. I applied it to my RC3 a few days ago with some manual edits that the Package Manager was not able to make.



ZarPrime

dekay,


OK, thanks.  I'll look back through the topic.


ZP

IdanC

Quote from: IdanC on March 18, 2010, 08:22:45 PM
just to let everyone know - with a few changes left to be done manually after installation, this mod is compatible with rc3

a few notes for installing on RC3 -

in load.php, this change will fail -

return true;
}

// Load a theme, by ID.


instead, find

return true;
}

function detectBrowser()


and replace with

$context['badges']['ownline'] = !empty($modSettings['badge_ownline']) ? explode(',', $modSettings['badge_ownline'], 20) : '';
 
$groups = $profile['additional_groups'];
// Load additional membergroups
if (!empty($groups))
{
$result_stars = $smcFunc['db_query']('', '
SELECT id_group, group_name, stars, online_color
FROM {db_prefix}membergroups
WHERE id_group IN (' . $groups . ')
',
array()
);

// additional groups
while ($row_stars = $smcFunc['db_fetch_assoc']($result_stars))
if (!empty($row_stars['stars']))
{
$memberContext[$user]['additional_groups']['id'][] = $row_stars['id_group'];
$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]);
$memberContext[$user]['additional_groups']['name'][] = $row_stars['group_name'];
$memberContext[$user]['additional_groups']['ag_color'][] = $row_stars['online_color'];
}
$smcFunc['db_free_result']($result_stars);
}

return true;
}

function detectBrowser()



also, in ManageSettings.php there is a failed search for

// Stats, compression, cookies.... server type stuff.

instead, search for

// Statistics.

last one - in display.template, instead of

search for
<li class="stars">', $message['member']['group_stars'], '</li>';
notice the class="stars"


luismanson

maybe a new package can be uploaded here

dav

Alright..

Everything is working when I manually installed the mod on SMF 1.1.11.

However, there's one addition I would like to see.

Before I installed this mod, I was able to have the Color in online list (Admin -> Members -> Membergroups -> Modify) show..
I still have the color there but the color doesn't show up anymore..

Is there anyway I can fix this?

Thanks!
-dav

dav

Quote from: dav on April 13, 2010, 05:20:02 PM
Alright..

Everything is working when I manually installed the mod on SMF 1.1.11.

However, there's one addition I would like to see.

Before I installed this mod, I was able to have the Color in online list (Admin -> Members -> Membergroups -> Modify) show..
I still have the color there but the color doesn't show up anymore..

Is there anyway I can fix this?

Thanks!
-dav

Anyone have any idea?

mysticmind

anyone installed this (with manual edit above) on SMF2 RC3?
is it all OK without any error logged?
i wonder why smf rc3 not include a ready built function like this since the author of this mods is MIA. :(

C4G-TK

Well, after installing 48 other mods, I installed this by EMULATING the package that was attached in reply #721.  I only had one failed test which was the ManageSettings.php edit, so I manually edited that file.  It is working.  Good luck.

-img removed-

X3neizes

I attached a modified version tested and running in SMF 2.0 RC3  ;)

luismanson

thanks @X3neizes

Are you from Argentina?

Advertisement: