简体   繁体   English

通过用户朋友访问博客文章

[英]Accessing blog posts by a users friends

I am using the EasySocial and EasyBlog extensions on my current project. 我在当前项目中使用EasySocial和EasyBlog扩展。 I have successfully customized the majority of the codes myself, but I am having trouble with my current assignment. 我自己已经成功定制了大多数代码,但是我目前的工作遇到了麻烦。

I need to create a code for a module that will display ONLY the blog posts written by a users friends. 我需要为模块创建代码,该模块将仅显示由用户朋友撰写的博客文章。 I believe I need to start it something like: 我相信我需要像这样开始:

$friends = Foundry::model('friends')->getFriends( $userId );

Then I was thinking that I need to do a mysqli search query in order to find the blogs written by each of the users friends. 然后,我想我需要进行mysqli搜索查询,以便找到每个用户朋友写的博客。 Would it go something like this?: 会这样吗?:

$blogsearch = mysqli_query ($con, "SELECT * FROM tablename WHERE uid = '" . Foundry::user()->id . "' AND data LIKE '%MINIARTS%'");

For each ($friends), "SELECT * FROM tablename WHERE blogposts"

echo rand()

I know this is not the best start but I just desperately need some direction. 我知道这不是最好的开始,但我只是急需一些指导。

您可以从应用程序目录中使用Blog应用程序,该目录将显示用户个人资料中的Blog帖子。可从此处使用此免费应用程序EasyBlog Application

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM