当前位置首页 » 平台应用 » 插件扩展 » LBS^2 文章归档修改

特别推荐 LBS^2 文章归档修改

[ 2009-04-01 20:07 | 作者: zone | 评论: 1 | 浏览: 356 ] [ 字号:    ]
1、class/cache.asp

找到
 this.calendarHTML;
下面添加
 this.Archive;

找到
 if(Application(lbsNamespace+"cacheCalendar")!=undefined&&Application(lbsNamespace+"cacheCalendarDay")==(new Date()).getDate()){
 this.calendarHTML=Application(lbsNamespace+"cacheCalendar");
 }else{
 this.loadCalendar();
 }
下面添加
 if(Application(lbsNamespace+"cacheArchive")!=undefined){
 this.Archive=Application(lbsNamespace+"cacheArchive");
 }else{
 this.loadArchive();
 }

找到
 this.loadCalendar();
下面添加
  this.loadArchive();

找到
 // Load Calendar
 this.loadCalendar = function(){
上面添加
 // Load Archive
 this.loadArchive = function(){
 this.Archive = this.generateArchive();
 this.saveToCache(lbsNamespace+"cacheArchive",this.Archive);
 }

 // Generate Archive ------------------------------
 this.generateArchive = function(){
  var monArray=[lang["month_1"], lang["month_2"], lang["month_3"], lang["month_4"], lang["month_5"], lang["month_6"], lang["month_7"], lang["month_8"], lang["month_9"], lang["month_10"], lang["month_11"], lang["month_12"]];
 var tmpA=connBlog.query("SELECT Count(log_id) AS cnt, Year(log_postTime) AS pstyear, Month(log_postTime) AS pstmonth FROM [blog_Article] GROUP BY Year(log_postTime), Month(log_postTime) ORDER BY Year(log_postTime) Desc, Month(log_postTime) ASC");
 if(tmpA){
   var crtYear = tmpA[0]["pstyear"];
   var Archive="";
   var cntBr=0;
   for(var i=0;i<tmpA.length;i++){
 if (i==0) {Archive +=''+tmpA[i]["pstyear"]+' &raquo;<br />\n'}
 if (tmpA[i]["pstyear"]==crtYear){
 Archive += '<a href="default.asp?date='+tmpA[i]["pstyear"]+'-'+tmpA[i]["pstmonth"]+'" title=" '+tmpA[i]["cnt"]+' ">'+monArray[tmpA[i]["pstmonth"]-1]+'</a> ';
 cntBr++;
 if(cntBr==5){
 cntBr=0;
 Archive +="<br />\n";
 }
      }else{
 cntBr=1;
 Archive += '\n<br />'+tmpA[i]["pstyear"]+' &raquo;<br />\n';
 Archive += '<a href="default.asp?date='+tmpA[i]["pstyear"]+'-'+tmpA[i]["pstmonth"]+'" title=" '+tmpA[i]["cnt"]+' ">'+monArray[tmpA[i]["pstmonth"]-1]+'</a> ';
 crtYear = tmpA[i]["pstyear"];
      }
   }
 tmpA=/10f1ad1cc06f152380e5a6c39a33d6943fafd7da/;
   return Archive;
  }
 }

2、global.asp

在innerSidebar里加
 <div id="panelArchive" class="panel">
 <h5><%=lang["archive"]%></h5>
 <div class="panel-content">
 <%=theCache.Archive%>
 </div>
 </div>

3、lang/blog.asp

 t["archive"]="文章归档";

修改(不是必须)
 t["month_1"]="1月";
 t["month_2"]="2月";
 t["month_3"]="3月";
 t["month_4"]="4月";
 t["month_5"]="5月";
 t["month_6"]="6月";
 t["month_7"]="7月";
 t["month_8"]="8月";
 t["month_9"]="9月";
 t["month_10"]="10月";
 t["month_11"]="11月";
 t["month_12"]="12月";

4、source/src_article.asp

找到三处
 theCache.loadCalendar();
分别在下面加
 theCache.loadArchive();
 顶
(0)
0%
 踩
(0)
0%
发表评论 [游客只需输入用户名即可发表评论]


表情
用户名:
密码:
注册
引用 1F 生活笔谈* (浙江省湖州市电信)
[ 2009-04-02 10:01 ]
这2个愚人节的更新,我转到LBS粉丝网去了~
zone
[ 2009-04-02 11:25 ]
归档的好像串行了,呵呵~
标签: lbs  相关文章
点击刷新 图文资讯