好!欢迎访问迷津渡口 现在时间是: 天气 °C ~ °C

迷津渡口

越感到迷惑 越接近真理

修复emlog分类计数的BUG

Emlog总分类的文章数竟然不包含子分类的文章数,于是总分类出现文章数量为0的尴尬局面。

愁死小指了,怎么办呢?修改module.php里面的widget_sort函数呗。

版本一:输出子分类(子分类太多看版本二)

<?php
//widget:分类
function widget_sort($title){
	global $CACHE;
	$sort_cache = $CACHE->readCache('sort'); ?>
<div class="sidebar">
	<h3><?php echo $title;?></h3>
	<ul id="blogsort">
	<?php
	foreach($sort_cache as $value):
		if ($value['pid'] != 0) continue;
		$logsnum = $value['lognum'];
	?>
	<?php if (!empty($value['children'])): ?>
		<?php
		$children0 = $value['children'];
		foreach ($children0 as $key):
			$value0 = $sort_cache[$key];
			$logsnum += $value0['lognum'];
		endforeach; ?>
	<?php endif; ?>
	<li><a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $logsnum; ?>)</a>	
	<?php if (!empty($value['children'])): ?>
		<ul>
		    <?php
		        $children = $value['children'];
		        foreach ($children as $key):
			    $value = $sort_cache[$key];
		    ?>
		        <li><a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $value['lognum'] ?>)</a></li>
		        <?php endforeach; ?>
		</ul>
	<?php endif; ?>
	</li>
	<?php endforeach; ?>
	</ul>
</div>	
<?php }?>

版本二:仅输出总分类

<?php
//widget:分类
function widget_sort($title){
	global $CACHE;
	$sort_cache = $CACHE->readCache('sort'); ?>
<div class="sidebar">
	<h3><i class="fa fa-folder mar-r-4"></i><?php echo $title;?></h3>
	<ul id="blogsort">
	<?php
	foreach($sort_cache as $value):
		if ($value['pid'] != 0) continue;
		$logsnum = $value['lognum'];
	?>
	<?php if (!empty($value['children'])): ?>
		<?php
		$children0 = $value['children'];
		foreach ($children0 as $key):
			$value0 = $sort_cache[$key];
			$logsnum += $value0['lognum'];
		endforeach; ?>
	<?php endif; ?>
	<li><a href="<?php echo Url::sort($value['sid']); ?>"><?php echo $value['sortname']; ?>(<?php echo $logsnum; ?>)</a></li>
	<?php endforeach; ?>
	</ul>
</div>	
<?php }?>


够周到了吧,该点赞的点赞,该回复的回复嘞~

点赞0
 标签: emlog分类计数bug
   支持一下
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
 点赞
 签到
 表情
 图片
 代码
提交评论

清空信息
关闭评论
chaiwanmei
 chaiwanmei 2018-12-17 08:48回复
#11
<a href="http://www.sitopromo.com/nike-air-force-1-low-red-skor">nike air force 1 low red</a> <a href="http://www.michellestill.com/billig-nike-air-max-90-premium-menns-gull-sportsg">billig nike air max 90 premium menns gull</a> <a href="http://www.wearechicanos.com/lebron-james-air-max-7-black-footc">lebron james air max 7 black</a> <a href="http://www.nhadatmoivn.com/hermes-belt-h-buckle-price-hermesr">hermes belt h buckle price</a> <a href="http://www.walkerhut.com/bon-march%C3%A9-nike-air-max-2011-femmes-noir-runningf">bon march茅 nike air max 2011 femmes noir</a> <a href="http://www.infotostudio.com/air-jordan-future-volt-for-sale-los-angeles-shoesg">air jordan future volt for sale los angeles</a>
chaiwanmei http://www.chaiwanmei.com/
exomotors
 exomotors 2018-12-02 07:57回复
#10
<a href="http://www.torsenli.com/billig-nike-hyperdunk-2016-dam%C3%A4nner-orange-footb">billig nike hyperdunk 2016 dam盲nner orange</a> <a href="http://www.grafiscar.com/silver-mens-nike-free-run-2-trainersd">silver mens nike free run 2</a> <a href="http://www.gfatraining.com/fendi-new-bags-collection-fendir">fendi new bags collection</a> <a href="http://www.tubomet.com/free-run-4.0-v2-womens-yellow-runningc">free run 4.0 v2 womens yellow</a> <a href="http://www.theuntoldlost.com/kobe-12-all-black-flag-sneakere">kobe 12 all black flag</a> <a href="http://www.agnnetworks.com/north-face-vest-womens-northfacer">north face vest womens</a>
exomotors http://www.exomotors.com/
burayagidin
 burayagidin 2018-11-30 13:14回复
