<?php
function litimgurls($imgid=0)
{
    global $lit_imglist,$dsql;
    //获取附加表
    $row = $dsql->GetOne("SELECT c.addtable FROM #@__archives AS a LEFT JOIN #@__channeltype AS c 
                                                            ON a.channel=c.id where a.id='$imgid'");
    $addtable = trim($row['addtable']);
    
    //获取图片附加表imgurls字段内容进行处理
    $row = $dsql->GetOne("Select imgurls From `$addtable` where aid='$imgid'");
    
    //调用inc_channel_unit.php中ChannelUnit类
    $ChannelUnit = new ChannelUnit(2,$imgid);
    
    //调用ChannelUnit类中GetlitImgLinks方法处理缩略图
    $lit_imglist = $ChannelUnit->GetlitImgLinks($row['imgurls']);
    
    //返回结果
    return $lit_imglist;
}
function getxx($type)
{
	global $dsql;
	$str="";
	$table="";
	$where="";
	if($type=='dianji'){
		$str="sum(click)";
		$table="#@__archives";
		$where=" where channel = '3'";
	}
	else if($type=='xiazai'){
		$str="sum(downloads)";
		$table="#@__downloads";
	}
	else if($type=='hanhua'){
		$str="count(aid)";
		$table="#@__addonsoft";
		$where=" where softtype = '汉化补丁'";
	}
	else if($type=='guowai'){
		$str="count(aid)";
		$table="#@__addonsoft";
		$where=" where softtype = '国外软件'";
	}
	else if($type=='guochan'){
		$str="count(aid)";
		$table="#@__addonsoft";
		$where=" where softtype = '国产软件'";
	}
	else if($type=='jinri'){
		$str="count(id)";
		$table="#@__archives";
		$where=" where channel = '3' and pubdate > UNIX_TIMESTAMP( CURDATE( ) )";
	}
	else{
		$str="count(id)";
		$table="#@__archives";
		$where=" where channel = '3'";
	}
	$row = $dsql->GetOne("Select $str as dd From $table $where");
	return $row['dd'];
}