vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - GRPS: Groups Commune 2.0.x (https://vborg.vbsupport.ru/showthread.php?t=127303)

djilou 07-11-2007 11:39 PM

Hi
to fix the pagination problem
On browse.php
Replace
Code:

$totalgroups = $db->query_first("SELECT COUNT(groupid) AS total FROM grps WHERE approved = '1'");
with
Code:

$totalgroups = $db->query_first("SELECT COUNT(groupid) AS total FROM grps WHERE approved = '1' AND catid = $c");

quiklink 07-12-2007 06:30 AM

Try this to add Groups to a user's public profile. It works for me:

Create a new plug in:
Product: GRPS: Groups Commune
Hook Location: member_complete
Title: GRPS: List Groups In User Profile
Execution Order: 5
Plugin PHP Code:
Code:

// ###################### extracts my groups groups for main grps page
//require_once("./includes/functions_grps.php");
$grps_ids = explode(' ', trim($userinfo['grps']));

$baselocation = ($vbulletin->options['grps_locationswitch'] == TRUE) ? $vbulletin->options['homeurl'] : $vbulletin->options['bburl'];

if (!empty($userinfo['grps']))
{
        $grps_ids_imploded = implode(",", $grps_ids);

        $grps_mygroups = $db->query("
                SELECT grps.groupid, grps.title, grps.description, grps.approved, grps.leaderid, grps_setting.image_name, MAX(grps_thread.lastpostdateline) AS dateline
                FROM grps
                LEFT JOIN grps_setting ON (grps_setting.groupid = grps.groupid)
                LEFT JOIN grps_thread ON (grps_thread.groupid = grps.groupid)
                LEFT JOIN " . TABLE_PREFIX . "user AS " . TABLE_PREFIX . "user ON (" . TABLE_PREFIX . "user.userid = grps.leaderid)
                WHERE grps.approved = '1' AND grps.groupid IN($grps_ids_imploded)
                GROUP BY grps.groupid
                ORDER BY dateline DESC
                LIMIT 15
        ");

        $mygroups = "<ul>";
        while ($grps_mygroupsinfo = $db->fetch_array($grps_mygroups))
        // foreach($grps_ids AS $grps_key_id => $grps_mygroups)
        {
                if(!$grps_mygroupsinfo['image_name'])
                {
                        $grps_mygroupsinfo['image_name'] = "<img src=\"" . $vbulletin->options['bburl'] . "/" . $stylevar['imgdir_grps'] . "/grps_mygroups_noimage.gif\" alt=\"" . $grps_mygroupsinfo[title] . "\" border=\"0\" /><br />";
                }
                else
                {
                        $grps_mygroupsinfo['image_name'] = "<img src=\"../groups/grps_imgs/defaults/" . $grps_mygroupsinfo['image_name'] . "\" width=\"100\" alt=\"" . $grps_mygroupsinfo[title] . "\" border=\"0\" /><br />";
                }

                if ($grps_mygroupsinfo['leaderid'] == $userinfo['userid'])
                {
                        $grps_mygroupsinfo['leader'] = "<img src=\"" . $vbulletin->options['bburl'] . "/" . $stylevar['imgdir_grps'] . "/grps_leader.gif\" alt=\"" . $grps_mygroupsinfo['title'] . " Leader\" border=\"0\" /><br />";
                }
                else
                {
                        $grps_mygroupsinfo['leader'] = FALSE;
                }


                $mygroups .= "
                        <li id=\"grpsgroupsbullets\">
                                <a href=\"" . $baselocation . "/groups/groups.php?" . $vbulletin->session->vars['sessionurl'] . "g=" . $grps_mygroupsinfo['groupid'] . "\" title=\"" . $grps_mygroupsinfo['title'] . "\"><b>" . fetch_trimmed_title($grps_mygroupsinfo['title'], 15) . "</b></a><br />
                                " . $grps_mygroupsinfo['image_name'] . "
                                " . $grps_mygroupsinfo['leader'] . "
                        </li>
                ";
        }
        $mygroups .= "</ul>";
        //eval('$grps_mygroupsprofilebits .= "' . fetch_template("groups_usercp_groupsbits") . '";');
        $grps_mygroupsprofilebits = $mygroups;


}

And of course make the plugin active.

Now go edit your memberinfo template and add $grps_mygroupsprofilebits where you want them to appear on the user's public profile page.

nutnut 07-14-2007 08:20 AM

Hi,

I'm having problems with permissions and I am using the latest download with the fix. My forums are installed under public_html/forum and this is my config:

chdir("../forum");

When I go to http://www.site.com/forum/groups/ I immediately get the permissions error message when i'm logged in as admin or regular user, and I changed permissions for both user groups to access the grps (you do not have permission to access this page. This could be due to one of several reasons:)

Thoughts? Thanks!

quiklink 07-14-2007 08:24 AM

Quote:

Originally Posted by nutnut (Post 1290653)
Hi,

I'm having problems with permissions and I am using the latest download with the fix. My forums are installed under public_html/forum and this is my config:

chdir("../forum");

When I go to http://www.site.com/forum/groups/ I immediately get the permissions error message when i'm logged in as admin or regular user, and I changed permissions for both user groups to access the grps (you do not have permission to access this page. This could be due to one of several reasons:)

Thoughts? Thanks!

Make sure you have Groups turned on in your Admin CP or you will get that permission error no matter what other permissions you have set.

nutnut 07-14-2007 08:32 AM

GRPS set to active yes.

quiklink 07-14-2007 08:34 AM

Make sure you have 'Is The GRPS directory parallel to your forums directory' set to 'No' since you are running it under the forum directory.

nutnut 07-14-2007 08:42 AM

Quote:

Originally Posted by quiklink (Post 1290658)
Make sure you have 'Is The GRPS directory parallel to your forums directory' set to 'No' since you are running it under the forum directory.

Oh, geez, that was it. Dyslexic moment I guess I read it wrong the first time. Thanks!

And thanks to the coder of this!

Mum 07-15-2007 12:52 AM

When you hit New Posts, does it bring up the ones from the groups as well?

Mum 07-15-2007 12:55 AM

Can you move posts from the normal forums to a group?

quiklink 07-15-2007 02:45 AM

Quote:

Originally Posted by Mum (Post 1291419)
When you hit New Posts, does it bring up the ones from the groups as well?

No

Quote:

Originally Posted by Mum (Post 1291425)
Can you move posts from the normal forums to a group?

No


All times are GMT. The time now is 06: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.03104 seconds
  • Memory Usage 1,755KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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