本文整理汇总了PHP中GetTypeUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP GetTypeUrl函数的具体用法?PHP GetTypeUrl怎么用?PHP GetTypeUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTypeUrl函数的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: ac_txt
function ac_txt()
{
global $cfg_basehost, $cfg_basedir, $cfg_cmspath, $cfg_multi_site, $dsql;
$str = $cfg_basehost . "\r\n";
$murl = $cfg_basedir . $cfg_cmspath . "/sitemap.txt";
$dsql->Execute('me', "SELECT * FROM #@__arctype");
while ($arcRow = $dsql->GetArray()) {
$typeurl = GetTypeUrl($arcRow['id'], $arcRow['typedir'], $arcRow['isdefault'], $arcRow['defaultname'], $arcRow['ispart'], $arcRow['namerule2'], $arcRow['moresite'], $arcRow['siteurl'], $arcRow['sitepath']);
if ($cfg_multi_site == 'N' && $arcRow['ispart'] != 2) {
$str .= $cfg_basehost . $typeurl . "\r\n";
} else {
$str .= $typeurl . "\r\n";
}
}
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,arc.litpic,\n t.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath\n from `#@__archives` arc left join #@__arctype t on arc.typeid=t.id WHERE arc.ismake > 0 ";
$dsql->Execute('a1', $query);
while ($aRow = $dsql->GetArray('a1')) {
$arcurl = GetFileUrl($aRow['id'], $aRow['typeid'], $aRow['senddate'], $aRow['title'], $aRow['ismake'], $aRow['arcrank'], $aRow['namerule'], $aRow['typedir'], $aRow['money'], $aRow['filename'], $aRow['moresite'], $aRow['siteurl'], $aRow['sitepath']);
if ($cfg_multi_site == 'N') {
$str .= $cfg_basehost . $arcurl . "\r\n";
} else {
$str .= $arcurl . "\r\n";
}
}
file_put_contents($murl, $str);
echo "<a href='/sitemap.txt' target='_blank'>成功更新文件: /sitemap.txt 浏览...</a>";
exit;
}
示例3: 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;
}
示例4: 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;
}
}
示例5: 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;
}
示例6: 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;
}
示例7: GetList
//.........这里部分代码省略.........
if (!empty($arr['rename'])) {
$addField .= "," . $addtable . "." . $k . " as " . $arr['rename'];
} else {
$addField .= "," . $addtable . "." . $k;
}
}
}
}
}
$query = "Select arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,\r\n\t\ttp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\r\n\t\t{$addField}\r\n\t\tfrom {$this->maintable} arc\r\n\t\tleft join #@__arctype tp on arc.typeid=tp.id\r\n\t\t{$addJoin}\r\n\t\twhere {$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['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
$row['typeurl'] = GetTypeUrl($row['typeid'], $row['typedir'], $row['isdefault'], $row['defaultname'], $row['ispart'], $row['namerule2'], $row['siteurl'], $row['sitepath']);
if ($ismake == 0 && $GLOBALS['cfg_multi_site'] == 'Y') {
if ($row["siteurl"] == "") {
$row["siteurl"] = $GLOBALS['cfg_mainsite'];
}
}
$row['description'] = cn_substr($row['description'], $infolen);
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['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['plusurl'] = $row['phpurl'] = $GLOBALS['cfg_phpurl'];
$row['memberurl'] = $GLOBALS['cfg_memberurl'];
$row['templeturl'] = $GLOBALS['cfg_templeturl'];
$row['title'] = cn_substr($row['title'], $titlelen);
if ($row['color'] != "") {
$row['title'] = "<font color='" . $row['color'] . "'>" . $row['title'] . "</font>";
}
if (ereg('c', $row['flag'])) {
$row['title'] = "<b>" . $row['title'] . "</b>";
}
//编译附加表里的数据
if (is_object($this->ChannelUnit)) {
示例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: 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);
//.........这里部分代码省略.........
示例10: lib_arclistsg
//.........这里部分代码省略.........
$limitsql = " LIMIT 0,{$line} ";
}
$orwhere = '';
if (isset($orwheres[0])) {
$orwhere = join(' AND ', $orwheres);
$orwhere = preg_replace("#^ AND#i", '', $orwhere);
$orwhere = preg_replace("#AND[ ]{1,}AND#i", 'AND ', $orwhere);
}
if ($orwhere != '') {
$orwhere = " WHERE {$orwhere} ";
}
$query = "SELECT {$arclistquery},tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\n tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n FROM `{$maintable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n {$orwhere} AND arc.arcrank > -1 {$ordersql} {$limitsql}";
$md5hash = md5($query);
$needcache = TRUE;
if ($idlist != '') {
$needcache = FALSE;
} else {
$idlist = GetArclistSgCache($md5hash);
if ($idlist != '') {
$needcache = FALSE;
}
}
//指定了id或使用缓存中的id
if ($idlist != '' && $_arclistEnv != 'index') {
$query = "SELECT {$arclistquery},tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,\n tp.moresite,tp.siteurl,tp.sitepath FROM `{$maintable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n WHERE arc.aid IN({$idlist}) {$ordersql} {$limitsql}";
}
$dsql->SetQuery($query);
$dsql->Execute("al");
$artlist = "";
$dtp2 = new DedeTagParse();
$dtp2->SetNameSpace("field", "[", "]");
$dtp2->LoadString($innertext);
$GLOBALS['autoindex'] = 0;
$ids = array();
for ($i = 0; $i < $line; $i++) {
for ($j = 0; $j < $col; $j++) {
if ($col > 1) {
$artlist .= " <div>\r\n";
}
if ($row = $dsql->GetArray("al")) {
$ids[] = $row['aid'];
$row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], 1, 0, $row['namerule'], $row['typedir'], 0, '', $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['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['stime'] = GetDateMK($row['pubdate']);
$row['typelink'] = "<a href='" . $row['typeurl'] . "'>" . $row['typename'] . "</a>";
$row['fulltitle'] = $row['title'];
$row['title'] = cn_substr($row['title'], $titlelen);
$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";
} else {
$artlist .= '';
}
if ($col > 1) {
$artlist .= " </div>\r\n";
}
}
//Loop Col
if ($col > 1) {
$i += $col - 1;
}
}
//loop line
$dsql->FreeResult("al");
//保存ID缓存
$idsstr = join(',', $ids);
if ($idsstr != '' && $needcache && $cfg_index_cache > 0) {
$mintime = time() - $cfg_index_cache * 3600;
$inquery = "INSERT INTO `#@__arccache`(`md5hash`,`uptime`,`cachedata`) VALUES ('" . $md5hash . "', '" . time() . "', '{$idsstr}'); ";
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arccache` WHERE md5hash='" . $md5hash . "' or uptime < {$mintime} ");
$dsql->ExecuteNoneQuery($inquery);
}
return $artlist;
}
示例11: 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']);
}
示例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: GetListUrl
function GetListUrl($typeid,$typedir,$isdefault,$defaultname,$ispart,$namerule2)
{
return GetTypeUrl($typeid,MfTypedir($typedir),$isdefault,$defaultname,$ispart,$namerule2);
}
示例14: cn_substr
$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:\\/\\/#", $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>";
示例15: lib_arclistDone
//.........这里部分代码省略.........
$dsql->SetQuery($query);
$dsql->Execute('al');
//$row = $dsql->GetArray("al");
$artlist = '';
if ($pagesize > 0) {
$artlist .= " <div id='{$tagid}'>\r\n";
}
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();
$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()]);