DEDECMS会员信息在个人模板info和index的调用问题
<span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>会员信息在个人模板info和index的调用问题,好长时间没解决 论坛发帖没人回答 看了一晚上代码 自己解决了。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>会员个人空间 index.htm 、 listarticle.htm不能像infos.htm模板一样使用 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><?php echo GetEnumsValue('pfirst',$row['pfirst']); ?> 语句来调用自定义联动数据,会报错 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>会员index.php以及变量文件index_do.php都由变量控制,首页模板在index.php中改写,其他文件则在会员文件夹下Inc/space_action.php中有说明。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>以下为例子,要让index.htm同样和infos.htm一样调用处联动数据,header.htm跟随模板文件的改动而相应,比如infos支持,这个页面的header.htm加在调用会成功,否则失败报错。 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>将Inc/space_action.php文件中的 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'><div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode4" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
/*--------------------------------- <br>
个人资料 <br>
function infos(){ } <br>
-------------------------------------*/ <br>
else if($action=='infos') <br>
{ <br>
include_once(DEDEDATA.'/enums/nativeplace.php'); <br>
include_once(DEDEINC."/enums.func.php"); <br>
$row = $dsql->GetOne("select * from `dede_member_person` where mid='{$_vars['mid']}' "); <br>
$dpl = new DedeTemplate(); <br>
$dpl->LoadTemplate(DEDEMEMBER."/space/{$_vars['spacestyle']}/infos.htm"); <br>
$dpl->display(); <br>
} </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>拷贝到index.php 经过筛选后的此位置, </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode5" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
/*----------------------------- <br>
//会员空间主页 <br>
function space_index(){ } <br>
------------------------------*/ <br>
else <br>
{ <br>
require_once(DEDEMEMBER.'/inc/config_space.php'); <br>
if($action == '') <br>
{ <br>
include_once(DEDEINC."/channelunit.func.php"); <br>
$dpl = new DedeTemplate(); <br>
$tplfile = DEDEMEMBER."/space/{$_vars['spacestyle']}/index.htm"; </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>改写方式如下 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode6" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
/*----------------------------- <br>
//会员空间主页 <br>
function space_index(){ } <br>
------------------------------*/ <br>
else <br>
{ <br>
require_once(DEDEMEMBER.'/inc/config_space.php'); <br>
include_once(DEDEDATA.'/enums/nativeplace.php');/*--后添加复制过来--*/ <br>
include_once(DEDEINC."/enums.func.php");/*--后添加复制过来--*/ <br>
if($action == '') <br>
{ <br>
include_once(DEDEINC."/channelunit.func.php"); <br>
$row = $dsql->GetOne("select * from `dede_member_person` where mid='{$_vars['mid']}' ");/*--后添加复制过来--*/ <br>
$dpl = new DedeTemplate(); <br>
$tplfile = DEDEMEMBER."/space/{$_vars['spacestyle']}/index.htm"; </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>综上所述 只要在相应的位置添加以下三条数据即可 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<div class="right">
<span><u>复制代码</u></span>
</div>
代码如下:</div>
<div class="msgborder" id="phpcode7" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
<br>
include_once(DEDEDATA.'/enums/nativeplace.php');/*--后添加复制过来--*/ <br>
include_once(DEDEINC."/enums.func.php");/*--后添加复制过来--*/ <br>
$row = $dsql->GetOne("select * from `dede_member_person` where mid='{$_vars['mid']}' ");/*--后添加复制过来--*/ </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>备注:相应的其他页面只需要在 Inc/space_action.php 统一添加三条语句即可</span>
頁:
[1]