2 Star 5 Fork 1

广树 / Typecho_CYBER DIMENSION NEPTUNE_主题模板

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
page_link.php 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
广树 提交于 2018-02-26 17:15 . 增加友链
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
/**
* 友链
*
* @package custom
*/
$this->need('header.php');
?>
<div class="col-mb-12 post_content_body" id="main" role="main">
<h1 class="post-title" itemprop="name headline"><?php $this->title() ?></h1>
<div class="post_content_box">
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<div class="post-content" itemprop="articleBody">
<div class="page_link_body">
<div id="page_link_box" class="clearfix"></div>
<div id="page_link_content">
<?php $this->content(); ?>
</div>
</div>
</div>
</article>
<?php $this->need('comments.php'); ?>
</div>
</div><!-- end #main-->
<script>
$(document).ready(function() {
var page_li_el = $('#page_link_content li');
for(var i=0;i<page_li_el.length;i++){
var li_i = page_li_el.eq(i);
if(li_i[0].childElementCount === 2){
if(li_i.find('a').length===1 && li_i.find('img').length===1){
var link_url = li_i.find('a').attr('href');
var icon_url = li_i.find('img').attr('src');
var link_name = li_i.find('a').text();
var link_alt = li_i.find('img').attr('alt');
var link_html = '<a href="'+link_url+'" class="post_item type_link"><div class="post_bg_body"><img alt="'+link_alt+'" src="'+icon_url+'" class="link_item_img"></div><p class="link_url_box">'+link_name+'</p></a>';
$('#page_link_box').append(link_html);
li_i.remove();
}
}
if(li_i[0].childElementCount === 1){
if(li_i.find('a').length===1){
var link_url = li_i.find('a').attr('href');
var link_name = li_i.find('a').text();
var link_html = '<a href="'+link_url+'" class="post_item type_link"><div class="post_bg_body"><img alt="'+link_name+'" src="'+'<?php $this->options->themeUrl('img/icon_1.jpg');?>'+'" class="link_item_img"></div><p class="link_url_box">'+link_name+'</p></a>';
$('#page_link_box').append(link_html);
li_i.remove();
}
}
}
});
</script>
<?php $this->need('footer.php'); ?>
PHP
1
https://gitee.com/eeg1412/typecho_cyberdimensionneptune__theme_template.git
git@gitee.com:eeg1412/typecho_cyberdimensionneptune__theme_template.git
eeg1412
typecho_cyberdimensionneptune__theme_template
Typecho_CYBER DIMENSION NEPTUNE_主题模板
master

搜索帮助