当前位置: 首页>>代码示例>>PHP>>正文


PHP GetDateMK函数代码示例

本文整理汇总了PHP中GetDateMK函数的典型用法代码示例。如果您正苦于以下问题:PHP GetDateMK函数的具体用法?PHP GetDateMK怎么用?PHP GetDateMK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetDateMK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plus_spacenewart

function plus_spacenewart(&$atts, &$refObj, &$fields)
{
    global $dsql, $_vars;
    $attlist = "channel=1,titlelen=30,infolen=200,row=8,imgwidth=120,imgheight=90";
    FillAtts($atts, $attlist);
    FillFields($atts, $fields, $refObj);
    extract($atts, EXTR_OVERWRITE);
    $query = "Select arc.*,mt.mtypename,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\r\n\t\ttp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n\t\tfrom `#@__archives` arc\r\n\t\tleft join `#@__arctype` tp on arc.typeid=tp.id\r\n\t\tleft join `#@__mtypes` mt on mt.mtypeid=arc.mtype\r\n\t\twhere arc.mid='{$_vars['mid']}' and arc.channel={$channel}\r\n\t\torder by id desc limit 0,{$row}";
    $dsql->SetQuery($query);
    $dsql->Execute("al");
    $artlist = '';
    $rearr = array();
    while ($row = $dsql->GetArray("al")) {
        //处理一些特殊字段
        $row['infos'] = cn_substr($row['description'], $infolen);
        $row['id'] = $row['id'];
        $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
        $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
        if ($row['litpic'] == '') {
            $row['litpic'] = '/images/defaultpic.gif';
        }
        if (!eregi("^http://", $row['litpic'])) {
            $row['picname'] = $row['litpic'] = $GLOBALS['cfg_cmsurl'] . $row['litpic'];
        } else {
            $row['picname'] = $row['litpic'] = $row['litpic'];
        }
        $row['stime'] = GetDateMK($row['pubdate']);
        $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
        $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . ereg_replace("['><]", "", $row['title']) . "'>";
        $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
        $row['fulltitle'] = $row['title'];
        $row['title'] = cn_substr($row['title'], $titlelen);
        if ($row['color'] != '') {
            $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
        }
        if (ereg('b', $row['flag'])) {
            $row['title'] = "<strong>" . $row['title'] . "</strong>";
        }
        //$row['title'] = "<b>".$row['title']."</b>";
        $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
        $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
        $row['memberurl'] = $GLOBALS['cfg_memberurl'];
        $row['templeturl'] = $GLOBALS['cfg_templeturl'];
        $rearr[] = $row;
    }
    //loop line
    $dsql->FreeResult("al");
    return $rearr;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:49,代码来源:plus_spacenewart.php

示例2: GetList


//.........这里部分代码省略.........
				  if(isset($nfields[$k])){
				     if($arr['rename']!="") $addField .= ",".$addtable.".".$k." as ".$arr['rename'];
				     else $addField .= ",".$addtable.".".$k;
				  }
			 }
		  }
		}
		//
		//----------------------------
		$query = "Select arc.ID,arc.title,arc.iscommend,arc.color,
		arc.typeid,arc.ismake,arc.money,arc.description,arc.shorttitle,
		arc.memberid,arc.writer,arc.postnum,arc.lastpost,
		arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.litpic,
		tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
		tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		$addField
		from {$this->maintable} arc
		left join #@__arctype tp on arc.typeid=tp.ID
		$addJoin
		where $orwhere $ordersql limit $limitstart,".$this->PageSize;
		$this->dsql->SetQuery($query);
		$this->dsql->Execute("al");
    $artlist = "";
    if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
    $indtp = new DedeTagParse();
 		$indtp->SetNameSpace("field","[","]");
    $indtp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    for($i=0;$i<$this->PageSize;$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"))
         {
           $GLOBALS['autoindex']++;
           //处理一些特殊字段
           $row['id'] =  $row['ID'];
           $row['arcurl'] = $this->GetArcUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],$row['arcrank'],$row['namerule'],$row['typedir'],$row['money']);
           $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["siteurl"]=="") $row["siteurl"] = $GLOBALS['cfg_mainsite'];
           	 if(!eregi("^http://",$row['picname'])){
           	 	  $row['litpic'] = $row['siteurl'].$row['litpic'];
           	 	  $row['picname'] = $row['litpic'];
           	 }
           }

           $row['description'] = cnw_left($row['description'],$infolen);
           if($row['litpic']=="") $row['litpic'] = $GLOBALS['cfg_plus_dir']."/img/dfpic.gif";
           $row['picname'] = $row['litpic'];
           $row['info'] = $row['description'];
           $row['filename'] = $row['arcurl'];
           $row['stime'] = GetDateMK($row['pubdate']);
           $row['textlink'] = "<a href='".$row['filename']."' title='".str_replace("'","",$row['title'])."'>".$row['title']."</a>";
           $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['phpurl'] = $GLOBALS['cfg_plus_dir'];
           $row['plusurl'] = $GLOBALS['cfg_plus_dir'];
 		       $row['templeturl'] = $GLOBALS['cfg_templets_dir'];
 		       $row['memberurl'] = $GLOBALS['cfg_member_dir'];
 		       $row['title'] = cn_substr($row['title'],$titlelen);
           if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
           if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>";
           //编译附加表里的数据
           if(is_object($this->ChannelUnit)){
              foreach($row as $k=>$v){
 		  	         if(ereg("[A-Z]",$k)) $row[strtolower($k)] = $v;
 		          }
              foreach($this->ChannelUnit->ChannelFields as $k=>$arr){
 		  	         if(isset($row[$k])) $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]);
 		  	      }
 		  	   }
           //---------------------------
           //解析单条记录
           //-------------------------
           if(is_array($indtp->CTags)){
       	      foreach($indtp->CTags as $k=>$ctag){
       		 	    $_f = $ctag->GetName();
       		 	    if(isset($row[$_f])) $indtp->Assign($k,$row[$_f]);
       		 	    else $indtp->Assign($k,"");
       	     }
           }
           $artlist .= $indtp->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;
  }
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_freelist_view.php

