⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inc_taglist_view.php

📁 强大的PHP内容管理系统尽量不要让站长把时间都花费在为您修正说明上。压缩包解压
💻 PHP
📖 第 1 页 / 共 2 页
字号:
		$this->dsql->Execute();
		while($row=$this->dsql->GetArray()){
			$idlists .= ($idlists=='' ? $row['aid'] : ','.$row['aid']);
		}
		if($idlists=='') return '';

		//按不同情况设定SQL条件
		$orwhere = " se.aid in($idlists) ";

		//排序方式
		$ordersql = "";
		if($orderby=="uptime") $ordersql = "  order by se.uptime $orderWay";
		else $ordersql=" order by se.aid $orderWay";

		//----------------------------
		$query = "Select se.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
			from `#@__full_search` se left join `#@__arctype` tp on se.typeid=tp.ID
			where $orwhere $ordersql
		";

		$this->dsql->SetQuery($query);
		$this->dsql->Execute('al');
		echo $this->dsql->GetError();
		$artlist = "";
		if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
		$this->dtp2->LoadSource($innertext);
		if(!is_array($this->dtp2->CTags)) return '';
		$GLOBALS['autoindex'] = 0;
		for($i=0;$i<$getrow;$i++)
		{
				if($col>1) $artlist .= "<tr>\r\n";
				for($j=0;$j<$col;$j++)
				{
					if($col>1) $artlist .= "<td width='$colWidth'>\r\n";
					if($row = $this->dsql->GetArray('al',MYSQL_ASSOC))
					{
						$GLOBALS['autoindex']++;
						//处理一些特殊字段
						$row['id'] =  $row['aid'];
						$row['arcurl'] = $row['url'];
						$row['typeurl'] = $this->GetListUrl($row['typeid'],$row['typedir'],$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],"abc");

						if($ismake==0 && $GLOBALS['cfg_multi_site']=='Y')
						{
							if($row['litpic']==''){
								$row['litpic'] = $GLOBALS['cfg_mainsite'].$GLOBALS['cfg_plus_dir']."/img/dfpic.gif";
              }
							else if(!eregi("^http://",$row['picname'])){
								$row['litpic'] = $row['siteurl'].$row['litpic'];
							}
							$row['picname'] = $row['litpic'];
						}else
						{
							if($row['litpic']=='') $row['litpic'] = $GLOBALS['cfg_plus_dir']."/img/dfpic.gif";
						}

						$row['description'] = cnw_left($row['addinfos'],$infolen);
						$row['picname'] = $row['litpic'];
						$row['info'] = $row['description'];
						$row['filename'] = $row['arcurl'];
						$row['uptime'] = GetDateMK($row['uptime']);
						$row['typelink'] = "<a href='".$row['typeurl']."'>[".$row['typename']."]</a>";
						$row['imglink'] = "<a href='".$row['filename']."'><img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".str_replace("'","",$row['title'])."'></a>";
						$row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".str_replace("'","",$row['title'])."'>";
						$row['title'] = cn_substr($row['title'],$titlelen);
						$row['textlink'] = "<a href='".$row['filename']."' title='".str_replace("'","",$row['title'])."'>".$row['title']."</a>";

						foreach($this->dtp2->CTags as $k=>$ctag)
						{
							if(isset($row[$ctag->GetName()])) $this->dtp2->Assign($k,$row[$ctag->GetName()]);
							else $this->dtp2->Assign($k,"");
						}

						$artlist .= $this->dtp2->GetResult();
					//if hasRow
					}else
					{
						$artlist .= "";
					}
					if($col>1) $artlist .= "	</td>\r\n";
				}//Loop Col
				if($col>1) $i += $col - 1;
				if($col>1) $artlist .= "	</tr>\r\n";
		}//Loop Line
		if($col>1) $artlist .= "</table>\r\n";
		$this->dsql->FreeResult("al");
		return $artlist;
	}

	//----------------------------------------
	//获得标签
	//----------------------------------------
	function GetTags($num,$ltype='new',$InnerText=""){

		$InnerText = trim($InnerText);
		if($InnerText=="") $InnerText = GetSysTemplets("tag_one.htm");
		$revalue = "";
		if($ltype=='rand') $orderby = ' rand() ';
		else if($ltype=='week') $orderby=' weekcc desc ';
		else if($ltype=='month') $orderby=' monthcc desc ';
		else if($ltype=='hot') $orderby=' count desc ';
		else $orderby = '  id desc  ';
		$this->dsql->SetQuery("Select tagname,count,monthcc,result From #@__tag_index order by $orderby limit 0,$num");
    $this->dsql->Execute();
		$ctp = new DedeTagParse();
		$ctp->SetNameSpace("field","[","]");
		$ctp->LoadSource($InnerText);
		while($row = $this->dsql->GetArray())
    {
		  $row['keyword'] = $row['tagname'];
		  $row['link'] = $cfg_cmspath."/tag.php?/".urlencode($row['keyword'])."/";

		  $row['highlight'] = $row['keyword'];
		  $row['result'] = trim($row['result']);
		  if(empty($row['result'])) $row['result'] = 0;

		  if($ltype=='view'||$ltype=='rand'||$ltype=='new'){
		  	 if($row['monthcc']>1000 || $row['weekcc']>300 ){
		  	 	  $row['highlight'] = "<span style='font-size:".mt_rand(12,16)."px;color:red'><b>{$row['highlight']}</b></span>";
		  	 }
		  	 else if($row['result']>150){
		  	 	  $row['highlight'] = "<span style='font-size:".mt_rand(12,16)."px;color:blue'>{$row['highlight']}</span>";
		  	 }
		  	 else if($row['count']>1000){
		  	 	  $row['highlight'] = "<span style='font-size:".mt_rand(12,16)."px;color:red'>{$row['highlight']}</span>";
		  	 }
		  }else{
		  	$row['highlight'] = "<span style='font-size:".mt_rand(12,16)."px;'>{$row['highlight']}</span>";
		  }

		  foreach($ctp->CTags as $tagid=>$ctag){
		    if(isset($row[$ctag->GetName()])) $ctp->Assign($tagid,$row[$ctag->GetName()]);
		  }
		  $revalue .= $ctp->GetResult();
		}

		return $revalue;
	}

  //---------------------------------
  //获取动态的分页列表
  //---------------------------------
	function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno")
	{
		$prepage="";
		$nextpage="";
		$prepagenum = $this->PageNo-1;
		$nextpagenum = $this->PageNo+1;
		if($list_len==""||ereg("[^0-9]",$list_len)) $list_len=3;

		$totalpage = $this->TotalPage;

		if($totalpage<=1 && $this->TotalResult>0) return "<a>共1页/".$this->TotalResult."条</a>";

		if($this->TotalResult == 0) return "<a>共0页/".$this->TotalResult."条</a>";

		$maininfo = "<a>共{$totalpage}页/".$this->TotalResult."条</a>\r\n";

		$purl = $this->GetCurUrl();

		$purl .= "?/".$this->Tag;

		//获得上一页和下一页的链接
		if($this->PageNo != 1){
			$prepage.="<a href='".$purl."/$prepagenum/'>上一页</a>\r\n";
			$indexpage="<a href='".$purl."/1/'>首页</a>\r\n";
		}
		else{
			$indexpage="<a>首页</a>\r\n";
		}

		if($this->PageNo!=$totalpage && $totalpage>1){
			$nextpage.="<a href='".$purl."/$nextpagenum/'>下一页</a>\r\n";
			$endpage="<a href='".$purl."/$totalpage/'>末页</a>\r\n";
		}
		else{
			$endpage="<a>末页</a>\r\n";
		}
		//获得数字链接
		$listdd="";
		$total_list = $list_len * 2 + 1;
		if($this->PageNo >= $total_list) {
    		$j = $this->PageNo-$list_len;
    		$total_list = $this->PageNo+$list_len;
    		if($total_list>$totalpage) $total_list=$totalpage;
		}else{
   			$j=1;
   			if($total_list>$totalpage) $total_list=$totalpage;
		}
		for($j;$j<=$total_list;$j++){
   		if($j==$this->PageNo) $listdd.= "<strong>$j</strong>\r\n";
   		else $listdd.="<a href='".$purl."/$j/'>".$j."</a>\r\n";
		}
		$plist  =  "";
		$plist .= $maininfo.$indexpage.$prepage.$listdd.$nextpage.$endpage;
		return $plist;
	}
 	//--------------------------
 	//获得一个指定的频道的链接
 	//--------------------------
 	function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2,$siteurl=""){
  	return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2,$siteurl);
  }
 	//--------------------------
 	//获得一个指定档案的链接
 	//--------------------------
 	function GetArcUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0){
  	return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$artdir,$money);
  }
  //---------------
  //获得当前的页面文件的url
  //----------------
  function GetCurUrl()
	{
		if(!empty($_SERVER["REQUEST_URI"])){
			$nowurl = $_SERVER["REQUEST_URI"];
			$nowurls = explode("?",$nowurl);
			$nowurl = $nowurls[0];
		}else{ $nowurl = $_SERVER["PHP_SELF"]; }
		return $nowurl;
	}
}//End Class
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -