原帖由 mickeycai 于 2005-8-19 09:52 发表
怎么像文文一样把头像和个人的宠物和个人形象弄上去呢?
个人形象弄了一下午才搞定
不过可能不适合你……
你试试吧
侧边栏函数- //侧边栏所需函数
- //===========================================================================================
- //个人资料-start
- if($discuz_user){
- $query = $db->query("SELECT avatar,money,postnum,bank,customstatus,regdate,location,onlinetime,bankmimi,bankstatus,luck,warning,gender,medals FROM $table_members WHERE uid='$discuz_uid'");
- $index_left = $db->fetch_array($query);
- $index_left[avatar] = $index_left[avatar] ? "<img align=center src="$index_left[avatar]" onload="if(this.width>140) {this.resized=true; this.width=140; }"} border="0">" : "<img align=center src="images/common/noavatar.gif" border="0">";
- //------------------------------------------------------------虚拟形象
- require_once('./virtualimage/images_config.php');
- $imagesset = $setting;
- unset($setting);
- if($imagesset[openalpha]){
- $alpha = "FILTER: alpha(opacity="+WearArray[i]+")";
- }
- $imagesdatas = '';
- if ($index_left[gender]==1){
- $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-init-init-0-init-0-init-init-0-0-0-init-0-0-0-0-0-0-0'; //男性的初始值
- $imagesdata[sex] = "m";
- $imagesdata[upid] = "init";
- }elseif ($index_left[gender]==2){
- $imagesdata[tempequip] = '0-0-0-0-0-0-0-0-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0'; //女性的初始值
- $imagesdata[sex] = "f";
- $imagesdata[upid] = "initf";
- }
- $imagesdata[pid] = 1;
- $imagesdata[uid] = $discuz_uid;
- $imagesdatas[] = $imagesdata;
- $index_left['vavatar'] = "
- <!-- 虚拟形象开始-->
- <DIV id='Show1'
- style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px; PADDING-BOTTOM: 0px; WIDTH: 120px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT: 150px"></DIV>
- <!-- 虚拟形象结束-->";
- if($imagesdatas!=''){
- $showimages = '';
- require_once('./virtualimage/global.php');
- $showimages = images_showimages($imagesdatas,$alhpa,$imagesset[imageurl]);
- unset($imagesdatas,$imagesdata,$alpha);
- }
-
- $cachetime = 3600;
- if(($timestamp-$_DCACHE[vavatar][2])>$cachetime){
- require_once DISCUZ_ROOT.'./include/cache.php';
- updatecache('vavatar');
- }
- //--------------------------------------------------------------
- //--------------------------------------------------------------勋章
- if($index_left['medals']){
- $medalshow = $_DCACHE[medalist];
- $medalid = strtok($index_left['medals'],",");
- $medalout='';
- while($medalid){
- $medalout.= $medalshow[$medalid];
- $medalid = strtok(",");
- }
- $index_left['medals'] = $medalout;
- }
- //--------------------------------------------------------------
- $index_left['regdate'] = gmdate($dateformat, $index_left['regdate'] + $timeoffset * 3600);
- $onlinehour = intval($index_left[onlinetime]/3600);
- $onlinemin = intval($index_left[onlinetime]%3600/60);
- }
- //个人资料-end
- //今日到访-start
- $todayT = mktime(0,0,0,date("m"),date("d"),date("Y"));
- $query = $db->query("SELECT username,FROM_UNIXTIME(lastvisit) as lastvisit FROM $table_members WHERE lastvisit>='$todayT' ORDER BY lastvisit DESC LIMIT 0, 500");
-
- $todaymembersnum = 0;
- $todaymembers = '';
- $comma = '';
-
- while ($memberstoday = $db->fetch_array($query)) {
- $todaymembers .= "$comma<a href=viewpro.php?username=$memberstoday[username] title='最近登录时间:$memberstoday[lastvisit]' target='_bank'>$memberstoday[username]</a>";
- ++$todaymembersnum;
- $comma = ",";
- }
- //今日到访-end
- //新回复-start
- $hack_cut_str = 24; //修改標題顯示字數
- $new_reply_threadlist = array();
- $rthread = array();
- $query = $db->query("SELECT t.*, f.name FROM $table_threads t, $table_forums f WHERE f.password='' AND t.fid<>'$fid' AND (f.viewperm='' or f.viewperm LIKE '%\t$groupid\t%') AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 20");
- while($rthread = $db->fetch_array($query)) {
- if($rthread['hide']){$rthread['author']='【身份隐藏】';}
- $rthread['forumname'] = $rthread['name'];
- $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
- $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
- $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
- $new_reply_threadlist[] = $rthread;
- }
- //新回复-end
- //新帖子-start
- $hack_cut_str = 24; //修改標題顯示字數
- $new_post_threadlist = array();
- $nthread = array();
- $query = $db->query("SELECT t.*, f.name FROM $table_threads t, $table_forums f WHERE f.password='' AND t.fid<>'$fid' AND (f.viewperm='' or f.viewperm LIKE '%\t$groupid\t%') AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 20");
- while($nthread = $db->fetch_array($query)) {
- if($nthread['hide']){$nthread['author']='【身份隐藏】';}
- $nthread['forumname'] = $nthread['name'];
- $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
- $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
- $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
- $new_post_threadlist[] = $nthread;
- }
- //新帖子-end
- //===========================================================================================
- //侧边栏所需函数-end
复制代码
模板
这个是有幸运的把读取幸运字段的代码删了就行
原帖由 野天 于 2005-8-18 10:10 发表
文文我用了你的那个巨好谢谢!
现在想增加些功能,例如高亮的帖子引用时仍高亮,增加今日之星等,发帖排行等,能接着完善这些吗?
没空拉……高考了哈哈 |