Urgent: Need Group name in viewtopic help!!

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
cdog
Registered User
Posts: 61
Joined: Tue Sep 08, 2009 6:11 pm

Re: Urgent: Need Group name in viewtopic help!!

Post by cdog »

4_seven wrote:please explain in easy words what u exactly want, bcs. i think that is not really clear
honestly, not sure if i can get any clearer....but i'll try...

I want The DEFAULT group name of the POSTER to display under the avatar, like rank title/posts/join date/avatar/rank img/etc/etc....


What i want is this format.
Avatar
Group: {Default Group Name}
Joined: {JOIN DATE}
Posts: {POSTS}
Trader: {RANK TITLE}

I have everything but the Group: {Default Group Name}...
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron

Re: Urgent: Need Group name in viewtopic help!!

Post by stickerboy »

I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
cdog
Registered User
Posts: 61
Joined: Tue Sep 08, 2009 6:11 pm

Re: Urgent: Need Group name in viewtopic help!!

Post by cdog »

dude, you are a life saver!! THANKS!!! that's EXACTLY what i needed! thank you SO much :)
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron

Re: Urgent: Need Group name in viewtopic help!!

Post by stickerboy »

Glad I could help you out ^_^
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

Re: Urgent: Need Group name in viewtopic help!!

Post by nasadows »

I look at the posttime of that link and it is today,how can you know so fast?

How come there is a life-saver that points exactly to cdog posts and help him but exists in another site :lol: Why he hasnt notified cdog of this? or are you him?
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

Re: Urgent: Need Group name in viewtopic help!!

Post by nasadows »

I will try this mod soon after I finish fixing my computer, but still I want to ask if this mod displays every group the user is in or just 1 group (the Default Group?)

It is best if we can have an option to make something like:
(USERNAME)
(AVATAR)
(OTHER Profile Info)
(GROUPMEMBERSHIP LIST):
Member of: Groupname1, Groupname2...
cdog
Registered User
Posts: 61
Joined: Tue Sep 08, 2009 6:11 pm

Re: Urgent: Need Group name in viewtopic help!!

Post by cdog »

nasadows wrote:I look at the posttime of that link and it is today,how can you know so fast?

How come there is a life-saver that points exactly to cdog posts and help him but exists in another site :lol: Why he hasnt notified cdog of this? or are you him?
i am cdog, to clarify this.
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

Re: Urgent: Need Group name in viewtopic help!!

Post by nasadows »

clarify what? do you know who helped you and did he notified you of that page or cherokee red is the one?

Do you know when it will be made official to phpbb?
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron

Re: Urgent: Need Group name in viewtopic help!!

Post by stickerboy »

nasadows wrote:clarify what? do you know who helped you and did he notified you of that page or cherokee red is the one?

Do you know when it will be made official to phpbb?
I'm not sure what you're asking in your other posts, or in the 1st part of this one, but to answer your 2nd question - I have no intentions of submitting this to the MODs database ;)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

Re: Urgent: Need Group name in viewtopic help!!

Post by nasadows »

okay, so you are the one who helped him not just the pointer to that site. I was wondering why you dont post it right away to this topic.

Anyway, can you go further as to make a listing of ALL the Groups the user is a member of, not just 1 (default) group like now? I see that in the Profile page in the form of a Dropdown box. In my view I want it to be "comma" style (Group: Group 1 (default), Group 2, Group 3,...) not drop-down style. Of course, Drop-downs in Viewtopic would look quite messy

I've managed to "colorize" the Group name display in Viewtopic to have the same color as the group color, not just plain text (so that it is more fancy looking). But the above listing, I've yet to figure out how to do it.

Thanks
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron

Re: Urgent: Need Group name in viewtopic help!!

Post by stickerboy »

