News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Show Multiple Badges (AKA Stars)

Started by Thantos, April 04, 2005, 10:03:46 PM

Previous topic - Next topic

Alpay


Krysia

Quote from: Alpay on February 18, 2007, 01:24:07 PM
Does it work on 1.1.2 ? Thanks :)
It sure does. :D It's running sans difficulty on my 1.1.2 forum. :)



EG

this is a great mod!  was using it with RC2  now Ive updated to 1.1.2  will it work ?  Ive read a few pages back you have to make physical changes within the database... is that right ???

perplexed

I have been using it for a long time and each time I upgraded it worked.  This time I upgraded to 1.1.1, installed the mods, and then applied the 1.1.2 patch and it works for me.  I didnt have to make any changes to database or anything.

If you are already at 1.1.2 then I can't say if it will work or not but doing it the way I did above, worked fine.

NativePages

I FINALLY figured out how to get this one to work! WOOHOO!!! Thanks, Thantos! As Martha would say, "This is a GOOD thing!"
http://www.nativepages.com/tnindian
I came, I saw, I installed, I asked a million questions, but eventually I got it!

cassie

Fantastic mod! Does exactly what I wanted it to do. I just installed it on 1.1.2 and it works like a charm.

Thank you for this mod!

bfdzio

Problem with the mod....It installed fine it claimed, but I am getting this on the top of my page..just the text of this...

Quote$txt['membergroups_showAddBadge'] = "Show the stars even if the group is a secondary group?";

I tried to uninstall, but it says there will be errors.  


hugocz

Im getting error when trying to install :|

1.     Execute Modification     ./Sources/Load.php     Test failed

Packages i run:
2.     WoW-Itemstats 1.25.6      1.25.6      
3.    SMF Gallery Lite    1.7.1
4.    SMF Ranks    1.1    
5.    Member Color Link    2.0.0    
6.    3guks PJIRC Integrated Chat Mod    1.1    
7.    TinyPortal    0.983    

Any tips? :)

Sandwich

#189
I've modified version 0.3 of this mod to work with SMF 1.1.x (it works on my forums, at least). Please test and let me know if it works for y'all.

EDIT: Wait a sec... is there a version 1.0? *goes hunting*

EDIT 2: Oki, now I feel like a dork. :p I didn't see the updated version before.  :-[ Ah well, I learned alot at least. :p

Orac


Sandwich

Thanks.

I've got a feature request. :) I'd like to be able to define a link for each membergroup's badge. How complicated would that be?

hugocz

Quote from: TEOC on April 07, 2007, 01:52:13 PM
Yep, check my post on the 22nd of December:- http://www.simplemachines.org/community/index.php?topic=32323.msg870620#msg870620  ;D

Yes, i downloaded it manually , and 1.0 and you see im geting error only on Load.php other's are sucesfull. So don't know what to do :O

hugocz

So anyone know if i can install it even with the Load.php error ?

hugocz

#194
Can't figure out how to fix it :| i would like this addon bad, but i don't want to install it if it says Load.php test failes, i try paste here the original xml code for load.php and the section in mine Load.php

Original:(from xml)

