我的Home > Instance > Action所有视图页面都有面包屑.如何从所有面包屑中删除"主页"链接?
$this->breadcrumbs=array(
'Keypairs'=>array('admin'),
'Manage',
);
Run Code Online (Sandbox Code Playgroud) 我已经添加了CodeIgniter-YouTube-API-Library,用于将视频文件上传到已注册的YouTube帐户.我手上有apikey,oauth密钥,oauth密码.我成功完成了上传.但目前的问题是当另一个用户尝试上传视频而不是上传到注册的YouTube帐户时,它会转到当前用户的YouTube帐户.如何通过提示用户登录注册帐户来避免这种情况.请建议解决方案.我正在使用以下代码.
public function request_youtube()
{
$params['key'] = 'ENTER YOUR GOOGLE CONSUMER KEY';
$params['secret'] = 'ENTER YOUR GOOGLE CONSUMER SECRET';
$params['algorithm'] = 'HMAC-SHA1';
$this->load->library('google_oauth', $params);
$data = $this->google_oauth->get_request_token(site_url('example/access_youtube'));
$this->session->set_userdata('token_secret', $data['token_secret']);
redirect($data['redirect']);
}
//This method will be redirected to automatically
//once the user approves access of your application
public function access_youtube()
{
$params['key'] = 'ENTER YOUR GOOGLE CONSUMER KEY';
$params['secret'] = 'ENTER YOUR GOOGLE CONSUMER SECRET';
$params['algorithm'] = 'HMAC-SHA1';
$this->load->library('google_oauth', $params);
$oauth = $this->google_oauth->get_access_token(false, $this->session->userdata('token_secret'));
$this->session->set_userdata('oauth_token', $oauth['oauth_token']);
$this->session->set_userdata('oauth_token_secret', $oauth['oauth_token_secret']);
} …Run Code Online (Sandbox Code Playgroud) 我必须从book(id,book_id,status)状态为的表中选择 3 行status=0。最初所有行都有status0。所以通过使用 select query.order by id 和 limit 3 我可以选择前 3 行。问题是如何将选定的行状态更新为1,因为它们被选中。
正在使用 PHP、CodeIgniter 和 MySQL,我可以在单个查询中完成吗?
例子:
id book_id status
1 100 0
2 101 0
3 102 0
4 103 0
5 104 0
6 105 0
Run Code Online (Sandbox Code Playgroud)
选择前 3 行后,该行的状态应更新为 1
id book_id status
1 100 1
2 101 1
3 102 1
4 103 0
5 104 0
6 105 0
Run Code Online (Sandbox Code Playgroud) 在标题中
<meta property="fb:admins" content="my id"/>
<meta property="fb:app_id" content="my api"/>
Run Code Online (Sandbox Code Playgroud)
并在身体
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ru_RU/all.js#xfbml=1&appId=my api";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Run Code Online (Sandbox Code Playgroud)
在HTML中
<div id="facebook">
<div class="fb-comments" data-href="<?= $this->productLink ?>" data-width="470" data-num-posts="10"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我发现问题 - 我用ajax加载我的网页,而且facebook代码不适用于ajax.如何在ajax之后呈现我的Facebook评论?执行该功能?
我已将yii CGridview的一列作为超链接.但是在点击它时,它会在同一个标签中打开链接地址.如何在新标签中打开链接地址?
array(
'header'=>'Name',
'name' => 'name',
'value' => 'CHtml::link($data->name, $data->site_url)',
'type' => 'raw',
),
Run Code Online (Sandbox Code Playgroud) 如何通过图形API或fql获取Facebook在过去30天内的总在线上线时间?
file_get_contents无法使用批量请求从Facebook获取fata.使用以下代码:
$url='https://graph.facebook.com/?batch=[{ "method": "POST", "relative_url":"method/fql.query?query=SELECT+first_name+from+user+where+uid=12345678"}]& access_token=xxxxxxx&method=post';
echo $post = file_get_contents($url,true);
it produces
Warning: file_get_contents(graph.facebook.com/?batch=[{ "method": "POST", "relative_url": "method/fql.query?query=SELECT+first_name+from+user+where+uid=12345"}]&access_to? ?ken=xxxx&method=post): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/user/workspace/fslo/test.php on line 9
Run Code Online (Sandbox Code Playgroud) 我有一个字符串AB0512CD123456并使用preg匹配如何将其转换为
Array[0]='AB';
Array[1]='05';
Array[2]='12CD12';
Array[3]='3456';
Run Code Online (Sandbox Code Playgroud)
这是第一个元素,大小为2,然后是2,6,4等.输入字符串可能是动态的.
php ×6
facebook ×2
yii ×2
ajax ×1
arrays ×1
breadcrumbs ×1
cgridview ×1
codeigniter ×1
facebook-fql ×1
google-api ×1
mysql ×1
plugins ×1
preg-match ×1
social ×1
string ×1
youtube ×1