📄 t_functions.php
字号:
//标题属性
$title=DoTitleFont($r[titlefont],$r[title]);
//标题链接
$titleurl=sys_ReturnBqTitleLink($r);
//显示类别
$myadd=sys_ReturnBqClassname($r,$have_class);
$smalltext=nl2br($r[smalltext]);
$allnews.="<table width=99% border=0 align=center cellpadding=3 cellspacing=0>
<tr bgcolor=".$tablecolor."><td width=62% height=25><strong>.</strong> ".$myadd."<a href='".$titleurl."' target=_blank>".$title."</a></td><td width=38%>发布时间:".$r[newstime]."</td></tr><tr valign=top><td height=25 colspan=2>".$smalltext."</td></tr></table>";
}
echo"$allnews";
}
//滚动图片信息
function sys_GetAutoPic($classid,$line,$width,$height,$showtitle=true,$strlen,$speed=5000,$enews=0){
global $empire;
$sql=sys_ReturnBqQuery($classid,$line,$enews,1);
if(!$sql)
{return "";}
$jsarray="";
$i=0;
while($r=$empire->fetch($sql))
{
$i++;
//标题链接
$titleurl=sys_ReturnBqTitleLink($r);
//------是否显示标题
if($showtitle)
{
$title=sub($r[title],0,$strlen,false);
//标题属性
$title=addslashes(DoTitleFont($r[titlefont],htmlspecialchars($title)));
}
$jsarray.="imgUrl[".$i."]=\"".$r[titlepic]."\";
imgLink[".$i."]=\"".$titleurl."\";
imgTz[".$i."]=\"<a href='".$titleurl."' target=_blank>".$title."</a>\";";
}
$pic="<a onclick=\"javascript:goUrl();\" style=\"CURSOR: hand\"><img style=\"FILTER: revealTrans(duration=2,transition=20);border-color:black;color:#000000\" src=\"javascript:\" width='".$width."' height='".$height."' border=1 name=imgInit id=imgInit></a>";
?>
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgTz=new Array();
var adNum=0;
<?=$jsarray?>
var imgPre=new Array();
var j=0;
for (i=1;i<=<?=$line?>;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
j++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=6;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
<?
if($showtitle)
{
?>
document.getElementById('jdtz').innerHTML=imgTz[adNum];
<?
}
?>
theTimer=setTimeout("nextAd()", <?=$speed?>);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
</script>
<?
//显示标题
if($showtitle)
{
?>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td align=center><?=$pic?></td></tr>
<tr><td height=1></td></tr>
<tr><td align=center style="background:#B1B1B1 right no-repeat" height=23 id=jdtz></td></tr>
</table>
<?
}
else
{
echo $pic;
}
echo"<script>nextAd();</script>";
}
//图片信息调用
function sys_GetPicNews($picid,$showtitle=false,$showtext=false){
global $empire,$dbtbpre;
$r=$empire->fetch1("select picid,title,pic_url,url,pic_width,pic_height,open_pic,border,pictext from {$dbtbpre}enewspic where picid='$picid' limit 1");
$pic="";
if($r[pic_width])
{$pic.=" width='".$r[pic_width]."'";}
if($r[pic_height])
{$pic.=" height='".$r[pic_height]."'";}
$pic="<a href='".$r[url]."' title='".$r[title]."' target='".$r[open_pic]."'><img src='".$r[pic_url]."'".$pic." border=".$r[border]."></a>";
//显示标题
if($showtitle)
{$pic.="<br><span style='line-height=15pt'><a href='".$r[url]."' target='".$r[open_pic]."'>".$r[title]."</a></span>";}
//显示简介
if($showtext)
{$pic="<table width=100% border=0 align=center cellpadding=3 cellspacing=1><tr><td width=32%><div align=center>".$pic."</div></td><td width=68%><div><a href='".$r[url]."' title='".$r[title]."' target='".$r[open_pic]."'>".nl2br($r[pictext])."</a></div></td></tr></table>";}
echo"$pic";
}
//多图片信息
function sys_GetMorePicNews($classid,$line,$num,$width,$height,$showtitle=true,$strlen,$enews=0){
global $empire,$public_r,$dbtbpre;
$sql=$empire->query("select * from {$dbtbpre}enewspic where classid='$classid' order by picid desc limit $num");
//输出
$i=0;
while($r=$empire->fetch($sql))
{
$i++;
if(($i-1)%$line==0||$i==1)
{$class_text.="<tr>";}
//是否显示原链接
if($enews==0)
{$titleurl=$r[url];}
else
{$titleurl=$public_r[newsurl]."e/NewsSys/ShowImg?picid=".$r[picid];}
//------是否显示标题
if($showtitle)
{
$title=sub($r[title],0,$strlen,false);
$title="<br><span style='line-height=15pt'>".$title."</span>";
}
$class_text.="<td align=center><a href='".$titleurl."' target=_blank><img src='".$r[pic_url]."' width='".$width."' height='".$height."' border=0>".$title."</a></td>";
//分割
if($i%$line==0)
{$class_text.="</tr>";}
}
if($i<>0)
{
$table="<table width=100% border=0 cellpadding=3 cellspacing=0>";$table1="</table>";
$ys=$line-$i%$line;
$p=0;
for($j=0;$j<$ys&&$ys!=$line;$j++)
{
$p=1;
$class_text.="<td></td>";
}
if($p==1)
{
$class_text.="</tr>";
}
}
$text=$table.$class_text.$table1;
echo"$text";
}
//广告标签
function sys_GetAd($adid){
global $empire,$public_r,$dbtbpre;
$r=$empire->fetch1("select * from {$dbtbpre}enewsad where adid='$adid'");
if($r['ylink'])
{
$ad_url=$r['url'];
}
else
{
$ad_url=$public_r[newsurl]."e/public/ClickAd?adid=".$adid;//广告链接
}
//----------------------文字广告
if($r[t]==1)
{
$r[titlefont]=$r[titlecolor].','.$r[titlefont];
$picurl=DoTitleFont($r[titlefont],$r[picurl]);//文字属性
$h="<a href='".$ad_url."' target=".$r[target]." title='".$r[alt]."'>".addslashes($picurl)."</a>";
//普通显示
if($r[adtype]==1)
{
$html=$h;
}
//可移动透明对话框
else
{
$html="<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_dialog.js></script>
<div style='position:absolute;left:300px;top:150px;width:".$r[pic_width]."; height:".$r[pic_height].";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=".$r[pic_width]." height=".$r[pic_height]." bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='".$public_r[newsurl]."d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > ".$h."</td></tr></table></div>";
}
}
//------------------html广告
elseif($r[t]==2)
{
$h=addslashes($r[htmlcode]);
//普通显示
if($r[adtype]==1)
{
$html=$h;
}
//可移动透明对话框
else
{
$html="<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_dialog.js></script>
<div style='position:absolute;left:300px;top:150px;width:".$r[pic_width]."; height:".$r[pic_height].";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=".$r[pic_width]." height=".$r[pic_height]." bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='".$public_r[newsurl]."d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > ".$h."</td></tr></table></div>";
}
}
//------------------弹出广告
elseif($r[t]==3)
{
//打开新窗口
if($r[adtype]==8)
{
$html="<script>window.open('".$r[url]."');</script>";
}
//弹出窗口
elseif($r[adtype]==9)
{
$html="<script>window.open('".$r[url]."','','width=".$r[pic_width].",height=".$r[pic_height].",scrollbars=yes');</script>";
}
//普能网页窗口
else
{
$html="<script>window.showModalDialog('".$r[url]."','','dialogWidth:".$r[pic_width]."px;dialogHeight:".$r[pic_height]."px;scroll:no;status:no;help:no');</script>";
}
}
//---------------------图片与flash广告
else
{
$filetype=GetFiletype($r[picurl]);
//flash
if($filetype==".swf")
{
$h="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' name='movie' width='".$r[pic_width]."' height='".$r[pic_height]."' id='movie'><param name='movie' value='".$r[picurl]."'><param name='quality' value='high'><param name='menu' value='false'><embed src='".$r[picurl]."' width='".$r[pic_width]."' height='".$r[pic_height]."' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' id='movie' name='movie' menu='false'></embed><PARAM NAME='wmode' VALUE='Opaque'></object>";
}
else
{
$h="<a href='".$ad_url."' target=".$r[target]."><img src='".$r[picurl]."' border=0 width='".$r[pic_width]."' height='".$r[pic_height]."' alt='".$r[alt]."'></a>";
}
//普通显示
if($r[adtype]==1)
{
$html=$h;
}
//满屏浮动显示
elseif($r[adtype]==4)
{
$html="<script>ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;
if(ns4){document.write(\"<layer id=DGbanner2 width=".$r[pic_width]." height=".$r[pic_height]." onmouseover=stopme('DGbanner2') onmouseout=movechip('DGbanner2')>".$h."</layer>\");}
else{document.write(\"<div id=DGbanner2 style='position:absolute; width:".$r[pic_width]."px; height:".$r[pic_height]."px; z-index:9; filter: Alpha(Opacity=90)' onmouseover=stopme('DGbanner2') onmouseout=movechip('DGbanner2')>".$h."</div>\");}</script>
<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_float_fullscreen.js></script>";
}
//上下浮动显示 - 右
elseif($r[adtype]==5)
{
$html="<script>if (navigator.appName == 'Netscape')
{document.write(\"<layer id=DGbanner3 top=150 width=".$r[pic_width]." height=".$r[pic_height].">".$h."</layer>\");}
else{document.write(\"<div id=DGbanner3 style='position: absolute;width:".$r[pic_height].";top:150;visibility: visible;z-index: 1'>".$h."</div>\");}</script>
<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_float_upanddown.js></script>";
}
//上下浮动显示 - 左
elseif($r[adtype]==6)
{
$html="<script>if(navigator.appName == 'Netscape')
{document.write(\"<layer id=DGbanner10 top=150 width=".$r[pic_width]." height=".$r[pic_height].">".$h."</layer>\");}
else{document.write(\"<div id=DGbanner10 style='position: absolute;width:".$r[pic_width].";top:150;visibility: visible;z-index: 1'>".$h."</div>\");}</script>
<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_float_upanddown_L.js></script>";
}
//全屏幕渐隐消失
elseif($r[adtype]==7)
{
$html="<script>ns4=(document.layers)?true:false;
if(ns4){document.write(\"<layer id=DGbanner4Cont onLoad='moveToAbsolute(layer1.pageX-160,layer1.pageY);clip.height=".$r[pic_height].";clip.width=".$r[pic_width]."; visibility=show;'><layer id=DGbanner4News position:absolute; top:0; left:0>".$h."</layer></layer>\");}
else{document.write(\"<div id=DGbanner4 style='position:absolute;top:0; left:0;'><div id=DGbanner4Cont style='position:absolute;width:".$r[pic_width].";height:".$r[pic_height].";clip:rect(0,".$r[pic_width].",".$r[pic_height].",0)'><div id=DGbanner4News style='position:absolute;top:0;left:0;right:820'>".$h."</div></div></div>\");}</script>
<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_fullscreen.js></script>";
}
//可移动透明对话框
elseif($r[adtype]==3)
{
$html="<script language=javascript src=".$public_r[newsurl]."d/js/acmsd/ecms_dialog.js></script>
<div style='position:absolute;left:300px;top:150px;width:".$r[pic_width]."; height:".$r[pic_height].";z-index:1;solid;filter:alpha(opacity=90)' id=DGbanner5 onmousedown='down1(this)' onmousemove='move()' onmouseup='down=false'><table cellpadding=0 border=0 cellspacing=1 width=".$r[pic_width]." height=".$r[pic_height]." bgcolor=#000000><tr><td height=18 bgcolor=#5A8ACE align=right style='cursor:move;'><a href=# style='font-size: 9pt; color: #eeeeee; text-decoration: none' onClick=clase('DGbanner5') >关闭>>><img border='0' src='".$public_r[newsurl]."d/js/acmsd/close_o.gif'></a> </td></tr><tr><td bgcolor=f4f4f4 > ".$h."</td></tr></table></div>";
}
else
{
$html="<script>function closeAd(){huashuolayer2.style.visibility='hidden';huashuolayer3.style.visibility='hidden';}function winload(){huashuolayer2.style.top=109;huashuolayer2.style.left=5;huashuolayer3.style.top=109;huashuolayer3.style.right=5;}//if(document.body.offsetWidth>800){
{document.write(\"<div id=huashuolayer2 style='position: absolute;visibility:visible;z-index:1'><table width=0 border=0 cellspacing=0 cellpadding=0><tr><td height=10 align=right bgcolor=666666><a href=javascript:closeAd()><img src=".$public_r[newsurl]."d/js/acmsd/close.gif width=12 height=10 border=0></a></td></tr><tr><td>".$h."</td></tr></table></div>\"+\"<div id=huashuolayer3 style='position: absolute;visibility:visible;z-index:1'><table width=0 border=0 cellspacing=0 cellpadding=0><tr><td height=10 align=right bgcolor=666666><a href=javascript:closeAd()><img src=".$public_r[newsurl]."d/js/acmsd/close.gif width=12 height=10 border=0></a></td></tr><tr><td>".$h."</td></tr></table></div>\");}winload()//}</script>";
}
}
echo $html;
}
//投票标签
function sys_GetVote($voteid){
global $empire,$public_r,$dbtbpre;
$r=$empire->fetch1("select * from {$dbtbpre}enewsvote where voteid='$voteid'");
if(empty($r[votetext]))
{
return '';
}
//模板
$votetemp=ReturnVoteTemp($r[tempid],0);
$votetemp=RepVoteTempAllvar($votetemp,$r);
$listexp="[!--empirenews.listtemp--]";
$listtemp_r=explode($listexp,$votetemp);
$r_exp="\r\n";
$f_exp="::::::";
//项目数
$r_r=explode($r_exp,$r[votetext]);
$checked=0;
for($i=0;$i<count($r_r);$i++)
{
$checked++;
$f_r=explode($f_exp,$r_r[$i]);
//投票类型
if($r[voteclass])
{$vote="<input type=checkbox name=vote[] value=".$checked.">";}
else
{$vote="<input type=radio name=vote value=".$checked.">";}
$votetext.=RepVoteTempListvar($listtemp_r[1],$vote,$f_r[0]);
}
$votetext=$listtemp_r[0].$votetext.$listtemp_r[2];
echo"$votetext";
}
//信息投票标签
function sys_GetInfoVote($classid,$id){
global $empire,$public_r,$dbtbpre;
$r=$empire->fetch1("select * from {$dbtbpre}enewsinfovote where id='$id' and classid='$classid' limit 1");
if(empty($r[votetext]))
{
return '';
}
//模板
$votetemp=ReturnVoteTemp($r[tempid],0);
$votetemp=str_replace('[!--news.url--]',$public_r['newsurl'],$votetemp);
$votetemp=RepVoteTempAllvar($votetemp,$r);
$listexp="[!--empirenews.listtemp--]";
$listtemp_r=explode($listexp,$votetemp);
$r_exp="\r\n";
$f_exp="::::::";
//项目数
$r_r=explode($r_exp,$r[votetext]);
$checked=0;
for($i=0;$i<count($r_r);$i++)
{
$checked++;
$f_r=explode($f_exp,$r_r[$i]);
//投票类型
if($r[voteclass])
{$vote="<input type=checkbox name=vote[] value=".$checked.">";}
else
{$vote="<input type=radio name=vote value=".$checked.">";}
$votetext.=RepVoteTempListvar($listtemp_r[1],$vote,$f_r[0]);
}
$votetext=$listtemp_r[0].$votetext.$listtemp_r[2];
return $votetext;
}
//友情链接
function sys_GetSitelink($line,$num,$enews=0,$classid=0,$stats=0){
global $empire,$public_r,$dbtbpre;
//图片
if($enews==1)
{$a=" and lpic<>''";}
//文字
elseif($enews==2)
{$a=" and lpic=''";}
else
{$a="";}
//调用相应的栏目分类
if(!empty($classid))
{
$whereclass=" and classid='$classid'";
}
$sql=$empire->query("select * from {$dbtbpre}enewslink where checked=1".$a.$whereclass." order by myorder,lid limit ".$num);
//输出
$i=0;
while($r=$empire->fetch($sql))
{
//链接
if(empty($stats))
{
$linkurl=$public_r[newsurl]."e/public/GotoSite?lid=".$r[lid]."&url=".urlencode($r[lurl]);
}
else
{
$linkurl=$r[lurl];
}
$i++;
if(($i-1)%$line==0||$i==1)
{$class_text.="<tr>";}
//文字
if(empty($r[lpic]))
{
$logo="<a href='".$linkurl."' title='".$r[lname]."' target=".$r[target].">".$r[lname]."</a>";
}
//图片
else
{
$logo="<a href='".$linkurl."' target=".$r[target]."><img src='".$r[lpic]."' alt='".$r[lname]."' border=0 width='".$r[width]."' height='".$r[height]."'></a>";
}
$class_text.="<td align=center>".$logo."</td>";
//分割
if($i%$line==0)
{$class_text.="</tr>";}
}
if($i<>0)
{
$table="<table width=100% border=0 cellpadding=3 cellspacing=0>";$table1="</table>";
$ys=$line-$i%$line;
$p=0;
for($j=0;$j<$ys&&$ys!=$line;$j++)
{
$p=1;
$class_text.="<td></td>";
}
if($p==1)
{
$class_text.="</tr>";
}
}
$text=$table.$class_text.$table1;
echo"$text";
}
//显示栏目导航
function sys_ShowClass($show=0){
global $navclassid,$empire,$class_r,$public_r,$dbtbpre;
if(empty($navclassid))
{$classid=0;}
else
{
$classid=$navclassid;
//终极栏目则显示同级栏目
if($class_r[$classid][islast]&&$class_r[$classid][bclassid])
{
$classid=$class_r[$classid][bclassid];
}
if($class_r[$classid][islast]&&empty($class_r[$classid][bclassid]))
{$classid=0;}
}
$sql=$empire->query("select classid,classname,islast,sonclass,tbname from {$dbtbpre}enewsclass where bclassid='$classid' and showclass=0 order by myorder,classid");
$s="";
while($r=$empire->fetch($sql))
{
//栏目链接
$classurl=sys_ReturnBqClassname($r,9);
//显示类别数据数
if($show)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -