最新公告:推荐好友购买联系客服领现金红包~

EMLOG将侧边栏的分类存档修改为两列

程序问题 主机帮助 534浏览

修改模版文件中的module.php文件,路径如下

根目录/content/templates/模版名称/module.php

分类修改为

<?php
//widget:分类
function widget_sort(title){
	globalCACHE;
	sort_cache =CACHE->readCache('sort'); ?>
	<dl>
	<dt><?php echo title; ?></dt><dd>
	<ul id="blogsort">
	<?php
	foreach(sort_cache as value):
		if (value['pid'] != 0) continue;
	?>
	<li style="width:40%; float:left;">
	<a href="<?php echo Url::sort(value['sid']); ?>"><?php echovalue['sortname']; ?>(<?php echo value['lognum'] ?>)</a>
	<a href="<?php echo BLOG_URL; ?>rss.php?sort=<?php echovalue['sid']; ?>"><img src="<?php echo TEMPLATE_URL; ?>images/rss.png" alt="订阅该分类"/></a>
	<?php if (!empty(value['children'])): ?>
		<ul>
		<?phpchildren = value['children'];
		foreach (children as key):value = sort_cache[key];
		?>
		<li>
			<a href="<?php echo Url::sort(value['sid']); ?>"><?php echovalue['sortname']; ?>(<?php echo value['lognum'] ?>)</a>
			<a href="<?php echo BLOG_URL; ?>rss.php?sort=<?php echovalue['sid']; ?>"><img src="<?php echo TEMPLATE_URL; ?>images/rss.png" alt="订阅该分类"/></a>
		</li>
		<?php endforeach; ?>
		</ul>		
	<?php endif; ?>
		</li>
	<?php endforeach; ?>
		</ul>
	</dd>
	</dl>
<?php }?>

归档修改为

<?php
//widget:归档
function widget_archive(title){
	globalCACHE; 
	record_cache =CACHE->readCache('record');
	?>
	<dl>
	<dt><?php echo title; ?></dt><dd>
	<ul id="record">
	<?php foreach(record_cache as value): ?>
	<li style="width:40%; float:left;"><a href="<?php echo Url::record(value['date']); ?>"><?php echo value['record']; ?>(<?php echovalue['lognum']; ?>)</a></li>
	<?php endforeach; ?>
		<div class="clear"></div>
	</ul>
	</dd>
	</dl>
<?php } ?>

对比原始代码可以发现添加的代码其实只有一个样式

 style="width:40%; float:left;

转载请注明:主机帮助 » EMLOG将侧边栏的分类存档修改为两列