Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 01-29-2014, 11:10 PM
Revenga Revenga is offline
 
Join Date: Mar 2012
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Show usergroup's description on a page

I couldn't find this searching so I figured I'd make a thread about it to hopefully get it working.

I'm using a roster plugin and I'm trying to customize it a bit more. I'd like the description of each usergroup to be shown by the list of members who are in that usergroup. The description being the usergroup description you enter when you edit a usergroup. See the screenshot I attached to see what I'm looking to do.

I think I need something like $something1[something2] to be there, but I can't figure it out and I don't even know if I'm on the right track.

Would you mind pointing me in the right direction or letting me know what I need to do for it to work? Help would be much appreciated.

- Revenga
Reply With Quote
  #2  
Old 01-29-2014, 11:22 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look at the showgroups_usergroup template and see what variable is being used in there and then put $variable[description] in where you want it and see if that works.
Reply With Quote
  #3  
Old 01-30-2014, 01:16 AM
Revenga Revenga is offline
 
Join Date: Mar 2012
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It didn't seem to work or do anything really. I tried doing what you said with showgroups and it didn't work. Though I'm not using showgroups in that screenshot I attached in original post, I'm using a Showroster Hack, but it didn't seem to work there either. Here's the showroster_header template I'm trying to work with if that helps at all:

Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<if condition="($groupsort == 'username')"><td class="tcat" colspan="12">Usernames &nbsp; ($usercount)</td>
	<else /><td class="tcat" colspan="12"><div style="float:left">$user[$groupsort] &nbsp;</div><div style="float:right">$usercount Members</div></td></if>
</tr>
<tr>
	<td class="thead" width="42%">$vbphrase[user_name]</td>
	<td class="thead" width="24%">Custom Title</td>
	<td class="thead" width="12%">Post Count</td>
	<td class="thead" width="11%">Join Date</td>
	<td class="thead" width="11%">Last Seen</td>
</tr>
$rosterbits
<tr>
	<td class="vbmenu_control" align="center" colspan="7"><span class="smallfont">Description here...</span></td>
</tr>
</table>
<br />

I highlighted where I want the usergroup description in red.

- Revenga
Reply With Quote
  #4  
Old 01-30-2014, 05:49 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You will need to look at the script that uses that template and see if the usergroup.description is even selected in the query and then get the variable name from there.
Reply With Quote
  #5  
Old 01-31-2014, 08:40 PM
Revenga Revenga is offline
 
Join Date: Mar 2012
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't look like it, assuming I'm looking in the right area. I'm not exactly a php wizard yet, so I guess I'll post the part in the showroster.php file that I'm looking at:

Code:
// Get Usergroups that should be displayed
$users = $db->query_read_slave("
	SELECT user.*, usergroup.usergroupid, usergroup.title, user.options, usertextfield.*, userfield.*,
	IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
	FROM " . TABLE_PREFIX . "usergroup AS usergroup
	LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.usergroupid = usergroup.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))
	LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
	LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
	LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
	WHERE (usergroup.showrosterviewpermissions = 1)
");

What needs to be edited, or added exactly?

- Revenga
Reply With Quote
  #6  
Old 01-31-2014, 09:01 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As Lynne said, you would need to add usergroup.description to the select, like:
Code:
	SELECT user.*, usergroup.usergroupid, usergroup.title, usergroup.description, user.options, usertextfield.*, userfield.*,

Then you could try using $groupcache[0][description], but I'm not sure if that will always work.
Reply With Quote
  #7  
Old 01-31-2014, 09:54 PM
Revenga Revenga is offline
 
Join Date: Mar 2012
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works! And I learned a little something new too so that's a bonus in my opinion. Thank you both for your help.

- Revenga
Reply With Quote
Благодарность от:
Lynne
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:40 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03983 seconds
  • Memory Usage 2,217KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete