PDA

View Full Version : Forum Home Enhancements - Social Group Forum List


Twilkey
08-26-2008, 10:00 PM
This is a more enriched version of this mod (https://vborg.vbsupport.ru/showthread.php?t=189244) that I made.


If you have Version 1.0 of this mod installed, please uninstall it and run through these instructions again, as I have fixed a couple crucial bugs and added some more settings.

Description:
This mod lists all your Social Groups in a table on the forum home, which makes it look like more forums.

Instructions:
First Import the product.
Second Edit your FORUMHOME template.
If you want the table to show above the forums,
Find:
<!-- / guest welcome message -->
<br />
</if>Add Below:
<if condition="$vboptions[sgfl_enable] == 1">
<form action="group.php?$session[sessionurl]do=grouplist" method="post">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat" width="100%" colspan="5">
<div style="float:$stylevar[right]" class="normal">$vbphrase[search_groups] <input type="text" class="bginput" name="filtertext" value="$filters[text]" style="font-size: 11px;" />&nbsp;<input type="submit" class="button" value="$vbphrase[go]" /></div>
$vboptions[sgfl_st]
</td>
</tr>
<tr>
<td class="thead" width="100%">

<if condition="$vboptions[sgfl_createdate] == 1">
<span style="float:$stylevar[right]">$vbphrase[sgfl_group_created]</span>
</if>
$vbphrase[sgfl_group_name]</td>
<if condition="$vboptions[sgfl_membercount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[sgfl_group_members]
</td>
</if>
<if condition="$vboptions[sgfl_messagecount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[messages]
</td>
</if>
<if condition="$vboptions[sgfl_piccount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[sgfl_pictures]
</td>
</if>
<if condition="$vboptions[sgfl_last_post] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[last_post]
</td>
</if>
</tr>
$sgforumlist
<tr>
<td colspan="5" align="center" class="tfoot smallfont">
<if condition="$show['creategroup']">
<strong><a href="group.php?$session[sessionurl]do=create">$vbphrase[sgfl_create_a_new_group]</a></strong> &nbsp;
</if>
&nbsp; <strong><a href="group.php?$session[sessionurl]do=search">$vbphrase[sgfl_search_groups]</a></strong>
</td>
</tr>
</table>

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="dofilter" value="1" />
</form>
</if>

If you want the table to show under the forums,
Find:
$forumhome_markread_script
<!-- /main -->

<br />Add Below:
<if condition="$vboptions[sgfl_enable] == 1">
<form action="group.php?$session[sessionurl]do=grouplist" method="post">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat" width="100%" colspan="5">
<div style="float:$stylevar[right]" class="normal">$vbphrase[search_groups] <input type="text" class="bginput" name="filtertext" value="$filters[text]" style="font-size: 11px;" />&nbsp;<input type="submit" class="button" value="$vbphrase[go]" /></div>
$vboptions[sgfl_st]
</td>
</tr>
<tr>
<td class="thead" width="100%">

<if condition="$vboptions[sgfl_createdate] == 1">
<span style="float:$stylevar[right]">$vbphrase[sgfl_group_created]</span>
</if>
$vbphrase[sgfl_group_name]</td>
<if condition="$vboptions[sgfl_membercount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[sgfl_group_members]
</td>
</if>
<if condition="$vboptions[sgfl_messagecount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[messages]
</td>
</if>
<if condition="$vboptions[sgfl_piccount] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[sgfl_pictures]
</td>
</if>
<if condition="$vboptions[sgfl_last_post] == 1">
<td class="thead" align="center" nowrap="nowrap">
$vbphrase[last_post]
</td>
</if>
</tr>
$sgforumlist
<tr>
<td colspan="5" align="center" class="tfoot smallfont">
<if condition="$show['creategroup']">
<strong><a href="group.php?$session[sessionurl]do=create">$vbphrase[sgfl_create_a_new_group]</a></strong> &nbsp;
</if>
&nbsp; <strong><a href="group.php?$session[sessionurl]do=search">$vbphrase[sgfl_search_groups]</a></strong>
</td>
</tr>
</table>

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="dofilter" value="1" />
</form>
</if>Now, by default this mod is disabled. So go into your settings and enable it, and Pick the Title of the Section you would like.

LIVE DEMO (http://features.gamingtv.us/forum/index.php)
_____________________________

Version FAQ

Version 1
Initial ReleaseVersion 2
Fixed Member Count Bug
Fixed Latest Post Bug
Added Ability to Limit Groups Listed
Allow Random Groups to Display (Limit must be greater then 0 for this to work.)
Allow admin to show or not show any of the info.Version 2.1
Added if statement to disable the table on the forumhome if the mod is disabled.
Fixed the class for the last post box.
Fixed special characters problem.

yingzhou
08-27-2008, 10:25 PM
Installed. If you can add the message from social group to the notification bar like the profile one?

ShackMaster
08-27-2008, 11:58 PM
Twilkey... you are the bomb brother... absolutely on the money. Thank you! Excellent!

INSTALLED!!!

Do you take donations?

Twilkey
08-28-2008, 01:09 AM
Twilkey... you are the bomb brother... absolutely on the money. Thank you! Excellent!

INSTALLED!!!

Do you take donations?
I do and your welcome.

Hornstar
08-28-2008, 04:20 AM
Cool, is there anyway to limit how many show up? and is there a way to set if it shows the latest ones with replies, the latest created, etc.

snake-boy
08-28-2008, 06:28 AM
Very nice - one problem though: It lists all my social groups as having only one member! regardless of how many members it actually has and regardless of whether the group is public or private.

I fiddled with the code a bit, but was unable to get it to work.

How can I correct this?

R1D1
08-28-2008, 09:50 AM
limit would be nice ;) and the latest x pics shown as thumbnails... and perhaps... only the groups youre in... and... ahm... cool work! thx...

lazydesis
08-28-2008, 12:12 PM
nice idea :)

Ricsca
08-28-2008, 09:07 PM
The number of member dont work. It remains writer always 1.

I have 24 social group, How can I make occupant except for space?

Thanks

Twilkey
08-28-2008, 10:26 PM
Sorry about the members count. I will fix that and release it when I release my next version.

myown
08-29-2008, 05:57 AM
thanks for this... will be installing soon

Twilkey
08-29-2008, 06:54 AM
Ok Guys. I have fixed the bugs in this mod and added some more features.
If you are running 1.0, please go through the instructions again, replacing all that you did before.

jluerken
08-29-2008, 09:50 AM
Can you please change the setting "Section Title" into a phrase?
Otherwise the addon cannot be used on multilanguage boards.

htscpl
08-29-2008, 10:20 AM
Nice mod ! ** installs **

Just a few items:

Mod was turned off but showed up on Forum Home anyway (if that is correct then never mind).

Second, I only have a few members in the few groups but mod is showing three times the number of members for one group ??

and finally, any way to make it's box collapsible? That would be great.

Anyway, as I said nice work! Thanks.

ShackMaster
08-29-2008, 01:53 PM
Thanks for the updates... excellent!

snake-boy
08-29-2008, 03:27 PM
Member count now works.

However:

Even if disabled in admin, it still shows on the forum.


Also, if I enable image count, nothing changes. I see no info about available images in any of my groups.


If "Show Date" is disabled, the heading "Created" still appears on the table.


It also ignores my style background color on the "last post" column (gives black bg). All other columns work fine, as it does in the default style.


See attached.

SuperDave71
08-31-2008, 04:43 PM
Works Great!

Leo Brazil
09-01-2008, 07:46 PM
Leo Brazil clicked installed !!

Just Awesome !!

Brandon Sheley
09-01-2008, 08:04 PM
Does anyone have a live demo?
I see the screenshots, but demo's are always better :D

Twilkey
09-02-2008, 05:11 AM
Does anyone have a live demo?
I see the screenshots, but demo's are always better :D
http://features.gamingtv.us/forum/index.php

anestetic
09-02-2008, 06:40 AM
44 bugs

Leo Brazil
09-02-2008, 12:26 PM
I found a couple of bugs on this. As I use different colors on regular Vb Style, the columm "Last Post" does not match my Alt color accordingly.

Also, if characters like " was used when the Social Group was created it gives me "&quot;" instead of correct character that in this case is ".

This mod got its potential just need an extra touch.

Tks

wolfstream
09-02-2008, 03:28 PM
Excellent mod.
/me clicks install

Leo Brazil
09-02-2008, 08:11 PM
Yeap, upgrade fixed bugs I've reported.

Keep rock'n dude !!

Leo Brazil
09-03-2008, 03:13 PM
If you let me suggest some improvments for next verision here it goes.

- Include on last post column data/time below last user's last post. This will look same design (pattern) of Vb forums.

- In my case if have Social Group Forum List above my forums and there's no space between it and forums. It'd look better if you include this separation on.

Cheers

Ricsca
09-14-2008, 10:36 PM
It is lacking the link "looks at all of the groups"

Pirate45
09-15-2008, 04:55 PM
Fixed up a little bit and this is something that many people will install. I would myself but it lacks a few fixes that other paople have noted.

Moyses
09-15-2008, 10:47 PM
great! tested fine for vb 3.7.3

Jaxel
09-17-2008, 08:13 PM
Could you possibly make a TABBED version of this mod? Instead of having the list of social groups on the bottom, could we have it so it simply adds the list to a tab at the top of the forum list? So we'll have two tabs, one for Forums, and one for Social Groups? Very much like the user profile tabbing in vb3.7.x

I figure you can just use the code directly from the user profile tabbing system and simply copy it over. Then just put the social group tables inside one of the DIVs.

dengbej
09-18-2008, 08:37 PM
i installed.thanks :)

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:

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)

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:
$sgfl_query = $db->query("SELECT * FROM " . TABLE_PREFIX . "socialgroup $sgfl_lim");
to:
$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
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
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?