Hey, I’m thinking about a good solution for the following problem:

We’ve an online social network. And the users have the possibility to ignore
/ block other user.
For example: When a userA blocks userB,  userB should see just a limited
profile of userA and shouldn’t see his profile pic on some list ( i.e. the
online user list ), also userB shouldn’t be able to write userA a message.
What is the best way to manage this problem? 
Should I create a list of the ignored User every time someone calls an
action and then use this list to check in the Model if there is a User which
ignores him?
Because I wont like to call a function ( to check if the user ignores him )
in a loop for a list ( i.e. to show the online user ) every single time.  

 

I thought about this function: 

 

public function getIgnoreList($checkIgnoreUser=null)

{

                        if ($checkIgnoreUser==null)

                                   return false;

 

                        $c = new Criteria();

 
$c->clearSelectColumns()->addSelectColumn(IgnorelistPeer::BOOKED_ID.' AS
ignMember');

                        $c->add(IgnorelistPeer::MEMBERS_ID, $this->getId());

 

                        $c2 = new Criteria();

 
$c2->clearSelectColumns()->addSelectColumn(IgnorelistPeer::MEMBERS_ID.' AS
ignMember');

                        $c2->add(IgnorelistPeer::BOOKED_ID, $this->getId());

 

                        $ign1 = IgnorelistPeer::doSelectRS($c);

                        $ign2 = IgnorelistPeer::doSelectRS($c2);

 

                        while ($ign1->next())

                        {

                                   $ignoreList1[] = $ign1->get("0");

                        }

 

                        while ($ign2->next())

                        {

                                   $ignoreList2[] = $ign2->get("0");

                        }

                        $this->ignoreList =
array_unique($ignoreList1,$ignoreList2);

}

 

Any help or suggestions would be really appreciated…

Thanks,

Marco

 

-- 
Marco Schierhorn 
Technical Director 

-------------------------------------------------------------------

ESV Media GmbH
Meerbuscher Str. 64-78 | 40670 Meerbusch
Tel. +49 (0)2159 / 9297-930 | Fax. +49 (0)2159 / 9297-931
Mobil +49 (0)173 / 99 37 000
www.esv-group.de | [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 

Geschäftsführer: Heinz Eissing
Amtsgericht | Neuss HRB 12902 

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser E-Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to