[2.0.19] Forum Membership Benefits By User Group

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
5
83%
Very Good
1
17%
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 6

sobewebmaster
Registered User
Posts: 119
Joined: Sun Oct 02, 2005 1:19 am

Post by sobewebmaster »

What about being able to set different PM limits for different groups, or adding/removing banner ads, etc.
Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana »

sobewebmaster wrote: What about being able to set different PM limits for different groups, or adding/removing banner ads, etc.


Good question.
concretemonkey
Registered User
Posts: 49
Joined: Sat Oct 23, 2004 1:05 am

Post by concretemonkey »

I have just installed the mod and was upset to see that it is only one checkbox for all three of the restrictions. I would have hoped for 3 seperate ones so that I may allow all members the ability to use the PM.

What code do i need to ignore in order to allow all members to use the PM system.

Thanks in advance for your help.
Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana »

Anyone?
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Great Mod, I've been looking for something like this for a long time! I'm running into a bit of a problem, and wanted to check and see if anyone else has had it.

I've recently begun to use usergroups extensively on my boards, in an effort to cut down on extraneous mass emails, etc. So, it's not uncommon for someone nto be a member of 3-4 usergroups.

The install of this mod went perfectly, BUT when I try to PM someone in my PM-allowed UG, I get the "permission denied" message. My guess is they're also a member of 3 other UGs, which haven't had the PMs enabled for.

Did I miss a step where the specific usergroup is put into the code? OR, is there a way to do this? This certainly won't work.
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

HelloOOOooo?

I see this same issue happened on page one of this Mod's topic, but in a genuinely frustrating way, was "solved" (I presume) via PM, not here in the thread.

Can ANYONE help me with this? It installed flawwlessly, and everything else works just right, but this PM issue is truly frustrating!

I honestly hope someone's still reading this topic...
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Help?

I have to wonder, since my issue seems to be the same as experienced by another user, and the author seems to have vanished already, how this mod made the database?

Can't even find a development thread to outline anything...
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

bumpittybumpbumpbump :wink:
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

I am currently reviewing this mod line by line, until I am able to find some sort of solution. Any and all help is welcome.
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Well, what does everyone make of this?

If I could read this code more effectively, maybe I'd have an idea...

Code: Select all

