本帖最后由 zhongyongxin 于 2010-9-10 10:28 编辑
首页index.php代码
- <?php
- /*
- [UCenter Home] (C) 2007-2008 Comsenz Inc.
- $Id: index.php 13003 2009-08-05 06:46:06Z liguode $
- */
- include_once('./common.php');
- if(is_numeric($_SERVER['QUERY_STRING'])) {
- showmessage('enter_the_space', "space.php?uid=$_SERVER[QUERY_STRING]", 0);
- }
- //二级域名
- if(!isset($_GET['do']) && $_SCONFIG['allowdomain']) {
- $hostarr = explode('.', $_SERVER['HTTP_HOST']);
- $domainrootarr = explode('.', $_SCONFIG['domainroot']);
- if(count($hostarr) > 2 && count($hostarr) > count($domainrootarr) && $hostarr[0] != 'www' && !isholddomain($hostarr[0])) {
- showmessage('enter_the_space', $_SCONFIG['siteallurl'].'space.php?domain='.$hostarr[0], 0);
- }
- }
- if($_SGLOBAL['supe_uid']) {
- //已登录,直接跳转个人首页
- showmessage('enter_the_space', 'space.php?do=home', 0);
- }
- @include_once(S_ROOT.'./data/data_st375_link.php');
- if(empty($_SCONFIG['networkpublic'])) {
- //实名
- foreach ($spacelist as $key => $value) {
- realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
- }
- realname_get();
- } else {
- //总会员
- $spacecount = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname('space')), 0);
- $cachefile = S_ROOT.'./data/cache_index.txt';
- $cachetime = @filemtime($cachefile);
- $spacelist = array();
- if($_SGLOBAL['timestamp'] - $cachetime > 10) {
- //20位热门用户
- $query = $_SGLOBAL['db']->query("SELECT s.*, sf.resideprovince, sf.residecity
- FROM ".tname('space')." s
- LEFT JOIN ".tname('spacefield')." sf ON sf.uid=s.uid
- ORDER BY s.lastlogin DESC LIMIT 0,10");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $spacelist[] = $value;
- }
- swritefile($cachefile, serialize($spacelist));
- } else {
- $spacelist = unserialize(sreadfile($cachefile));
- }
- //大家的最新动态
- $feedlist = array();
- $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('feed')." WHERE friend='0' ORDER BY dateline DESC LIMIT 0,10");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'], $value['username']);
- $feedlist[] = $value;
- }
- //竞价排名
- $showlist = array();
- $query = $_SGLOBAL['db']->query("SELECT sh.note, s.* FROM ".tname('show')." sh
- LEFT JOIN ".tname('space')." s ON s.uid=sh.uid
- ORDER BY sh.credit DESC LIMIT 0,18");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
- $value['note'] = addslashes(getstr($value['note'], 80, 0, 0, 0, 0, -1));
- $showlist[$value['uid']] = $value;
- }
- if(empty($star) && $showlist) {
- $star = sarray_rand($showlist, 1);
- }
- //格式化动态
- foreach ($feedlist as $key => $value) {
- $feedlist[$key] = mkfeed($value);
- }
- //在线人数
- $olcount = getcount('session', array());
- //应用
- $myappcount = 0;
- $myapplist = array();
- if($_SCONFIG['my_status']) {
- $myappcount = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname('myapp')." WHERE flag>='0'"), 0);
- if($myappcount) {
- $query = $_SGLOBAL['db']->query("SELECT appid,appname FROM ".tname('myapp')." WHERE flag>=0 ORDER BY flag DESC, displayorder LIMIT 0,35");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
- $myapplist[] = $value;
- }
- }
- }
- $_TPL['css'] = 'network';
- include template("index");
- }
- ?>
复制代码
所要调用html调用
- <DIV class="litet">
- <UL>
- <LI class=top>
- <H2>最新日记</H2></LI>
- <LI class=mid>
- <DIV class=p90>
- <!--{loop $_SBLOCK['block3'] $value}-->
- <li><a href="space.php?uid=$value[uid]&do=blog&id=$value[blogid]" target = "_blank">$value[subject]</a></li>
- <!--{/loop}-->
- </DIV></LI>
- <LI class=botj></LI></UL></DIV></div>
- <div class="col-2">
- <DIV class="litet">
- <UL>
- <LI class=top>
- <H2>最新话题</H2></LI>
- <LI class=mid>
- <DIV class=p90>
- </DIV></LI>
- <LI class=botj></LI></UL></DIV></div>
- </div>
复制代码
我的首页就是调用不出最新话题和最新日记 忧闷中...............
我也看了官方的调用教程 首页index.php调用不出最新话题和最新日记
|