本文內容很零散,是在具體使用中總結的,待整理:
1、會員列表分頁位置:/e/member/list
2、欄目ID表:前綴_enewsclass
3、單獨調用一個欄目鏈接:<?=$class_r[欄目id]['classpath']?>
4、單獨調用一個欄目名稱:<?=$class_r[欄目id]['classname']?>
5、內容頁收藏夾地址:[!--news.url--]e/member/fava/add?classid=[!--classid--]&id=[!--id--]
6、內容頁調用會員的用戶名和空間鏈接:<a href="[!--news.url--]e/space/?userid=[!--userid--]">[!--username--]</a>
7、內容頁顯示會員收藏數:<?=$empire->gettotal("select count(*) as total from phome_enewsfava where id='$navinfor[id]'and classid='$navinfor[classid]'");?>
8、統計當前欄目的文章數:[totaldata]$GLOBALS[navclassid],0[/totaldata]
9、統計 159 欄目的文章數:[totaldata]'159',0,0[/totaldata]
10、關于帝國CMS會將“/”自動替換為空的說明,請用到“/”的地方用“////”四個反斜杠代替
11、內容頁簡介字數的控制:<?=sub($navinfor[smalltext],0,您的字數,false)?>
12、對靈動標簽的內容進行排序:
- [e:loop={'select * from hao_sd_about where classid=1 order by title asc limit 10',20,24,0}]
- <li><a href="<?=$bqsr[titleurl]?>" target="_self" title="<?=sub($bqr[title],0,40,false)?>"><?=sub($bqr[title],0,26,false)?></a></li>
- [/e:loop]
解釋:
hao_sd_about是要查詢字段所在的表名;
classid=1是要查詢的欄目ID是1;
order by title asc 是查詢title這個字段的//升序排列
order by title desc 是查詢title這個字段的//降序排列
limit 10 是取10條,可以去掉去全部!
13、<?=date('Y-m-d',$bqr[newstime])?> 靈動標簽的時間輸出
14、調用欄目圖片(一般在內容頁):
- [e:loop={"select classimg from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]
- <?=$bqr[classimg]?>
- [/e:loop]
解釋:phome_enewsclass是您要調用的表的名稱;
$GLOBALS[navclassid]是當前欄目的ID;如果是調用固定欄目就填寫固定的ID,比如如下:
- [e:loop={"select classimg from XXX_enewsclass where classid='8'",1,24,0}]
- <a href="[!--news.url--]<?=$class_r[8]['classpath']?>"><img src="<?=$bqr[classimg]?>" alt="<?=$class_r[8]['classname']?>" /></a>
- [/e:loop]
15、欄目列表頁調用一篇文章的內容:
- [e:loop={={4,1,12,0}]
- <?=$bqr[newstext]?>
- [/e:loop]
注意:newstext字段的屬性設置,不然不能顯示
16、調用欄目圖片:
- [e:loop={"select classimg from 數據庫前綴_enewsclass where classid='要調用的欄目ID'",1,24,0}]
- <a href="[!--news.url--]<?=$class_r[要調用的欄目ID]['classpath']?>"><img src="<?=$bqr[classimg]?>" alt="<?=$class_r[要調用的欄目ID]['classname']?>" /></a>
- [/e:loop]
17、上傳圖片存放的原始表:“表前綴_enewsfile”,這個主要是便于修改上傳的內容!
18、全局網站名稱調用:<?=$public_r[sitename]?>
19、當前位置[--[!--newsnav--]修改“首頁”兩個字:修改位置:e/data/language/gb/pub/fun.php'index'=>'首頁',這兩個字可以隨意更改成您想用的字;
20、分頁分為:[!--show.page--](下拉式);[!--show.listpage--](列表式)------注意:動態頁面只支持列表式(PS:[!--show.listpage--]的分頁樣式在:e/class/t_functions.php下修改;文字在語言包:e/data/language/fun.php 下修改 )
- /** 隨即調用 phome_ecms_news 表中 id為3 標題有 南京 文章內容有 南京
- [ecmsinfo]"select * from phome_ecms_news where classid in (3) and (title like '%南京%' or newstext like '%南京%') order by rand() desc limit 10",10,28,0,24,9,0[/ecmsinfo]
- /**調用 phome_ecms_news 表id為2,關鍵字為 阿彌陀經 的文章
- [ecmsinfo]"select * from phome_ecms_news where checked=1 and classid=2 and keyboard ='$navinfor[阿彌陀經]' limit 10",50,32,0,24,14,0[/ecmsinfo]
新聞熱點
疑難解答