#-----[ OPEN ]------------------------------------------ 
# 
privmsg.php
# 
#-----[ FIND ]------------------------------------------ 
# 
	if ( $submit )
	{
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//begin mod group_extras
	$extras_username = ( isset($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
	$sql = "SELECT user_id
				FROM " . USERS_TABLE . "
				WHERE username = '" . str_replace("\'", "''", $extras_username) . "'";
	$result_id = $db->sql_query($sql);
	if (!($result_id)) 
	{
		message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
	}
	list($pm_username_extras) = $db->sql_fetchrow($result_id);
	$members_id = compare_for_extras();
	if (!in_array($pm_username_extras, $members_id))
	{
		$error = TRUE;
		$error_msg = $lang['user_disabled_pm'];
	}
//end mod group_extras
We modified the dB with:

Code: Select all

ALTER TABLE phpbb_groups ADD group_extras TINYINT(1) NOT NULL DEFAULT 0;
Then , here's the SQL query...

Code: Select all

//begin mod group_extras
function compare_for_extras()
{
   global $db;
   $grabbed_users = array();
   
   $sql = "SELECT DISTINCT g.group_id, ug.user_id
      FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
      WHERE g.group_extras = 1
      AND ug.group_id = g.group_id";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
   }

   while ($userrow = $db->sql_fetchrow($result))
   {
      array_push($grabbed_users, $userrow['user_id']);
   }
   
   return $grabbed_users;
}
//end mod group_extras
Does this work?

It's not working for me, but could be me, I'm crackers...
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Fortunately, shakey_1, the other user who had a similar problem PM'd me one of the exchanges he'd had with the author. While I'm certain this isn't the solution in my case, I'm sharing it here for the benefit of all:
shakey_1 wrote: Open privmsg and try this:

Find:

Code: Select all

//begin mod group_extras 
   $extras_username = ( isset($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : ''; 
   $sql = "SELECT user_id 
            FROM " . USERS_TABLE . " 
            WHERE username = '" . str_replace("\'", "''", $extras_username) . "'"; 
   $result_id = $db->sql_query($sql); 
   if (!($result_id)) 
   { 
      message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); 
   } 
   list($pm_username_extras) = $db->sql_fetchrow($result_id); 
   $members_id = compare_for_extras(); 
   if (!in_array($pm_username_extras, $members_id)) 
   { 
      $error = TRUE; 
      $error_msg = $lang['user_disabled_pm']; 
   } 
//end mod group_extras 
replace with:

Code: Select all

//begin mod group_extras 
   $extras_username = ($HTTP_POST_VARS['username']); 
   $sql = "SELECT user_id 
            FROM " . USERS_TABLE . " 
            WHERE username = '" . $extras_username . "'"; 
   $result_id = $db->sql_query($sql); 
   if (!($result_id)) 
   { 
      message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); 
   } 
   list($pm_username_extras) = $db->sql_fetchrow($result_id); 
   $members_id = compare_for_extras(); 
   if (!in_array($pm_username_extras, $members_id)) 
   { 
      $error = TRUE; 
      $error_msg = $lang['user_disabled_pm']; 
   } 
   echo "username: $extras_username <br />"; 
   echo "pm_u_e:"; 
   print_r($pm_username_extras); 
   echo "<br />members_id:"; 
   print_r($members_id); 
//end mod group_extras 


I'm convinced at this point, that the problem is in the functions.php change, the function compare_for_extras() referenced above.
Any ideas?
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
shakey_1
Registered User
Posts: 58
Joined: Mon Jan 23, 2006 12:08 am

Post by shakey_1 »

Jackanape, don't know if you have seen it yet, but you have email. Hope it helps.
User avatar
Jackanape
Registered User
Posts: 1076
Joined: Wed Oct 13, 2004 6:01 am
Location: Capitol of the Great State of New York
Name: Jack Drury
Contact:

Post by Jackanape »

Got it, Shakey, and Thanks! Looks like the solution has been found, so if any of you folks have the same issue, here 'tis! I'm glad Shake was able to send these files over, as the solution was in privmsg.php, NOT where I was looking! LOL

Find:

Code: Select all

//begin mod group_extras
   $extras_username = ( isset($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
   $sql = "SELECT user_id
            FROM " . USERS_TABLE . "
            WHERE username = '" . str_replace("\'", "''", $extras_username) . "'";
   $result_id = $db->sql_query($sql);
   if (!($result_id))
   {
      message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
   }
   list($pm_username_extras) = $db->sql_fetchrow($result_id);
   $members_id = compare_for_extras();
   if (!in_array($pm_username_extras, $members_id))
   {
      $error = TRUE;
      $error_msg = $lang['user_disabled_pm'];
   }
//end mod group_extras 
Replace with:

Code: Select all

//begin mod group_extras 
   $extras_username = ( isset($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : ''; 
   $sql = "SELECT user_id 
            FROM " . USERS_TABLE . " 
            WHERE username = '" . str_replace("\'", "''", $extras_username) . "'"; 
   $result_id = $db->sql_query($sql); 
   if (!($result_id)) 
   { 
      message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); 
   } 
   $pm_username_extras_array = $db->sql_fetchrow($result_id); 
   $pm_username_extras = $pm_username_extras_array['user_id']; 
   $members_id = compare_for_extras(); 
   if (!in_array($pm_username_extras, $members_id)) 
   { 
      $error = TRUE; 
      $error_msg = $lang['user_disabled_pm']; 
   } 
//end mod group_extras
I believe the only difference is the addition of

Code: Select all

   $pm_username_extras = $pm_username_extras_array['user_id']; 
to the above snippet, but just to be sure, I included the whole shebang.

Thanks again Shakey, and good luck to anyone using this mod--it's a good'un, and I hope not to run into any more problems!
~Extending the rule of meticulous exactitude to exaspirating punctillio...still.~
Treat your phpBB like a member of the family--Update and MOD her by hand, with HTML-Kit
: : Wanna Talk Poker? : : Image : :
shakey_1
Registered User
Posts: 58
Joined: Mon Jan 23, 2006 12:08 am

Post by shakey_1 »

Jackanape wrote: Thanks again Shakey, and good luck to anyone using this mod--it's a good'un, and I hope not to run into any more problems!


You're welcome, glad I was able to help you get it lined out. You're right, it's a useful mod.
shakey_1
Registered User
Posts: 58
Joined: Mon Jan 23, 2006 12:08 am

Post by shakey_1 »

I found one incompatability with this mod that I wanted to throw out there in case anyone else came looking for this error. If you use an ignore mod, such as Ignore Suite+++ 1.0.6 you will get an error stating "Sorry, but no such user exists." I took the ignore suite off and the PM functionality came right back though. I haven't tested it with any other ignore mods, so I don't know if they will cause the same results.
Post Reply

Return to “[2.0.x] MOD Database Releases”