現在很多網站都有實名驗證的環節,上傳一些必要的身份證、個人信息等,便于對會員手動審核開通權限。會員使用權限開通狀態(-10 郵件驗證 -1 手工審核, 0 沒限制),下面介紹DedeCMS會員開發增加實名驗證的方法。增加會員身份證、真實姓名、身份證與本人拍照認證信息,實現DedeCMS后臺調用查看這些信息。

這里不利用個人資料模板,用頭像設置的模板修改,單獨做實名認證的模板。

dede后臺查看會員調用真實姓名、認證信息、身份證信息。
使用SQL命令增加數據庫相應字段
alter table dede_member add shiming char(50) comment '認證信息';
alter table dede_member add shenfenzheng char(100) comment '身份證號';
alter table dede_member add xingming char(100) comment '真實姓名';
新增edit_shiming.php,edit_shiming.htm
edit_shiming.php是由edit_face.php修改而來,修改后的文件鏈接:
edit_shiming.htm是由edit_face.htm修改而來,參考下面的修改方法。
會員中心調用實名制信息
在/member/templets/images/文件夾下,新建圖片名為shiming.jpg、v.png。實現未上傳顯示shiming.jpg圖片,反之顯示已上傳的內容的效果,并顯示加V圖片,需要增加一個php判斷:
打開edit_shiming.htm,在<div class="postForm">下面把原來屬于edit_face.htm的代碼刪除。增加代碼:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<p class="cellBg"><img src="
<?php
if($cfg_ml->fields['shiming']==''){
echo "images/shiming.jpg";}
else{
echo $cfg_ml->fields['shiming'];}
?>" width="300" height="150"/>
</p>
<p>
<input name='oldshiming' type='hidden' id='oldshiming' value='<?php echo $shiming; ?>'/>
認證彩照:<input name='faceurl' type='text' id='faceurl' size='35' class='intxt' style='width:250px' value='<?php echo $shiming; ?>'/>
<input name="shiming" type="file" id="shiming" size="45" />
<a href="edit_shiming.php?dopost=delold&oldshiming=<?php echo urlencode($shiming); ?>">[刪除]</a>
</p>
<p class="cellBg">
身份證號:<input name='shenfenzheng' type='text' id='shenfenzheng' class='intxt' value='<?php echo $shenfenzheng?>'/>
</p>
<p>
真實姓名:<input name='xingming' type='text' id='xingming' class='intxt' value='<?php echo $xingming?>'/>
</p>
|
會員中心任意位置顯示會員已認證加V
修改后可以實現會員中心首頁和公共頭部顯示是否已認證加V信息,如果已認證會員等級值為180,在這兩個區域增加代碼:
|
1
2
3
4
5
6
7
8
|
<?php
if($cfg_ml->M_Rank=='180'){
echo "<img src='templets/images/v.png' width='15' height='15'/><span>已實名認證</span>";
}
else if($cfg_ml->M_Rank=='10'){
echo "未實名認證<a href='edit_shiming.php'>立即認證</a>";
}
?>
|
系統后臺調用實名制信息
打開/dede/templets/member_view.htm,如果你改過dede后臺地址,請自行修改。找到
|
1
2
3
4
5
6
|
<tr>
<td align="right" class='bline'>電子郵箱:</td>
<td class='bline' style="text-align:left;">
<input name="email" type="text" id="email" value="<?php echo $row['email']?>" style="width:150px;"/>
</td>
</tr>
|
下面增加
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<tr>
<td align="right" class='bline'>認證信息:</td>
<td class='bline' style="text-align:left;">
<img src="
<?php
if($row['shiming']==''){
echo '../images/shiming.jpg';}
else{
echo $row['shiming'];}
?>" width="300" height="150"/>
</td>
</tr>
<tr>
<td align="right" class='bline'>真實姓名:</td>
<td class='bline' style="text-align:left;">
<input name="xingming" type="text" id="xingming" value="
<?php
if($row['xingming']==''){
echo '未設置';}
else{
echo $row['xingming'];}?>" style="width:150px;" />
</td>
</tr>
<tr>
<td align="right" class='bline'>身份證:</td>
<td class='bline' style="text-align:left;">
<input name="shenfenzheng" type="text" id="shenfenzheng" value="
<?php if($row['shenfenzheng']==''){
echo '未設置';}
else{
echo $row['xingming'];}?>" style="width:150px;" />
</td>
</tr>
|

















