What is the best way to create PHP Related Posts?

2

I have a system that I use, but I wanted to have a system to make the search for related posts more filtered, I currently use REGEXP SQL to do, I already used LIKE and the results did not please me, Anyone have any new ideas on how to do it?

    
asked by anonymous 07.03.2014 / 18:03

3 answers

1

In my opinion, the best way to create a system of related posts would be to use the concept of tags. Just like CMS's do, for example, Wordpress.

For each post you relate it with tags, keywords related to it, if I create a post about a car, for example a Camaro, I would put tags like for example: car, chevrolet, automobile, gasoline and so on on.

For this, you would need to create some tables in your database to make the relationship.

In a quick search , you can find publications that can help you.

Good luck and good studies;)

    
07.03.2014 / 18:50
1

The most likely thing is that you have to make the system that will serve you.

There are CMS's (Drupal, Wordpress), but you would have to do a migration of your system what

Depending on the situation it can be a lot more complicated.

    
07.03.2014 / 18:07
0

The best way is to create a field of type list, where you can manually specify the related posts, many plugins work exactly like this.

Sometimes the posts related by the automatic search, return posts with little cohesion and / or different directions that make use of similar key words. Unless you develop an algorithm there Google to relate posts.

Nobody better than the editor to know what the post in question really is.

You may also end up having a need to relate a specific post, and that solution will suit you perfectly.

You can create an automatic search of the ajax type to look for similar posts, and help in the ideal post search, as it happens when you create a question here in StackOverflow but leave the final decision always with the editor.

It's a quick and easy to deploy solution that's clear and functional.

And about LIKE , I invite you to view this video of the great Fábio Akita.

    
07.03.2014 / 19:40