本文整理匯總了PHP中MfTypedir函數的典型用法代碼示例。如果您正苦於以下問題:PHP MfTypedir函數的具體用法?PHP MfTypedir怎麽用?PHP MfTypedir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MfTypedir函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: LogicListAllSunType
function LogicListAllSunType($ID,$maptype,$pd)
{
$fid = $ID;
$mapString = "";
$pd = $pd + 15;
if($maptype=="rss") $this->dsql->SetQuery("Select ID,typedir,isdefault,defaultname,typename,ispart,namerule2 From #@__arctype where reID='".$ID."' And ishidden<>1 And ispart<2 order by sortrank");
else $this->dsql->SetQuery("Select ID,typedir,isdefault,defaultname,typename,ispart,namerule2 From #@__arctype where reID='".$ID."' And ishidden<>1 order by sortrank");
$this->dsql->Execute($fid);
$mapString .= "<div style='margin-left:{$pd}px'>";
while($row=$this->dsql->GetObject($fid))
{
if($maptype=="site") $typelink = GetTypeUrl($row->ID,MfTypedir($row->typedir),$row->isdefault,$row->defaultname,$row->ispart,$row->namerule2);
else $typelink = $GLOBALS['cfg_plus_dir']."/rss/".$row->ID.".xml";
$lastLink = " <a href='$typelink'>".$row->typename."</a> ";
$mapString .= $lastLink;
$mok = $this->LogicListAllSunType($row->ID,$maptype,$pd);
if(ereg("<a",$mok)){
//$mapString = str_replace($lastLink,"<div style='margin-left:{$pd}px'>$lastLink",$mapString);
$mapString .= $mok;
}
}
$mapString .= "</div>\r\n";
return $mapString;
}
示例2: lib_autochannel
function lib_autochannel(&$ctag, &$refObj)
{
global $dsql;
$attlist = 'partsort|0,typeid=-1';
FillAttsDefault($ctag->CAttribute->Items, $attlist);
extract($ctag->CAttribute->Items, EXTR_SKIP);
$innertext = trim($ctag->GetInnerText());
$topid = $typeid;
$sortid = $partsort;
if ($topid == '-1' || $topid == '') {
$topid = isset($refObj->TypeLink->TypeInfos['id']) ? $refObj->TypeLink->TypeInfos['id'] : 0;
}
if (empty($sortid)) {
$sortid = 1;
}
$getstart = $sortid - 1;
$row = $dsql->GetOne("SELECT id,typename FROM `#@__arctype` WHERE reid='{$topid}' AND \n ispart<2 AND ishidden<>'1' ORDER BY sortrank asc limit {$getstart},1");
if (!is_array($row)) {
return '';
} else {
$typeid = $row['id'];
}
if (trim($innertext) == '') {
$innertext = GetSysTemplets('part_autochannel.htm');
}
$row = $dsql->GetOne("SELECT id,typedir,isdefault,defaultname,ispart,namerule2,typename,moresite,siteurl,sitepath \n FROM `#@__arctype` WHERE id='{$typeid}' ");
if (!is_array($row)) {
return '';
}
$dtp = new DedeTagParse();
$dtp->SetNameSpace('field', '[', ']');
$dtp->LoadSource($innertext);
if (!is_array($dtp->CTags)) {
unset($dtp);
return '';
} else {
$row['typelink'] = GetTypeUrl($row['id'], MfTypedir($row['typedir']), $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['siteurl'], $row['sitepath']);
foreach ($dtp->CTags as $tagid => $ctag) {
if (isset($row[$ctag->GetName()])) {
$dtp->Assign($tagid, $row[$ctag->GetName()]);
}
}
$revalue = $dtp->GetResult();
unset($dtp);
return $revalue;
}
}
示例3: GetFileUrl
function GetFileUrl(
$aid,$typeid,$timetag,$title,$ismake=0,$rank=0,
$namerule="",$artdir="",$money=0,$aburl=false,$siteurl="")
{
if($rank!=0||$ismake==-1||$typeid==0||$money>0) //動態文章
{
if($GLOBALS['cfg_multi_site']=='Y')
{
$siteurl = $GLOBALS['cfg_basehost'];
}
return $siteurl.$GLOBALS['cfg_plus_dir']."/view.php?aid=$aid";
}
else
{
$articleRule = $namerule;
$articleDir = MfTypedir($artdir);
if($namerule=="") $articleRule = $GLOBALS['cfg_df_namerule'];
if($artdir=="") $articleDir = $GLOBALS['cfg_cmspath'].$GLOBALS['cfg_arcdir'];
$dtime = GetDateMk($timetag);
$articleRule = strtolower($articleRule);
list($y,$m,$d) = explode("-",$dtime);
$articleRule = str_replace("{typedir}",$articleDir,$articleRule);
$articleRule = str_replace("{y}",$y,$articleRule);
$articleRule = str_replace("{m}",$m,$articleRule);
$articleRule = str_replace("{d}",$d,$articleRule);
$articleRule = str_replace("{timestamp}",$timetag,$articleRule);
$articleRule = str_replace("{aid}",$aid,$articleRule);
$articleRule = str_replace("{cc}",dd2char($m.$d.$aid.$y),$articleRule);
if(ereg('{p',$articleRule)){
$articleRule = str_replace("{pinyin}",GetPinyin($title)."_".$aid,$articleRule);
$articleRule = str_replace("{py}",GetPinyin($title,1)."_".$aid,$articleRule);
}
$articleUrl = "/".ereg_replace("^/","",$articleRule);
//是否強製使用絕對網址
if($aburl && $GLOBALS['cfg_multi_site']=='Y'){
if($siteurl=="") $siteurl = $GLOBALS["cfg_basehost"];
$articleUrl = $siteurl.$articleUrl;
}
return $articleUrl;
}
}
示例4: LogicListAllSunType
function LogicListAllSunType($id, $maptype)
{
$fid = $id;
$mapString = "";
if ($maptype == "rss") {
$this->dsql->SetQuery("Select id,typedir,isdefault,defaultname,typename,ispart,namerule2,moresite,siteurl,sitepath From #@__arctype where reid='" . $id . "' And ishidden<>1 And ispart<>2 order by sortrank");
} else {
$this->dsql->SetQuery("Select id,typedir,isdefault,defaultname,typename,ispart,namerule2,moresite,siteurl,sitepath From #@__arctype where reid='" . $id . "' And ishidden<>1 order by sortrank");
}
$this->dsql->Execute($fid);
while ($row = $this->dsql->GetObject($fid)) {
if ($maptype == "site") {
$typelink = GetTypeUrl($row->id, MfTypedir($row->typedir), $row->isdefault, $row->defaultname, $row->ispart, $row->namerule2, $row->moresite, $row->siteurl, $row->sitepath);
} else {
$typelink = $GLOBALS['cfg_cmsurl'] . "/data/rss/" . $row->id . ".xml";
}
$mapString .= "<li><a href='{$typelink}'>" . $row->typename . "</a></li>\n\t\t";
$mapString .= $this->LogicListAllSunType($row->id, $maptype);
}
return $mapString;
}
示例5: GetArcList
//.........這裏部分代碼省略.........
return '';
} else {
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,\n tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n {$addField}\n FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n {$addJoin}\n WHERE arc.id in({$idstr}) {$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['id']] = $row['id'];
//處理一些特殊字段
$row['infos'] = cn_substr($row['description'], $infolen);
$row['id'] = $row['id'];
if ($cfg_digg_update > 0) {
$prefix = 'diggCache';
$key = 'aid-' . $row['id'];
$cacherow = GetCache($prefix, $key);
$row['goodpost'] = $cacherow['goodpost'];
$row['badpost'] = $cacherow['badpost'];
$row['scores'] = $cacherow['scores'];
}
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'], 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:\\/\\//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('/c/', $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;
}
示例6: GetListUrl
function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2)
{
return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2);
}
示例7: GetSortArc
/**
* 獲得最差或最好的踩踩文章
*
* @param array $atts
* @param object $refObj
* @param array $fields
* @return array
*/
function GetSortArc($atts, $refObj = '', $fields = array())
{
$arcrow = empty($atts['row']) ? 12 : $atts['row'];
$order = empty($atts['order']) ? 'scores' : $atts['order'];
$orderway = empty($atts['orderway']) ? 'desc' : $atts['orderway'];
if (empty($arcrow)) {
$arcrow = 12;
}
$query = "SELECT arc.*,tp.typedir,tp.typename,\n tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON tp.id = arc.typeid\n WHERE arc.arcrank>-1 ORDER BY arc.{$order} {$orderway} LIMIT 0,{$arcrow} ";
$rsArray = array();
$cacheFile = DEDEDATA . '/cache/caicai_' . md5($query) . '.inc';
$needCache = false;
if (file_exists($cacheFile) && filemtime($cacheFile) - time() < $this->arcCacheTime) {
$fp = fopen($cacheFile, 'r');
$ids = fread($fp, filesize($cacheFile));
fclose($fp);
$ids = trim($ids);
if (!empty($ids)) {
$query = "SELECT arc.*,tp.typedir,tp.typename,\n tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid\n WHERE arc.id in({$ids}) ORDER BY arc.{$order} {$orderway} ";
}
} else {
$needCache = true;
}
$ids = array();
$i = 0;
$this->dsql->Execute('cai', $query);
while ($arr = $this->dsql->GetArray('cai')) {
$i++;
$ids[] = $arr['id'];
$arr['filename'] = $arr['arcurl'] = GetFileUrl($arr['id'], $arr['typeid'], $arr['senddate'], $arr['title'], $arr['ismake'], $arr['arcrank'], $arr['namerule'], $arr['typedir'], $arr['money'], $arr['filename'], $arr['moresite'], $arr['siteurl'], $arr['sitepath']);
$arr['typeurl'] = GetTypeUrl($arr['typeid'], MfTypedir($arr['typedir']), $arr['isdefault'], $arr['defaultname'], $arr['ispart'], $arr['namerule2'], $arr['moresite'], $arr['siteurl'], $arr['sitepath']);
if ($arr['litpic'] == '') {
$arr['litpic'] = '/images/defaultpic.gif';
}
if (!preg_match("#^http:\\/\\/#", $arr['litpic'])) {
$arr['picname'] = $arr['litpic'] = $GLOBALS['cfg_cmsurl'] . $arr['litpic'];
} else {
$arr['picname'] = $arr['litpic'] = $arr['litpic'];
}
$rsArray[$i] = $arr;
}
$this->dsql->FreeResult('cai');
//寫入緩存
if ($needCache && count($ids) > 0) {
$idsstr = join(',', $ids);
file_put_contents($cacheFile, $idsstr);
// $fp = fopen($cacheFile, 'w');
// fwrite($fp, $idsstr);
// fclose($fp);
}
return $rsArray;
}
示例8: GetOneTypeUrl
function GetOneTypeUrl($typeinfos)
{
if (defined('DEDEMOB')) {
return 'list.php?tid=' . $typeinfos['id'];
} else {
return GetTypeUrl($typeinfos['id'], MfTypedir($typeinfos['typedir']), $typeinfos['isdefault'], $typeinfos['defaultname'], $typeinfos['ispart'], $typeinfos['namerule2'], $typeinfos['moresite'], $typeinfos['siteurl'], $typeinfos['sitepath']);
}
}
示例9: GetOneTypeUrlA
/**
* 獲取某欄目的url
*
* @param array $typeinfos 欄目信息
* @return string
*/
function GetOneTypeUrlA($typeinfos)
{
return GetTypeUrl($typeinfos['id'], MfTypedir($typeinfos['typedir']), $typeinfos['isdefault'], $typeinfos['defaultname'], $typeinfos['ispart'], $typeinfos['namerule2'], $typeinfos['moresite'], $typeinfos['siteurl'], $typeinfos['sitepath']);
}
示例10: showmsg
}
}
if ($pageno == 0 && $mkpage == 1) {
$dsql->ExecuteNoneQuery("Delete From `#@__arccache` ");
}
$reurl = '';
//更新數組所記錄的欄目
if (!empty($tid)) {
if (!isset($cfg_Cs[$tid])) {
showmsg('沒有該欄目數據, 可能緩存文件(/data/cache/inc_catalog_base.inc)沒有更新, 請檢查是否有寫入權限');
exit;
}
if ($cfg_Cs[$tid][1] > 0) {
require_once DEDEINC . "/arc.listview.class.php";
$lv = new ListView($tid);
$position = MfTypedir($lv->Fields['typedir']);
} else {
require_once DEDEINC . "/arc.sglistview.class.php";
$lv = new SgListView($tid);
}
//$lv->CountRecord();
if ($lv->TypeLink->TypeInfos['ispart'] == 0 && $lv->TypeLink->TypeInfos['isdefault'] != -1) {
$ntotalpage = $lv->TotalPage;
} else {
$ntotalpage = 1;
}
if ($cfg_remote_site == 'Y' && $isremote == "1") {
if ($serviterm != "") {
list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
$config = array('hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd, 'debug' => 'TRUE');
} else {
示例11: 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;
}
示例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;
}
示例13: 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;
}
示例14: GetMakeFileRule
/**
* 獲得要創建的文件名稱規則
*
* @access public
* @param int $typeid 欄目ID
* @param string $wname
* @param string $typedir 欄目目錄
* @param string $defaultname 默認名稱
* @param string $namerule2 欄目規則
* @return string
*/
function GetMakeFileRule($typeid, $wname, $typedir, $defaultname, $namerule2)
{
$typedir = MfTypedir($typedir);
if ($wname == 'index') {
return $typedir . '/' . $defaultname;
} else {
$namerule2 = str_replace('{tid}', $typeid, $namerule2);
$namerule2 = str_replace('{typedir}', $typedir, $namerule2);
return $namerule2;
}
}
示例15: SpGetArcList
//.........這裏部分代碼省略.........
else if($ids!='')
{
$query = "Select arc.ID,arc.title,arc.iscommend,arc.color,arc.typeid,arc.channel,
arc.ismake,arc.description,arc.pubdate,arc.senddate,arc.arcrank,arc.click,arc.digg,arc.diggtime,
arc.money,arc.litpic,arc.writer,arc.shorttitle,arc.memberid,arc.postnum,arc.lastpost,
tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,
tp.namerule2,tp.ispart,tp.moresite,tp.siteurl{$addField}
from `$maintable` arc left join `#@__arctype` tp on arc.typeid=tp.ID $addJoin
where arc.ID in($ids) $ordersql ";
}else
{
return '';
}
}
$artlist = "";
$dsql->SetQuery($query);
$dsql->Execute("al");
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field","[","]");
$dtp2->LoadString($innertext);
$nids = array();
if($col>1) $artlist = "<table width='$tablewidth' border='0' cellspacing='0' cellpadding='0'>\r\n";
$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",MYSQL_ASSOC))
{
//處理一些特殊字段
$row['description'] = cn_substr($row['description'],$infolen);
$nids[] = $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'],true,$row['siteurl']);
$row['typeurl'] = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
if($row['litpic']=="") $row['litpic'] = $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['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'];
foreach($dtp2->CTags as $k=>$ctag){ @$dtp2->Assign($k,$row[$ctag->GetName()]); }
$GLOBALS['autoindex']++;
$artlist .= $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";
$dsql->FreeResult("al");
if($needup)
{
$ids = join(',',$nids);
$inquery = "INSERT INTO `#@__arccache`(`md5hash`,`uptime`,`cachedata`) VALUES ('".$md5hash."', '".time()."', '$ids'); ";
$dsql->ExecuteNoneQuery("Delete From `#@__arccache` where md5hash='".$md5hash."' or uptime < $mintime ");
$dsql->ExecuteNoneQuery($inquery);
}
$t2 = ExecTime();
//echo ($t2-$t1).$query;
//$debug = trim($artlist).'<li>'.($t2-$t1)." $query</li>";
return trim($artlist);
}