News:

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

Main Menu

Display Additional Membergroups on Profile

Started by vbgamer45, January 09, 2007, 10:16:18 PM

Previous topic - Next topic

Daniel15

Quote from: Lill-Micke on January 18, 2007, 02:24:01 AM
QuoteHi Daniel15!

Thx for this great mod!
I installed it and it works great.
How can I get the users membergroup to show in a topic?

Can you post the code to insert in $sourcedir/Display.php and in $themedir/Display.template.php so I can edit the files?
It is this two files to edit so that the membergroup show's up in topic, right?

(Sorry for my bad English)

//Micke

Is there enyone that know how to fix this?

//Micke
I haven't looked into this, but it should be easy to do. You'd need to edit prepareDisplayContext in Display.php, and Display.template.php (not sure if it would also require more edits to Load.php). I don't have time to look into this at the moment, unfortunately.

Quote from: SWTrisha on January 30, 2007, 10:37:35 PM
one more if you please

QuoteInstalling this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Themes/default/Profile.template.php Test failed

thank you.
Do you have any other mods installed? Do any of them edit the profile page?

Quote from: Vinspire on January 31, 2007, 10:03:04 PM
Does it work the same as Show Multiple Badges (AKA Stars) by Thantos ?
I haven't tried that mod, but it looks like it only works on SMF 1.0.5 (and beta versions of 1.1). I've got a feeling that may do the badges (stars, eg. ), whereas my mod shows all the usergroups.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

SWTrisha

Quote
Quotefrom: SWTrisha on January 30, 2007, 10:37:35 PM
one more if you please
Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Themes/default/Profile.template.php Test failed
thank you.

Do you have any other mods installed? Do any of them edit the profile page?

yes

Daniel15

Quote from: SWTrisha on February 01, 2007, 12:48:38 AM
Quote
Quotefrom: SWTrisha on January 30, 2007, 10:37:35 PM
one more if you please
Quote
Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Themes/default/Profile.template.php Test failed
thank you.

Do you have any other mods installed? Do any of them edit the profile page?

yes

Which mods?
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

SWTrisha

1. Additional Membergroups on Profile 1.0  [ Apply Mod ] [ List Files ] [ Delete ] 
2. Signature Option Post 1.1   [ Uninstall ] [ List Files ] [ Delete ] 
3. Enchanced post template 1.0.2   [ Uninstall ] [ List Files ] [ Delete ] 
4. Enhanced Calendar 1.0  [ Apply Mod ] [ List Files ] [ Delete ] 
5. Bear Tabs 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
6. Custom Board Sort 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
7. Sticky First Post (extends sticky topic) 1.3.0   [ Uninstall ] [ List Files ] [ Delete ] 
8. Mod List Color Alternate 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
9. Stars to Profile 1.0.1   [ Uninstall ] [ List Files ] [ Delete ] 
10. Zodiac Starsigns 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
11. Member Color Link 2.0.0   [ Uninstall ] [ List Files ] [ Delete ] 
12. Merge Double Posts 1.0.6   [ Uninstall ] [ List Files ] [ Delete ] 
13. Move Old Topics 1.2   [ Uninstall ] [ List Files ] [ Delete ] 
14. Avatars at Index Mod 1.3   [ Uninstall ] [ List Files ] [ Delete ] 
15. PaypalDonations 1.7   [ Uninstall ] [ List Files ] [ Delete ] 
16. BBCode Bar For Signature 1.2   [ Uninstall ] [ List Files ] [ Delete ] 
17. Admin Notepad 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
18. SMFShop 3.0   [ Uninstall ] [ List Files ] [ Delete ] 
19. New Topic Button 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
20. ShowTopics 1.1   [ Uninstall ] [ List Files ] [ Delete ] 
21. Display Age and Location next to posts 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
22. Monthly Statistics on Profile 1.0   [ Uninstall ] [ List Files ] [ Delete ] 
23. Language Drop 1.1   [ Uninstall ] [ List Files ] [ Delete ] 
24. FlashChat Integration 0.1 Beta   [ Uninstall ] [ List Files ] [ Delete ] 
25. Users Online Today Mod 1.4.0   [ Uninstall ] [ List Files ] [ Delete ] 
26. Spell Check Custom Words 1.0.1   [ Uninstall ] [ List Files ] [ Delete 

Lill-Micke

Quote
I haven't looked into this, but it should be easy to do. You'd need to edit prepareDisplayContext in Display.php, and Display.template.php (not sure if it would also require more edits to Load.php). I don't have time to look into this at the moment, unfortunately.

Ok!

But if you get time over, can you fix this then?
I can wait.

//Micke
On my page:
MKPortal M1.1.1
SMF 1.1.1

SWTrisha

I know your pretty busy but I was wondering if you had time to check into my problem with loading your mod. I am hoping to open my forum on Monday.

I had a major crash and had to start all over. It's taken me a month to get thing back up. I would love to open with all mods in place.

I look forward to having your mods on my forum. :)

