[BETA] Simple Ignore 1.4.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
NoahK
Registered User
Posts: 217
Joined: Wed Nov 12, 2003 4:49 am
Location: Atlanta, GA
Contact:

Post by NoahK » Sun May 02, 2004 8:35 pm

Actually the code that finally worked for me is below. Not only does it stop people you've ignored from PM'ing you, it also stops you from PM'ing them (otherwise I could just pester someone, and they couldn't respond).

Code: Select all

   //Get user ignore settings 1 
   $sql2 = "SELECT ignored_id,user_id FROM " . $table_prefix . "ignoreuser WHERE user_id = " . $userdata[user_id]; 
   if ( !($result2 = $db->sql_query($sql2)) ) 
   { 
      message_die(GENERAL_ERROR, 'Error retrieving ignore user data', '', __LINE__, __FILE__, $sql); 
   } 
   $ignored_ids2 = array(); 
   while( $row2 = $db->sql_fetchrow($result2) ) 
   { 
      $ignored_ids2[$row2['ignored_id']] = true; 
   }
   //Get user ignore settings 2
   $sql = "SELECT ignored_id,user_id FROM " . $table_prefix . "ignoreuser WHERE ignored_id = " . $userdata[user_id]; 
   if ( !($result = $db->sql_query($sql)) ) 
   { 
      message_die(GENERAL_ERROR, 'Error retrieving ignore user data', '', __LINE__, __FILE__, $sql); 
   } 
   $ignored_ids = array(); 
   while( $row = $db->sql_fetchrow($result) ) 
   { 
      $ignored_ids[$row['user_id']] = true; 
   }
	if ( $submit )
	{
		if ( !empty($HTTP_POST_VARS['username']) )
		{
			$to_username = $HTTP_POST_VARS['username'];

			$sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active 
				FROM " . USERS_TABLE . "
				WHERE username = '" . str_replace("\'", "''", $to_username) . "'
					AND user_id <> " . ANONYMOUS;
			if ( !($result = $db->sql_query($sql)) )
			{
				$error = TRUE;
				$error_msg = $lang['No_such_user'];
			}

			$to_userdata = $db->sql_fetchrow($result);
			if ( isset($ignored_ids[$to_userdata['user_id']]) && $ignored_ids[$to_userdata['user_id']] ) 
			{
				message_die(GENERAL_ERROR, $to_username . $lang['Has_ignored']); 
			}
			if ( isset($ignored_ids2[$to_userdata['user_id']]) && $ignored_ids2[$to_userdata['user_id']] ) 
			{
				message_die(GENERAL_ERROR, 'You cannot send Private Messages to ' . $to_username . ' because you have them Ignored.'); 
			}
Come play Final Fantasy Tactics: Online!
Features:
- Pick one of 351 class combinations. Battle 150 different monsters. Find over 2,200 weapons, armor, and items. Fight in tournaments or play the Gil Slots. Anything goes!

karlsson
Registered User
Posts: 12
Joined: Fri Mar 07, 2003 4:53 am
Location: Somerville, MA
Contact:

Post by karlsson » Wed May 05, 2004 2:12 am

karlsson wrote: Does this mod work on 2.0.8?

I desperately need to add this ignore feature to my site, and I tried one that I found but it doesn't seem to work right with my 2.0.8:

http://www.gunnerx.net/phpBB21/viewtopic.php?t=6

So far, i think the problem is something with it not being able to properly get user_id if the user is not logged in or something.


Sorry to bother. I figured out my problem and it was totally my own fault (the Anonymous user had been deleted). So you can ignore me now.

/l
Livephish.org trading community - http://livephish.org/forum/

MaddoxX
Registered User
Posts: 450
Joined: Sat May 15, 2004 4:43 pm
Location: Russia

Post by MaddoxX » Thu Jun 17, 2004 9:22 pm

Any updated version on this one ?? With the pm block ?
:D

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Post by stickerboy » Fri Jul 30, 2004 1:52 pm

I see that other people have been having problems with pm's. Mine is a little bit different through.

I have this mod and Niels Custome Mass PM mod installed. Problem is that they both edit the same bit of code.
Namely this part in privmsg.php -

Code: Select all

$to_userdata = $db->sql_fetchrow($result);
your mod adds this after -

Code: Select all

			if ( isset($ignored_ids[$to_userdata['user_id']]) && $ignored_ids[$to_userdata['user_id']] ) 
			{
				message_die(GENERAL_ERROR, $to_username . $lang['Has_ignored']); 
			}
but Niels mod changes the code from this -

Code: Select all

			if ( !($result = $db->sql_query($sql)) )
			{
				$error = TRUE;
				$error_msg = $lang['No_such_user'];
			}

			$to_userdata = $db->sql_fetchrow($result);
		}
		else
		{

Code: Select all

// Start replacement - Custom mass PM MOD
	if( !($result2 = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain users PM information', '', __LINE__, __FILE__, $sql);
	}
	$to_users = $db->sql_fetchrowset($result2);
	$n=0;
	while ($to_username_array[$n] && !$error)
	{
		if (strcasecmp($to_users[$n]['username'], str_replace("\'", "'",$to_username_array[$n]))) 
		{ 
			$error = TRUE; 
			$error_msg .= $lang['No_such_user']." '".str_replace("\'", "'", $to_username_array[$n]);
		}
		$n++;
	}
}
else
{
// End replacement - Custom mass PM MOD
It's a bit annoying as I can't seem to have them both running without loosing my pm functionality altogether. I'm unsure as to who to post this to, so i'm putting it here and at Niels site. I'll keep both posts updated.
Or if need be, i'll create a post in the correct topic (if there is one for this type of problem) and edit my posts.

I did have a look at the code for the 2 mods to see if i could figure it out myself, but I'm still really unsure about php.
Any help would be great.
cheers,

kenny :) [/code]
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Post by stickerboy » Mon Aug 02, 2004 11:20 am

Sorry, just a little bump.
If no-one can help, it's ok. i'll just remove this part from the pm.
cheers :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

kratzer54847
Registered User
Posts: 143
Joined: Wed Oct 15, 2003 9:46 pm
Location: Wannsee
Contact:

Post by kratzer54847 » Sun Dec 12, 2004 10:07 am

Hi there,

how does this MOD work?
If a User is ignored and I view one of his posts,does it say "Click here to view the blocked post" or does it only block the post once and gives no chance to view it even if the user is ignored?

mfg Johny

soapgirlie
Registered User
Posts: 115
Joined: Fri Dec 06, 2002 2:02 am

Post by soapgirlie » Thu Dec 30, 2004 4:18 am

Does anyone know if this works in 2.0.11?

encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption » Sun Jan 09, 2005 7:14 pm

yea I would like to know that too....

-e-

Ravenhearte
Registered User
Posts: 96
Joined: Fri Oct 10, 2003 3:45 pm
Location: Just this side of sane.
Contact:

Post by Ravenhearte » Sun Apr 17, 2005 9:34 am

I just redesigned my site and installed phpBB 2.0.13, if anyone is still interested in this mod i might see about updating it for the new version and make it into an actual mod instead of a beta. let me know...

Tom_S
Registered User
Posts: 524
Joined: Tue Jul 29, 2003 6:54 pm
Location: 127.0.0.1
Contact:

Post by Tom_S » Tue Apr 19, 2005 7:22 am

soapgirlie wrote: Does anyone know if this works in 2.0.11?


Why would you be running 2.0.11? Are you asking to be hacked? If you just read and keep up you will see the numerous warnings to folks to upgrade and stay upgraded for security reasons. I lost three websites because I didn't. Okay...nuff preaching UPGRADE!! :wink:
I went back in Time...
Image

Ravenhearte
Registered User
Posts: 96
Joined: Fri Oct 10, 2003 3:45 pm
Location: Just this side of sane.
Contact:

Post by Ravenhearte » Mon Jun 20, 2005 7:49 am

Little update. I've hammered out the kinks and resubmitted to the mod database(again...). The mod works like this:

An ignore button is added below the users post next to profile etc. If you click this button the user is ignored and you will no longer see their posts. Instead the post text will be replaced with a message that states "{User} Is On Your Ignore List." All the profile, email, website, etc buttons are gone and replaced by an unignore button. While the user is on your ignore list they cannot send you pms nor can you send them pms(this is to stop abuse from people ignoring users and then harrasing them through pm without the person being able to reply). You can read any posts by clicking the unignore button, this will take the user off your ignore list and you will be able to view their posts like normal. They will also be able to send you pms and vice versa. There is no way to view a single ignored post without completely unignoring the user.

Download here:

http://www.ravenhearte.org/studio/phpbb ... ore140.zip

or

http://www.ravenhearte.org/studio/phpbb ... ore140.rar

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3476
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Post by bonelifer » Mon Jun 20, 2005 2:24 pm

Please update the link on the first page as that is the page most people will look at. Since there will be many pages to come after this one no one is going to go through all the different pages just to find the download link which should be on the first page.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

davidh44
Registered User
Posts: 386
Joined: Sat Mar 09, 2002 5:56 am

Post by davidh44 » Tue Jun 21, 2005 10:09 am

Cool. :D Thanks for the new version Ravenhearte!

Ravenhearte
Registered User
Posts: 96
Joined: Fri Oct 10, 2003 3:45 pm
Location: Just this side of sane.
Contact:

Post by Ravenhearte » Wed Jun 29, 2005 11:18 am

Rejected once again. *sigh* stupid grammatical errors. Works fine, *bitch bitch rant rant whine whine moan moan*. Anyone have any feature ideas before I fix the little grammar errors and resubmit to database?

User avatar
aboyd
Registered User
Posts: 193
Joined: Mon May 10, 2004 7:30 pm
Location: USA
Contact:

Post by aboyd » Wed Jul 06, 2005 7:33 am

No. Any changes now will open you up to the possibility of more problems that keep you out of the database. Instead, just fix what they said to fix and resubmit. If there's another problem, fix only what they mention, and resubmit again.

Once the mod is official, then would be an ideal time to expand the thing, increase the version number past 1.0.0, and so on.

Just MHO.

Also, how does yours stack up against this one:

http://www.phpbb.com/phpBB/viewtopic.php?t=228489

That one will never be official, I think because the original author is MIA and someone else unofficially modded it. However, she made it EasyMod compliant, and added an admin screen with some nice data. If yours is missing any of that, I'd suggest that after your mod is approved & official, you absorb the other mod's features, if you like them. Otherwise, those features will never see the light of day in any official capacity.

-Tony

Post Reply

Return to “[2.0.x] MODs in Development”