[ABD] Friend Request Approval MOD

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Sun Jul 26, 2009 12:25 pm

This is one great MOD. Installed it on a test forum, works fine.

What I'd like to do before deploying it on my production forum, is delete all the friend relations that are not two-way. I know it can be done with one single SQL query (I do have enough knowledge to list all the two-way relations using a left join clause) but I just can't figure out how, or maybe I'm high.

Can anybody help? ;)

Thanks

kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [DEV] Friend Request Approval MOD

Post by kmklr72 » Sun Jul 26, 2009 3:20 pm

I can't really think of a good script to do what you want right now (just woke up), but I'll mess around with some code later this afternoon and see what I can come up with.

User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Sun Jul 26, 2009 4:22 pm

I wrote a PHP script to do it using loops, but I'm pretty sure it can be done using a single SQL query. Anyway, here is the script -- note that it might not work correctly, I haven't tested it much.

Code: Select all

<?php

	$db = new mysqli('localhost', 'USERNAME', 'PASSWORD', 'DATABASE');
	
	$result = $db->query("SELECT * FROM `phpbb_zebra` WHERE `user_id`>0 AND `zebra_id`>0 ORDER BY `user_id`, `zebra_id`");
	$q++;
	if ( $result->num_rows > 0 )
	{
		$t = $result->num_rows;
		
		while ( $row = $result->fetch_object() )
		{
			$result1 = $db->query("SELECT * FROM `phpbb_zebra` WHERE `user_id`='" . $row->zebra_id . "' AND `zebra_id`='" . $row->user_id . "' LIMIT 1");
			$q++;
			
			if ( $result1->num_rows == 0 )
			{
				$db->query("DELETE FROM `phpbb_zebra` WHERE `user_id`='" . $row->user_id . "' AND `zebra_id`='" . $row->zebra_id . "' LIMIT 1");
				$q++;
				$d++;
			}
			
			$result1->free_result();
		}
	}
	$result->free_result();

	echo "Total Queries performed: $q\nTotal Rows: $t\nTotal Deleted: $d\n";
	
?>
Also, it's supposed to be ran from the CLI.

trickoff
Registered User
Posts: 513
Joined: Mon Jan 07, 2008 12:23 am

Re: [DEV] Friend Request Approval MOD

Post by trickoff » Sun Jul 26, 2009 4:57 pm

Thank you for a super mod!
Just want to inform you that characters like åäö is not working. Seems like UTF-8 isn't supported.

kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [DEV] Friend Request Approval MOD

Post by kmklr72 » Sun Jul 26, 2009 5:20 pm

trickoff wrote:Thank you for a super mod!
Just want to inform you that characters like åäö is not working. Seems like UTF-8 isn't supported.
There I go forgetting the utf8 functions again :lol: . Thanks for telling me about this.

stathisch wrote:I wrote a PHP script to do it using loops, but I'm pretty sure it can be done using a single SQL query. Anyway, here is the script -- note that it might not work correctly, I haven't tested it much.
Thanks for the script. I'll see if I can get it converted to phpbb's functions so everyone can use it :) .

User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Sun Jul 26, 2009 5:25 pm

kmklr72 wrote:Thanks for the script. I'll see if I can get it converted to phpbb's functions so everyone can use it :) .
Oh I should have done that myself in the first place. Anyway OK. :)
Also please test it yourself too. :P

kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [DEV] Friend Request Approval MOD

Post by kmklr72 » Mon Jul 27, 2009 3:49 am

Just a quick update on the status of the next version of this MOD. There have been a few bugs fixed and some optimizations in the lists. New friends has been added and a complete friends list with pagination is being worked on. The code has been added for a popup notificationon new requests much like the pm popup notification but this hasn't been tested. If there is anything else anyone wants to see in this MOD, now would be the time to tell me :) .

superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: [DEV] Friend Request Approval MOD

Post by superj707 » Mon Jul 27, 2009 4:15 am