nasadows wrote:okay, so you are the one who helped him not just the pointer to that site. I was wondering why you dont post it right away to this topic.
Ah, yes. I created the code and posted it on my site :)
nasadows wrote:Anyway, can you go further . . .
*snip*
Thanks
Try this out. I just tested locally and it works fine :) The only thing I didn't do, was add the group colour
http://www.sixstringmods.co.uk/snippets ... php?id=304
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

Re: Urgent: Need Group name in viewtopic help!!

Post by nasadows »

It works like magic :D well, the dream is basically done, I'm trying to do the only thing left, that is to "beautify" the plain-looking list to be more colorful

I guess that is something extracted from the legend list, though I'm a newbie so I cant be sure if i can do that alone.
In the meantime I've just got a new idea for an alternative, that is i'll be combining the 2 script you make for cdog and me
To make one like this:

Group: COLORFULDEFAULTGROUP
Also (member of): Group2, Group 3, Group 4 (THE REST OF THE GROUPS IN PLAIN TEXT)
I have to find a away to EXCLUDE the Default Group from being mentioned in the second list so that it will not be duplicated (it would look ridiculous if it be). I guess this is really simple for you, can you help me that? ;)

A million thanks for your helping us :mrgreen:
cdog
Registered User
Posts: 61
Joined: Tue Sep 08, 2009 6:11 pm

Re: Urgent: Need Group name in viewtopic help!!

Post by cdog »

http://www.phpbb.com/community/viewtopi ... #p11033605

please help with this also guys, if possible ;)
nasadows
Registered User
Posts: 119
Joined: Wed Mar 25, 2009 3:49 am

User's Group membership list with Color in Viewtopic

Post by nasadows »

YAYYY GUYS I DID IT!!
here is what it looks like now:
Image

If you click over a group name it even takes you to that group's member list!

All taken from cherokee red and $legend in index.php
I've yet to figure out how to sort/make the Default group appear first, but it's WAYYYY trivial thing now! :lol:
EDIT Oct 23,2009: This mod, after some small improvement following this post, still have one small problem (maybe not important to you) relating to a bug in memberlist.php, since its code is taken from there. The problem is that Hidden Groups which a user has already had the membership of will not be shown to that user's view (Hidden Groups will not be included in the list) Admins or who has enough permission can still see Hidden Groups displayed in the list fine.
Have a quick look at here:
http://www.phpbb.com/bugs/phpbb3/ticket ... t_id=52235

The mod User's Group membership list with Color in Viewtopic has been born! :mrgreen:

Code: Select all

        // Stolen from memberlist.php - get a dropdown list of all users groups (checking for auths as well)
        $gsql = 'SELECT g.group_id, g.group_name, g.group_type, g.group_colour
            FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
            WHERE ug.user_id = $poster_id
                AND g.group_id = ug.group_id" . ((!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' AND g.group_type <> ' . GROUP_HIDDEN : '') . '
                AND ug.user_pending = 0
            ORDER BY g.group_type, g.group_name';
        // Stolen from index.php its where the legend is :))
        $gcresult = $db->sql_query($gsql);
        $grouplistcolor = array();
        while ($gcrow = $db->sql_fetchrow($gcresult))
        {
        	$groupcolor_text = ($gcrow['group_colour']) ? ' style="color:#' . $gcrow['group_colour'] . '"' : '';
        	$group_name = ($gcrow['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $gcrow['group_name']] : $gcrow['group_name'];


        	{
        		$grouplistcolor[] = '<a' . $groupcolor_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $gcrow['group_id']) . '">' . $group_name . '</a>';
        	}
        }
        $db->sql_freeresult($gcresult);

        $grouplistcolor = implode('<br><img src="images/usergroups.gif" width=9> ', $grouplistcolor);
Last edited by nasadows on Fri Oct 23, 2009 12:11 pm, edited 3 times in total.
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron

Re: Urgent: Need Group name in viewtopic help!!

Post by stickerboy »

Nice work, i'll update the article with a link to your post :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

Return to “[3.0.x] MOD Requests”