vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Send a Private Message to Public Group Leaders Upon a Join Request (https://vborg.vbsupport.ru/showthread.php?t=83086)

cynix2 02-01-2006 05:54 PM

after a good long while of testing i finally fixed up this hack

the main problem that existed was the bbcode was being parsed in the hack, when it didnt need to be, vb will parse the bbcode when displaying the pm, so i then proceeded to use bbcode to construct the phrase for the pm

the second thing i fixed was the url issue, i was on the right track using {2} in my last post above but i put the wrong variable into the hack, so now it works just fine

anyways here are the new updated files, amykhar you might wanna update the hack so people dont have to come to the last page to see it needed fix'n

EasyTarget 02-01-2006 05:56 PM

thanks cynix

installed and seems to be working good.

Snake 02-01-2006 06:29 PM

Yeah thanks man. That worked now! :)

Eriond 02-19-2006 11:09 AM

excellent plugin :D

*INSTALLED* finally :) very new to all this so took me a few days to learn exactly how to get this working *feels silly*

working perfectly just wondering if there was any news on an auto reply pm accepting the member?

Hornstar 02-21-2006 05:01 AM

Quote:

Originally Posted by cynix2
after a good long while of testing i finally fixed up this hack

the main problem that existed was the bbcode was being parsed in the hack, when it didnt need to be, vb will parse the bbcode when displaying the pm, so i then proceeded to use bbcode to construct the phrase for the pm

the second thing i fixed was the url issue, i was on the right track using {2} in my last post above but i put the wrong variable into the hack, so now it works just fine

anyways here are the new updated files, amykhar you might wanna update the hack so people dont have to come to the last page to see it needed fix'n


Is this the same file that you download from the side bar?




Code:

product - vbulletin
hooklocation - profile_insertjoinreques
title - PM Group Leader on Join Request
Plugin PHP Code -

require_once(DIR . '/includes/class_bbcode.php');
// Find the leaders of the usergroup

        $leaders = $db->query_read("
                                SELECT ugl.userid, username
                                FROM " . TABLE_PREFIX . "usergroupleader AS ugl
                                INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
                                WHERE ugl.usergroupid = " . $vbulletin->GPC['usergroupid'] . "
                        ");

        // Get the name of the member group
                        $groupname = $db->query_first("
                        SELECT title
                        FROM " . TABLE_PREFIX . "usergroup
                        WHERE usergroupid = " .  $vbulletin->GPC['usergroupid'] ."
                        ORDER BY usergroupid DESC
                        LIMIT 1
                    ");
        // Create the message:
        $message = construct_phrase($vbphrase['group_memberships_message'], $groupname['title'], $vbulletin->options['bburl']);

    if ($db->num_rows($leaders))
        {
                while ($leader = $db->fetch_array($leaders))
                {
                        // create the DM to do error checking and insert the new PM
                        $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
                        $pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
                        $pmdm->set('fromusername', $vbulletin->userinfo['username']);
                        $pmdm->set('title', $vbulletin->userinfo['username']. " would like to join " . $groupname['title']);
                        $pmdm->set('message', $message);
                        $pmdm->set_recipients($leader[username], $botpermissions);
                        $pmdm->set('dateline', TIMENOW);
                        $pmdm->set_info('savecopy',0);
                        $pmdm->save();
                }
        }

        else {
                eval(standard_error(fetch_error('usergroup_already_member')));
        }

 // End of mod


plugin is active - yes

Edit, I edited this post so it will help other people, I finally got it working, yay!!

axelhols 03-15-2006 11:34 AM

I still sense that this plug-in is buggy.

getting Fatal error: Unable to proceed with save while $errors array is not empty in class vb_datamanager_pm in /includes/class_dm.php on line 758

1. Using VB 3.5.3
2. Using multiple joinable Groups with multiple group leaders for each.
2. Have added the VB phrase group_memberships_message.

The confusing part is that the problem is intermittant. When I remove the plug-in and VB phrase and re-install everything it seems to work for while until a few new user registrations later and join requests to any of the groups bombs out with the error message above. In another case it will work with only one of my 3 joinable groups and bomb out with the other two. In other cases each group leader will get multiple (3) PM messages for the same "join request to one specific group!.

Has anybody else using VB 3.5.3 with multiple joinable groups and group leaders experienced similar intermittant problems with this plug-in?.

amykhar 03-15-2006 11:59 AM

It must be something in the pm settings for some of the group leaders. At some point, I'll look into how to make this more bullet-proof, but for now it suits my needs.

ricker 03-22-2006 04:45 PM

Quote:

Has anybody else using VB 3.5.3 with multiple joinable groups and group leaders experienced similar intermittant problems with this plug-in?.
unfortunately yes, i had to disable this plugin. :(

trackpads 04-01-2006 11:13 AM

I found out how to reproduce the error that happens on line 758, in my case one of my group leaders had a space in his username. Once I removed him as a group leader the bug went away. I am not sure which version of the hack I have but I am going to reinstall and try again.

Thanks again,

-Jason

trackpads 04-01-2006 11:18 AM

Ok, big dummy, should have tested it again "after" I uploaded the new version. It works :) :)

Thanks!!


All times are GMT. The time now is 10:00 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.01119 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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