vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Display a list of users in a usergroup under a forum? (https://vborg.vbsupport.ru/showthread.php?t=307937)

patracy 02-05-2014 01:58 AM

Display a list of users in a usergroup under a forum?
 
Anyone have an idea of how to make this work?

I'd like to take the vendor usergroup we have (id:20) and have a forum display setup to list their usernames in a list (with hyperlinks to their profiles) as a forum.

kh99 02-05-2014 01:26 PM

I don't know what you mean when you say "as a forum". But maybe a roster mod, like this one: https://vborg.vbsupport.ru/showthread.php?t=299659 . I haven't tried it myself, and you might want to look at others by searching vb4 mod titles for "roster".

patracy 02-06-2014 01:54 PM

Nahh, not really what I'm looking for. I'd like to simply display under a forum place holder a list of names with the names being hyperlinks to their profiles. Not really wanting another page to display. I assume that there's something that could be leveraged from the canned vB file showgroups.php since they display there. Just really would like to trim it down to either a single page that would display only the vendor usergroup (not the admin/mods) or a simple listing of user names on the main page, which is really what I'm aiming for.

kh99 02-06-2014 04:56 PM

Well, you could try creating a plugin using hook location forumdisplay_complete and code like this (change the X on the first line to the id of the forum where you want it to display):
PHP Code:

if ($forumid == X)
{
   if (
$result $vbulletin->db->query_read_slave("SELECT * FROM " TABLE_PREFIX "user WHERE usergroupid=20 ORDER BY username"))
   {
      while (
$user $vbulletin->db->fetch_array($result))
      {
         
$members[] = $user;
      }
      
$template vB_Template::create('my_memberlist');
     
$template->register('members'$members);
     
$template_hook['forumdisplay_below_threadlist'] .= $template->render();
   }



then create a new template something like this:
Code:

Members:<br /><br />
<vb:each from="members" key="key" value="member">
<a href="{vb:link member, {vb:raw member}}">{vb:var member.username}</a><br />
</vb:each>
<br/><br/>


In this example I named the new template 'my_memberlist', but you can name it anything you want as long as you change it in the plugin code as well.

Of course this is a simple example, html isn't really my thing so I'll leave it up to you to make it look good.

patracy 02-13-2014 08:48 PM

Hmm, so I did all this, but all I see is the newly formed forum, but no listing. Is there something I should do in how the forum is setup? Maybe insert some code into the link?


All times are GMT. The time now is 07:33 AM.

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.00984 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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