1、圖片+標題+摘要 帝國cms靈動標簽怎麼調?
用e:loop 調用
[e:loop={17,1,0,1}]
標題圖片:<img src="<?=$bqr[titlepic]?>" alt="<?=$bqsr[title]?>" />
內容簡介截取前200個位元組(一個中文字元是兩個位元組):<?=esub($bqr[smalltext],200)?>
標題:<?=$bqsr[title]?>
[/e:loop]
2、帝國cms發布的文章怎麼去掉圖片自帶的Alt 和title
這個是在文章中添加圖片上傳時,自動生成的吧?
應該在編輯器里處理。
3、帝國cms首頁多表調用,要調用欄目縮略圖+標題。
本來不想回答 去年做過項目4表聯合 拿去自己改吧 不會改就沒辦法 不解釋
[e:loop={'select *
from
(
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news where istop=1 order by newstime desc limit 13 )
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news1 where istop=1 order by newstime desc limit 13)
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news2 where istop=1 order by newstime desc limit 13)
Union All
(select id,classid,istop,title,titleurl,titlepic,newstime from phome_ecms_news3 where istop=1 order by newstime desc limit 13)
) as A order by newstime desc limit 20',0,24,0}]
<?php
$fb=$empire->fetch1("select *
from
(
(select id,classid,smalltext from phome_ecms_news_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news1_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news2_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,smalltext from phome_ecms_news3_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
) as A");
?>
<li class="clearfix">
<a target='_blank' href="<?=$bqr[titleurl]?>" title="<?=$bqr[title]?>" class="index-img"><img src="<?=$bqr[titlepic]?$bqr[titlepic]:'404.jpg'?>" alt="<?=$bqr[title]?>"></a>
<div class="index-text">
<h1><a target='_blank' href="<?=$bqr[titleurl]?>"><?=$bqr[title]?></a>
</h1>
<div class="index-con"></div>
<div class="index-intro"><a target="_blank" href="<?=$bqr[titleurl]?>?from=index_new_intro"><?=$fb[smalltext]?></a></div>
<div class="index-like clearfix">
<span class="time">
<?php
$fr=$empire->fetch1("select *
from
(
(select id,classid,infotags from phome_ecms_news_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news1_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news2_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
Union All
(select id,classid,infotags from phome_ecms_news3_data_1 where id='$bqr[id]' and classid='$bqr[classid]')
) as A");
$keyr=explode(',',$fr[infotags]);
for($i=0;$i<2;$i++)
{
echo'<span><a href="/liaotian/tags-'.$keyr[$i].'-0.html" target=_blank>'.$keyr[$i].'</a></span> ';
}
?>
</span>
<span class="time"><?=format_datetime($bqr[newstime],"m-d")?></span>
<div class="post-ope">
<a href="/e/public/digg/?classid=<?=$bqr[classid]?>&id=<?=$bqr[id]?>&dotop=1&ajaxarea=diggnum<?=$bqr[id]?>" class="post-like-btn post-like" id="post-like-top-btn">
<script>
document.write('<script src="/e/public/ViewClick/?classid=<?=$bqr[classid]?>&id=<?=$bqr[id]?>&down=5?t='+Math.random()+'"><'+'/script>');
</script>
</a>
</div>
</div>
</div>
</li>
[/e:loop]
功能:聯合取4表數據 關聯取附表簡介 並取標簽 附加頂功能 動態瀏覽量等
4、帝國CMS模版,別的正常,唯獨標題圖片調用不出來!
第一步,檢查你的這個數據表{$dbtbpre}ecms_game 中是否含有 titlepic 這個欄位;
第二步,如果沒有包含這個欄位,那麼你要給它添加上去;
如果有這個欄位也仍然調用不出來,可能這個欄位的值 本身就為空字元串。
你這個程序的if判斷似乎有點問題,請你檢查你的判斷邏輯是否正確,你的程序意思是:if($userr[game]) 如果查詢結果中game欄位存在值,那麼$game='';else否則如果game欄位不存在值,那麼......<img src='".$userr[titlepic].'"/> 其中這里的$userr[titlepic]也很可能如第二步猜測的不存在該值(查無該條記錄)!
5、帝國cms 首頁怎麼添加帶圖片和標題的新內容啊?
你是說首頁調用吧,用靈動標簽很簡單。
[e:loop={1,10,0,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><img src="<?=$bqr['titlepic']?>"><?=$bqr['title']?></a> <br>
[/e:loop]
這段代碼是調用欄目id為1的10條最新信息。
其中<?=$bqsr['titleurl']?>是調用文章的地址,<?=$bqr['titlepic']?>是圖片路徑,<?=$bqr['title']?>是文章標題。這種調用如果文章沒有標題圖片就調用不出來圖片。可以用這種寫法
<img src="<?=$bqr[titlepic]?$bqr[titlepic]:$public_r[newsurl]."e/data/images/notimg.gif"?>" width="60" height="60" alt="">,這樣如果沒有標題圖片會調用默認圖片notimg。
愛建站公益網有詳細教程,你可以看我資料找到網址,在這里就不發了