#9
<a href="http://www.femmedeguinee.com/nike-flyknit-white-men-skot">nike flyknit white men</a> <a href="http://www.hollerrealtor.com/billig-nike-hyperdunk-2014-low-dam%C3%A4nner-lila-sneakere">billig nike hyperdunk 2014 low dam盲nner lila</a> <a href="http://www.psychedelicsf.com/air-jordan-1-foamposite-paranorman-x-runninga">air jordan 1 foamposite paranorman x</a> <a href="http://www.kristyhuston.com/mackage-coat-with-black-fur-mackager">mackage coat with black fur</a> <a href="http://www.minruteguide.com/nike-cortez-oatmeal-runninga">nike cortez oatmeal</a> <a href="http://www.dennygorman.com/prada-brown-loafers-pradar">prada brown loafers</a>
burayagidin http://www.burayagidin.com/
lacosmeticink
 lacosmeticink 2018-11-20 16:18回复
#8
<a href="http://www.nowminning.com/curry-one-black-taxi-skoe">curry one black taxi</a> <a href="http://www.tryautolikes.com/adidas-superstar-2-dust-pink-farm-print-trainersd">adidas superstar 2 dust pink farm print</a> <a href="http://www.melekmelodifm.com/lebron-12-upcoming-box-trainerse">lebron 12 upcoming box</a> <a href="http://www.myelectricrc.com/asics-gel-quantum-360-gold-purple-trainersa">asics gel quantum 360 gold purple</a> <a href="http://www.marijuanapeer.com/new-balance-577-herre-gr%C3%A5-sneakerc">new balance 577 herre gr氓</a> <a href="http://www.pritoi.com/purple-converse-shoesz">purple converse</a>
lacosmeticink http://www.lacosmeticink.com/
avonew
 avonew 2018-11-16 17:09回复
#7
<a href="http://www.sncforu.com/air-jordan-7-retro-university-blue-white-yellow-footb">air jordan 7 retro university blue white yellow</a> <a href="http://www.occformacion.com/nike-dunk-high-herre-r%C3%B8d-foote">nike dunk high herre r酶d</a> <a href="http://www.poteputi.com/new-balance-420-hvit-skor">new balance 420 hvit</a> <a href="http://www.artikhazirsin.com/air-jordan-b-mo-black-red-trainersf">air jordan b mo black red</a> <a href="http://www.milligande.com/bvlgari-white-ceramic-ring-price-jewelryr">bvlgari white ceramic ring price</a> <a href="http://www.kokismith.com/roshe-run-grey-white-black-sole-footb">roshe run grey white black sole</a>
avonew http://www.avonew.com/
eatisrael
 eatisrael 2018-11-16 07:09回复
#6
<a href="http://www.bharatovation.com/jordan-1-real-low-sportsf">jordan 1 real low</a> <a href="http://www.donareseguros.com/billig-adidas-superstar-dam%C3%A4nner-rosa-runningb">billig adidas superstar dam盲nner rosa</a> <a href="http://www.cierreplus.com/nike-free-flyknit-4.0-tight-up-skob">nike free flyknit 4.0 tight up</a> <a href="http://www.flypiip.com/nike-hyperdunk-2016-womens-white-black-shoese">nike hyperdunk 2016 womens white black</a> <a href="http://www.jimmysjulyjam.com/hermes-constance-colors-hermesr">hermes constance colors</a> <a href="http://www.cakeeaterspgh.com/time-navy-denver-broncos-47-nfl-game-xp-new-era-47-closer-cap-hata">time navy denver broncos 47 nfl game xp new era 47 closer cap</a>
eatisrael http://www.eatisrael.com/
qrsdeals
 qrsdeals 2018-11-13 09:48回复
