vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Show usergroup's description on a page (https://vborg.vbsupport.ru/showthread.php?t=307684)

Revenga 01-29-2014 10:10 PM

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

Lynne 01-29-2014 10:22 PM

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.

Revenga 01-30-2014 12:16 AM

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

Lynne 01-30-2014 04:49 PM

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.

Revenga 01-31-2014 07:40 PM

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

kh99 01-31-2014 08:01 PM

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.

Revenga 01-31-2014 08:54 PM

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


All times are GMT. The time now is 05:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01605 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete