在個人模板中的調用會員信息的方法,DEDE技術
導讀:DEDE技術DEDE技術DEDECMS會員信息調用方法。dede58模板dede織夢模板。
會員信息在個人模板info和ind織夢的模板ex的調用問題,好長時間沒解決 論壇發帖沒人回答 看了一晚上代碼 自己解決了。
會員個人空間 index.htm 、 listarticle.htm不能像infos.htm模板一樣使用
<?php echo GetEnumsValue('pfirst',$row['pfirst']); ?> 語句來調用自定義聯動數據,會報錯
會員index.php以及變量文件index_do.php都由變量控制,首頁模板在index.php中改寫,其他文件則在會員文件夾下Inc/space_action.php中有說明。 以下為例子,要讓index.htm同樣和infos.htm一樣調用處聯動數據,header.htm跟隨模板文件的改動而相應,比如infos支持,這個頁面的header.htm加在調用會成功,否則失敗報錯。 將Inc/space_action.php文件中的 /*--------------------------------- 個人資料 function infos(){ } -------------------------------------*/ else if($action=='infos') { include_once(DEDEDATA.'/enums/nativeplace.php'); include_once(DEDEINC."/enums.func.php"); $row = $dsql->GetOne("select * from `dede_member_person` where mid='{$_vars['mid']}' "); $dpl = new DedeTemplate(); $dpl->LoadTemplate(DEDEMEMBER."/space/{$_vars['spacestyle']}/infos.htm"); $dpl->display(); }
拷貝到index.php 經過篩選后的此位置, /*----------------------------- //會員空間主頁 function space_index(){ } ------------------------------*/ else { require_once(DEDEMEMBE織夢cms模板R.'/inc/config_space.php'); if($action == '') { include_once(DEDEINC."/channelunit.func.php"); $dpl = new DedeTemplate(); $tplfile = DEDEMEMBER."/space/{$_vars['spacestyle']}/index.htm";
改寫方式如下
/*----------------------------- //會員空間主頁 function space_index(){ } ------------------------------*/ else { require_once(DEDEMEMBER.'/inc/config_space.php'); include_once(DEDEDATA.'/enums/nativeplace.php');/*--后添加復制過來--*/ include_once(DEDEINC."/enums.func.php");/*--后添加復制過來--*/ if($action == '') { include_once(DEDEINC."/channelunit.func.php"); $row = $dsql->GetOne("select * from `dede_member_person` where mid='{$_vars['mid']}' ");/*--后添加復制過來--*/ $dpl = new DedeTemplate(); $tplfile = DEDEMEMBER."/space/{$_vars['spacestyle']}/index.htm";
綜上所述 只要在相應的位置添加以下三條數據即可 include_once(DEDEDATA.'/enums/nativeplace.php');/*--后添加復制過來--*/ include_once(DEDEINC."/enums.func.php");/*--后添加復制過來--*/ $row = $dsql->GetOne("select * from `dede_member_dede織夢模板person` where mid='{$_vars['mid']}' ");/*--后添加復制過來--*/
備注:相應的其他頁面只需要在 Inc/space_action.php 統一添加三條語句即可。
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-21 ,文章在個人模板中的調用會員信息的方法,DEDE技術主要講述模板,標簽,DEDE技術網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_33036.html
為你推薦與在個人模板中的調用會員信息的方法,DEDE技術相關的文章