Daniel15

QuoteI was wondering if you had time to check into my problem with loading your mod
Most likely, one of those other mods have edited Profile.template.php, and you'll need to manually install the mod (not through the Package Manager). Upload the mod to my package parser (see my signature), and do all the steps required to install it.

QuoteBut if you get time over, can you fix this then?
I'll try remember to, but it might not be for a while :(
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Valiantheart

Are we suppose to add the modification after what we searched? The xml file says "before". Maybe that's why it's not working.

Daniel15

QuoteAre we suppose to add the modification after what we searched? The xml file says "before"
"before" means that what you're searching for is before the text to add (and conversely, the text to add goes after what you're searching for).

If you're confused, upload the mod to my package parser (see my signature) :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

NativePages

First of all, cool mod. It installed easily and was fairly easy to figure out.  Second, I know you're busy so I'll be patient about waiting for you to respond to this.

I am using SMF 1.1.2.  I have 24 mods installed (yeah, I know ... a bit mod happy, but it's cheaper than drowning my sorrows in gin!), a number of which I'm sure have edited the profile template(s).  I'm using a customized version of the default theme.

The first additional membergroup is showing up just like it's supposed to. It's positions 2 forward I'm not getting. It seems to be missing or ignoring those. 

This was the only reference to additional membergroups I could find in my profile.template.php file:

   // Only display member group information/editing with the proper permissions.
   if ($context['allow_edit_membergroups'])
   {
      echo '
                     <tr>
                        <td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
                     </tr><tr>
                        <td valign="top">
                           <b>', $txt['primary_membergroup'], ': </b>
                           <div class="smalltext">(<a href="', $scripturl, '?action=helpadmin;help=moderator_why_missing" onclick="return reqWin(this.href);">', $txt['moderator_why_missing'], '</a>)</div>
                        </td>
                        <td>
                           <select name="ID_GROUP">';
      // Fill the select box with all primary member groups that can be assigned to a member.
      foreach ($context['member_groups'] as $member_group)
         echo '
                              <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected="selected"' : '', '>
                                 ', $member_group['name'], '
                              </option>';
      echo '
                           </select>
                        </td>
                     </tr><tr>
                        <td valign="top"><b>', $txt['additional_membergroups'], ':</b></td>
                        <td>
                           <div id="additionalGroupsList">
                              <input type="hidden" name="additionalGroups[]" value="0" />';
      // For each membergroup show a checkbox so members can be assigned to more than one group.
      foreach ($context['member_groups'] as $member_group)
         if ($member_group['can_be_additional'])
            echo '
                              <label for="additionalGroups-', $member_group['id'], '"><input type="checkbox" name="additionalGroups[]" value="', $member_group['id'], '" id="additionalGroups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked="checked"' : '', ' class="check" /> ', $member_group['name'], '</label><br />';
      echo '
                           </div>
                           <a href="javascript:void(0);" onclick="document.getElementById(\'additionalGroupsList\').style.display = \'block\'; document.getElementById(\'additionalGroupsLink\').style.display = \'none\'; return false;" id="additionalGroupsLink" style="display: none;">', $txt['additional_membergroups_show'], '</a>
                           <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                              document.getElementById("additionalGroupsList").style.display = "none";
                              document.getElementById("additionalGroupsLink").style.display = "";
                           // ]]></script>
                        </td>
                     </tr>';
   }


I'm not sure where else to look or even that I would know what's missing. When you get a chance, can you give me a hand?

Thanks in advance,
NativePages
http://www.nativepages.com/tnindian
http://www.nativepages.com/tnindian
I came, I saw, I installed, I asked a million questions, but eventually I got it!

SteeleButterfly

Something I haven't seen mentioned but that I would like this mod to do:

Can a member set, by membergroup, which ones other people can see? There will be some folks on our board that will want some of the membergroups to be displayed, but not others.

Thank you,
SteeleButterfly, hxxp:theswordcoast.net/forum/ [nonactive]
SteeleButterfly, hxxp:theswordcoast.net/forum/ [nonactive]

MSport

Has anyone made this work? Showing the additional group membership on the topic display?  If so, please post how-to with code/files.

Thanks!

Quote from: Daniel15☎ on February 01, 2007, 12:38:23 AM
I haven't looked into this, but it should be easy to do. You'd need to edit prepareDisplayContext in Display.php, and Display.template.php (not sure if it would also require more edits to Load.php). I don't have time to look into this at the moment, unfortunately.

hugocz

Yes that would be awensome definetly, i was lookin for a mod that can show the mutiple membergroup titles under username in posts, but no luck so far.

Con

#33
Quote from: hugocz on April 21, 2007, 06:56:11 AM
Yes that would be awensome definetly, i was lookin for a mod that can show the mutiple membergroup titles under username in posts, but no luck so far.

Looking for the same thing.

sig-alfa-epilson

#34
ohhh sorrrry........................

your mod is excelent

daniel15 i love you and the mod love

GJSchaller

Hello!

Just adding my support to the idea of adding groups under a person's name / avatar on a post, either as a part of this mod, or as a new one.  It would be most helpful.

Thank you!
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

snib

Also looking for adding the groups by a poster's name. If Daniel15 or anyone else has time to look into this, please do.... I posted in the mod request forum and was recommended to ask here.

Any updates?
Snib

Tearstar

#37
Ok, I have gotten somewher on the displaying this on the post, Undernath the persons name is their main group, then underneath that it says "Array", but it is displaying in the right spot.

Any clues so far?

What I have done so far is modded in Display.template.php after this here;

      // Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';


I put in       

// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['additionalGroups2']) && $message['member']['additionalGroups2'] != '')
echo '
', $message['member']['additionalGroups2'], '<br />';


Which did get another line to show up under the main group, but it says "Array" also if the don't have a main group but have a post counted group their main group shows up as "Array"

so got it a lil closer

snib

I'm getting somewhere with this, I'll post back when I've got it all figured out
Snib

Jim R

I would like to display the additional membergroups within the roster of each membergroup, just under each user's email address.  I felt like I had isolated the code I needed from Profile.template.php and put it in membergroup.template.php, but it's not working. 

Here is what I have:


foreach ($context['members'] as $member)
{
echo '
<tr class="windowbg2">
<td>', $member['name'], '</td>
<td>', $member['email'];

[b] // Loop through each additional group
foreach ($context['member']['additionalGroups2'] as $additionalGroup)
{
// Output this membergroup
echo '<br>',$additionalGroup;
}
// End modification[/b]


echo' </td>
<td class="windowbg">', $member['last_online'], '</td>
<td class="windowbg">', $member['registered'], '</td>
<td', empty($context['group']['assignable']) ? ' colspan="2"' : '', '>', $member['posts'], '</td>';


Advertisement: