Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions duoshuo/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
</script>
<?php
if($this->isSSL()){
?>
<script type="text/javascript" src="https://static.<?php echo self::DOMAIN;?>/embed.js" charset="UTF-8" async="async"></script>
<?php
} else {
?>
<script type="text/javascript" src="http://static.<?php echo self::DOMAIN;?>/embed.js" charset="UTF-8" async="async"></script>
<?php
}
?>
<script type="text/javascript" src="<?php echo($this->isSSL()?'https':'http');?>://static.<?php echo self::DOMAIN;?>/embed.js" charset="UTF-8" async="async"></script>
<?php
}

Expand All @@ -636,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);
})();
</script><?php
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
'sync_log' => 1,
);
?>
<iframe id="duoshuo-remote-window" src="<?php echo 'http://' . self::DOMAIN . '/connect-site/?'. http_build_query($params, null, '&');?>" style="width:100%;height:580px;"></iframe>
<iframe id="duoshuo-remote-window" src="<?php echo DUOSHUO_RES_PERFIX . self::DOMAIN . '/connect-site/?'. http_build_query($params, null, '&');?>" style="width:100%;height:580px;"></iframe>
</div>
1 change: 1 addition & 0 deletions duoshuo/duoshuo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()){
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '&');
?>
<div class="wrap">
<?php screen_icon(); ?>
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '&');
?>
<div class="wrap">
<?php screen_icon(); ?>
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '&');
?>
<link rel="stylesheet" href="<?php echo $this->pluginDirUrl; ?>styles.css" type="text/css" />

Expand Down
4 changes: 2 additions & 2 deletions duoshuo/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@
handler = function(e){
var service = this.className.match(/ds\-(\w+)/)[1],
message = <?php echo json_encode('我的' . get_option('blogname') . '(' .get_option('siteurl') . ')装了');?> + duoshuoName[service] + ' 评论插件,用微博、QQ、人人帐号就能登录评论了,很给力。来试试吧!',
image = 'http://static.duoshuo.com/images/top.jpg',
image = <?php echo DUOSHUO_RES_PERFIX;?>.'static.duoshuo.com/images/top.jpg',
title = '多说评论插件',
url = 'http://duoshuo.com';
url = <?php echo DUOSHUO_RES_PERFIX;?>'duoshuo.com';
window.open('http://<?php echo $this->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');
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, '&');
?>
<div class="wrap">
<?php screen_icon(); ?>
Expand Down
2 changes: 1 addition & 1 deletion duoshuo/themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ function loadDuoshuoThemes(json){
}
</script>

<script src="http://<?php echo $this->shortName;?>.duoshuo.com/api/sites/themes.jsonp?callback=loadDuoshuoThemes"></script>
<script src="<?php echo DUOSHUO_RES_PERFIX.$this->shortName;?>.duoshuo.com/api/sites/themes.jsonp?callback=loadDuoshuoThemes"></script>

</div>