Home > php教程 > PHP开发 > body text

ThinkPHP文章相关阅读功能的实现方法

WBOY
Release: 2016-06-07 17:23:39
Original
1489 people have browsed it

我们在网上阅读文章时,当阅读完一篇感兴趣的文章时,还不够尽兴,还想阅读一些相关的文章,在文章的末尾往下看,就会发现相关阅读列出和本次阅读的文章相关的篇章,我们点击又可以阅读了,节省了搜索时间。在注重用户体验的设计方面来说,相关阅读功能肯定是少不了的。


实现相关阅读的方法很多,这里是根据相同标签的方法去列出相关的文章,其原理是文章的标签如果相同,那么它们的标签的ID也会相同,因此列出一篇文章的相关文章其实就是列出和其标签相同的文章。


好了,进入正题吧。准备两张关联的表wb

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!