在一个社交网站中,我想在sql server db中创建一个表来保存所有好友活动,这些活动将载入一个类似于facebook "News Feed“的页面中,这些活动的示例如下:
朋友添加了一张照片朋友更改了他的个人资料图片朋友喜欢照片朋友评论照片
因此,我创建了以下表:
Id uniqueidentifier
UserId uniqueidentifier -> The friend how did the activity
ObjectId uniqueidentifier -> entity id which the user did the activity
我的火药库里有一个现有的结构。
数据模型:
- users (collection)
- 9d5UCo4RtyTosiFAIvnPK4zFCUk1 ( each user is a separate document )
- trips ( collection )
- New York (Document)
- fields: date, description, photos:[url1, url2, ....] ( fields in the New York document), status:public
我正在使用Facebook的PHP SDK来尝试和获得最多的喜欢一个页面的照片,以便能够作为“英雄照片”使用。逻辑是,点赞和评论最多的照片看起来最有趣。
然而,我能想到的唯一方法是缓慢和笨拙的。
有比使用下面的方法更好的方法吗?
1. Query the Graph API for the albums belonging to a Page
2. Query the Graph API for Photos in each Album
3. Add the likes & comments for each photo
4. Re-order the list of photos a
我的图像不会被载入页面吗?我不知道是怎么回事,我已经做了很多网站,直到现在,但我认为我在我的代码错误。我正在尝试加载这个图像,但是它不会!:c
以下是代码:
<!DOCTYPE html>
<html>
<head>
<title>Error 404</title>
</head>
<body>
<h1>Oops!</h1>
<p>What you have just encountered is Error 404. This means that
我有一页要花很长时间才能载入。
原因是js脚本代码。
我将其设置为异步加载,但没有帮助。
有办法这样做吗?(在脚本中,我还从视图中引用了模型。)
PageView:
@section Scripts{
<script>
//Lots of code with functions and references to DOM and AJAX
</script>
}
_Layout:
@if (IsSectionDefined("Scripts"))
{
@await RenderSectionAsync("