How to - Multiple membergroups shown on post page...

Started by MoreBloodWine, January 03, 2008, 03:44:25 AM

Previous topic - Next topic

MoreBloodWine

Ok, once again I DO NOT want to use this mod  because I DO NOT want the additional groups shown on the profile page just the post page, I've been trying to explain that. If someone who knows enough coding can come by and help make work what I've been suggesting then all will be fine so once again... with the proper modifications to the following code I know it WILL work but I lack the skills to modify said code, so with that said how does the below code need to be modified / told to grab the secondary group in this case Co. GM

// 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 />';


If you look at the pic below you will see I've duplicated the above code in my Display.template.php file so it shows Administrator twice on the post page. Well, with the above code changed to grab the Co. GM group the pic would then show Co. GM above Administrator. Now if that isnt clear enough I dont know what is.

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

Just delete that display code form the Profile.template.php that the mod installs.  It will not display in the profile area then, and you'll be able to use the source code to your needs.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

#22
Quote from: Rumbaar on January 12, 2008, 09:29:44 AM
Just delete that display code form the Profile.template.php that the mod installs.  It will not display in the profile area then, and you'll be able to use the source code to your needs.
Ok, once again I still DO NOT want to use this mod... I have my reasons, and while I appreciate the help for trying to push the mod I wont use it. I know what I suggested / have been suggesting can and will work. If the above code I posted can be told to grab the main primary group then it can certianly be modified / told to grab the secondary group in my case Co. GM , So everyone pleaee stop trying to push the mod on me. I realise this is a free / volunteer service so when someone has the time to come by and help me with what I'm after then great, no real rush so long as what I'm after gets done.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

Well if the simple install and coding above will meet the needs, I can't understand why.  But that's your choice.

So if someone posts the code here to extract the same db query as the mod does for the source file (which a modification or new code to generate the pull of the secondary membergroups would require) and it's the same as the mod you wouldn't still use it?

You might want to try the Help Wanted section to try and find a coder to do custom work for you, best of luck.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

Quote from: Rumbaar on January 12, 2008, 09:41:56 AM
Well if the simple install and coding above will meet the needs, I can't understand why.  But that's your choice.

So if someone posts the code here to extract the same db query as the mod does for the source file (which a modification or new code to generate the pull of the secondary membergroups would require) and it's the same as the mod you wouldn't still use it?

You might want to try the Help Wanted section to try and find a coder to do custom work for you, best of luck.
Once again I appreciate all the help thus far, but obviously what I want and what I get are most likely going to be two different things but like I've been trying to say... if the below code can be told to grab the primary group which is Administrator then it can certainly be told to grab the additional group in my case Co. GM

// 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 />';


So with the proper modification to the above code I would get what I want which is shown in the pic below except one of the Adminstrator tags would now show Co. GM

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

That code makes reference to code found in Load.php. Which in it's current configuration only extracts the Primary Membergroup.  You can't simply alter that code in the Display.template.php file to extract the secondary membergroup or any other membergroup, as the underlying code behind it isn't code that way.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

Quote from: Rumbaar on January 12, 2008, 10:02:40 AM
That code makes reference to code found in Load.php. Which in it's current configuration only extracts the Primary Membergroup.  You can't simply alter that code in the Display.template.php file to extract the secondary membergroup or any other membergroup, as the underlying code behind it isn't code that way.
After reading that I figure wtf may as well give what you and the other guy posted a shot... so with that said heres end product... Thx.

http://www.border-patrol.net/index.php?topic=6.msg11#new
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Bulakbol

Looking good. Did you use this ' , $message['member']['additionalGroups2'][0], ' to get the group name?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

MoreBloodWine

Quote from: JohnyB on January 12, 2008, 05:49:48 PM
Looking good. Did you use this ' , $message['member']['additionalGroups2'][0], ' to get the group name?
I did what was suggested minus your suggestion to only get one group to show... I didnt need that because I only assigned myself / needed myself in one additional group... now had I needed myself in more than one additional group I woulda done what you suggested if that made any sense lol
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Bulakbol

Understood. The most important is you have it the way you want it displayed.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Rumbaar

Well that looks exactly how you wanted it?  Also JohnyB had the code to extract all membergroups I was the one who pointed out the single membergroup option.

Can I ask why you were initially so set against using the mod and code modifications?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

Quote from: Rumbaar on January 12, 2008, 06:50:23 PM
Can I ask why you were initially so set against using the mod and code modifications?
Less edits the better...
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


eline

if(!empty($message['member']['additionalGroups2']))
foreach ($message['member']['additionalGroups2'] as $additional)
echo $additional. '<br />';


JohnyB, what should I do to us this for display star images based on additional groups?
I dont know how jet this arrays works ...

Bulakbol

Hi eline. Forget those codes. I will make a mod for you if you will tell me what custom theme you are using. If you are using default core theme, I can attach the zipped file now.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

barrage time

hxxp:www.rune-live.com [nonactive]
www.rune-live.com, sign up today.

eline


Bulakbol

Quote from: eline on February 24, 2008, 05:52:45 AM
Quote from: JohnyB on February 23, 2008, 08:55:46 PM
I can attach the zipped file now.

Do it :) and tx -> karma point ++

Hi eline. Sorry, there's no option to attach file here. PM me your email address and I'll send you the mod. I'll probably submit it after. Thanks for the Karma point.  ;)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

FragaCampos

Thanks Bulakbol for this explanation.
I worked great on SMF 1.1.11 :)

Quote from: Bulakbol on January 12, 2008, 05:48:46 AM
Install Display Additional Membergroups on Profile. Then in Sources/Load.php, look for

if ($set == 'normal')
{
$select_columns = "
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.signature, mem.personalText, mem.location, mem.gender, mem.avatar, mem.ID_MEMBER, mem.memberName,


and add mem.additionalGroups, at the end after mem.memberName,

In default/Display.template.php, find

', $message['member']['group'], '<br />';

and below it, add

if(!empty($message['member']['additionalGroups2']))
foreach ($message['member']['additionalGroups2'] as $additional)
echo $additional. '<br />';


Don't forget to install the "Display Additional Membergroups on Profile" first.

Advertisement: