婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網(wǎng)站建設(shè) > 建站知識 > 發(fā)布的文章顯示紅色日期或加上new字或new小圖片

發(fā)布的文章顯示紅色日期或加上new字或new小圖片

POST TIME:2020-04-03 22:03

給近三天(或當(dāng)天)發(fā)布的文章顯示紅色日期或加上new字或new小圖片等。
都是圍繞pubdate做文章,寫擴展的。
第2、3要注意的問題是:如:"<img src='new.gif' />中不能用雙引號,否則不行。
如果要給當(dāng)天的加,把 3600 * 24 * 3 改為 3600 * 24  即可。
1、==========紅色的日期========

  1. [field:pubdate runphp='yes']
  2. $a="<font color=red>".strftime('%m-%d',@me)."</font>";
  3. $b=strftime('%m-%d',@me);
  4. $ntime = time();
  5. $day3 = 3600 * 24 * 3;
  6. if(($ntime - @me) < $day3) @me = $a;
  7. else @me =$b;
  8. [/field:pubdate]


2、==========紅色的(new)========

  1. [field:pubdate runphp='yes']
  2. $aa=strftime('%m-%d',@me);
  3. $ntime = time();
  4. $tagtime = @me;
  5. $day3 = 3600 * 24 * 3;
  6. if($tagtime > $ntime-$day3) @me = "<font color='red'>(new)</font>";
  7. else @me = $aa;
  8. [/field:pubdate]


3、==========加new.gif小圖片========

  1. [field:pubdate runphp='yes']
  2. $aa=strftime('%m-%d',@me);
  3. $ntime = time();
  4. $tagtime = @me;
  5. $day3 = 3600 * 24 * 3;
  6. if($tagtime > $ntime-$day3) @me = "<img src='new.gif' />".$aa;
  7. else @me = $aa;
  8. [/field:pubdate]
  9.  
--------------------------------------------------------------------------------

一種很酷的時間效果
  1. [field:pubdate runphp="yes"]
  2. if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%H:%M",@me).'</FONT>';}
  3. else {@me=strftime("%m-%d",@me);}
  4. [/field:pubdate]


--------------------------------------------------------------------------------

DEDE seo小技巧加個百度搜索本篇文章
【<a href="javascript:" onclick='window.open("http://www.baidu.com/s?q1={dede:field name="title" /}&q2=&q3=&q4=&rn=10&lm=0&ct=1&ft=&q5=& amp;q6=你的網(wǎng)址")' target="_top" title="在百度搜索“{dede:field name="title" /}”相關(guān)內(nèi)容"><font color=red>在百度搜索更多繁體字</font></a>】

把你的網(wǎng)址改一下
或者

【<a href="javascript:" onclick='window.open("http://www.baidu.com/baidu?word={dede:field name="title" /}")' target="_top" title="在百度搜索“{dede:field name="title" /}”相關(guān)內(nèi)容"><font color=red>搜索舞步</font></a>】

--------------------------------------------------------------------------------

  1. 調(diào)用tag: {dede:field name='keywords' runphp='yes' }
  2. if(!empty(@me)){
  3. $kws = explode(' ',@me);
  4. @me = "";
  5. foreach($kws as $k){
  6. @me .= "<a href='/tag.php?/$k/'>$k</a> ";
  7. }
  8. @me= str_replace('+', ' ',trim(@me));
  9. }
  10.  



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 新巴尔虎右旗| 西贡区| 威远县| 荣昌县| 获嘉县| 焉耆| 兴化市| 台北县| 房产| 二连浩特市| 收藏| 牙克石市| 基隆市| 若羌县| 太保市| 浦东新区| 政和县| 富民县| 新丰县| 洮南市| 金湖县| 杭州市| 衡阳县| 金川县| 阿坝县| 兴安盟| 登封市| 房山区| 丰镇市| 临邑县| 万盛区| 禹州市| 阿尔山市| 枞阳县| 内乡县| 类乌齐县| 崇阳县| 融水| 凌源市| 顺昌县| 长宁县|