帝國(guó)CMS在反饋信息頁面調(diào)用萬能標(biāo)簽的方法

字號(hào):


    這篇文章主要為大家介紹了帝國(guó)CMS在反饋信息頁面調(diào)用萬能標(biāo)簽的方法,需要的朋友可以參考下。
    對(duì)于帝國(guó)CMS來說,其萬能標(biāo)簽功能都十分強(qiáng)大!是眾多使用帝國(guó)CMS的站長(zhǎng)建站時(shí)使用率較多的一個(gè)標(biāo)簽!
    今天遇到一個(gè)項(xiàng)目需要在反饋信息頁面引用某個(gè)欄目的最新信息,使用萬能標(biāo)簽顯然實(shí)現(xiàn)是最簡(jiǎn)單的,而反饋信息頁面不支持萬能標(biāo)簽的調(diào)用!
    經(jīng)過一番測(cè)試,得出了如下的解決方法:
    萬能標(biāo)簽的調(diào)用函數(shù)為e\class\下的t_functions.php中的函數(shù)sys_GetEcmsInfo,動(dòng)態(tài)頁面不支持標(biāo)簽調(diào)用卻支持php代碼的使用,于是問題有了解決途徑!
    以帝國(guó)CMS自帶的“默認(rèn)反饋分類”為例,其原始代碼如下:
    代碼如下:
    [!--cp.header--]
    <table width=100% cellpadding=3 cellspacing=1>
    <form name='feedback' method='post' enctype='multipart/form-data' action='../../enews/index.php'>
    <input name='enews' type='hidden' value='AddFeedback'>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>您的姓名:</div></td>
    <td bgcolor='ffffff'><input name='name' type='text' size='42'>
    (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>職務(wù):</div></td>
    <td bgcolor='ffffff'><input name='job' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>公司名稱:</div></td>
    <td bgcolor='ffffff'><input name='company' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系郵箱:</div></td>
    <td bgcolor='ffffff'><input name='email' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系電話:</div></td>
    <td bgcolor='ffffff'><input name='mycall' type='text' size='42'>
    (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>網(wǎng)站:</div></td>
    <td bgcolor='ffffff'><input name='homepage' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系地址:</div></td>
    <td bgcolor='ffffff'><input name='address' type='text' size="42"></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>信息標(biāo)題:</div></td>
    <td bgcolor='ffffff'><input name='title' type='text' size="42"> (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>信息內(nèi)容(*):</div></td>
    <td bgcolor='ffffff'><textarea name='saytext' cols='60' rows='12'></textarea>
    </td>
    </tr>
    <tr>
    <td bgcolor='ffffff'></td>
    <td bgcolor='ffffff'><input type='submit' name='submit' value='提交'></td>
    </tr>
    </form>
    </table>
    [!--cp.footer--]
    現(xiàn)在以調(diào)用默認(rèn)數(shù)據(jù)表10條最新信息為例,修改后的代碼如下:
    代碼如下:
    [!--cp.header--]
    <?php
    include("../../class/t_functions.php");
    ?>
    <table width=100% cellpadding=3 cellspacing=1>
    <form name='feedback' method='post' enctype='multipart/form-data' action='../../enews/index.php'>
    <input name='enews' type='hidden' value='AddFeedback'>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>您的姓名:</div></td>
    <td bgcolor='ffffff'><input name='name' type='text' size='42'>
    (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>職務(wù):</div></td>
    <td bgcolor='ffffff'><input name='job' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>公司名稱:</div></td>
    <td bgcolor='ffffff'><input name='company' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系郵箱:</div></td>
    <td bgcolor='ffffff'><input name='email' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系電話:</div></td>
    <td bgcolor='ffffff'><input name='mycall' type='text' size='42'>
    (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>網(wǎng)站:</div></td>
    <td bgcolor='ffffff'><input name='homepage' type='text' size='42'></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>聯(lián)系地址:</div></td>
    <td bgcolor='ffffff'><input name='address' type='text' size="42"></td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>信息標(biāo)題:</div></td>
    <td bgcolor='ffffff'><input name='title' type='text' size="42"> (*)</td>
    </tr>
    <tr>
    <td width='16%' height=25 bgcolor='ffffff'><div>信息內(nèi)容(*):</div></td>
    <td bgcolor='ffffff'><textarea name='saytext' cols='60' rows='12'></textarea>
    </td>
    </tr>
    <tr>
    <td bgcolor='ffffff'></td>
    <td bgcolor='ffffff'><input type='submit' name='submit' value='提交'></td>
    </tr>
    </form>
    </table>
    <?php
    sys_GetEcmsInfo(0,10,28,0,3,2,0);
    ?>
    [!--cp.footer--]
    其中,頭部include引入萬能標(biāo)簽函數(shù)sys_GetEcmsInfo所在的文件t_functions.php,然后就可以在需要顯示信息的位置加上函數(shù)sys_GetEcmsInfo(0,10,28,0,3,2,0);注意函數(shù)中的各項(xiàng)參數(shù)與萬能標(biāo)簽中的參數(shù)一一對(duì)應(yīng)!
    至此,問題搞定!