示例3: GetArcList

	function GetArcList($limitstart=0,$row=10,$col=1,$titlelen=30,$infolen=250,
	$imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$innertext="",$tablewidth="100",$ismake=1,$orderWay='desc')
	{
		global $cfg_list_son;
		$t1 = ExecTime();
		$getrow = ($row=="" ? 10 : $row);
		if($limitstart=="") $limitstart = 0;
		if($titlelen=="") $titlelen = 100;
		if($infolen=="") $infolen = 250;
		if($imgwidth=="") $imgwidth = 120;
		if($imgheight=="") $imgheight = 120;
		if($listtype=="") $listtype = "all";
		if($orderby=="") $orderby="default";
		else $orderby=strtolower($orderby);
		if($orderWay=='') $orderWay = 'desc';
		$tablewidth = str_replace("%","",$tablewidth);
		if($tablewidth=="") $tablewidth=100;
		if($col=="") $col=1;
		$colWidth = ceil(100/$col);
		$tablewidth = $tablewidth."%";
		$colWidth = $colWidth."%";
		$innertext = trim($innertext);
		if($innertext=="") $innertext = GetSysTemplets("list_fulllist.htm");

		$idlists = '';
		$this->dsql->SetQuery("Select aid From #@__tag_list where tid='{$this->TagID}' And arcrank>-1 limit $limitstart,$getrow");
		//echo "Select aid From #@__tag_list where tid='{$this->TagID}' And arcrank>-1 limit $limitstart,$getrow";
		$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,"");
						}

//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_taglist_view.php

示例4: SpGetFullList


//.........这里部分代码省略.........
    
	 //文档排序的方式
		$ordersql = "";
    if($orderby=='rand') $ordersql = "  order by rand()";
    else if($orderby=='click'||$orderby=='hot') $ordersql = "  order by arcf.click desc";
    else if($orderby=='digg') $ordersql = "  order by arcf.digg desc";
    else if($orderby=='diggtime') $ordersql = "  order by arcf.diggtime desc";
		else $ordersql=" order by arcf.aid desc";

    //返回结果条数
	  if(!empty($limit)) $limitsql = " limit $limitv ";
	  else $limitsql = " limit 0,$line ";

	  //载入底层模板
	  $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace("field","[","]");
    $dtp2->LoadString($innertext);
    if(!is_array($dtp2->CTags)) return '';

		//执行SQL查询
		$query = "Select arcf.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		from `#@__full_search` arcf left join `#@__arctype` tp on arcf.typeid=tp.ID
		where $orwhere $ordersql $limitsql ";
		
		$md5hash = md5($query);
		$artlist = '';
		$ids = '';
		$needup = false;
		if($idlist=='' && $cfg_al_cachetime>0)
		{
		  	$ids = SpGetArclistDateCacheF($dsql,$md5hash);
		  	if($ids=='-1') $needup = true;
		  	else if($ids!='')
		  	{
		         $query = "Select arcf.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		                 from `#@__full_search` arcf left join `#@__arctype` tp on arcf.typeid=tp.ID
		                 where arcf.aid in($ids) $ordersql $limitsql ";
		  	}else 
		  	{
		  		return '';
		  	}
		}
		$nids = array();
		$t1 = ExecTime();
		$dsql->SetQuery($query);
		$dsql->Execute("alf");
    
    $GLOBALS['autoindex'] = 0;
    while($row = $dsql->GetArray("alf"))
    {
       //处理一些特殊字段
       $row['description'] = cn_substr($row['addinfos'],$infolen);
       $nids[] = $row['id'] =  $row['aid'];
       if(!isset($row['picname'])) $row['picname'] = '';
       
       if($row['url']=='') $row['url'] = $GLOBALS['cfg_phpurl'].'/view.php?aid='.$row['aid'];
       
       $row['filename'] = $row['arcurl'] = $row['url'];
       $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
       if($row['litpic']=="") $row['litpic'] = $GLOBALS['PubFields']['templeturl']."/img/default.gif";
       $row['picname'] = $row['litpic'];
       if($GLOBALS['cfg_multi_site']=='Y')
       {
           if($row['siteurl']=="") $row['siteurl'] = $GLOBALS['cfg_mainsite'];
           if(!eregi("^http://",$row['picname'])){
           	 	$row['litpic'] = $row['siteurl'].$row['litpic'];
           	 	$row['picname'] = $row['litpic'];
           }
       }
       $row['stime'] = GetDateMK($row['uptime']);
       $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
       $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."' />";
       $row['imglink'] = "<a href='".$row['arcurl']."'>".$row['image']."</a>";
       $row['fulltitle'] = $row['title'];
       $row['title'] = cn_substr($row['title'],$titlelen);
       $row['textlink'] = "<a href='".$row['arcurl']."'>".$row['title']."</a>";
       foreach($dtp2->CTags as $k=>$ctag)
       {
       		if(isset($row[$ctag->GetName()])){
       			$dtp2->Assign($k,$row[$ctag->GetName()]);
       		}
       		else $dtp2->Assign($k,'');
       }
       $GLOBALS['autoindex']++;
       $artlist .= $dtp2->GetResult();
     }//Loop Line
     $dsql->FreeResult("alf");
     
     if($needup)
     {
     	  $ids = join(',',$nids);
     	  $inquery = "INSERT INTO `#@__arccache_full`(`md5hash`,`uptime`,`cachedata`) VALUES ('".$md5hash."', '".time()."', '$ids'); ";
	      $dsql->ExecuteNoneQuery("Delete From `#@__arccache_full` where md5hash='".$md5hash."' or uptime < $mintime ");
	      $dsql->ExecuteNoneQuery($inquery);
     }
     
     $t2 = ExecTime();
     //echo "<hr>".($t2-$t1)." $query<hr>";
     return $artlist;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_fun_SpFullList.php

示例5: GetArcList

  function GetArcList($innertext="")
  {
    $typeid=$this->TypeID;
		$innertext = trim($innertext);
		if($innertext=="") $innertext = GetSysTemplets("rss.htm");
		$orwhere = " #@__archives.arcrank > -1 ";
		$orwhere .= " And (".$this->TypeLink->GetSunID($this->TypeID,"#@__archives",$this->TypeFields['channeltype'])." Or #@__archives.typeid2='".$this->TypeID."') ";
		$ordersql=" order by #@__archives.senddate desc";
		//----------------------------
		$query = "Select #@__archives.ID,#@__archives.title,#@__archives.source,#@__archives.writer,#@__archives.typeid,#@__archives.ismake,#@__archives.money,
		#@__archives.description,#@__archives.pubdate,#@__archives.senddate,#@__archives.arcrank,#@__archives.click,
		#@__archives.litpic,#@__arctype.typedir,#@__arctype.typename,#@__arctype.isdefault,
		#@__arctype.defaultname,#@__arctype.namerule,#@__arctype.namerule2,#@__arctype.ispart,
		#@__arctype.siteurl 
		from #@__archives 
		left join #@__arctype on #@__archives.typeid=#@__arctype.ID
		where $orwhere $ordersql limit 0,".$this->MaxRow;
		$this->dsql->SetQuery($query);
		$this->dsql->Execute("al");
    $artlist = "";
    $dtp2 = new DedeTagParse();
 		$dtp2->SetNameSpace("field","[","]");
    $dtp2->LoadSource($innertext);
    while($row = $this->dsql->GetArray("al"))
    {
      //处理一些特殊字段
      if($row["litpic"]=="") $row["litpic"] = $GLOBALS["cfg_plus_dir"]."/img/dfpic.gif";
      $row["picname"] = $row["litpic"];
      $row["arcurl"] = $this->GetArcUrl($row["ID"],$row["typeid"],$row["senddate"],$row["title"],
                        $row["ismake"],$row["arcrank"],$row["namerule"],$row["typedir"],$row["money"]);
      $row["typeurl"] = $this->GetListUrl($row["typeid"],$row["typedir"],$row["isdefault"],$row["defaultname"],$row["ispart"],$row["namerule2"]);
      $row["info"] = $row["description"];
      $row["filename"] = $row["arcurl"];
      $row["stime"] = GetDateMK($row["pubdate"]);
      $row["image"] = "<img src='".$row["picname"]."' border='0'>";
      $row["fullurl"] = $row['siteurl'].$row["arcurl"];
      $row["phpurl"] = $GLOBALS["cfg_plus_dir"];
 		  $row["templeturl"] = $GLOBALS["cfg_templets_dir"];
 		  if($row["source"]=="") $row["source"] = $GLOBALS['cfg_webname'];
 		  if($row["writer"]=="") $row["writer"] = "秩名";
 		  
 		  foreach($row as $k=>$v){
 		  	$row[$k] = htmlspecialchars($v);
 		  }
      //---------------------------
      if(is_array($dtp2->CTags)){
       	foreach($dtp2->CTags as $k=>$ctag){
       		if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
       		else $dtp2->Assign($k,"");
       	}
      }
      $artlist .= $dtp2->GetResult()."\r\n";
     }
     $this->dsql->FreeResult("al");
     return $artlist;
  }
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:56,代码来源:inc_rss_view.php

