Skip to content

Commit

Permalink
完善前端代码
Browse files Browse the repository at this point in the history
  • Loading branch information
fooleap committed Apr 29, 2018
1 parent d0fdfc0 commit 28ea9dc
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 12,912 deletions.
13 changes: 6 additions & 7 deletions api/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 获取权限,简单封装常用函数
*
* @author fooleap <fooleap@gmail.com>
* @version 2018-04-26 17:26:55
* @version 2018-04-29 12:00:27
* @link https://github.com/fooleap/disqus-php-api
*
*/
Expand Down Expand Up @@ -350,12 +350,11 @@ function getUserData(){

function getForumData(){
global $data_path, $forum_data;
$fields_data = array(
'api_key' => DISQUS_PUBKEY,
'forum' => DISQUS_SHORTNAME,
$fields = (object) array(
'forum' => DISQUS_SHORTNAME
);
$curl_url = '/api/3.0/forums/details.json?'.http_build_query($fields_data);
$data = curl_get($curl_url);
$curl_url = '/api/3.0/forums/details.json?';
$data = curl_get($curl_url, $fields);
$forum = array(
'founder' => $data -> response -> founder,
'name' => $data -> response -> name,
Expand Down Expand Up @@ -412,7 +411,7 @@ function getCurrentDir (){
}

if( time() > $forum_data -> session -> expires || md5(DISQUS_PASSWORD) != $forum_data -> passwd ){
adminLogin();
//adminLogin();
}

if( time() > $forum_data -> forum -> expires || !$forum_data -> forum){
Expand Down
12 changes: 6 additions & 6 deletions api/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 登录
*
* @author fooleap <fooleap@gmail.com>
* @version 2018-03-10 14:01:48
* @version 2018-04-27 13:46:11
* @link https://github.com/fooleap/disqus-php-api
*
*/
Expand All @@ -23,11 +23,11 @@

$authorize = 'authorization_code';
$fields = array(
'grant_type'=>urlencode($authorize),
'client_id'=>urlencode(PUBLIC_KEY),
'client_secret'=>urlencode(SECRET_KEY),
'redirect_uri'=>urlencode($redirect),
'code'=>urlencode($CODE)
'grant_type'=>$authorize,
'client_id'=>PUBLIC_KEY,
'client_secret'=>SECRET_KEY,
'redirect_uri'=>$redirect,
'code'=>$CODE
);
$user_id = getAccessToken($fields);
if( $user_id ){
Expand Down
6 changes: 4 additions & 2 deletions api/postcomment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @param url 访客网址,可为空
*
* @author fooleap <fooleap@gmail.com>
* @version 2018-04-26 17:17:55
* @version 2018-04-29 11:59:39
* @link https://github.com/fooleap/disqus-php-api
*
*/
Expand Down Expand Up @@ -56,8 +56,10 @@
'author_name' => $author_name,
'author_email' => $author_email,
'author_url' => $author_url,
'state' => $approved
);
if( !!$session ){
$post_data -> state = $approved;
}
}

$data = curl_post($curl_url, $post_data);
Expand Down
2 changes: 1 addition & 1 deletion dist/iDisqus.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/iDisqus.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 28ea9dc

Please sign in to comment.