vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Forum Home Enhancements - Social Group Forum List (https://vborg.vbsupport.ru/showthread.php?t=189302)

R-D 10-02-2008 08:23 PM

Here's a few changes to cache the template and also stop the plugin running when the mod is disabled. This saves 5 queries on forumhome when you've disabled the mod in the options.

This is the changed forumhome_start plugin:

PHP Code:

if ($vbulletin->options['sgfl_enable']){
$show['creategroup'] = ($vbulletin->userinfo['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['cancreategroups']);

$sgfl_limit $vbulletin->options['sgfl_limit'];

if (
$sgfl_limit 0)
{
    if (
$vbulletin->options['sglist_rand'] == 1)
    {
        
$sgfl_lim "ORDER BY RAND() LIMIT $sgfl_limit";
    }
    else
    {
        
$sgfl_lim "LIMIT $sgfl_limit";
    }
}
else
{
    
$sgfl_lim "";
}

$sgfl_query $db->query("SELECT * FROM " TABLE_PREFIX "socialgroup $sgfl_lim");
        while (
$sgfl $db->fetch_array($sgfl_query))
        {
         
exec_switch_bg();
                
$sgfl[groupid] = htmlspecialchars_uni($sgfl['groupid']);
                
$sgfl[name] = $sgfl['name'];
                
$sgfl[description] = $sgfl['description'];
                
$sgfl[picturecount] = htmlspecialchars_uni($sgfl['picturecount']);
                
$sgfl[lastposter] = htmlspecialchars_uni($sgfl['lastposter']);
                
$sgfl[lastposterid] = htmlspecialchars_uni($sgfl['lastposterid']);
        
$sgfl[dateline] = vbdate($vbulletin->options['dateformat'], $sgfl['dateline'], true);



$countmembers $vbulletin->db->query_first("SELECT COUNT(*) AS count_member FROM " TABLE_PREFIX "socialgroupmember WHERE groupid='$sgfl[groupid]'");
$countmember $countmembers['count_member'];

$countmessage $vbulletin->db->query_first("SELECT COUNT(*) AS countmessages FROM " TABLE_PREFIX "groupmessage WHERE groupid='$sgfl[groupid]'");
$countmessages $countmessage['countmessages'];


            
$sgfl_comments_query $db->query("SELECT * FROM " TABLE_PREFIX "groupmessage WHERE groupid='$sgfl[groupid]'");
                  
$sgfl_comments $db->fetch_array($sgfl_comments_query);

                             
$sgfl_comments[gmid] = htmlspecialchars_uni($sgfl_comments['gmid']);
                             
$sgfl_comments[postuserid] = htmlspecialchars_uni($sgfl_comments['postuserid']);
                             
$sgfl_comments[postusername] = htmlspecialchars_uni($sgfl_comments['postusername']);
                     
$sgfl_comments[dateline] = vbdate($vbulletin->options['dateformat'], $sgfl_comments['dateline'], true);



        eval(
'$sgforumlist .= "' fetch_template('sgfl_bit') . '";');
        }



And a new plugin to cache the template (hook: cache_templates)

PHP Code:

if ($vbulletin->options['sgfl_enable'] AND THIS_SCRIPT == 'index')
{
$globaltemplates[] = 'sgfl_bit';




And to remove invite-only groups from the list:

In the forumhome_start plugin, change:
PHP Code:

$sgfl_query $db->query("SELECT * FROM " TABLE_PREFIX "socialgroup $sgfl_lim"); 

to:
PHP Code:

$sgfl_query $db->query("SELECT * FROM " TABLE_PREFIX "socialgroup WHERE type != 'inviteonly' $sgfl_lim"); 


Thug 10-26-2008 02:21 PM

isit possible to make it so when the group leader creates a group forum it will go into a sub section on my main forum called "group forums"

trigatch4 11-07-2008 12:05 PM

How about showing Random, Popular, Joined, etc... Social Groups?

How about in a Sidebar?

fadmedia 11-13-2008 05:56 PM

This is exactly what my users were requesting, but we have so many groups, I have to limit how many appear. It would be really useful if I could do something like the 10 most recently active groups. For the moment I'm using the random setting, but I know people will be asking for the group with the most recent post to be at the top of the list.

Chance4Today 12-02-2008 06:21 PM

Will this be available for 3.8?

Charles_1 12-25-2008 10:39 PM

Quote:

Originally Posted by fadmedia (Post 1665044)
This is exactly what my users were requesting, but we have so many groups, I have to limit how many appear. It would be really useful if I could do something like the 10 most recently active groups. For the moment I'm using the random setting, but I know people will be asking for the group with the most recent post to be at the top of the list.

Agree. I have especially one active group that I would like to have still visible in forumhome, but with more and more groups from users it will be visible less and less over time becouse of random setting :-(. Or possibility to sticky some group (to be still visible at the top) would be great.

Nevertheless thanks for this hack :up:

Leo Brazil 01-13-2009 10:24 AM

It doesn't work for 3.8.0

After upgrade it gave me MySQL error. Probably some tables are different from previows version 3.7 to 3.8

I hope someone Twilkey can upgrade this mod to 3.8 or someone here can find a solution for.

Edit: Found a solution ! You're trying to use this on 3.8.0 the file attached can solve the problem of MySQL errors. As I suspected one table has been changed on for 3.8.0. Do not install this file if you are running later versions than 3.8.0

Just import the product through your admin control panel allowing orverwrite. Template edits remains the same as first post.

Enjoy.

htscpl 03-04-2009 10:15 AM

Thanks for the update Leo, just upgraded to 3.8.1 and I was cursing the loss of my social groups on the forum home page. Upgraded and now works just fine! Thanks again! :D

Moyses 03-18-2009 04:46 AM

Quote:

Originally Posted by Leo Brazil (Post 1710806)
It doesn't work for 3.8.0

After upgrade it gave me MySQL error. Probably some tables are different from previows version 3.7 to 3.8

I hope someone Twilkey can upgrade this mod to 3.8 or someone here can find a solution for.

Edit: Found a solution ! You're trying to use this on 3.8.0 the file attached can solve the problem of MySQL errors. As I suspected one table has been changed on for 3.8.0. Do not install this file if you are running later versions than 3.8.0

Just import the product through your admin control panel allowing orverwrite. Template edits remains the same as first post.

Enjoy.

Thanks Man! :up:;)

Keesa 04-04-2009 09:20 AM

This looks promising, but I am not seeing anything on the Demo page that shows me what this does?

http://features.gamingtv.us/forum/index.php

Does anyone have it working on 3.8.1 that I can see?


All times are GMT. The time now is 06:03 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.01205 seconds
  • Memory Usage 1,774KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete