源码论坛,商业源码下载,尽在锦尚中国商业源码论坛

标题: 19楼风格DZ7.2问题求助 [打印本页]

作者: lujunjie521    时间: 2010-11-28 10:18
标题: 19楼风格DZ7.2问题求助
19楼风格DZ7.2问题求助

如果uchome和DZ不在一个数据库,怎么修改index_19louhome.inc.php文件?


<?php

/*
        [Discuz!] (C)2001-2009 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $Id: index_classics.inc.php 21260 2009-11-23 08:33:35Z monkey $
*/

require_once './include/common.inc.php';
$in_caifuc=99;
$uchome_tablepre='uchome_';
$query = $db->query("SELECT todayposts FROM {$tablepre}forums WHERE type!='group' and status='1'");
while($forum = $db->fetch_array($query)) {
        $todayposts += $forum['todayposts'];
}
$onlinenum = $db->result_first("SELECT COUNT(*) FROM {$tablepre}sessions");
$postdata = $historyposts ? explode("\t", $historyposts) : array('0','0');
$onlineinfo = explode("\t", $onlinerecord);

        require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
        if((@!include(DISCUZ_ROOT.'./forumdata/cache/cache_caifuc_uch.php')) || $expiration < time()) {
                $caifuc_uchome_pic=$caifuc_album=$caifuc_uch_hot=$caifuc_uch_new=$caifuc_uch_vip=$caifuc_uch_class=$gonggao=$caifuc_link=array();
                $query = $db->query("SELECT id,subject,type,message FROM {$tablepre}announcements ORDER BY starttime DESC LIMIT 6");
        while ($caifuc_temp = $db->fetch_array($query)) {
                $caifuc_temp['subject'] = cutstr($caifuc_temp['subject'],30,'');
                $gonggao[] = $caifuc_temp;
        }
        $query = $db->query("SELECT name,url,logo FROM {$tablepre}forumlinks ORDER BY displayorder");
        while($caifuc_temp = $db->fetch_array($query)) {   
                        $caifuc_link[] = $caifuc_temp;
        }
if($ucappopen['UCHOME']){
        $aaa=0;
        $query = $db->query("SELECT p.* FROM {$uchome_tablepre}pic p, {$uchome_tablepre}album a WHERE a.friend='0' AND a.albumid=p.albumid ORDER BY p.dateline DESC LIMIT 4");
        while($caifuc_temp = $db->fetch_array($query)) {
                $aaa++;
                $caifuc_temp['attachment'] = $uchomeurl."/attachment/".$caifuc_temp['filepath'];
                $caifuc_temp['image'] = caifuc_sizeimage($caifuc_temp['attachment'],'./forumdata/imagecaches/uch_pic_'.$aaa.'.jpg',300,165);
                $caifuc_temp['name'] = $caifuc_temp['title'] ? cutstr($caifuc_temp['title'],30,"") : cutstr($caifuc_temp['filename'],30,"");  
                $caifuc_uchome_pic[] = $caifuc_temp;
        }
        $query = $db->query("SELECT albumid,albumname,picnum,pic,picflag,uid,username FROM {$uchome_tablepre}album WHERE friend='0' AND picnum>0 ORDER BY updatetime DESC LIMIT 2");
        $aaa=0;
        while($caifuc_temp = $db->fetch_array($query)) {
                $aaa++;
                $caifuc_temp['albumname']=cutstr($caifuc_temp['albumname'],20,"");
                $caifuc_temp['pic']=$uchomeurl."/attachment/".str_replace('.thumb.jpg','',$caifuc_temp['pic']);
                $caifuc_temp['image'] = caifuc_sizeimage($caifuc_temp['pic'],'./forumdata/imagecaches/uch_album_'.$aaa.'.jpg',140,100);
                $caifuc_album[] = $caifuc_temp;
        }
        $query = $db->query("SELECT b.blogid,b.subject,b.uid,b.username,bb.message FROM {$uchome_tablepre}blog b,{$uchome_tablepre}blogfield bb WHERE b.blogid=bb.blogid and b.friend='0' ORDER BY b.replynum DESC LIMIT 2");
        while($caifuc_temp = $db->fetch_array($query)) {
                $caifuc_temp['subject'] = cutstr($caifuc_temp['subject'],40,"");               
                $caifuc_temp['message']=cutstr(strip_tags($caifuc_temp['message']),180,"");
                $caifuc_uch_hot[] = $caifuc_temp;
        }
        $query = $db->query("SELECT classid,classname FROM {$uchome_tablepre}class");
        while($caifuc_temp = $db->fetch_array($query)) {
                $caifuc_uch_class[$caifuc_temp[classid]] = $caifuc_temp[classname];
        }
        $query = $db->query("SELECT blogid,subject,uid,username,classid FROM {$uchome_tablepre}blog WHERE friend='0' ORDER BY dateline DESC LIMIT 6");
        while($caifuc_temp = $db->fetch_array($query)) {
                $caifuc_temp['subject'] = $caifuc_temp['classid']?cutstr($caifuc_temp['subject'],37,""):cutstr($caifuc_temp['subject'],45,"");
                $caifuc_temp['classname'] = $caifuc_temp['classid']?"[".$caifuc_uch_class[$caifuc_temp[classid]]."]":'·';
                $caifuc_temp['username'] = cutstr($caifuc_temp['username'],10,"");
                $caifuc_uch_new[] = $caifuc_temp;
        }
        $aaa=0;
        $query = $db->query("SELECT uid,username,viewnum FROM {$uchome_tablepre}space ORDER BY viewnum DESC LIMIT 10");
        while($caifuc_temp = $db->fetch_array($query)) {
                $aaa++;
                $caifuc_temp['nn']=$aaa;
                $caifuc_uch_vip[] = $caifuc_temp;
        }
}
        $data=array("expiration"=>3600 + time(),"caifuc_uchome_pic"=>$caifuc_uchome_pic,"caifuc_album"=>$caifuc_album,"caifuc_uch_hot"=>$caifuc_uch_hot,"caifuc_uch_new"=>$caifuc_uch_new,"caifuc_uch_vip"=>$caifuc_uch_vip,"caifuc_uch_class"=>$caifuc_uch_class,"gonggao"=>$gonggao,"caifuc_link"=>$caifuc_link);
        require_once DISCUZ_ROOT.'./include/cache.func.php';
        writetocache('caifuc_uch', '', getcachevars($data));
        include(DISCUZ_ROOT.'./forumdata/cache/cache_caifuc_uch.php');
}
function caifuc_sizeimage($twt_infile,$twt_outfile,$width,$height){
        @unlink($twt_outfile);
        list($in_width,$in_height,$in_type)=getimagesize($twt_infile);
        switch($in_type){
                case 1:
                        $in_image=imagecreatefromgif($twt_infile);
                        break;
                case 2:
                        $in_image=imagecreatefromjpeg($twt_infile);
                        break;
                case 3:
                        $in_image=imagecreatefrompng($twt_infile);
                        break;
                default:
                        return $twt_infile;
                break;
        }
        if($in_image==''){
                return $twt_infile;
        }
        if($in_width>$width || $in_height>$height){
                $x=$y=0;
                $WBL=$in_width/$width;
                $HBL=$in_height/$height;
                $zoom=$HBL<$WBL?$HBL:$WBL;
                $temp_width=round($in_width/$zoom);
                $temp_height=round($in_height/$zoom);
                $x=$temp_width>$width?0-($temp_width-$width)/2:0;
                $twt_image = imagecreatetruecolor($width, $height);
                imagecopyresampled($twt_image, $in_image, $x, $y, 0, 0, $temp_width, $temp_height, $in_width, $in_height);
                imagejpeg($twt_image, $twt_outfile);
                imagedestroy($twt_image);
                imagedestroy($in_image);
                clearstatcache();
        }
return file_exists($twt_outfile)?$twt_outfile:$twt_infile;
}

include template('19lou_home');
?>




欢迎光临 源码论坛,商业源码下载,尽在锦尚中国商业源码论坛 (https://bbs.52jscn.com/) Powered by Discuz! X3.3