源码论坛公告:本站是一个交流学习建站资源的社区论坛,旨在交流学习源码脚本等资源技术,欢迎大家投稿发言! 【点击此处将锦尚放在桌面

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

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 1100|回复: 0
打印 上一主题 下一主题

19楼风格DZ7.2问题求助

[复制链接]

4

主题

63

帖子

713

金币

初级会员

Rank: 1

积分
1583
跳转到指定楼层
1#
发表于 2010-11-28 10:18:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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');
?>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

锦尚中国源码论坛

聚合标签|锦尚中国,为中国网站设计添动力 ( 鲁ICP备09033200号 ) |网站地图

GMT+8, 2024-11-23 22:52 , Processed in 0.109411 second(s), 25 queries .

带宽由 锦尚数据 提供 专业的数据中心

© 锦尚中国源码论坛 52jscn Inc. 非法入侵必将受到法律制裁 法律顾问:IT法律网 & 褚福省律师 锦尚爱心 版权申诉 版权与免责声明