帝国CMS调用论坛和Tipask内容
1.Tipask:
帝国 CMS首页调用tipask的其实并不难,帝国CMS的tipask问题表是ask_quertion,只需调用表中的字段。
以下是灵动标签实现,
[e:loop={"select id,title from ask_question order by id desc limit 10",10,24,0}] <li><a href="/tipask/?q-<?=$bqr[id]?>" target="_blank" title="<?=$bqr[title]?>" ><?=esub($bqr[title],30)?></a> </li> [/e:loop]
说明:tipask.ask_question 里的“tipask”要替换成你的数据库名称。
2.如何调用论坛新帖
http://bbs.phome.net/showthread-35-29390-0.html[ecmsinfo]'select 贴子标题字段 as title,贴子ID字段 as id from 贴子数据表 order by 排序字段 desc limit 调用条数',0,标题截取字数,0,24,模板ID,0[/ecmsinfo]
例如:(调用论坛最新10个贴子)
DISCUZ论坛:[ecmsinfo]'select subject as title,tid as id from cdb_threads order by tid desc limit 10',0,30,0,24,1,0[/ecmsinfo]
PHPWIND论坛:[ecmsinfo]'select subject as title,tid as id from pw_threads order by tid desc limit 10',0,30,0,24,1,0[/ecmsinfo]
如果论坛跟帝国CMS安装在不同的数据库,“贴子数据表”用“数据库.数据表”表示,如“discuzdb.cdb_threads”
灵动标签调用方式:
[e:loop={"select tid,subject from cdb_threads order by tid desc limit 9",9,24,0}] <li> <a href="/bbs/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=esub($bqr[subject],28)?> </a> </li> [/e:loop]