SELECT pa_ContactID,t_ContactName FROM Profiles as P INNER JOIN Categories_ContactsCategories AS CC ON ( CC.pi_contactID = pa_ContactID AND (pi_CategoryID =507 OR pi_CategoryID IN (SELECT pa_CategoryID FROM Categories WHERE pi_ParentID=397) )) inner join Profiles_MediaObjects as PM on (PM.pi_MediaObjectID=pa_ContactID) where P.b_Deleted=0 and P.b_Completed=1 and b_featured=0 and ( (t_picsFolder='place' and b_Status=1) OR (t_picsFolder!='place') ) and ( (t_picsFolder='event' and pa_ContactID in (select pi_ContactID FROM Profiles_Events WHERE pi_ContactID=pa_ContactID and ((d_EndDate='0000-00-00') Or (d_EndDate ='2014-04-19' and (d_EndTime >= '08:00:00' OR d_EndTime ='00:00:00')) OR (d_EndDate >'2014-04-19')) and NotImportant=0)) OR (t_picsFolder!='event') ) and ( (t_picsFolder='movie' and 1 in (select b_PlayingNow FROM Profiles_Movies WHERE pi_MovieID=pa_ContactID))OR (t_picsFolder!='movie') ) and ((PM.pi_Typeid!=0) OR (PM.pi_MediaObjectID in (select pi_MediaObjectID from MediaObjects_Authors))) and b_closed=0 and pa_ContactID not in (15756,15755,15754) group by pa_ContactID order by d_DateAdded DESC
:: Beirut.com :: Beirut City Guide