View Full Version : Copy "Forum Leaders" for different user group?
OakleyBoss
08-04-2012, 07:17 PM
I have a usergroup for paid subscribers on my forum, and I would like to make a list similar to "Forum Leaders" with the names of the people in this usergroup. I copied the template and the php file for ShowGroups and renamed them. However the problem I am having now is that it still shows the same forum leaders as the original. How would I go about changing the usergroups on the new file while still leaving the old forum leaders page the same?
Thanks.
Sarteck
08-04-2012, 11:32 PM
On your new page (the showgroups.php that you copied and renamed), change the following line:
WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
to
WHERE usergroup.usergroupid=12345
Change 12345 to whatever the ID for your new group is.
Also, change this line:
define('THIS_SCRIPT', 'showgroups');
Change showgroups to whatever the page is called.
No need to use your copied template, unless you made changes to it.
--------------- Added 1344126854 at 1344126854 ---------------
Oh, also take out the whole IF block for showing Moderators. Begins with:if ($vbulletin->options['forumleaders'] == 1)
OakleyBoss
08-05-2012, 01:59 PM
Thanks a million! That worked great. Only one more question! When on the page above the page title it still says "Show Groups". It seems that it references a 'showgroups' phrace somewhere, so I don't really know how to change it.
http://img88.imageshack.us/img88/1256/screenshot20120805at105.png (http://imageshack.us/photo/my-images/88/screenshot20120805at105.png/)
I think I would have to copy the template and rename it to change the bottom "Show Groups", but the really hard one is in the navbar. I have no clue how to go about this?
Thanks,
Sarteck
08-06-2012, 09:50 AM
Change the line$navbits = construct_navbits(array('' => $vbphrase['show_groups']));, to:$navbits = construct_navbits(array('' => 'My freaking cool Page Title'));
--------------- Added 1344250391 at 1344250391 ---------------
Oh, oh, that might be quicknav, now that I think about it. X3
You'd wanna alter this instead:$navpopup = array(
'id' => 'showgroups_navpopup',
'title' => $vbphrase['show_groups'],
'link' => 'showgroups.php' . $vbulletin->session->vars['sessionurl_q'],
);
construct_quick_nav($navpopup);Probably to something like this:$navpopup = array(
'id' => THIS_SCRIPT.'_navpopup',
'title' => 'My Freaking Cool page Title',
'link' => THIS_SCRIPT.'.php' . $vbulletin->session->vars['sessionurl_q'],
);
construct_quick_nav($navpopup);
But tbh, I'm not really sure atm. X3 Try one or the other or both. I think the first example I gave just changes the actual title shown in the browser's Title Bar.
OakleyBoss
08-06-2012, 11:31 PM
Thanks fixed some of it the "Show Groups" under new posts in the screen cap from before is still there. But I'll play around with it to figure it out. It's pretty good for now.
Thanks a million for the very helpful and fast response!
Sarteck
08-07-2012, 02:19 AM
All right. Let us know here if you still have the problem, and I'll see what I can do about hunting down the right stuff. X3
qpurser
08-07-2012, 03:10 PM
Hope I may jump in in this thread
Sarteck,
I wanted to achieve similar for several of my usergroups to show.
I modified my showgroups.php with the instructions you gave by replacing
WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
into
WHERE usergroup.usergroupid=12
I left the " . $vbulletin->bf_ugp_genericoptions['showgroup'] ." out. Is that correct?
After changing the code I renamed the usergroups.php into usergroupspremium.php.
Works fine and it shows exactly all the members from user group 12.
Now I wanted to do the same for another usergroup and replaced this time the 12 with 9 and called the file usergroupspremium2.php
I changed also the "define('THIS_SCRIPT', 'showgroups');" accordingly to point to the different php files
However when I call the usergroupspermium2.php it only shows the users from usergroup 12.
Does vBulletin keeps a cache somewhere or the template instructs it to do this and it doesn't get emptied?
Any help greatly appreciated
Michael
Sarteck
08-08-2012, 04:12 AM
Michael,
As far as I know, no--your second page should be working just fine. :hmm:
Ah, wait. XD It's right there in the page. Dunno how I missed it.
// VBIV-6689 Caching.
$groupcache = array();
if ($vbulletin->options['flcache'])
{
require_once(DIR . '/includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();
$groupcache = vB_Cache::instance()->read('showgroups.groupcache');
}
Just change that to:$groupcache = array();
Are you going to be doing this for several groups? If so, it might actually be better altogether to use a plugin for it and just use the original vBulletin stuff. I mean if it's only one or two groups, I guess that'd be fine, but if you plan on adding more at a later date, I'll just make a plugin sometime the next few days, let ya test it out.
qpurser
08-08-2012, 09:41 AM
Michael,
As far as I know, no--your second page should be working just fine. :hmm:
Ah, wait. XD It's right there in the page. Dunno how I missed it.
// VBIV-6689 Caching.
$groupcache = array();
if ($vbulletin->options['flcache'])
{
require_once(DIR . '/includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();
$groupcache = vB_Cache::instance()->read('showgroups.groupcache');
}
Just change that to:$groupcache = array();
Are you going to be doing this for several groups? If so, it might actually be better altogether to use a plugin for it and just use the original vBulletin stuff. I mean if it's only one or two groups, I guess that'd be fine, but if you plan on adding more at a later date, I'll just make a plugin sometime the next few days, let ya test it out.
Thanks so much again for you help. I had something different in the file but removed it and now it works great.
I had (running vB 4.2.0):
// VBIV-6689 Caching.
$groupcache = array();
if ($vbulletin->options['flcache'])
{
$groupcache = vB_Cache::instance()->read('showgroups.groupcache');
}
I am not a coder by any means but do a lot of reading here (especially the excellent articles here on the forum) and try to learn from a lot of coding stuff posted here. For now I manage to add some conditionals or use examples to put something together but that's it for now.
Definitely not a PRO like you and others here.
I am just going to use it for 2 or 3 groups and really wouldn't know so far how to put a plugin together but as you mentioned just for a couple groups it works for me the way it is.
Once again really appreciate your help
Michael
Sarteck
08-08-2012, 10:51 AM
Ah, okay; I use 4.1.11, so yeah, that's the reason for the difference. And yup, that's what you'd have to remove to disable the caching on that page. :3
Also, I'm no pro by any means. X3 I'm pretty decent at cobbling stuff together, but that's about it. I started off knowing a bit of PHP, and only learned by making mistake after mistake after mistake. XD Best way to learn, heh.
And all right, if it's just two or three groups, then I guess you'd be fine. Since it seems to be something other vB owners want, though, I might make a product for it, anyways.
And no prob. That's what this forum is for--to find out how to modify your vBulletin to do what you want it to do. :3
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.