Show Multiple Badges (AKA Stars)

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

Previous topic - Next topic

hugocz

#200
Well i don't have this in my Load.php but i think that's cause I don't have the mod installed? I can't install it cause Load.php

Also im using Ranks and Stars images one location MOD, can this be why i can't install this one ?

I can't post my Load.php here it's too long(characters limit)








TrueSatan

OK can you put it in a zip archive and post it as an attachment?

The two mods do conflict but what I'll try to do for you is to merge them as regards the Load.php file.

What you would then be able to do is to install this mod ignoring the error and then rename the Load.php file on your server (do this in case you need to remove this mod)...name it whatever would let you find it again easily..."Load.php-mulbadge" sans quotes would do fine. Then upload the new Load.php file I'll make for you in its place.

Your obvious other alternative, that would save on having a custom  mod, would be not to use the Ranks and Stars images one location mod.

hugocz

#202
Oh, i see, thanks alot TrueSatan that would be much appreciated :)

I've uploaded the file here http://hugo.rytir.com/Load.php.txt

Also could you help please with the second problem, (if you help me modify the Load.php) then how I make the mod work in my custom theme? cause im using a modified Tinyportal theme and most mods work only in default, don't know how about this one.

Thanks again every much :)

EDIT: I uninstalled the Ranks in one directory and now installed this mod without errors :D tho i need to figure out 2thinks now, how to make it show the secondary group title, not just badge, and make it work in nondefault theme :)

EDIT2: Ahh looks like the addon only show badges not the grouptitles, i want titles, looks like theres not mod like that around.

hugocz

Really sorry that i keep spaming, but now that i Finally installed it without any errors using the packages installer (i uninstalled the problematic mod before).

And figured out it can't do exactly what i wanted to, i tried to uninstall it and woah :S

1.     Execute Modification     ./Sources/Load.php     Test successful
2.    Execute Modification    ./Sources/ManageMembers.php    Test failed
3.    Execute Modification    ./Themes/default/ManageMembers.template.php    Test failed
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
5.    Execute Code    remove_settings.php

Why am i geting errors, when i installed it, it was 100% error free, someone help me out so i can give up on this, please.

TrueSatan

The reason you're getting error is because you have mods that have altered the files this mod seeks to alter. I've sorted out the conflict you reported between this mod and the "Ranks and Stars images one location" mod...that one conflicts with it in the Load.php file. I'll attach two files to this posting...the first is for a clean board with no other mods than these two in place...the second is your Load.php file with the conflict in it regarding the two mods in question resolved for you.

To resolve the new problem you've reported I'll need to see your ./Themes/default/ManageMembers.template.php file and to manually edit that for you.

BTW I don't use Tiny Portal so I can't be of much use to you regarding that...I only use the default theme and though I can point you to documentation on how to integrate mods into themes in general since I must assume that as you're using Tiny Portal the theme in question is a Tiny Portal theme I'll again have to suggest that you ask on the Tiny Portal forum about it.

To use the second file please rename it to Load.php and first add the Ranks and Stars images one location then this mod ignoring the error on the Load.php file then rename the Load.php file on your server as I described earlier and upload the new file....but don't do any of the above until I've sorted your new ./Themes/default/ManageMembers.template.php problem.

TrueSatan

Quote
EDIT2: Ahh looks like the addon only show badges not the grouptitles, i want titles, looks like theres not mod like that around.

Sorry...just catching up with you having been doing the editing you needed and making a meal too...don't worry I didn't get food all over my computer.

You could get around this by making suitable images that included appropriate text and thus you wouldn't need any new mod.

hugocz

Yes im sorry man, you helping me good, i did send you PM but probably too late, i downloaded the Load.php's and will test it, but firt i  would to know how to sucesfully uninstall it, too.

I can edit the files myselft, just don't know what code to change :( (the most important part yeah:D)

Two files is giving me error:

./Sources/ManageMembers.php and /Themes/default/ManageMembers.template.php

I've uploaded them here:
http://hugo.rytir.com/smf/ManageMembers.php.txt
http://hugo.rytir.com/smf/ManageMembers.template.php.txt

Please TrueSatan if you will be so kind and tell me what code i must remove/change in there ? Much apreciated


TrueSatan

You'll have to forgive me not giving you a complete answer right now...I look after my elderly mother and must get her off to bed....probably the easiest way for you to see what needs to be done is for me to do it then for you to compare what you had before with what I give you. Most of us learn that way.

Uninstalling isn't too difficult...really it's just a matter of reversing the process...delete the manually edited file(s) change back the old file(s) whose name(s) you edited and then use the package manager to do an uninstall.

I'll edit the files for you later on tonight and post the fixed versions here.

TrueSatan

Hmmm the two files you have provided are completely clean of any mods whatever...they are identical to those in the SMF installer pack. It would seem that you have tried to uninstall more than once and that a previous attempt already managed to uninstall the mod...either that or it never installed properly even in the files it claimed to install into.

I now need to see the two files that appeared to succeed in the uninstall as those ought to have failed if a complete uninstall had been done...

Your site is looking rather mangled to be frank. I would hope that you have been working on a test site in any case and have followed standard practice and backed up your files before applying any mod.

I can straighten out these files for you fairly easily but what worries me is did you do exactly as I told you with regard to the Load.php file prior to uninstalling as the package installer result indicates otherwise?

hugocz

#209
I didn't do anything with your Load.php's yet, and i didn't really tried to install or uninstall with errors. here's the complete list what i did.

1. Uninstall - Ranks and Images in one Location - sucessfull no errors
2. Install Multiple Badges - sucessfull no errors
3. Try ot Uninstall Multiple Badges, now it was saying errors so did hit back

The end, then i posted you the error files here, i really didn't do anything else.

here's the other mods i got installed:
1.    Show Multiple Badges (Aka Stars)     1.0
2.    WoW-Itemstats 1.25.6    1.25.6
3.    SMF Gallery Lite    1.7.1    
5.    Member Color Link    2.0.0    
6.    3guks PJIRC Integrated Chat Mod    1.1    
7.    TinyPortal    0.983    
10.    Custom BBCode    2.00


EDIT: TrueSatan i uninstalled it now :) i hit uninstall even with erros and replaced all the files, both  the sucesfulf and failel ones with files from 2007-04-20_before_multiplebadges_1-0.tar.gz  it's the automatic backup when installin new mod, phew glad it's solved out, i can now keep lookin :) Thanks you again

TrueSatan

I can make some guesses as to what happened (an explanation of the lack of errors shown but there still being problems)...but they can only be guesses due to not (at this time...no criticism intended) having all the information I'd need to confirm them. I'd guess that you might not have had the files all set to CHMOD 777. Before installing any mod you should go to:

Admin>Packages>Options

Set up your ftp details in Installation Options (this can need some trial and error to see if the settings work properly to change the CHMOD of your files...if not try altering them) then Cleanup Permissions>All files are writable.

Check via ftp to see that all files really are writable...as above if they aren't the ftp settings you put in the Installation Options aren't right.

You can use the same process to make less files writable after installing a mod if you so wish...see the other options in Cleanup Permissions.

In this case the important ones are the files affected by this mod...their permissions should be set to CHMOD 777...do it manually via ftp if you can't get the above process to work or are having to spend a lot of time sorting it out (do get it working some time though.)

I'll add the mod to the two problem files for you and post them later.

What is the end result you are seeking now...do you want the mod installed or not?

hugocz

What i seek now is a MOD that allow me to show multiple membergroup titles, for example:

Name
-primary group
-secondary group
-post group
-primary badge
-post group badge

I need the reverse of what this MOD does actually, instead of badge i want just the text. and enable witch groups to show with the check button.


TrueSatan

You could try requesting that such a mod be written via a posting in the SMF Coding Discussion forum, though unless you were to be prepared to pay someone to write the code you might not get anyone to do the work....it is possible to offer payment for a custom mod via that forum.

One way around your problem might be to use the Member Awards mod by Jay Bachatero and giving badges to the members in the groups you mention...it wouldn't be an automated system but it might suffice for your needs.http://custom.simplemachines.org/mods/index.php?mod=475

Con

Thanks for making this mod, I just have a small question, how can I make it that it displays the badges in one line, instead of under each other?

TrueSatan

Thantos (who was kind enough to code this mod) is now engaged on many duties as part of the core coding team for SMF and is thus unable to continue to support mods such as this...I'll do my best to help though.

This mod is coded to show the badges in a line as much as is possible...if the badges are numerous or big then to stop them flowing across from the side bar multiple lines are used.

Perhaps the badges you have opted to use are simply too big?

For future reference those who want the badges to show under each other should change the code as follows:

in Sources/Load.php find:


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);
}


replace with:


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" /> <br> ', empty($star[0]) ? 0 : $star[0]);
  return implode("<br/>", $starstrings);
}

Con

my badges are all 13x13 pixels, so, thats not too big.
But after installing this mod, they are all shown under each other, not next to one another.

TrueSatan

Please post examples of the images you are using. What theme are you using them in? In the default theme the mod performs as it should...if you are using a custom theme then that could be the problem.

Con

Heh, yea a default theme, 'black22'

Attached one of the images

TrueSatan

 Right..."black22" isn't a default theme it's a custom theme...and it's probably why you are having problems. Please switch to the SMF default theme and test this mod in that...I expect that you'll find it works properly. Your star/badge image certainly looks to be OK.

The following tutorial gives details of how to install into a custom theme...though some themes can be a problem and that's not an area in which I would be of help to you.

http://docs.simplemachines.org/index.php?topic=402


Con

Quote from: TrueSatan on May 07, 2007, 04:42:19 AM
Right..."black22" isn't a default theme it's a custom theme...and it's probably why you are having problems. Please switch to the SMF default theme and test this mod in that...I expect that you'll find it works properly. Your star/badge image certainly looks to be OK.

The following tutorial gives details of how to install into a custom theme...though some themes can be a problem and that's not an area in which I would be of help to you.

http://docs.simplemachines.org/index.php?topic=402


Sorry, yypo, I ment it was a custom, anyway, it even shows them under each other in the default theme.

Advertisement: