小编Pat*_*rik的帖子

如何使用Facebook的API检查用户是否喜欢我的Facebook页面或URL

我想我会疯了.我无法让它发挥作用.
我只想检查用户是否喜欢我的iFrame应用程序中的javascript页面.

FB.api({
    method:     "pages.isFan",
    page_id:        my_page_id,
},  function(response) {
        console.log(response);
        if(response){
            alert('You Likey');
        } else {
            alert('You not Likey :(');
        }
    }
);
Run Code Online (Sandbox Code Playgroud)

返回:False
但我是我的页面的粉丝,所以不应该返回true?!

javascript facebook facebook-graph-api

101
推荐指数
4
解决办法
15万
查看次数

俄语月份名称错误

我正在开发一个网站,我的客户来自俄罗斯。他说,新闻中的月份翻译是错误的。

\n\n

例如,九月:

\n\n
    \n
  • 我从 php 得到这个:\xd0\xa1\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8c
  • \n
  • 这是他的:\xd0\xa1\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8f
  • \n
\n\n

我怎样才能覆盖这个?

\n\n

说明:\n使用区域设置时ru_RU,输出的月份名称将为俄语。但据我的客户说,月份的名称是错误的。我不会说俄语,所以我不知道他是对还是错

\n\n

我刚刚看到,如果我将日期从: 翻译8th of September 2011成俄语,它将看起来像这样:8 \xd1\x81\xd0\xb5\xd0\xbd\xd1\x82\xd1\x8f\xd0\xb1\xd1\x80\xd1\x8f 2011看翻译

\n\n

因此,解决该问题的方法可能是重写日期格式。

\n\n

我还没有解决这个问题;显然这是一个错误/缺失的功能,因为俄罗斯的先进的词尾变化。而且我需要的日期格式不存在。我认为这会影响strftimePHPdate()

\n\n

有人可以验证这一点吗?

\n

php strftime

5
推荐指数
1
解决办法
3495
查看次数

获取tt_content uid

我正在开发一个扩展,允许管理员将东西保存到数据库.

我希望扩展的每个实例都应该在数据库中拥有它自己的Id.有没有办法在扩展php中获取tt_content uid(我猜是扩展实例Id).

php typo3

5
推荐指数
1
解决办法
6360
查看次数

删除未连接到分支的提交

我想合并来自另一个存储库的一些更改,因此我添加了远程、获取并合并。但我没想到会添加另一个分支的提交。

我支持合并中的一项提交,并手动添加更改的文件并推送该提交。

所以现在我在一个分支中有两个断开连接的提交树。像这样的东西:

A-B-C-D-master
1-2-3-4
Run Code Online (Sandbox Code Playgroud)

我只想删除 1-2-3-4 提交。我不关心历史记录或任何子/父提交或文件。
我想保留 ABCD 提交以及所有历史记录。

我努力了:

git reflog expire --expire-unreachable=now --all
git gc --prune=all --aggressive

git rebase [hash]
Run Code Online (Sandbox Code Playgroud)

但似乎没有任何作用。

git

4
推荐指数
1
解决办法
2156
查看次数

用jQuery动画图标

我用jquery动画了一个图标.第一个周期是好的,但是当它重新开始下一个周期时,整个事情就会加速.有谁知道为什么?

我不知道这是否是最佳方式,但我不知道其他任何方式.
它不是gif的原因是alpha透明度.

示例:http: //jsbin.com/ESuGAXe/1/edit?js,output

jQuery的:

jQuery(function() {
    var plusicon = jQuery('.icon.plus');
    animateIcon(plusicon, 3000);

    function animateIcon(plusicon, duration) {
        jQuery('.sprite1', plusicon).stop(true).animate({'opacity':0}, duration, function() {
            jQuery('.sprite2', plusicon).stop(true).animate({'opacity':0}, duration, function() {
                jQuery('.sprite3', plusicon).stop(true).animate({'opacity':0}, duration, function() {
                    animateIcon();
                });
                jQuery('.sprite1', plusicon).stop(true).animate({'opacity':1}, duration);
            });
            jQuery('.sprite3', plusicon).stop(true).animate({'opacity':1}, duration);
        });
        jQuery('.sprite2', plusicon).stop(true).animate({'opacity':1}, duration);
    }
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery

2
推荐指数
1
解决办法
305
查看次数

Typoscript:如果页面不相等

我正在尝试在其包含的页面的子页面上包含一个typoscript.

在页面ID 272我已在设置中包含一个typoscript文件:

<INCLUDE_TYPOSCRIPT: source="FILE:fileadmin/templates/typoscript/fancyBoxPopup.ts">
Run Code Online (Sandbox Code Playgroud)

而且我只希望这个typoscript在那些页面上运行.所以我尝试了这个:

[globalVar = TSFE:id!= 252,253,254,270,272,271,273,274]

但这使得脚本在所有子节点和父节点上运行(声明中列出的那些)
以下是完整的脚本:

[globalVar = TSFE:id != 252, 253, 254, 270, 272, 271, 273, 274]
    page.includeJS >
    page.includeJS.ieFixes = fileadmin/templates/js/ieFixes.js

    columnWidth {
        page {
            main = 400
        }
    }
[end]   
Run Code Online (Sandbox Code Playgroud)

typo3 typoscript

1
推荐指数
1
解决办法
2789
查看次数

lambda 创建事件事件的权限:PutEvents

我想要一个 lambda 创建 EventBridge 事件,但在调用 lambda 时出现此错误:

User: arn:aws:sts::120293923901:assumed-role/MyApiOrdersPostFunct-I1QOYC7P1R0Z/MyApiOrdersPostFunct-SJtAeYoiaguW is not authorized to perform: events:PutEvents on resource: arn:aws:events:eu-north-1:120293923901:event-bus/MyApiEventBus because no identity-based policy allows the events:PutEvents action
Run Code Online (Sandbox Code Playgroud)

我添加了政策但没有改变。

这是 lambda 调用 eventbridge。

User: arn:aws:sts::120293923901:assumed-role/MyApiOrdersPostFunct-I1QOYC7P1R0Z/MyApiOrdersPostFunct-SJtAeYoiaguW is not authorized to perform: events:PutEvents on resource: arn:aws:events:eu-north-1:120293923901:event-bus/MyApiEventBus because no identity-based policy allows the events:PutEvents action
Run Code Online (Sandbox Code Playgroud)

这是 CDK 配置。有两个策略(attachInlinePolicy、addToRolePolicy),因为我测试了这两个策略。


import { APIGatewayProxyHandler, APIGatewayProxyResult } from 'aws-lambda';
import { EventBridgeClient, PutEventsCommand } from '@aws-sdk/client-eventbridge';

const eventBridge = new EventBridgeClient({ region: 'eu-north-1' });

export const post: APIGatewayProxyHandler = …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-iam aws-lambda aws-cdk aws-event-bridge

0
推荐指数
1
解决办法
6860
查看次数