我应该使用什么结构来检查一个值是否为NULL在树枝模板?

让我首先说,我已经寻找这个问题的答案很长一段时间了……

我试图设置Facebook OAuth与我的应用程序,这是在我的机器上本地开发。Facebook授权的一切都很完美,直到我从使用localhost转移到另一个域名(仍然是我机器的本地域名)。现在我得到如下错误。

不能加载URL:这个URL的域不包括在应用程序的 域。要加载此URL,请添加所有域和子域 在你的应用程序设置的应用程序域字段。

我的hosts文件包含127.0.0.1 domain.dev(完美工作)

我的重定向在我的应用程序(使用Socialite)是http://domain.dev/auth/facebook/callback

在我的Facebook应用程序设置…

我的应用域名是Domain .dev 我的网站网址是http://domain.dev/ 我的有效OAuth重定向uri是 http://domain.dev/auth/facebook/callback

出现错误消息时的URL是..

https://www.facebook.com/v2.5/dialog/oauth?client_id=XXXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Fdomain.dev%2Fauth%2Ffacebook%2Fcallback&scope=email&response_type=code&state=0ztcKhmWwFLtj72TWE8uOKTcf65JmePtG95MZLDD

我不知道问题出在哪里。

屏幕截图1

屏幕截图2

在docker中,我想这样做:

git clone XYZ
cd XYZ
make XYZ

然而,因为没有cd命令,我每次都必须传入完整路径(使XYZ /fullpath)。对此有什么好的解决方案吗?

Facebook无法掌握我的og:图像文件,我已经尝试了所有常见的解决方案。我开始认为这可能与https://..有关。

I have checked http://developers.facebook.com/tools/debug and have zero warnings or errors. It is finding the images we linked to in the "og:image", but they're showing up blank. When we click the image(s), however, they DO exist and it takes is straight to them. It DOES show one image -- an image hosted on a non-https server. We've tried square images, jpegs, pngs, larger sizes and smaller sizes. We've put the images right in public_html. Zero are showing up. It's not a caching error, because when we add another og:image to the meta, FB's linter does find and read that. It DOES show a preview. The preview is blank. The only exception we're getting is for images that are not on this website. We thought maybe there was some anti-leach on cpanel or the .htaccess that was preventing the images from showing up, so we checked. There was not. We even did a quick < img src="[remote file]" > on an entirely different server and the image shows up fine. We thought maybe it was the og:type or another oddity with another meta tag. We removed all of them, one at a time and checked it. No change. Just warnings. The same code on a different website shows up without any issue. We thought maybe it was not pulling images because we're using the same product page(s) for multiple products (changing it based on the get value, ie, "details.php?id=xxx") but it's still pulling in one image (from a different url). Leaving any og:image or image_src off, FB does not find any images.

我已经山穷水尽了。如果我说我自己和其他人在这方面花了多少时间,你会感到震惊。问题是这是一个在线商店。我们绝对绝对不能没有图像。我们必须这么做。我们还有十多个其他网站……这是唯一一个有og:图像问题的。它也是唯一一个使用https的,所以我们认为这可能是问题所在。但我们在网上找不到任何这样的先例。

这些是元标签:

<meta property="og:title" content="[The product name]" /> 
<meta property="og:description" content="[the product description]" /> 
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-art-black.png" />
<meta property="og:image" content="http://www.[ADIFFERENTwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png" />
<meta property="og:image" content="https://www.[ourwebsite].com/images/ARShopHeader.png" />
<meta property="og:image" content="http://www.[ourwebsite].com/overdriven-blues-music-tshirt-art-black.JPG" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="https://www.[ourwebsite].com/apparel-details.php?i=10047" />
<meta property="og:site_name" content="[our site name]" />      
<meta property="fb:admins" content="[FB-USER-ID-NUMBER]"/>
<meta name="title" content="[The product name]" />
<meta name="description" content="[The product description]" />
<link rel="image_src" href="https://www.[ourwebsite].com/images/shirts/overdriven-blues-music-tshirt-details-black.png" />
<meta name="keywords" content="[four typical keywords]">
<meta name="robots" content="noarchive">

如果你想要它,这里有一个链接到我们一直在做的产品页面。[缩短链接,试图阻止这进入我们网站的搜索结果]:http://rockn.ro/114

编辑——

使用“see what facebook sees”刮刀工具,我们可以看到以下内容:

"image": [          
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-details-safari.png"
      },
      {
         "url": "https://www.[httpSwebsite].com/images/shirts/soul-man-soul-music-tshirt-art-safari.png"
      },
      {
         "url": "http://www.[theotherNONSECUREwebsite].com/wp-content/uploads/2011/06/ARS-Header-Shine2.png"
      }
   ],

我们测试了它为单个页面找到的所有链接。所有这些都是完全有效的图像。

编辑2 ----

我们尝试了一个测试,并在NONSECURE网站上添加了一个子域名(从该网站上的图像实际上可以通过facebook看到)。子域名为http://img.[nonsecuresite].com。然后,我们将所有图像放入主子域文件夹并引用它们。它不会把这些图片拉进FB。但是,它仍然会提取在不安全的主域上引用的任何图像。

发布的解决方案----

Thanks to Keegan, we now know that this is a bug in Facebook. To workaround, we placed a subdomain in a different NON-HTTPS website and dumped all images in it. We referenced the coordinating http://img.otherdomain.com/[like-image.jpg] image in og:image on each product page. We then had to go through FB Linter and run EVERY link to refresh the OG data. This worked, but the solution is a band-aid workaround, and if the https issue is fixed and we go back to using the natural https domain, FB will have cached the images from a different website, complicating matters. Hopefully this information helps to save someone else from losing 32 coding hours of their life.

我试图得到我的朋友的名字和id与图形API v2.0,但数据返回空:

{
  "data": [
  ]
}

当我使用v1.0时,以下请求一切正常:

FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
                                              NSDictionary* result,
                                              NSError *error) {
    NSArray* friends = [result objectForKey:@"data"];
    NSLog(@"Found: %i friends", friends.count);
    for (NSDictionary<FBGraphUser>* friend in friends) {
        NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);
    }
}];

但是现在我找不到朋友了!

我正在GitHub上写一个维基页面,我正在使用Markdown。

我的问题是我放了一个大的图像(这个图像在它自己的存储库中),我需要调整它的大小。

我尝试过不同的解决方案,但都不奏效:

![image](http://url.to/image.png "Title" {width=40px height=400px})

![image](http://url.to/image.png = 250x250)

![image](http://url.to/image.png = 250x)

[[http://url.to/image.png = 250x]]

有办法拿到它吗?

它最好没有HTML。

当使用Facebook Sharer时,Facebook将为用户提供使用从源中提取的几个图像中的一个作为他们的链接预览的选项。如何选择这些图像,以及如何确保页面上的任何特定图像始终包含在此列表中?

目标: 允许用户通过Facebook认证进入iOS应用程序,这需要访问我正在运行的受保护的web服务。

假设: 对于那些选择不使用Facebook登录的用户,有一个本地认证(和注册)系统。

细节:

假设我们希望为用户提供一种选择,让用户无需为我们的系统创建单独的帐户/凭据就可以登录Facebook。 因为我们支持自己的本地身份验证机制(用户名和密码),所以我们有自己的用户id,并发出一个身份验证令牌,该令牌在初始凭证验证之后用于后续交互。

我很惊讶Facebook在他们的开发者文档中没有这方面的最佳实践。所有现有的文档都假设你正在将facebook认证构建到一个网站中,或者是一个不需要认证服务的独立移动应用程序。

以下是我对这将如何设计的最初想法,但希望验证它是否正确。

Client pops the Facebook iOS Login UI User signs in with Facebook credentials and gets access token iOS App passes access token to our server Our server talks to FB graph API using access token to (a) validate the token and (b) get the FB user ID for that access token. e.g. Our server would call https://graph.facebook.com/me/?access_token=XYZ which would return profile info in a JSON object Assuming it's valid, our server extracts the User ID from the JSON object and checks whether the user already has an account. If so, we issue our own auth ticket to client to use for that session. If user doesn't have an account, we create a new one with the Facebook User ID, assign our own unique UserID and issue our auth ticket. Client then passes auth ticket back on subsequent interactions that need authentication.

这对我来说似乎是正确的方法,但不确定我是否错过了一些疯狂的基本内容,走上了错误的(复杂的)道路。

Facebook回调已经开始追加#_=_哈希下划线返回URL

有人知道为什么吗?解决方案是什么?

我试图使一个登录与Facebook可用在我的脚本。我已经做了一切,但当我试图登录Facebook帐户时,我从Facebook得到这个错误:

错误 应用程序没有设置:这个应用程序的开发人员没有设置这个应用程序正确的Facebook登录。

以下是错误截图:

什么好主意吗?