<file name="$sourcedir/Load.php">
<operation>
&nbsp; &nbsp; &nbsp; <search position="replace"><![CDATA[
'group_stars' => getgroupstars($profile['ID_MEMBER'], $profile['stars']),
]]></search>
<add><![CDATA[
'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $settings['images_url'] . '/' . $profile['stars'][1] : '') . '" alt="*" border="0" />', empty($profile['stars'][0]) ? 0 : $profile['stars'][0]),
]]></add>
</operation>
<operation>
<search position="replace" ><![CDATA[
function getgroupstars($id, $stars)
{
&nbsp; global $context, $db_prefix, $settings;
&nbsp; $ret = '';
&nbsp; $allstars = array($stars);
&nbsp; $result = db_query("
&nbsp; &nbsp; &nbsp; &nbsp; SELECT mg.stars
&nbsp; &nbsp; &nbsp; &nbsp; FROM {$db_prefix}membergroups AS mg,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {$db_prefix}members AS mem
WHERE (FIND_IN_SET(mg.ID_GROUP, mem.additionalGroups) OR ( mg.ID_GROUP=mem.ID_POST_GROUP AND mem.ID_GROUP != 0 ))
AND mem.ID_MEMBER=$id
AND mg.showAddBadge=1
",
&nbsp; &nbsp; &nbsp; &nbsp; __FILE__, __LINE__);
&nbsp; while ( $row = mysql_fetch_row($result) )
&nbsp; &nbsp; &nbsp; &nbsp; $allstars[] = explode('#', $row[0]);
&nbsp; mysql_free_result($result);
&nbsp; $starstrings = array();
&nbsp; foreach($allstars AS $star)
&nbsp; &nbsp; &nbsp; &nbsp; $starstrings[] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($star[1]) ? $settings['images_url'] . '/' . $star[1] : '') . '" alt="*" border="0" />', empty($star[0]) ? 0 : $star[0]);
&nbsp; return implode("<br/>", $starstrings);
}
]]></search>
<add><![CDATA[]]></add>
</operation>
</file>


My Load.php:

'group_stars' => str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($profile['stars'][1]) ? $boardurl . '/ranks/' . $profile['stars'][1] : '') . '" alt="*" border="0" />', empty($profile['stars'][0]) || empty($profile['stars'][1]) ? 0 : $profile['stars'][0]),
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),
);



EDIT: I think it's prolly cause the mod, Ranks images in one directory, these two prolly won't work together?

Thantos

I am no longer able to keep my mods up to date since I'd rather spend the time I have on developing SMF.  As such the following mods are up for the taking.  I give my permission to update and/or modify and restribute under your name this mod.  All I request is that you let the Customization Team know if / when you post a new version of the mod so that they can remove my version.  thanks.

hugocz

:( Well atleast you leave the mod for good Thantos :) Anyone please can continue on this mod? I would like to use it badly, but can't get it install without errors.

TrueSatan

Quote from: bfdzio on March 18, 2007, 08:36:46 PM
Problem with the mod....It installed fine it claimed, but I am getting this on the top of my page..just the text of this...

Quote$txt['membergroups_showAddBadge'] = "Show the stars even if the group is a secondary group?";

I tried to uninstall, but it says there will be errors. 

Your theme directory/Languages/Modifications.english.php file has an error. It appears that ?> is not at the very end of it...it's probably in the file though...you need to delete ?> from where it is and move it to the end of the file on a line of its own.

TrueSatan

I'm far from being a great coder but unless somebody better steps in I'll try to at least keep an eye on this one and keep it compatible with new SMF versions as best I can...if somebody else can do better please do it.

TrueSatan

Quote from: hugocz on April 20, 2007, 06:37:30 AM
:( Well atleast you leave the mod for good Thantos :) Anyone please can continue on this mod? I would like to use it badly, but can't get it install without errors.

Would you please post your entire Load.php file...I am not clear as to your having or not having the following at the end of it:

function getgroupstars($id, $stars)
{
  global $context, $db_prefix, $settings;
  $ret = '';
  $allstars = array($stars);
  $result = db_query("
        SELECT mg.stars
        FROM {$db_prefix}membergroups AS mg,
                {$db_prefix}members AS mem
WHERE (FIND_IN_SET(mg.ID_GROUP, mem.additionalGroups) OR ( mg.ID_GROUP=mem.ID_POST_GROUP AND mem.ID_GROUP != 0 ))
AND mem.ID_MEMBER=$id
AND mg.showAddBadge=1
",
        __FILE__, __LINE__);
  while ( $row = mysql_fetch_row($result) )
        $allstars[] = explode('#', $row[0]);
  mysql_free_result($result);
  $starstrings = array();
  foreach($allstars AS $star)
        $starstrings[] = str_repeat('<img src="' . str_replace('$language', $context['user']['language'], isset($star[1]) ? $settings['images_url'] . '/' . $star[1] : '') . '" alt="*" border="0" />', empty($star[0]) ? 0 : $star[0]);
  return implode("<br/>", $starstrings);
}


...followed by the closing ?> line

If you don't have that the mod will fail to work.

Advertisement: