本文整理汇总了PHP中GetFileUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP GetFileUrl函数的具体用法?PHP GetFileUrl怎么用?PHP GetFileUrl使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetFileUrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: DelArc
function DelArc($aid,$onlyfile=false,$channelid=0)
{
global $dsql;
if(!is_object($dsql)) $dsql = new DedeSql(false);
$tables = GetChannelTable($dsql,$aid,'arc');
//读取文档信息
$arctitle = "";
$arcurl = "";
$arcQuery = "
Select a.ID,a.title,a.typeid,
a.ismake,a.senddate,a.arcrank,c.addtable,
a.money,t.typedir,t.typename,a.adminID,
t.namerule,t.namerule2,t.ispart,
t.moresite,t.siteurl,t.siterefer,t.sitepath
from `{$tables['maintable']}` a
left join `#@__arctype` t on a.typeid=t.ID
left join `#@__channeltype` c on c.ID=a.channel
where a.ID='$aid'
";
$arcRow = $dsql->GetOne($arcQuery);
if(!is_array($arcRow)) return false;
//删除数据库的内容
$rs = $dsql->ExecuteNoneQuery("Delete From `{$tables['maintable']}` where ID='$aid'");
if($rs){
$dsql->ExecuteNoneQuery("Delete From `#@__full_search` where aid='$aid'");
if($arcRow['addtable']!=""){
$dsql->ExecuteNoneQuery("Delete From `{$tables['addtable']}` where aid='$aid'");
}
$dsql->ExecuteNoneQuery("Delete From `#@__feedback` where aid='$aid'");
$dsql->ExecuteNoneQuery("Delete From `#@__memberstow` where arcid='$aid'");
}
//删除HTML
if($arcRow['ismake']==-1||$arcRow['arcrank']!=0
||$arcRow['typeid']==0||$arcRow['money']>0){
return true;
}
$arcurl = GetFileUrl($arcRow['ID'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],
$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],false,'');
if(!ereg("\?",$arcurl)){
$truedir = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']);
$htmlfile = $truedir.$arcurl;
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);
$arcurls = explode(".",$arcurl);
$sname = $arcurls[count($arcurls)-1];
$fname = ereg_replace("(\.$sname)$","",$arcurl);
for($i=2;$i<=100;$i++){
$htmlfile = $truedir.$fname."_$i".".".$sname;
if(file_exists($htmlfile) && !is_dir($htmlfile)) unlink($htmlfile);
else break;
}
}
//删除文本文件
$ipath = $GLOBALS['cfg_cmspath']."/data/textdata/".(ceil($aid/5000))."/";
$filename = $GLOBALS['cfg_basedir'].$ipath."{$aid}.txt";
if(is_file($filename)) unlink($filename);
return true;
}
示例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: DisplayWidgetIcon
function DisplayWidgetIcon()
{
$id = $_GET["id"];
$pac = $_GET["pac"];
$data = GetPageData($pac, false);
if ($data == null) {
return;
}
if ($data['error'] != null && $data['error'] != "") {
SetSortValue($id, -3);
$src = GetFeedwebUrl() . "IMG/Remove.png";
if ($data['error'] == "Bad PAC") {
$title = __("The widget data is invalid and cannot be used.", "FWTD");
echo "<script>function OnInvalidPAC() { if (window.confirm ('" . __("Remove Invalid Widget?", "FWTD") . "') == true) " . "window.location.href='" . plugin_dir_url(__FILE__) . "/widget_commit.php?feedweb_cmd=REM&wp_post_id=" . $id . "'; } " . "</script><a href='#' onclick='OnInvalidPAC()'><img title='{$title}' src='{$src}' style='padding-left: 4px;'/></a>";
return;
}
$title = __("Unknown error.", "FWTD") . __("\nPlease contact Feedweb (contact@feedweb.net)", "FWTD");
echo "<img title='{$title}' src='{$src}' style='padding-left: 4px;'/>";
return;
}
$src = GetFeedwebUrl() . "IMG/Edit.png";
$votes = $data['votes'];
$score = $data['score'];
if ($score != "") {
SetSortValue($id, intval($votes));
$format = __("Edit / Remove Rating Widget\n(%s Votes. Average Score: %s)", "FWTD");
$title = sprintf($format, $votes, $score);
if ($data['image'] != "") {
$src = GetFileUrl($data['image']);
}
} else {
SetSortValue($id, 0);
$title = __("Edit / Remove Rating Widget\n(No votes yet)", "FWTD");
}
$width = 675;
$height = 360;
$url = plugin_dir_url(__FILE__) . "widget_dialog.php?wp_post_id=" . $id . "&mode=edit&KeepThis=true&TB_iframe=true&height={$height}&width={$width}";
$div_class = GetStatusImageClass();
$image_id = $div_class . "_" . $id;
echo "<div class='{$div_class}' style='display: inline;' onmouseover='ShowFeedwebStats({$id})' onmouseout='HideFeedwebStats()'>";
$answers = $data['answers'];
if ($answers != null) {
for ($index = 0; $index < count($answers); $index++) {
$text = str_replace("'", "’", $answers[$index]);
echo "<input type='hidden' class='FeedwebPostAnswerData' value='{$text}'/>";
}
}
echo "<input alt='{$url}' class='thickbox' id='{$image_id}' title='{$title}' type='image' src='{$src}'/></div>";
}
示例5: GetOneArchive
function GetOneArchive($aid)
{
global $dsql;
include_once DEDEINC . "/channelunit.func.php";
$aid = trim(preg_replace('/[^0-9]/', '', $aid));
$reArr = array();
$chRow = $dsql->GetOne("SELECT arc.*,ch.maintable,ch.addtable,ch.issystem FROM `#@__arctiny` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='{$aid}' ");
if (!is_array($chRow)) {
return $reArr;
} else {
if (empty($chRow['maintable'])) {
$chRow['maintable'] = '#@__archives';
}
}
if ($chRow['issystem'] != -1) {
$nquery = " SELECT arc.*,tp.typedir,tp.topid,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath\n FROM `{$chRow['maintable']}` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid\n WHERE arc.id='{$aid}' ";
} else {
$nquery = " SELECT arc.*,1 AS ismake,0 AS money,'' AS filename,tp.typedir,tp.topid,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath\n FROM `{$chRow['addtable']}` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid\n WHERE arc.aid='{$aid}' ";
}
$arcRow = $dsql->GetOne($nquery);
if (!is_array($arcRow)) {
return $reArr;
}
if (!isset($arcRow['description'])) {
$arcRow['description'] = '';
}
if (empty($arcRow['description']) && isset($arcRow['body'])) {
$arcRow['description'] = cn_substr(html2text($arcRow['body']), 250);
}
if (!isset($arcRow['pubdate'])) {
$arcRow['pubdate'] = $arcRow['senddate'];
}
if (!isset($arcRow['notpost'])) {
$arcRow['notpost'] = 0;
}
$reArr = $arcRow;
$reArr['aid'] = $aid;
$reArr['topid'] = $arcRow['topid'];
$reArr['arctitle'] = $arcRow['title'];
$reArr['arcurl'] = GetFileUrl($aid, $arcRow['typeid'], $arcRow['senddate'], $reArr['title'], $arcRow['ismake'], $arcRow['arcrank'], $arcRow['namerule'], $arcRow['typedir'], $arcRow['money'], $arcRow['filename'], $arcRow['moresite'], $arcRow['siteurl'], $arcRow['sitepath']);
return $reArr;
}
示例6: GetFileUrl
from `{$tables['maintable']}` arc
left join #@__arctype t on t.ID = arc.typeid
left join #@__channeltype c on c.ID = arc.channel
where arc.ID='$aid'
";
$arcRow = $dsql->GetOne($arcQuery);
if($arcRow['ismake']==-1||$arcRow['arcrank']!=0
||$arcRow['typeid']==0||$arcRow['money']>0||$arcRow['channel']<-1)
{
$dsql->Close();
echo "<script language='javascript'>location.href='{$cfg_plus_dir}/view.php?aid={$aid}';</script>";
exit();
}
$arcurl = GetFileUrl($arcRow['ID'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],
$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],true,$arcRow['siteurl']);
$arcfile = GetFileUrl($arcRow['ID'],$arcRow['typeid'],$arcRow['senddate'],$arcRow['title'],$arcRow['ismake'],
$arcRow['arcrank'],$arcRow['namerule'],$arcRow['typedir'],$arcRow['money'],false,'');
$truefile = GetTruePath($arcRow['siterefer'],$arcRow['sitepath']).$arcfile;
MakeArt($aid,true,true);
$dsql->Close();
echo "<script language='javascript'>location.href='$arcurl"."?".time()."';</script>";
exit();
}
/*--------------------------
//推荐文档
function commendArchives();
---------------------------*/
else if($dopost=="commendArchives")
{
CheckPurview('a_Commend,sys_ArcBatch');
$dsql = new DedeSql(false);
if( $aid!="" && !ereg("(".$aid."`|`".$aid.")",$qstr) ) $qstr .= "`".$aid;
示例7: GetArcUrl
function GetArcUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0)
{
return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$artdir,$money);
}
示例8: cn_substr
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:\\/\\/#", $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'] != '') {
示例9: toXml
function toXml()
{
global $dsql, $cfg_webname, $cfg_basehost, $cfg_soft_lang;
$addonQuery = $limitQuery = "";
if (!empty($this->Typeid)) {
$addonQuery .= "AND arc.typeid=" . intval($this->Typeid);
$typeinfos = $this->getType($this->Typeid);
}
if ($this->SitemapType == 2) {
$setupmaxaid = baidu_get_setting('setupmaxaid');
$addonQuery .= "AND arc.id>" . intval($setupmaxaid);
}
$this->Start = intval($this->Start);
//var_dump($typeinfos);exit();
if (!empty($this->Row)) {
$limitQuery = "LIMIT {$this->Start}," . intval($this->Row);
}
$query = "SELECT arc.*,arc.senddate AS pubdate,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\n\t\t\ttp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,at.body\n\t\t\tFROM `{$this->MainTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n LEFT JOIN `#@__addonarticle` at ON arc.id=at.aid\n\t\t\tWHERE arc.arcrank=0 AND arc.arcrank > -1 AND arc.channel=1 {$addonQuery} ORDER BY arc.senddate DESC {$limitQuery}";
//var_dump($query);
$dsql->SetQuery($query);
$dsql->Execute('dd');
$xmlstr = '<?xml version="1.0" encoding="UTF-8"?>
<urlset>';
$setupmaxaid = 0;
while ($row = $dsql->GetArray('dd')) {
$row['id'] = isset($row['aid']) ? $row['aid'] : $row['id'];
$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['showdate'] = Mydate('Y-m-d', $row['pubdate']);
$row['priority'] = 0;
$row['body'] = isset($row['body']) ? Html2Text($row['body']) : '';
$row['body'] = empty($row['body']) ? $row['description'] : $row['body'];
//var_dump($row);exit;
if (preg_match("#c#", $row['flag'])) {
$row['priority'] = '1.0';
}
if (!isset($typeinfos)) {
$typeinfos = $this->getType($row['typeid']);
}
//var_dump($typeinfo);exit();
//var_dump($row);
$row['source'] = trim(Html2Text($row['source']));
$row['title'] = baidu_strip_invalid_xml($row['title']);
$row['body'] = baidu_strip_invalid_xml($row['body']);
$addstr = $copyrightstr = $yearstr = "";
$copyrightstr = !empty($row['source']) ? "\r\n\t\t\t\t\t<copyrightHolder><name><![CDATA[{$row['source']}]]></name></copyrightHolder>" : '';
$addstr .= empty($row['litpic']) ? "" : "\r\n\t\t\t\t\t<image><![CDATA[{$row['litpic']}]]></image>";
$yearstr = Mydate('Y', $row['pubdate']);
$rowxmlstr = <<<EOT
\t
\t<url>
\t\t\t<loc><![CDATA[{$cfg_basehost}{$row['filename']}]]></loc>
\t\t\t<lastmod>{$row['showdate']}</lastmod>
\t\t\t<changefreq>always</changefreq>
\t\t\t<priority>{$row['priority']}</priority>
\t\t\t<data>
\t\t\t\t<Webpage>
\t\t\t\t\t<name><![CDATA[{$row['title']}]]></name>
\t\t\t\t\t<url><![CDATA[{$cfg_basehost}{$row['filename']}]]></url>
\t\t\t\t\t<provider>
\t\t\t\t\t\t<name><![CDATA[{$cfg_webname}]]></name>
\t\t\t\t\t\t<url><![CDATA[{$cfg_basehost}]]></url>
\t\t\t\t\t</provider>
\t\t\t\t\t<description><![CDATA[{$row['description']}]]></description>
<text><![CDATA[{$row['body']}]]></text>
<keywords><![CDATA[{$row['keywords']}]]></keywords>
\t\t\t\t\t<breadcrumb><![CDATA[{$typeinfos['position']}]]></breadcrumb>
\t\t\t\t\t{$addstr}
<isPartOf>
\t\t\t\t\t\t<name><![CDATA[{$typeinfos['typename']}]]></name>
\t\t\t\t\t\t<url><![CDATA[{$cfg_basehost}{$typeinfos['typelink']}]]></url>
\t\t\t\t\t</isPartOf>
{$copyrightstr}
\t\t\t\t\t<copyrightYear>{$yearstr}</copyrightYear>
\t\t\t\t</Webpage>
\t\t\t</data>
\t\t</url>
EOT;
if ($cfg_soft_lang == 'gb2312') {
$rowxmlstr = gb2utf8($rowxmlstr);
}
//var_dump($rowxmlstr);exit;
$xmlstr .= $rowxmlstr;
}
//exit($xmlstr);
$xmlstr .= "\r\n</urlset>";
//$xmldata['content'] = $xmlstr;
return $xmlstr;
}
示例10: GetFileUrl
function GetFileUrl($aid,$typeid,$timetag,$title,$ismake=0,$rank=0,$namerule="",$artdir="",$money=0,$siterefer="",$sitepath=""){
$articleRule = "";
$articleDir = "";
if($namerule!="") $articleRule = $namerule;
else if(is_array($this->TypeInfos)) $articleRule = $this->TypeInfos['namerule'];
if($artdir!="") $articleDir = $artdir;
else if(is_array($this->TypeInfos)) $articleDir = $this->GetTypeDir();
return GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$articleRule,$articleDir,$money,$siterefer,$sitepath);
}
示例11: GetArcList
//.........这里部分代码省略.........
}
} else {
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,\n act.namerule2,act.ispart,act.moresite,act.siteurl,act.sitepath\n FROM `{$this->AddTable}` arc LEFT JOIN `#@__arctype` act ON arc.typeid=act.id\n WHERE {$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")) {
if ($this->ChannelType < 0 || $this->ChannelTypeid < 0) {
$row["id"] = $row["aid"];
$row["ismake"] = empty($row["ismake"]) ? "" : $row["ismake"];
$row["filename"] = empty($row["filename"]) ? "" : $row["filename"];
$row["money"] = empty($row["money"]) ? "" : $row["money"];
$row["description"] = empty($row["description "]) ? "" : $row["description"];
$row["pubdate"] = empty($row["pubdate "]) ? $row["senddate"] : $row["pubdate"];
}
//处理一些特殊字段
$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 (!preg_match("/^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);
} else {
if (isset($row[$ctag->GetName()])) {
$this->dtp2->Assign($k, $row[$ctag->GetName()]);
} else {
$this->dtp2->Assign($k, '');
}
}
}
}
$artlist .= $this->dtp2->GetResult();
} else {
$artlist .= "";
}
if ($col > 1) {
$artlist .= "</td>\r\n";
}
}
//Loop Col
if ($col > 1) {
$artlist .= "</tr>\r\n";
}
}
//Loop Line
if ($col > 1) {
$artlist .= "</table>\r\n";
}
$this->dsql->FreeResult("al");
return $artlist;
}
示例12: GetFileUrl
$row['senddate'] = $addTableRow['senddate'];
$row['channel'] = $addTableRow['channel'];
$row['arcrank'] = $addTableRow['arcrank'];
$row['senddate'] = $addTableRow['senddate'];
$row['typedir'] = $addTableRow['typedir'];
$row['isdefault'] = $addTableRow['isdefault'];
$row['defaultname'] = $addTableRow['defaultname'];
$row['ispart'] = $addTableRow['ispart'];
$row['namerule2'] = $addTableRow['namerule2'];
$row['moresite'] = $addTableRow['moresite'];
$row['siteurl'] = $addTableRow['siteurl'];
$row['sitepath'] = $addTableRow['sitepath'];
}
}
}
$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['title'] = changyan_autoCharset($row['title']);
$feedArr['title'] = $row['title'];
$feedArr['url'] = $cfg_basehost . $row['arcurl'];
$feedArr['ttime'] = date('Y-m-d h:m:s', $row['senddate']);
$feedArr['sourceid'] = $arr['aid'];
$feedArr['parentid'] = 0;
$feedArr['categoryid'] = $row['typeid'];
$feedArr['ownerid'] = $row['mid'];
$feedArr['metadata'] = '';
$dsql->SetQuery("SELECT feedback_id FROM `#@__plus_changyan_importids` WHERE aid={$arr['aid']}");
$dsql->Execute('dd');
$feedback_ids = array();
while ($farr = $dsql->GetArray('dd')) {
$feedback_ids[] = $farr['feedback_id'];
}
示例13: DelArcSg
/**
* 删除不带主表内容模型的数据
*
* @access public
* @param int $aid 文档ID
* @return string
*/
function DelArcSg($aid)
{
global $dsql, $cfg_cookie_encode, $cfg_ml, $cfg_upload_switch, $cfg_medias_dir;
$aid = intval($aid);
//读取文档信息
$arctitle = '';
$arcurl = '';
$arcQuery = "Select arc.id,arc.typeid,arc.senddate,arc.arcrank,ch.addtable,ch.nid,\n tp.typedir,tp.typename,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n from `#@__arctiny` arc\n left join `#@__arctype` tp on tp.id=arc.typeid\n left join `#@__channeltype` ch on ch.id=arc.channel\n where arc.id='{$aid}' ";
$arcRow = $dsql->GetOne($arcQuery);
if (!is_array($arcRow)) {
return FALSE;
}
//删除数据库的内容
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` where id='{$aid}' ");
$dsql->ExecuteNoneQuery("DELETE FROM `" . $arcRow['addtable'] . "` where aid='{$aid}' ");
$dsql->ExecuteNoneQuery("DELETE FROM `#@__feedback` where aid='{$aid}'");
$dsql->ExecuteNoneQuery("DELETE FROM `#@__member_stow` where aid='{$aid}'");
$dsql->ExecuteNoneQuery("DELETE FROM `#@__taglist ` where aid='{$aid}'");
//删除HTML
if ($arcRow['arcrank'] != 0 || $arcRow['typeid'] == 0) {
return TRUE;
}
$arcurl = GetFileUrl($arcRow['id'], $arcRow['typeid'], $arcRow['senddate'], '', 1, $arcRow['arcrank'], $arcRow['namerule'], $arcRow['typedir'], 0, '');
if (!preg_match("#\\?#", $arcurl)) {
$htmlfile = GetTruePath() . str_replace($GLOBALS['cfg_basehost'], '', $arcurl);
if (file_exists($htmlfile) && !is_dir($htmlfile)) {
@unlink($htmlfile);
$arcurls = explode(".", $htmlfile);
$sname = $arcurls[count($arcurls) - 1];
$fname = preg_replace("#(\\.{$sname})\$#", "", $htmlfile);
for ($i = 2; $i <= 100; $i++) {
$htmlfile = $fname . "_{$i}" . "." . $sname;
if (file_exists($htmlfile) && !is_dir($htmlfile)) {
@unlink($htmlfile);
} else {
break;
}
}
}
}
//删除文本文件
$filenameh = DEDEDATA . "/textdata/" . ceil($aid / 5000) . "/{$aid}-" . substr(md5($cfg_cookie_encode), 0, 16) . ".txt";
return TRUE;
}
示例14: lib_likearticle
//.........这里部分代码省略.........
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,\r\n 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 arc.arcrank>-1 AND ({$keyword}) {$typeid} {$orderquery} limit 0, {$row}";
} else {
if (!empty($typeid)) {
$typeid = " arc.typeid IN({$typeid}) AND arc.id<>{$arcid} ";
}
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,\r\n 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 arc.arcrank>-1 AND {$typeid} {$orderquery} limit 0, {$row}";
}
$innertext = trim($ctag->GetInnerText());
if ($innertext == '') {
$innertext = GetSysTemplets('part_arclist.htm');
}
$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;
$line = $row;
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['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') {
$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 .= " </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;
}
示例15: GetPreNext
function GetPreNext($gtype = '')
{
$rs = '';
if (count($this->PreNext) < 2) {
$aid = $this->ArcID;
$preR = $this->dsql->GetOne("Select id From `#@__arctiny` where id<{$aid} And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id desc");
$nextR = $this->dsql->GetOne("Select id From `#@__arctiny` where id>{$aid} And arcrank>-1 And typeid='{$this->Fields['typeid']}' order by id asc");
$next = is_array($nextR) ? " where arc.id={$nextR['id']} " : ' where 1>2 ';
$pre = is_array($preR) ? " where arc.id={$preR['id']} " : ' where 1>2 ';
$query = "Select arc.id,arc.title,arc.shorttitle,arc.typeid,arc.ismake,arc.senddate,arc.arcrank,arc.money,arc.filename,\r\n\t\t\t\t\t\tt.typedir,t.typename,t.namerule,t.namerule2,t.ispart,t.moresite,t.siteurl,t.sitepath\r\n\t\t\t\t\t\tfrom `#@__archives` arc left join #@__arctype t on arc.typeid=t.id ";
$nextRow = $this->dsql->GetOne($query . $next);
$preRow = $this->dsql->GetOne($query . $pre);
if (is_array($preRow)) {
$mlink = GetFileUrl($preRow['id'], $preRow['typeid'], $preRow['senddate'], $preRow['title'], $preRow['ismake'], $preRow['arcrank'], $preRow['namerule'], $preRow['typedir'], $preRow['money'], $preRow['filename'], $preRow['moresite'], $preRow['siteurl'], $preRow['sitepath']);
$this->PreNext['pre'] = "上一篇:<a href='{$mlink}'>{$preRow['title']}</a> ";
} else {
$this->PreNext['pre'] = "上一篇:没有了 ";
}
if (is_array($nextRow)) {
$mlink = GetFileUrl($nextRow['id'], $nextRow['typeid'], $nextRow['senddate'], $nextRow['title'], $nextRow['ismake'], $nextRow['arcrank'], $nextRow['namerule'], $nextRow['typedir'], $nextRow['money'], $nextRow['filename'], $nextRow['moresite'], $nextRow['siteurl'], $nextRow['sitepath']);
$this->PreNext['next'] = "下一篇:<a href='{$mlink}'>{$nextRow['title']}</a> ";
} else {
$this->PreNext['next'] = "下一篇:没有了 ";
}
}
if ($gtype == 'pre') {
$rs = $this->PreNext['pre'];
} else {
if ($gtype == 'next') {
$rs = $this->PreNext['next'];
} else {
$rs = $this->PreNext['pre'] . " " . $this->PreNext['next'];
}
}
return $rs;
}