Forum Moderators: coopster

Message Too Old, No Replies

Related articles

         

gonny

1:16 pm on Jun 28, 2008 (gmt 0)

10+ Year Member



Hi all!
How can get related articles reading one.

$tito3 = strtolower($title);
$query44 = $DB->query("SELECT id, title FROM news WHERE LOWER(titolo) LIKE '%{$tito3}%' ORDER BY id DESC");

this query show exactly articles with same titles. So, how can make to show articles which have some word same or similar with present article.

jatar_k

1:40 pm on Jun 28, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you would have to break up the title and do searches on parts of it. The hard thing with 'related' is you can build the relation any way you want

it could be any of the following

  • just search for recent articles
  • adopt a tag system so you could then search for tags that are the same
  • you could use categories and show other recent from the same category
  • split the title into words, remove words like the,and,to etc and do a couple searches for other stories with those words

    the term 'related' is a misnomer, they are only related based on how the person making the site decided to relate them. When it comes down to it you can show them the stories you want them to read (meaning get traffic to) and call it 'related'.

  • gonny

    1:57 pm on Jun 28, 2008 (gmt 0)

    10+ Year Member



    is what I wanted to know. how to divide the sentence in order to obtain the items that resemble to that article.

    jatar_k

    2:51 pm on Jun 30, 2008 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member



    you can use split [php.net] and then you could use each word in a query

    it's pretty intensive though, that's why some of the methods I posted above would speed this up significantly