kmklr72 wrote:Just a quick update on the status of the next version of this MOD. There have been a few bugs fixed and some optimizations in the lists. New friends has been added and a complete friends list with pagination is being worked on. The code has been added for a popup notificationon new requests much like the pm popup notification but this hasn't been tested. If there is anything else anyone wants to see in this MOD, now would be the time to tell me :) .

Friggen awesome Kmklr. You are still my hero !!

User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Mon Jul 27, 2009 11:30 am

hmm maybe showing the users avatar on the request page? :D

trickoff
Registered User
Posts: 513
Joined: Mon Jan 07, 2008 12:23 am

Re: [DEV] Friend Request Approval MOD

Post by trickoff » Mon Jul 27, 2009 2:40 pm

stathisch wrote:hmm maybe showing the users avatar on the request page? :D
The avatar is already showing.

User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Mon Jul 27, 2009 2:47 pm

trickoff wrote:
stathisch wrote:hmm maybe showing the users avatar on the request page? :D
The avatar is already showing.
That means I did something wrong while installing it on my test forum. D'oh! :lol:

User avatar
djrikyx
Registered User
Posts: 17
Joined: Tue Dec 16, 2008 8:49 pm

Re: [DEV] Friend Request Approval MOD

Post by djrikyx » Fri Jul 31, 2009 7:34 am

kmklr72 wrote:If there is anything else anyone wants to see in this MOD, now would be the time to tell me :) .
I think is a trouble do this, but i try to tell you if you want make for next release.

A Log system for friend request.
Example1: I send a friend request to User1, User1 see in a Log box: 'Djrikyx have requested to be friend with you.'
Example2: if User1 accept my request i see in my Log box: 'User1 have approved your friend request!'
if denied same thing but show 'User1 have denied your friend request.'
This is instead at PM notification. i think it's better :)

Other thing, but is a double trouble (xD) in the same box, i can see what my friends does.

Example: User1 it's my friend, User1 become friend of User2, and i see in my log Box:
'User1 it' now a friend of User2'

if this is possible phpbb become a real social network!!
Sorry for my bad english, I'm Italian

superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: [DEV] Friend Request Approval MOD

Post by superj707 » Fri Jul 31, 2009 8:16 am

djrikyx wrote:
kmklr72 wrote:If there is anything else anyone wants to see in this MOD, now would be the time to tell me :) .
I think is a trouble do this, but i try to tell you if you want make for next release.

A Log system for friend request.
Example1: I send a friend request to User1, User1 see in a Log box: 'Djrikyx have requested to be friend with you.'
Example2: if User1 accept my request i see in my Log box: 'User1 have approved your friend request!'
if denied same thing but show 'User1 have denied your friend request.'
This is instead at PM notification. i think it's better :)

Other thing, but is a double trouble (xD) in the same box, i can see what my friends does.

Example: User1 it's my friend, User1 become friend of User2, and i see in my log Box:
'User1 it' now a friend of User2'

if this is possible phpbb become a real social network!!

wow you are full of awesome great excellent ideas.

User avatar
stathisch
Registered User
Posts: 145
Joined: Fri Jul 24, 2009 11:33 am
Location: Greece
Contact:

Re: [DEV] Friend Request Approval MOD

Post by stathisch » Fri Jul 31, 2009 9:36 am

About the Log box you're saying, I believe this should be started by someone as a seperate MOD, especially if you want to include friend actions.

kmklr72
Registered User
Posts: 477
Joined: Sat Dec 29, 2007 9:37 pm
Location: St. Louis, USA
Name: Kevin

Re: [DEV] Friend Request Approval MOD

Post by kmklr72 » Fri Jul 31, 2009 5:35 pm

I don't know if I'll get it working but I'll see what I can do for a logging system in FRAM. Right now I'm having problems with the installer which is pretty much halting development on anything else.

Locked

Return to “[3.0.x] Abandoned MODs”