POST TIME:2020-04-09 01:21
dedecms會員空間更換模板教程:
1、數(shù)據(jù)庫member表spacename后增加字段spacetemplets字段
2、在member/templets/space/目錄增加幾個自選模板文件夾
如:
member/templets/space/1/
member/templets/space/2/
member/templets/space/3/
3、修改member/index.php
104行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_info.htm");
132行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_guestbook_form.htm");
167行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_index.htm");
213行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_group.htm");
253行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_threads.htm");
287行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_asks.htm");
321行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_infos.htm");
增加".$spacetemplets."/路徑
115行
$spaceInfos = $dsql->GetOne("Select
ID,uname,spacename,spacetemplets,spaceimage,news,sex,c1,c2,spaceshow,logintime,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
143行
$spaceInfos = $dsql->GetOne("Select ID, userid, `type`,
uname,c1,c2,spaceshow,logintime,spacename,spacetemplets,spaceimage,news,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
184行
$spaceInfos = $dsql->GetOne("Select ID, userid, `type`,
uname,c1,c2,spaceshow,logintime,spacename,spacetemplets,spaceimage,news,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
224行
$spaceInfos = $dsql->GetOne("Select ID, userid, `type`,
uname,c1,c2,spaceshow,logintime,spacename,spacetemplets,spaceimage,news,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
258行
$spaceInfos = $dsql->GetOne("Select ID, userid, `type`,
uname,c1,c2,spaceshow,logintime,spacename,spacetemplets,spaceimage,news,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
292行
$spaceInfos = $dsql->GetOne("Select ID, userid, `type`,
uname,c1,c2,spaceshow,logintime,spacename,spacetemplets,spaceimage,news,scores From
dede_member where `$fieldname`='{$fieldvalue}'; ");
增加spacetemplets字段
4、member/space_info.php
7行
require_once(dirname
(__FILE__)."/templets/space/".$spacetemplets."/member_infos.htm");
增加spacetemplets字段
5、member/templets/space_info.htm
58行后增加
<tr>
<td height="24" colspan="2" bgcolor="#FBFEEF" > 選擇模板:</td>
</tr>
<tr>
<td height="35" colspan="2" >
<input name="spacetemplets" type="text" id="spacetemplets" size="35"
value="<?php echo $spacetemplets?>" class="company_manage_form_label" />
</td>
</tr>
效果:
6、member/index_do.php
327行
$upquery = "Update dede_member set spacename='$spacename',spacetemplets='$spacetemplets',spaceimage='$spaceimage',news='$news',mybb='$mybb'
where ID='".$cfg_ml->M_ID."';
";
增加spacetemplets字段
此行數(shù)為修改過后的行數(shù),所給出的代碼為修改后的代碼,只作參考。
由于時間不多,所以沒有太多的圖片,只是比較簡單容易實現(xiàn)個人會員自選空間模板。此次改動,并沒有做后臺管理員設置的選項,也沒有做企業(yè)會員的自選模板,等有時間,我可能會寫出相關(guān)的教程,由于我也沒有用過DEDECMS,只看著代碼去修改,難免有錯漏的,如果錯誤,請指出,別丟罵就OK了。