列表页/内容页调用当前文档作者的会员头像的方法
完整代码为:
- {dede:field.mid runphp='yes'}
- $id = @me;
- if($id <> 0){
- $sql = "select * from dede_member where mid = $id";
- $query = mysql_query($sql);
- $row = mysql_fetch_array($query);
- if($row['face'] == ''){
- @me = '作者头像:<img src="/member/templets/images/dfboy.png" />';
- }
- else{
- $face = $row['face'];
- @me = '作者头像:<img src="'.$face.'" />';
- }
- }
- else{
- @me = '游客发表';
- }
- {/dede:field.mid}
列表页
- [field:mid runphp='yes']
- $id = @me;
- if($id <> 0){
- $sql = "select * from dede_member where mid = $id";
- $query = mysql_query($sql);
- $row = mysql_fetch_array($query);
- if($row['face'] == ''){
- @me = '作者头像:<img src="/member/templets/images/dfboy.png" />';
- }
- else{
- $face = $row['face'];
- @me = '作者头像:<img src="'.$face.'" />';
- }
- }
- else{
- @me = '游客发表';
- }
- [/field.mid]