示例6: cn_substr

 //处理一些特殊字段
 $row['info'] = $row['infos'] = cn_substr($row['description'], $infolen);
 $row['id'] = $row['id'];
 if ($row['corank'] > 0 && $row['arcrank'] == 0) {
     $row['arcrank'] = $row['corank'];
 }
 $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
 $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
 if ($row['litpic'] == '-' || $row['litpic'] == '') {
     $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
 }
 if (!preg_match("#^http:\\/\\/#", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
     $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
 }
 $row['picname'] = $row['litpic'];
 $row['stime'] = GetDateMK($row['pubdate']);
 $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
 $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . preg_replace("#['><]#", "", $row['title']) . "'>";
 $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
 $row['fulltitle'] = $row['title'];
 $row['title'] = cn_substr($row['title'], $titlelen);
 if ($row['color'] != '') {
     $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
 }
 if (preg_match('#b#', $row['flag'])) {
     $row['title'] = "<strong>" . $row['title'] . "</strong>";
 }
 //$row['title'] = "<b>".$row['title']."</b>";
 $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
 $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
 $row['memberurl'] = $GLOBALS['cfg_memberurl'];
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:arcmulti.php

示例7: GetArcList

 /**
  *  获得文档列表
  *
  * @access    public
  * @param     string  $innertext  底层模板
  * @return    string
  */
 function GetArcList($innertext = "")
 {
     $typeid = $this->TypeID;
     $innertext = trim($innertext);
     if ($innertext == "") {
         $innertext = GetSysTemplets("rss.htm");
     }
     $orwhere = " arc.arcrank > -1 ";
     $orwhere .= " AND (arc.typeid in (" . GetSonIds($this->TypeID, $this->TypeFields['channeltype']) . ") ) ";
     $ordersql = " ORDER BY arc.id desc";
     $query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,\r\n        tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n        FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\r\n        WHERE {$orwhere} {$ordersql} LIMIT 0," . $this->MaxRow;
     $this->dsql->SetQuery($query);
     $this->dsql->Execute('al');
     $artlist = '';
     $dtp2 = new DedeTagParse();
     $dtp2->SetNameSpace('field', '[', ']');
     $dtp2->LoadSource($innertext);
     while ($row = $this->dsql->GetArray('al')) {
         //处理一些特殊字段
         if ($row['litpic'] == '-' || $row['litpic'] == '') {
             $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
         }
         if (!preg_match("/^http:\\/\\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
             $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
         }
         $row['picname'] = $row['litpic'];
         $row["arcurl"] = GetFileUrl($row["id"], $row["typeid"], $row["senddate"], $row["title"], $row["ismake"], $row["arcrank"], $row["namerule"], $row["typedir"], $row["money"], $row['filename'], $row["moresite"], $row["siteurl"], $row["sitepath"]);
         $row["typeurl"] = GetTypeUrl($row["typeid"], $row["typedir"], $row["isdefault"], $row["defaultname"], $row["ispart"], $row["namerule2"], $row["moresite"], $row["siteurl"], $row["sitepath"]);
         $row["info"] = $row["description"];
         $row["filename"] = $row["arcurl"];
         $row["stime"] = GetDateMK($row["pubdate"]);
         $row["image"] = "<img src='" . $row["picname"] . "' border='0'>";
         $row["fullurl"] = $GLOBALS["cfg_basehost"] . $row["arcurl"];
         // 2011-6-20 启用多站点RSS输出存在的路径问题(by:织梦的鱼)
         if ($GLOBALS['cfg_multi_site'] == 'Y') {
             $row["fullurl"] = $row["arcurl"];
         }
         $row["phpurl"] = $GLOBALS["cfg_plus_dir"];
         $row["templeturl"] = $GLOBALS["cfg_templets_dir"];
         if ($row["source"] == '') {
             $row["source"] = $GLOBALS['cfg_webname'];
         }
         if ($row["writer"] == '') {
             $row["writer"] = "秩名";
         }
         foreach ($row as $k => $v) {
             $row[$k] = htmlspecialchars($v);
         }
         if (is_array($dtp2->CTags)) {
             foreach ($dtp2->CTags as $k => $ctag) {
                 if ($ctag->GetName() == 'array') {
                     //传递整个数组,在runphp模式中有特殊作用
                     $dtp2->Assign($k, $row);
                 } else {
                     if (isset($row[$ctag->GetName()])) {
                         $dtp2->Assign($k, $row[$ctag->GetName()]);
                     } else {
                         $dtp2->Assign($k, '');
                     }
                 }
             }
         }
         $artlist .= $dtp2->GetResult() . "\r\n";
     }
     $this->dsql->FreeResult('al');
     return $artlist;
 }
开发者ID:soonfine,项目名称:leread,代码行数:74,代码来源:arc.rssview.class.php

示例8: GetArcList

 function GetArcList($limitstart = 0, $row = 10, $col = 1, $titlelen = 30, $infolen = 250, $imgwidth = 120, $imgheight = 90, $achanneltype = "all", $orderby = "default", $innertext = "", $tablewidth = "100")
 {
     $typeid = $this->TypeID;
     if ($row == '') {
         $row = 10;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     if ($titlelen == '') {
         $titlelen = 30;
     }
     if ($infolen == '') {
         $infolen = 250;
     }
     if ($imgwidth == '') {
         $imgwidth = 120;
     }
     if ($imgheight = '') {
         $imgheight = 120;
     }
     if ($achanneltype == '') {
         $achanneltype = '0';
     }
     $orderby = $orderby == '' ? 'default' : strtolower($orderby);
     $tablewidth = str_replace("%", "", $tablewidth);
     if ($tablewidth == '') {
         $tablewidth = 100;
     }
     if ($col == '') {
         $col = 1;
     }
     $colWidth = ceil(100 / $col);
     $tablewidth = $tablewidth . "%";
     $colWidth = $colWidth . "%";
     $innertext = trim($innertext);
     if ($innertext == '') {
         $innertext = GetSysTemplets("search_list.htm");
     }
     //排序方式
     $ordersql = '';
     if ($orderby == "senddate") {
         $ordersql = " order by arc.senddate desc";
     } else {
         if ($orderby == "pubdate") {
             $ordersql = " order by arc.pubdate desc";
         } else {
             if ($orderby == "id") {
                 $ordersql = "  order by arc.id desc";
             } else {
                 $ordersql = " order by arc.sortrank desc";
             }
         }
     }
     //搜索
     $query = "Select arc.*,act.typedir,act.typename,act.isdefault,act.defaultname,act.namerule,\r\n\t\tact.namerule2,act.ispart,act.moresite,act.siteurl,act.sitepath\r\n\t\tfrom `#@__archives` arc left join `#@__arctype` act on arc.typeid=act.id\r\n\t\twhere {$this->AddSql} {$ordersql} limit {$limitstart},{$row}";
     $this->dsql->SetQuery($query);
     $this->dsql->Execute("al");
     $artlist = "";
     if ($col > 1) {
         $artlist = "<table width='{$tablewidth}' border='0' cellspacing='0' cellpadding='0'>\r\n";
     }
     $this->dtp2->LoadSource($innertext);
     for ($i = 0; $i < $row; $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")) {
                 //处理一些特殊字段
                 $row["arcurl"] = GetFileUrl($row["id"], $row["typeid"], $row["senddate"], $row["title"], $row["ismake"], $row["arcrank"], $row["namerule"], $row["typedir"], $row["money"], $row['filename'], $row["moresite"], $row["siteurl"], $row["sitepath"]);
                 $row["description"] = $this->GetRedKeyWord(cn_substr($row["description"], $infolen));
                 $row["title"] = $this->GetRedKeyWord(cn_substr($row["title"], $titlelen));
                 $row["id"] = $row["id"];
                 if ($row['litpic'] == '-' || $row['litpic'] == '') {
                     $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                 }
                 if (!eregi("^http://", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                     $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                 }
                 $row['picname'] = $row['litpic'];
                 $row["typeurl"] = GetTypeUrl($row["typeid"], $row["typedir"], $row["isdefault"], $row["defaultname"], $row["ispart"], $row["namerule2"], $row["moresite"], $row["siteurl"], $row["sitepath"]);
                 $row["info"] = $row["description"];
                 $row["filename"] = $row["arcurl"];
                 $row["stime"] = GetDateMK($row["pubdate"]);
                 $row["textlink"] = "<a href='" . $row["filename"] . "'>" . $row["title"] . "</a>";
                 $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}'></a>";
                 $row["image"] = "<img src='" . $row["picname"] . "' border='0' width='{$imgwidth}' height='{$imgheight}'>";
                 $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                 $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                 $row['templeturl'] = $GLOBALS['cfg_templeturl'];
                 if (is_array($this->dtp2->CTags)) {
                     foreach ($this->dtp2->CTags as $k => $ctag) {
                         if ($ctag->GetName() == 'array') {
                             //传递整个数组,在runphp模式中有特殊作用
                             $this->dtp2->Assign($k, $row);
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:arc.searchview.class.php

示例9: GetArcList


//.........这里部分代码省略.........
         $query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,\n            tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,\n            {$addField}\n            FROM `{$this->AddTable}` arc\n            LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n            WHERE {$this->addSql} {$ordersql} LIMIT {$limitstart},{$row}";
     } else {
         $t1 = ExecTime();
         $ids = array();
         $nordersql = str_replace('.aid', '.id', $ordersql);
         $query = "SELECT id From `#@__arctiny` arc WHERE {$this->addSql} {$nordersql} LIMIT {$limitstart},{$row} ";
         $this->dsql->SetQuery($query);
         $this->dsql->Execute();
         while ($arr = $this->dsql->GetArray()) {
             $ids[] = $arr['id'];
         }
         $idstr = join(',', $ids);
         if ($idstr == '') {
             return '';
         } else {
             $query = "SELECT tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,\n                tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,arc.aid,arc.aid AS id,arc.typeid,\n                       {$addField}\n                       FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n                       WHERE arc.aid IN({$idstr}) AND arc.arcrank >-1 {$ordersql} ";
         }
         $t2 = ExecTime();
         //echo $t2-$t1;
     }
     $this->dsql->SetQuery($query);
     $this->dsql->Execute('al');
     $t2 = ExecTime();
     //echo $t2-$t1;
     $artlist = '';
     $this->dtp2->LoadSource($innertext);
     $GLOBALS['autoindex'] = 0;
     for ($i = 0; $i < $row; $i++) {
         if ($col > 1) {
             $artlist .= "<div>\r\n";
         }
         for ($j = 0; $j < $col; $j++) {
             if ($row = $this->dsql->GetArray("al")) {
                 $GLOBALS['autoindex']++;
                 $ids[$row['aid']] = $row['id'] = $row['aid'];
                 //处理一些特殊字段
                 $row['ismake'] = 1;
                 $row['money'] = 0;
                 $row['arcrank'] = 0;
                 $row['filename'] = '';
                 $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                 $row['typeurl'] = GetTypeUrl($row['typeid'], MfTypedir($row['typedir']), $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                 if ($row['litpic'] == '-' || $row['litpic'] == '') {
                     $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                 }
                 if (!preg_match("/^http:\\/\\//", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                     $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                 }
                 $row['picname'] = $row['litpic'];
                 $row['pubdate'] = $row['senddate'];
                 $row['stime'] = GetDateMK($row['pubdate']);
                 $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
                 $row['fulltitle'] = $row['title'];
                 $row['title'] = cn_substr($row['title'], $titlelen);
                 if (preg_match('/b/', $row['flag'])) {
                     $row['title'] = "<b>" . $row['title'] . "</b>";
                 }
                 $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
                 $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                 $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                 $row['templeturl'] = $GLOBALS['cfg_templeturl'];
                 //编译附加表里的数据
                 foreach ($row as $k => $v) {
                     $row[strtolower($k)] = $v;
                 }
                 foreach ($this->ChannelUnit->ChannelFields as $k => $arr) {
                     if (isset($row[$k])) {
                         $row[$k] = $this->ChannelUnit->MakeField($k, $row[$k]);
                     }
                 }
                 if (is_array($this->dtp2->CTags)) {
                     foreach ($this->dtp2->CTags as $k => $ctag) {
                         if ($ctag->GetName() == 'array') {
                             //传递整个数组,在runphp模式中有特殊作用
                             $this->dtp2->Assign($k, $row);
                         } else {
                             if (isset($row[$ctag->GetName()])) {
                                 $this->dtp2->Assign($k, $row[$ctag->GetName()]);
                             } else {
                                 $this->dtp2->Assign($k, '');
                             }
                         }
                     }
                 }
                 $artlist .= $this->dtp2->GetResult();
             }
             //if hasRow
         }
         //Loop Col
         if ($col > 1) {
             $i += $col - 1;
             $artlist .= "    </div>\r\n";
         }
     }
     //Loop Line
     $t3 = ExecTime();
     //echo ($t3-$t2);
     $this->dsql->FreeResult('al');
     return $artlist;
 }
开发者ID:cwcw,项目名称:cms,代码行数:101,代码来源:arc.sglistview.class.php

示例10: GetArcList

 function GetArcList($atts, $refObj = '', $fields = array())
 {
     $attlist = "titlelen=30,infolen=200,imgwidth=120,imgheight=90";
     FillAtts($atts, $attlist);
     FillFields($atts, $fields, $refObj);
     extract($atts, EXTR_OVERWRITE);
     $rsArray = array();
     //global $_vars;
     //$t1 = Exectime();
     if (!$this->isQuery) {
         $this->dsql->Execute('mbdl', $this->sourceSql);
     }
     $i = 0;
     while ($row = $this->dsql->GetArray('mbdl')) {
         $i++;
         if (!isset($row['description'])) {
             $row['description'] = '';
         }
         if (!isset($row['color'])) {
             $row['color'] = '';
         }
         if (!isset($row['pubdate'])) {
             $row['pubdate'] = $row['senddate'];
         }
         //处理一些特殊字段
         $row['infos'] = cn_substr($row['description'], $infolen);
         $row['id'] = $row['id'];
         $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
         $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
         if ($row['litpic'] == '-' || $row['litpic'] == '') {
             $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
         }
         if (!eregi("^http://", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
             $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
         }
         $row['picname'] = $row['litpic'];
         $row['stime'] = GetDateMK($row['pubdate']);
         $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
         $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . ereg_replace("['><]", "", $row['title']) . "'>";
         $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
         $row['fulltitle'] = $row['title'];
         $row['title'] = cn_substr($row['title'], $titlelen);
         if ($row['color'] != '') {
             $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
         }
         if (ereg('b', $row['flag'])) {
             $row['title'] = "<strong>" . $row['title'] . "</strong>";
         }
         //$row['title'] = "<b>".$row['title']."</b>";
         $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
         $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
         $row['memberurl'] = $GLOBALS['cfg_memberurl'];
         $row['templeturl'] = $GLOBALS['cfg_templeturl'];
         $rsArray[$i] = $row;
         if ($i >= $this->pageSize) {
             break;
         }
     }
     $this->dsql->FreeResult();
     //echo "执行时间:".(Exectime() - $t1);
     return $rsArray;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:62,代码来源:arc.memberlistview.class.php

示例11: lib_arclistDone


//.........这里部分代码省略.........
    if ($col > 1) {
        $artlist = "<table width='{$tablewidth}' border='0' cellspacing='0' cellpadding='0'>\r\n";
    }
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadString($innertext);
    $GLOBALS['autoindex'] = 0;
    $ids = array();
    for ($i = 0; $i < $line; $i++) {
        if ($col > 1) {
            $artlist .= "<tr>\r\n";
        }
        for ($j = 0; $j < $col; $j++) {
            if ($col > 1) {
                $artlist .= "\t<td width='{$colWidth}'>\r\n";
            }
            if ($row = $dsql->GetArray("al")) {
                $ids[] = $row['id'];
                //处理一些特殊字段
                $row['info'] = $row['infos'] = cn_substr($row['description'], $infolen);
                $row['id'] = $row['id'];
                if ($row['corank'] > 0 && $row['arcrank'] == 0) {
                    $row['arcrank'] = $row['corank'];
                }
                $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                if ($row['litpic'] == '-' || $row['litpic'] == '') {
                    $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                }
                if (!eregi("^http://", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                    $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                }
                $row['picname'] = $row['litpic'];
                $row['stime'] = GetDateMK($row['pubdate']);
                $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
                $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . ereg_replace("['><]", "", $row['title']) . "'>";
                $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
                $row['fulltitle'] = $row['title'];
                $row['title'] = cn_substr($row['title'], $titlelen);
                if ($row['color'] != '') {
                    $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
                }
                if (ereg('b', $row['flag'])) {
                    $row['title'] = "<strong>" . $row['title'] . "</strong>";
                }
                //$row['title'] = "<b>".$row['title']."</b>";
                $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
                $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                $row['templeturl'] = $GLOBALS['cfg_templeturl'];
                if (is_array($dtp2->CTags)) {
                    foreach ($dtp2->CTags as $k => $ctag) {
                        if ($ctag->GetName() == 'array') {
                            //传递整个数组,在runphp模式中有特殊作用
                            $dtp2->Assign($k, $row);
                        } else {
                            if (isset($row[$ctag->GetName()])) {
                                $dtp2->Assign($k, $row[$ctag->GetName()]);
                            } else {
                                $dtp2->Assign($k, '');
                            }
                        }
                    }
                    $GLOBALS['autoindex']++;
                }
                $artlist .= $dtp2->GetResult() . "\r\n";
开发者ID:klr2003,项目名称:sourceread,代码行数:67,代码来源:arclist.lib.php

示例12: SpGetArcList


//.........这里部分代码省略.........
		if($idlist!="")
		{
			$reids = explode(",",$idlist);
		  $ridnum = count($reids);
		  $idlistSql = "";
		  for($i=0;$i<$ridnum;$i++){
				if($idlistSql=="") $idlistSql .= " And ( arc.ID='".$reids[$i]."' ";
				else $idlistSql .= " Or arc.ID='".$reids[$i]."' ";
		  }
		  $idlistSql .= ") ";
		  $orwhere .= $idlistSql;
		  unset($idlistSql);
		  unset($reids);
		  $row = $ridnum;
		}
		//关键字条件
		if($keyword!="")
		{
		  $keywords = explode(",",$keyword);
		  $ridnum = count($keywords);
		  $orwhere .= " And (arc.keywords like '%".trim($keywords[0])." %' ";
		  for($i=1;$i<$ridnum;$i++){
			  if($keywords[$i]!="") $orwhere .= " Or arc.keywords like '%".trim($keywords[$i])." %' ";
		  }
		  $orwhere .= ")";
		  unset($keywords);
	  }
	  $limit = trim(eregi_replace("limit","",$limit));
	  if($limit!="") $limitsql = " limit $limit ";
	  else $limitsql = " limit 0,$line ";
		//////////////
		$query = "Select arc.ID,arc.title,arc.iscommend,arc.color,arc.typeid,arc.ismake,
		arc.description,arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.money,
		arc.litpic,tp.typedir,tp.typename,tp.isdefault,
		tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
		from #@__archives arc left join #@__arctype tp on arc.typeid=tp.ID
		where $orwhere $ordersql $limitsql";
		 
		$dsql->SetQuery($query);
		$dsql->Execute("al");
    $artlist = "";
    if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace("field","[","]");
    $dtp2->LoadString($innertext);
    $GLOBALS['autoindex'] = 0;
    for($i=0;$i<$line;$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 = $dsql->GetArray("al"))
         {
           //处理一些特殊字段
           $row['description'] = cn_substr($row['description'],$infolen);
           $row['id'] =  $row['ID'];
           file_put_contents("c:/ttt.txt",$row['id']); 
           if($row['litpic']=="") $row['litpic'] = $PubFields['templeturl']."/img/default.gif";
           $row['picname'] = $row['litpic'];
           $row['arcurl'] = GetFileUrl($row['id'],$row['typeid'],$row['senddate'],
                            $row['title'],$row['ismake'],$row['arcrank'],$row['namerule'],
                            $row['typedir'],$row['money'],true,$row['siteurl']);
           $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);

           $row['info'] = $row['description'];
           $row['filename'] = $row['arcurl'];
           $row['stime'] = GetDateMK($row['pubdate']);
           $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
           $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."'>";
           $row['imglink'] = "<a href='".$row['filename']."'>".$row['image']."</a>";
           $row['title'] = cn_substr($row['title'],$titlelen);
           $row['textlink'] = "<a href='".$row['filename']."'>".$row['title']."</a>";
           
           if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
           if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>";
           
           $row['phpurl'] = $PubFields['phpurl'];
 		       $row['templeturl'] = $PubFields['templeturl'];
           if(is_array($dtp2->CTags)){
       	      foreach($dtp2->CTags as $k=>$ctag){
       		 	    if(isset($row[$ctag->GetName()])) $dtp2->Assign($k,$row[$ctag->GetName()]);
       		 	    else $dtp2->Assign($k,"");
       	      }
       	      $GLOBALS['autoindex']++;
           }
           $artlist .= $dtp2->GetResult()."\r\n";
         }//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";
     $dsql->FreeResult("al");
     return $artlist;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_separate_functions.php

示例13: GetArcList

	function GetArcList($limitstart=0,$row=10,$col=1,$titlelen=30,$infolen=250,
	$imgwidth=120,$imgheight=90,$listtype="all",$orderby="default",$innertext="",$tablewidth="100",$ismake=1,$orderWay='desc')
	{
		global $cfg_list_son;
		$t1 = ExecTime();
		$typeid=$this->TypeID;
		if($row=="") $row = 10;
		if($limitstart=="") $limitstart = 0;
		if($titlelen=="") $titlelen = 100;
		if($infolen=="") $infolen = 250;
		if($imgwidth=="") $imgwidth = 120;
		if($imgheight=="") $imgheight = 120;
		if($listtype=="") $listtype = "all";
		if($orderby=="") $orderby="default";
		else $orderby=strtolower($orderby);
		if($orderWay=='') $orderWay = 'desc';
		$tablewidth = str_replace("%","",$tablewidth);
		if($tablewidth=="") $tablewidth=100;
		if($col=="") $col=1;
		$colWidth = ceil(100/$col);
		$tablewidth = $tablewidth."%";
		$colWidth = $colWidth."%";
		$innertext = trim($innertext);
		if($innertext=="") $innertext = GetSysTemplets("list_digglist.htm");
		//按不同情况设定SQL条件
		$orwhere = " arc.arcrank > -1 ";
    
		//排序方式
		$ordersql = "";
		if($orderby=="digg") $ordersql=" order by arc.digg $orderWay";
		else $ordersql=" order by arc.diggtime $orderWay";

    $this->dtp2->LoadSource($innertext);
		if(!is_array($this->dtp2->CTags)) return '';

		$query = "Select arc.*,
			tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
			tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
			from `#@__full_search` arc
			left join #@__arctype tp on arc.typeid=tp.ID
			where $orwhere $ordersql limit $limitstart,$row
		";
		$this->dsql->SetQuery($query);
		$this->dsql->Execute("alf");
		//$t2 = ExecTime();
		//echo $query."|";
		//echo ($t2-$t1)."<br>";
		$artlist = "";
		$GLOBALS['autoindex'] = 0;
		while($row = $this->dsql->GetArray("alf"))
    {
       //处理一些特殊字段
       $row['description'] = cn_substr($row['addinfos'],$infolen);
       $row['id'] =  $row['aid'];
       $row['filename'] = $row['arcurl'] = $row['url'];
       $row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
       if($row['litpic']=="") $row['litpic'] = $GLOBALS['PubFields']['templeturl']."/img/default.gif";
       $row['picname'] = $row['litpic'];
       if($GLOBALS['cfg_multi_site']=='Y')
       {
           if($row['siteurl']=="") $row['siteurl'] = $GLOBALS['cfg_mainsite'];
           if(!eregi("^http://",$row['picname'])){
           	 	$row['litpic'] = $row['siteurl'].$row['litpic'];
           	 	$row['picname'] = $row['litpic'];
           }
       }
       $row['stime'] = GetDateMK($row['uptime']);
       $row['typelink'] = "<a href='".$row['typeurl']."'>".$row['typename']."</a>";
       $row['image'] = "<img src='".$row['picname']."' border='0' width='$imgwidth' height='$imgheight' alt='".ereg_replace("['><]","",$row['title'])."' />";
       $row['imglink'] = "<a href='".$row['arcurl']."'>".$row['image']."</a>";
       $row['fulltitle'] = $row['title'];
       $row['title'] = cn_substr($row['title'],$titlelen);
       $row['textlink'] = "<a href='".$row['arcurl']."'>".$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,'');
       }
       $GLOBALS['autoindex']++;
       $artlist .= $this->dtp2->GetResult();
     }//Loop Line
		 $this->dsql->FreeResult("alf");
		//$t3 = ExecTime();
		//echo ($t3-$t2)."<br>";
		return $artlist;
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:86,代码来源:inc_digglist_view.php

示例14: GetArcList


//.........这里部分代码省略.........
				$addField = "";
				$addJoin = "";
			}

			$query = "Select arc.*,
			tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl
			$addField
			from `{$this->maintable}` arc
			left join #@__arctype tp on arc.typeid=tp.ID
			$addJoin
			where $orwhere $ordersql limit $limitstart,$row";

			$this->dtp2->LoadSource($innertext);
			if(!is_array($this->dtp2->CTags)) return '';
			
			$this->dsql->Execute("al",$query);
			
			$t2 = ExecTime();
			
			$artlist = "";
			if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
			
			$GLOBALS['autoindex'] = 0;
			for($i=0;$i<$row;$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']++;
						//处理一些特殊字段
						//if()
						$row['id'] =  $row['ID'];
						$row['arcurl'] = $this->GetArcUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],$row['arcrank'],$row['namerule'],$row['typedir'],$row['money']);
						$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["siteurl"]=="") $row["siteurl"] = $GLOBALS['cfg_mainsite'];
							if(!eregi("^http://",$row['picname'])){
								$row['litpic'] = $row['siteurl'].$row['litpic'];
								$row['picname'] = $row['litpic'];
							}
						}

						$row['description'] = cn_substr($row['description'],$infolen);
						if($row['litpic']=="") $row['litpic'] = $GLOBALS['cfg_plus_dir']."/img/dfpic.gif";
						$row['picname'] = $row['litpic'];
						$row['info'] = $row['description'];
						$row['filename'] = $row['arcurl'];
						$row['stime'] = GetDateMK($row['pubdate']);
						
						if($this->hasDmCache){
						  $row['areaidname'] = $row['areaid2name'] = $row['sectoridname'] = $row['sectorid2name'] =$row['smalltypeidname'] = '';
						  $row['areaidname'] = $this->areas[$row['areaid']];
						  $row['areaid2name'] = $this->areas[$row['areaid2']];
						  $row['sectoridname'] = $this->sectors[$row['sectorid']];
						  $row['sectorid2name'] = $this->sectors[$row['sectorid2']];
						  $row['smalltypeidname'] = $this->smalltypes[$row['smalltypeid']];
						}

						$row['textlink'] = "<a href='".$row['filename']."' title='".str_replace("'","",$row['title'])."'>".$row['title']."</a>";

						if($row['typeid'] != $this->Fields['ID']){
							$row['typelink'] = "<a href='".$row['typeurl']."'>[".$row['typename']."]</a>";
						}else{
							$row['typelink']= '';
						}
						$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['phpurl'] = $GLOBALS['cfg_plus_dir'];
						$row['plusurl'] = $GLOBALS['cfg_plus_dir'];
						$row['templeturl'] = $GLOBALS['cfg_templets_dir'];
						$row['memberurl'] = $GLOBALS['cfg_member_dir'];
						$row['title'] = cn_substr($row['title'],$titlelen);
						if($row['color']!="") $row['title'] = "<font color='".$row['color']."'>".$row['title']."</font>";
						if($row['iscommend']==5||$row['iscommend']==16) $row['title'] = "<b>".$row['title']."</b>";
						//编译附加表里的数据
						foreach($row as $k=>$v){ $row[strtolower($k)] = $v; }
						foreach($this->ChannelUnit->ChannelFields as $k=>$arr){
							if(isset($row[$k])) $row[$k] = $this->ChannelUnit->MakeField($k,$row[$k]);
						}
						foreach($this->dtp2->CTags as $k=>$ctag){
								@$this->dtp2->Assign($k,$row[$ctag->GetName()]);
						}
						$artlist .= $this->dtp2->GetResult();
					}//if hasRow
					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");
		//$t3 = ExecTime();
		//echo ($t3-$t2)."<br>";
		return $artlist;
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:inc_arclist_view.php

示例15: lib_arclistDone


//.........这里部分代码省略.........
        $artlist = "<table width='{$tablewidth}' border='0' cellspacing='0' cellpadding='0'>\r\n";
    }
    $dtp2 = new DedeTagParse();
    $dtp2->SetNameSpace('field', '[', ']');
    $dtp2->LoadString($innertext);
    $GLOBALS['autoindex'] = 0;
    $ids = array();
    $orderWeight = array();
    for ($i = 0; $i < $line; $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 = $dsql->GetArray("al")) {
                $ids[] = $row['id'];
                //处理一些特殊字段
                $row['info'] = $row['infos'] = cn_substr($row['description'], $infolen);
                $row['id'] = $row['id'];
                if ($row['corank'] > 0 && $row['arcrank'] == 0) {
                    $row['arcrank'] = $row['corank'];
                }
                $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                $row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['moresite'], $row['siteurl'], $row['sitepath']);
                if ($row['litpic'] == '-' || $row['litpic'] == '') {
                    $row['litpic'] = $GLOBALS['cfg_cmspath'] . '/images/defaultpic.gif';
                }
                if (!preg_match("#^http:\\/\\/#i", $row['litpic']) && $GLOBALS['cfg_multi_site'] == 'Y') {
                    $row['litpic'] = $GLOBALS['cfg_mainsite'] . $row['litpic'];
                }
                $row['picname'] = $row['litpic'];
                $row['stime'] = GetDateMK($row['pubdate']);
                $row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
                $row['image'] = "<img src='" . $row['picname'] . "' border='0' width='{$imgwidth}' height='{$imgheight}' alt='" . preg_replace("#['><]#", "", $row['title']) . "'>";
                $row['imglink'] = "<a href='" . $row['filename'] . "'>" . $row['image'] . "</a>";
                $row['fulltitle'] = $row['title'];
                $row['title'] = cn_substr($row['title'], $titlelen);
                if ($row['color'] != '') {
                    $row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
                }
                if (preg_match('#b#', $row['flag'])) {
                    $row['title'] = "<strong>" . $row['title'] . "</strong>";
                }
                //$row['title'] = "<b>".$row['title']."</b>";
                $row['textlink'] = "<a href='" . $row['filename'] . "'>" . $row['title'] . "</a>";
                $row['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
                $row['memberurl'] = $GLOBALS['cfg_memberurl'];
                $row['templeturl'] = $GLOBALS['cfg_templeturl'];
                if (is_array($dtp2->CTags)) {
                    foreach ($dtp2->CTags as $k => $ctag) {
                        if ($ctag->GetName() == 'array') {
                            //传递整个数组,在runphp模式中有特殊作用
                            $dtp2->Assign($k, $row);
                        } else {
                            if (isset($row[$ctag->GetName()])) {
                                $dtp2->Assign($k, $row[$ctag->GetName()]);
                            } else {
                                $dtp2->Assign($k, '');
                            }
                        }
                    }
                    $GLOBALS['autoindex']++;
                }
                if ($pagesize > 0) {
开发者ID:iabing,项目名称:mzzyc,代码行数:67,代码来源:arclist.lib.php


注:本文中的GetDateMK函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。