Sorry...

I used array_unique($related_posts);

But after working on the idea more I scrapped what I had. The site Brian
pointed out was good...but my posts have many HABTM tables and different
situation use different tables so for now I have put it on hold until next
update. 

-----Original Message-----
From: westaussie [mailto:scott.sans...@gmail.com] 
Sent: June-09-09 12:27 AM
To: CakePHP
Subject: Re: Find similar - SOLVED


Hey Dave ... could you please elaborate on your solution to maybe help
someone else who has come up against something similar. That would be much
appreciated.

Scott

On Jun 9, 2:16 am, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> Never mind...i figured it out.
>
> Thanks.
>
> Dave
>
> -----Original Message-----
> From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com]
> Sent: June-08-09 3:30 PM
> To: cake-php@googlegroups.com
> Subject: RE: Find similar
>
> Cool! Thanks looks good.
>
> I have modified it a bit to suit my needs but 1 question not so much 
> related...
>
> My results returns the same post sometimes 2 or 3 times in the array. 
> If I am viewing a post tagged with TagA TagB TagC it will return PostA 
> 2 times if it was tagged with TagA and TagB
>
> Seems like its finding post with TagA , TagB, TagC so what I wantto do 
> is remove duplicate results before sending to the view. How can I 
> remove based on the Post.id?
>
> I do not have an array to compre against for array_diff_key()
>
> Ideas? Thoughts? Suggestions?
>
> Dave
>
> -----Original Message-----
> From: brian [mailto:bally.z...@gmail.com]
> Sent: June-08-09 2:11 PM
> To: cake-php@googlegroups.com
> Subject: Re: Find similar
>
> Have a look here:
>
> http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-...
> l-find
>
> On Sun, Jun 7, 2009 at 3:37 PM, Dave Maharaj ::
> WidePixels.com<d...@widepixels.com> wrote:
> > Wondering where to start on something like this.
>
> > Post HABTM Tags
>
> > Viewing a Post it may be tagged with "environament' , "earth" , "eco".
> > I want to add to the Post view a "Related Posts" section so how do I 
> > get Posts that were also tagged with all or any of the tags 
> > "environament' , "earth" , "eco".
>
> > Thanks,
>
> > Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to