uch2.0会员动态调用

时间: 2009-08-15 / 分类: 网站技术 / 被围观: 1,437 次 / 0个评论 发表评论

演示站:http://www.7-202.cn/home/network.php

后台》数据调用》添加新模块》手写SQL:

SELECT * FROM `uchome_feed` AS `feed` WHERE `feed`.`friend`=’0′ ORDER BY `feed`.`dateline` DESC

数据显示HTML代码区域填写一下代码:(注意:[‘block1’]   两处要相同)

<!–{eval $siteurl = ‘http://你的UCH地址/’;}–>

<!–{eval $feed_list = array();}–>
<!–{loop $_SBLOCK[‘block1’] $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 id=”scrollbody” style=”height:318px; overflow:hidden;”>
<!–{loop $values $value}–>
<li style=”margin:15px; font-size:12px;”>
        <!–{if $notime}–>

        <!–{else}–>

        <!–{/if}–>
        <tt>
                <!–{eval echo str_replace(‘src=”attachment’, ‘src=”‘.$siteurl.’attachment’, str_replace(‘ref=”space’, ‘ref=”‘.$siteurl.’space’, $value[title_template]));}–>
        </tt>
        </li>
<!–{/loop}–>
</ul>
<script>startMarquee(228, 318, 2, ‘scrollbody’);</script>
<!–{/loop}–>

Comments are closed.