本帖最后由 fjnhlhl 于 2010-01-11 01:39 编辑
演示网站:好习惯网 http://hxg123.cn 查询SQL语句复制- SELECT * FROM `uchome_feed` AS `feed` WHERE `feed`.`appid`='0' AND `feed`.`friend`='0' ORDER BY `feed`.`dateline` DESC
复制代码 代码数据显示HTML代码:- <!--{eval $feed_list = array();}-->
- <!--{loop $_SBLOCK[block7] $value}-->
- <!--{if empty($feed_list[$value['hash_data']][$value['uid']])}-->
- <!--{eval realname_set($value['uid'], $value['username']);}-->
- <!--{eval $feed_list[$value['hash_data']][$value['uid']] = $value;}-->
- <!--{/if}-->
- <!--{/loop}-->
- <!--{eval $list = array();}-->
- <!--{loop $feed_list $values}-->
- <!--{eval $actors = array();}-->
- <!--{eval $a_value = array();}-->
- <!--{loop $values $value}-->
- <!--{if empty($a_value)}-->
- <!--{eval $a_value = $value;}-->
- <!--{/if}-->
- <!--{eval $actors[] = "<a href="{$siteurl}space.php?uid=$value[uid]">".$_SN[$value['uid']]."</a>";}-->
- <!--{/loop}-->
- <!--{eval $a_value = mkfeed($a_value, $actors);}-->
- <!--{if $a_value['dateline']>=$_SGLOBAL['today']}-->
- <!--{eval $list['today'][] = $a_value;}-->
- <!--{elseif $a_value['dateline']>=$_SGLOBAL['today']-3600*24}-->
- <!--{eval $list['yesterday'][] = $a_value;}-->
- <!--{else}-->
- <!--{eval $theday = sgmdate('Y-m-d', $a_value['dateline']);}-->
- <!--{eval $list[$theday][] = $a_value;}-->
- <!--{/if}-->
- <!--{/loop}-->
- <!--{loop $list $day $values}-->
- <UL class=line_list id=scrollbody style="OVERFLOW: hidden; HEIGHT: 250px">
- <!--{loop $values $value}-->
- <li class="type_$value[icon]" id="feed_$value[feedid]_li">
- <!--{eval echo str_replace('src="attachment', 'src="'.$siteurl.'attachment', str_replace('ref="space', 'ref="'.$siteurl.'space', $value[title_template]));}-->
- <!--{if empty($notime)}--> <span class="time"><!--{date('m-d H:i',$value[dateline],1)}--></span><!--{/if}-->
- </li>
- <!--{/loop}-->
- </ul>
- <SCRIPT>startMarquee(205, 90, 0, "scrollbody");
- function startMarquee(h,speed,delay,sid){
- var t = null;
- var p = false;
- var o = document.getElementById(sid);
- o.style.height = 205+"px";
- o.innerHTML += o.innerHTML;
- o.onmouseover = function(){p = true}
- o.onmouseout = function(){p = false}
- o.scrollTop = 0;
- function start(){
- t = setInterval(scrolling, speed);
- if(!p) {
- o.scrollTop += 2;
- }
- }
- function scrolling(){
- if(p) return;
- if(o.scrollTop % h != 0){
- o.scrollTop += 2;
- if(o.scrollTop >= o.scrollHeight/2) o.scrollTop = 0;
- } else {
- clearInterval(t);
- setTimeout(start, delay);
- }
- }
- setTimeout(start, delay);
- }
- </SCRIPT>
- <!--{/loop}-->
复制代码 教程录像 |