vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Copy "Forum Leaders" for different user group? (https://vborg.vbsupport.ru/showthread.php?t=286320)

OakleyBoss 08-04-2012 07:17 PM

Copy "Forum Leaders" for different user group?
 
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:

Code:

WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
to

Code:

WHERE usergroup.usergroupid=12345
Change 12345 to whatever the ID for your new group is.



Also, change this line:
PHP Code:

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 [DATE]1344126854[/DATE] at [TIME]1344126854[/TIME] ---------------

Oh, also take out the whole IF block for showing Moderators. Begins with:
PHP Code:

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/125...20805at105.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
PHP Code:

$navbits construct_navbits(array('' => $vbphrase['show_groups'])); 

, to:
PHP Code:

$navbits construct_navbits(array('' => 'My freaking cool Page Title')); 

--------------- Added [DATE]1344250391[/DATE] at [TIME]1344250391[/TIME] ---------------

Oh, oh, that might be quicknav, now that I think about it. X3


You'd wanna alter this instead:
PHP Code:

$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:
PHP Code:

$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
Code:

WHERE (usergroup.genericoptions & " . $vbulletin->bf_ugp_genericoptions['showgroup'] . ")
into
Code:

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.

PHP Code:

// 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:
PHP Code:

$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

Quote:

Originally Posted by Sarteck (Post 2355417)
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.
PHP Code:

// 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:
PHP Code:

$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):
Code:

// 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


All times are GMT. The time now is 12:40 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.01254 seconds
  • Memory Usage 1,765KB
  • 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
  • (5)bbcode_code_printable
  • (10)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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