From 4e3d0421ec7f2e82f7c5a0d3ca4efa366b9d8faf Mon Sep 17 00:00:00 2001 From: LuoJia Date: Sat, 29 Nov 2014 11:59:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?https=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- duoshuo/WordPress.php | 12 +----------- duoshuo/config.php | 2 +- duoshuo/duoshuo.php | 1 + duoshuo/manage.php | 2 +- duoshuo/preferences.php | 2 +- duoshuo/profile.php | 2 +- duoshuo/settings.php | 4 ++-- duoshuo/statistics.php | 2 +- duoshuo/themes.php | 2 +- 9 files changed, 10 insertions(+), 19 deletions(-) diff --git a/duoshuo/WordPress.php b/duoshuo/WordPress.php index ba523bc..778912e 100644 --- a/duoshuo/WordPress.php +++ b/duoshuo/WordPress.php @@ -605,17 +605,7 @@ public function appendScripts(){ duoshuoQuery.sso.login += '&redirect_to=' + encodeURIComponent(window.location.href); duoshuoQuery.sso.logout += '&redirect_to=' + encodeURIComponent(window.location.href); -isSSL()){ -?> - - - - + 1, ); ?> - + diff --git a/duoshuo/duoshuo.php b/duoshuo/duoshuo.php index 2f89126..a9ac721 100644 --- a/duoshuo/duoshuo.php +++ b/duoshuo/duoshuo.php @@ -9,6 +9,7 @@ */ define('DUOSHUO_PLUGIN_PATH', dirname(__FILE__)); +define('DUOSHUO_RES_PERFIX',(@$_SERVER['HTTPS'] == "on")?'https://':'http://'); if (version_compare(PHP_VERSION, '5.0.0', '<')){ if(is_admin()){ diff --git a/duoshuo/manage.php b/duoshuo/manage.php index 9500d5b..fdb7e0b 100644 --- a/duoshuo/manage.php +++ b/duoshuo/manage.php @@ -3,7 +3,7 @@ $params = array( 'jwt' => $this->jwt(), ); -$adminUrl = 'http://' . $this->shortName . '.' . self::DOMAIN.'/admin/?' . http_build_query($params, null, '&'); +$adminUrl = DUOSHUO_RES_PERFIX . $this->shortName . '.' . self::DOMAIN.'/admin/?' . http_build_query($params, null, '&'); ?>
diff --git a/duoshuo/preferences.php b/duoshuo/preferences.php index 071c0c7..634bc7e 100644 --- a/duoshuo/preferences.php +++ b/duoshuo/preferences.php @@ -3,7 +3,7 @@ $params = array( 'jwt' => $this->jwt(), ); -$adminUrl = 'http://' . $this->shortName . '.' . self::DOMAIN . '/admin/settings/?' . http_build_query($params, null, '&'); +$adminUrl = DUOSHUO_RES_PERFIX . $this->shortName . '.' . self::DOMAIN . '/admin/settings/?' . http_build_query($params, null, '&'); ?>
diff --git a/duoshuo/profile.php b/duoshuo/profile.php index bdcb10e..5a0e76e 100644 --- a/duoshuo/profile.php +++ b/duoshuo/profile.php @@ -2,7 +2,7 @@ $params = array( 'jwt' => $this->jwt(), ); -$settingsUrl = 'http://' . self::DOMAIN . '/settings/?' . http_build_query($params, null, '&'); +$settingsUrl = DUOSHUO_RES_PERFIX . self::DOMAIN . '/settings/?' . http_build_query($params, null, '&'); ?> diff --git a/duoshuo/settings.php b/duoshuo/settings.php index c153d2a..0680b9e 100644 --- a/duoshuo/settings.php +++ b/duoshuo/settings.php @@ -194,9 +194,9 @@ handler = function(e){ var service = this.className.match(/ds\-(\w+)/)[1], message = + duoshuoName[service] + ' 评论插件,用微博、QQ、人人帐号就能登录评论了,很给力。来试试吧!', - image = 'http://static.duoshuo.com/images/top.jpg', + image = .'static.duoshuo.com/images/top.jpg', title = '多说评论插件', - url = 'http://duoshuo.com'; + url = 'duoshuo.com'; window.open('http://shortName . '.' . self::DOMAIN;?>/share-proxy/?service=' + service + '&url=' + encodeURIComponent(url) + '&message=' + encodeURIComponent(message) + '&title=' + encodeURIComponent(title) + '&images=' + image, '_blank', 'height=550,width=600,top=0,left=0,toolbar=no,menubar=no,resizable=yes,location=yes,status=no'); diff --git a/duoshuo/statistics.php b/duoshuo/statistics.php index 7c40ac1..674f5ba 100644 --- a/duoshuo/statistics.php +++ b/duoshuo/statistics.php @@ -3,7 +3,7 @@ $params = array( 'jwt' => $this->jwt(), ); -$adminUrl = 'http://' . $this->shortName . '.' . self::DOMAIN . '/admin/statistics/?' . http_build_query($params, null, '&'); +$adminUrl = DUOSHUO_RES_PERFIX . $this->shortName . '.' . self::DOMAIN . '/admin/statistics/?' . http_build_query($params, null, '&'); ?>
diff --git a/duoshuo/themes.php b/duoshuo/themes.php index 5f50108..3cec272 100644 --- a/duoshuo/themes.php +++ b/duoshuo/themes.php @@ -43,6 +43,6 @@ function loadDuoshuoThemes(json){ } - +
From 39c5e29d55802fc045627e8776cf5e7710609825 Mon Sep 17 00:00:00 2001 From: LuoJia Date: Fri, 5 Dec 2014 23:19:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDembed=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- duoshuo/WordPress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duoshuo/WordPress.php b/duoshuo/WordPress.php index 778912e..b934cf7 100644 --- a/duoshuo/WordPress.php +++ b/duoshuo/WordPress.php @@ -626,7 +626,7 @@ public function printScripts(){ ds.type = 'text/javascript'; ds.async = true; ds.charset = 'UTF-8'; - ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; + ds.src = ((document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'); (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); Date: Fri, 27 Feb 2015 20:31:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?echo=E8=A1=A5=E4=B8=8A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- duoshuo/WordPress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duoshuo/WordPress.php b/duoshuo/WordPress.php index b934cf7..c9e310e 100644 --- a/duoshuo/WordPress.php +++ b/duoshuo/WordPress.php @@ -605,7 +605,7 @@ public function appendScripts(){ duoshuoQuery.sso.login += '&redirect_to=' + encodeURIComponent(window.location.href); duoshuoQuery.sso.logout += '&redirect_to=' + encodeURIComponent(window.location.href); - +