#5
<a href="http://www.hirepeyton.com/billig-nike-sko-2018-herre-bl%C3%A5-trainersg">billig nike sko 2018 herre bl氓</a> <a href="http://www.cphwph.com/coach-double-corner-zip-wristlet-coachr">coach double corner zip wristlet</a> <a href="http://www.myfoxbeaumont.com/salvatore-ferragamo-belt-sale-uk-beltr">salvatore ferragamo belt sale uk</a> <a href="http://www.kathimartuza.com/air-jordan-17-shoesm">air jordan 17</a> <a href="http://www.cheryberber.com/air-jordan-7-retro-mulberry-lavender-shoesc">air jordan 7 retro mulberry lavender</a> <a href="http://www.gdaypeter.com/nobis-merideth-parka-nobisr">nobis merideth parka</a>
qrsdeals http://www.qrsdeals.com/
guntruther
 guntruther 2018-11-09 07:50回复
#4
<a href="http://www.artikhazirsin.com/lebron-12-heart-of-the-lion-for-sale-skoe">lebron 12 heart of the lion for sale</a> <a href="http://www.audioalpaca.com/nike-air-max-2014-flyknit-for-sale-skoc">nike air max 2014 flyknit for sale</a> <a href="http://www.selvasurf.com/womens-nike-air-max-90-vt-gold-grey-shoesc">womens nike air max 90 vt gold grey</a> <a href="http://www.coldditch.com/bon-march%C3%A9-asics-gel-noosa-tri-7-hommes-rouge-trainersb">bon march茅 asics gel noosa tri 7 hommes rouge</a> <a href="http://www.grassmannword.com/barato-nike-free-v3-hombres-amarillo-skob">barato nike free v3 hombres amarillo</a> <a href="http://www.mjchronicles.com/nike-air-force-1-clear-air-max-sneakerb">nike air force 1 clear air max</a>
guntruther http://www.guntruther.com/
ftpronto
 ftpronto 2018-11-05 14:32回复
#3
<a href="http://www.btntextil.com/nike-limited-mens-pittsburgh-steelers-84-antonio-brown-80th-anniversary-throwback-nfl-jersey-89.99-nflv">nike limited mens pittsburgh steelers 84 antonio brown 80th anniversary throwback nfl jersey 89.99</a> <a href="http://www.ratedpractice.com/asics-gel-kayano-20-electric-orange-urine-shoesg">asics gel kayano 20 electric orange urine</a> <a href="http://www.joemaniophoto.com/billig-asics-gel-kinsei-5-dam%C3%A4nner-silber-shoesb">billig asics gel kinsei 5 dam盲nner silber</a> <a href="http://www.rakebackhero.com/parajumpers-jacket-new-york-parajumpersr">parajumpers jacket new york</a> <a href="http://www.exetervanhire.com/coach-audrey-sunglasses-coachr">coach audrey sunglasses</a> <a href="http://www.webdevbook.com/2014-15-real-madrid-2-varane-away-pink-soccer-long-sleeve-shirt-kit-nflv">2014 15 real madrid 2 varane away pink soccer long sleeve shirt kit</a>
ftpronto http://www.ftpronto.com/
dave wei脽 jordan 1
 dave wei脽 jordan 1 2018-08-28 10:58回复
#2
<a href="http://www.poweringamericaradio.com/sunglassesoutlet_en/cheap-monster-dog-sunglasses-from-oakley">cheap monster dog sunglasses from oakley</a><a href="http://www.poweringamericaradio.com/sunglassessale_en/discount-ray-ban-rb4165-india">discount ray ban rb4165 india</a><a href="http://www.poweringamericaradio.com/sunglasseswholesale_en/oakley-ten-oo9128-07">oakley ten oo9128 07</a><a href="http://www.poweringamericaradio.com/uggclearance_en/ugg-5854-sale-ga">ugg 5854 sale ga</a>
dave wei脽 jordan 1 http://www.iconhoteljacksonville.com/sneakerfactory_de/dave-wei%c3%9f-jordan-1
顶部留言底部
 00:00/00:00
我想和你虚度时光 - 花房姑娘(9)
  1. 我想和你虚度时光
  2. 花房姑娘
  3. 恋恋风尘
  4. 我喜爱一切不彻底的事物
  5. 我的心里是满的
  6. Long Way
  7. 给少年的歌
  8. 晴日共剪窗
  9. 天上的月你的脸