Browse Source

修复部分网站图标不显示的问题

pull/4/merge
xiaoz 4 years ago
parent
commit
d3cede4dff
  1. 14
      controller/index.php
  2. 2
      templates/default/index.php

14
controller/index.php

@ -76,6 +76,20 @@ function is_login(){ @@ -76,6 +76,20 @@ function is_login(){
return false;
}
}
//将URL转换为base64编码
function base64($url){
$urls = parse_url($url);
//获取请求协议
$scheme = empty( $urls['scheme'] ) ? 'http://' : $urls['scheme'].'://';
//获取主机名
$host = $urls['host'];
//获取端口
$port = empty( $urls['port'] ) ? '' : ':'.$urls['port'];
$new_url = $scheme.$host.$port;
return base64_encode($new_url);
}
// 载入前台首页模板
require('templates/'.TEMPLATE.'/index.php');
?>

2
templates/default/index.php

@ -166,7 +166,7 @@ @@ -166,7 +166,7 @@
<span class="label label-info" data-toggle="tooltip" data-placement="left" title="" data-original-title="Hello I am a Tooltip"></span>
<div class="xe-comment">
<a href="#" class="xe-user-name overflowClip_1">
<img src="https://favicon.rss.ink/?url=<?php echo $link['url']; ?>" alt="HUAN" width="16" height="16" />
<img src="https://favicon.rss.ink/v1/<?php echo base64($link['url']); ?>" alt="HUAN" width="16" height="16" />
<strong><?php echo $link['title']; ?></strong>
</a>
<p class="overflowClip_2"><?php echo $link['description']; ?></p>

Loading…
Cancel
Save