本帖最后由 688576 于 2017-3-9 12:10 编辑
效果图:
性别:男 样式
性别:女 样式
性别:保密 样式
首先。在需要添加名片卡的任意 <a> 标签内添加
修改模板部分。(修改前备份)
打开:template/default/home/space_card.htm
覆盖全部内容如下:
- <!--{template common/header}-->
- <div id="WB_Card">
- <!--{eval $encodeusername = rawurlencode($space['username']);}-->
- <div class="CardT Gender_$space['gender']">
- <div class="userlogo">
- <!--{avatar($space[uid],small)}-->
- <div class="gender Gender_Of_$space['gender']" title=""></div>
- </div>
- <div class="username">
- <strong>$space[username]</strong>
- <!--{if $_G['setting']['verify']['enabled']}-->
- <!--{loop $_G['setting']['verify'] $vid $verify}-->
- <!--{if $verify['available'] && $verify['showicon']}-->
- <!--{if $space['verify'.$vid] == 1}-->
- <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank"><!--{if $verify['icon']}--><img src="$verify['icon']" alt="$verify[title]" title="$verify[title]" /><!--{else}-->$verify[title]<!--{/if}--></a>
- <!--{elseif !empty($verify['unverifyicon'])}-->
- <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank"><!--{if $verify['unverifyicon']}--><img src="$verify['unverifyicon']" alt="$verify[title]" title="$verify[title]" /><!--{/if}--></a>
- <!--{/if}-->
- <!--{/if}-->
- <!--{/loop}-->
- <!--{/if}-->
- </div>
- <div class="usergroup">
- {lang usergroup} : $space[group][grouptitle]
- </div>
- </div>
- <div class="CardB">
- <div class="userinfo">
- <p>{lang credits} : $space[credits]</p>
- <p>{lang thread} : $space[threads]</p>
- <p>{lang friends} : $space[friends]</p>
- </div>
- <div class="userresid">
- $space[resideprovince] $space[residecity]
- </div>
- <div class="useroperat">
- <a class="ws dw" href="home.php?mod=space&uid=$space[uid]">{lang visit_Ta_space}</a>
- <!--{if $space[self]}-->
- <a class="ws dw" href="home.php?mod=spacecp&ac=avatar">{lang edit_avatar}</a>
- <a class="ws dw" href="home.php?mod=spacecp&ac=profile">{lang update_profile}</a>
- <!--{else}-->
- <!--{eval require_once libfile('function/friend');$isfriend=friend_check($space[uid]);}-->
- <!--{if !$isfriend}-->
- <a class="ws dw" href="home.php?mod=spacecp&ac=friend&op=add&uid=$space[uid]&handlekey=addfriendhk_{$space[uid]}" id="a_friend_li_{$space[uid]}" onclick="showWindow(this.id, this.href, 'get', 0);">{lang add_friend}</a>
- <!--{else}-->
- <a class="ws dw" href="home.php?mod=spacecp&ac=friend&op=ignore&uid=$space[uid]&handlekey=ignorefriendhk_{$space[uid]}" id="a_ignore_{$space[uid]}" onclick="showWindow(this.id, this.href, 'get', 0);">{lang ignore_friend}</a>
- <!--{/if}-->
- <a class="ws dw" href="home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_$space[uid]&touid=$space[uid]&pmid=0&daterange=2" id="a_sendpm_$space[uid]" onclick="showWindow('showMsgBox', this.href, 'get', 0)">{lang send_pm}</a>
- <!--{/if}-->
- <!--{eval $cardid = rand(1,25500000);}-->
-
- <div id="More" class="MoreBox_$cardid">
- <a class="ws xw" href="javascript:;"><i class="fa fa-18 font-setup"></i></a>
- <div id="More_$cardid" class="menuBox" style="display: none;">
- <!--{if checkperm('allowbanuser') || checkperm('allowedituser')}-->
- <!--{if checkperm('allowedituser')}-->
- <a href="{if $_G[adminid] == 1}admin.php?action=members&operation=search&username=$encodeusername&submit=yes&frames=yes{else}forum.php?mod=modcp&action=member&op=edit&uid=$space[uid]{/if}" target="_blank" class="xi1">{lang user_edit}</a>
- <!--{/if}-->
- <!--{if checkperm('allowbanuser')}-->
- <a href="{if $_G[adminid] == 1}admin.php?action=members&operation=ban&username=$encodeusername&frames=yes{else}forum.php?mod=modcp&action=member&op=ban&uid=$space[uid]{/if}" target="_blank" class="xi1">{lang user_ban}</a>
- <!--{/if}-->
- <a class="a" href="forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users=$encodeusername" target="_blank" class="xi1">{lang manage_post}</a>
- <!--{/if}-->
- <a href="home.php?mod=space&uid=$space[uid]&do=thread&view=me&from=space&type=thread" $orderactives[thread]>{lang space_Ta_thread}</a>
- <a href="home.php?mod=space&uid=$space[uid]&do=thread&view=me&from=space&type=reply" $orderactives[reply]>{lang space_Ta_reply}</a>
- <a href="home.php?mod=spacecp&ac=poke&op=send&uid=$space[uid]&handlekey=propokehk_{$space[uid]}" id="a_poke_{$space[uid]}" onclick="showWindow(this.id, this.href, 'get', 0);" class="xi2">{lang say_hi}</a>
- </div>
- <script type="text/javascript">
- Y_jQ(function(){
- Y_jQ(".MoreBox_$cardid").hover(
- function(){
- Y_jQ("#More_$cardid").slideToggle(100);
- },
- function(){
- Y_jQ("#More_$cardid").slideUp(100)
- }
- )
- })
- </script>
- </div>
- </div>
- </div>
- </div>
-
- <!--{template common/footer}-->
复制代码 打开:template/default/common/common.css
在最后加入:- #append_parent .card { width: 380px !important; }#WB_Card { width: 380px; height: 220px; }
- #WB_Card .CardT { width: 380px; height: 125px; text-align: center; color: #FFF; text-shadow: 0 0 4px rgba(0, 0, 0, 0.4); }
- #WB_Card .Gender_0 { background-image: url("../images/CardT_0.jpg"); background-repeat: no-repeat; }
- #WB_Card .Gender_1 { background-image: url("../images/CardT_1.jpg"); background-repeat: no-repeat; }
- #WB_Card .Gender_2 { background-image: url("../images/CardT_2.jpg"); background-repeat: no-repeat; }
- #WB_Card .CardT .userlogo { width: 56px; height: 56px; margin: 0 auto; padding-top: 10px; }
- #WB_Card .CardT .userlogo img { background-color: rgba(255, 255, 255, 0.3); border-radius: 50%; width: 48px; height: 48px; padding: 4px; }
- #WB_Card .CardT .userlogo .gender { background-image: url("../images/Gender.png"); background-repeat: no-repeat; width: 16px; height: 16px; position: relative; left: 38px; bottom: 18px; }
- #WB_Card .CardT .userlogo .Gender_Of_1 { background-position: 0 0; }
- #WB_Card .CardT .userlogo .Gender_Of_2 { background-position: -25px 0; }
- #WB_Card .CardT .username { font-size: 0; padding-top: 5px; }
- #WB_Card .CardT .username strong { font-size: 14px; }
- #WB_Card .CardT .username a { display: inline-block !important; margin-left: 5px; }
- #WB_Card .CardT .username a img { width: 16px; height: 16px; display: inline; }
- #WB_Card .CardT .usergroup { padding-top: 5px; }
- #WB_Card .CardB { width: 380px; height: 95px; }
- #WB_Card .CardB .userinfo { text-align: center; padding-top: 8px; }
- #WB_Card .CardB .userinfo p { font-size: 14px; display: inline; padding: 0 10px; }
- #WB_Card .CardB .userinfo p + p { border-left: 1px solid #D9D9D9; }
- #WB_Card .CardB .userresid { height: 18px; text-align: center; padding-top: 6px; }
- #WB_Card .CardB .useroperat { height: 27px; text-align: center; padding-top: 8px; }
- #WB_Card .CardB .useroperat .ws { border-style: solid; border-width: 1px; border-color: #DDD; height: 25px; line-height: 25px; display: inline-block !important; margin: 0 3px; }
- #WB_Card .CardB .useroperat .xw { width: 40px; }
- #WB_Card .CardB .useroperat .dw { width: 80px; }
- #WB_Card .CardB .useroperat #More { display: inline-table; width: 42px; }
- #WB_Card .CardB .useroperat #More div { position: absolute; left: 306px; top: 214px !important; }
- #WB_Card .CardB .useroperat #More div a { text-align: left; white-space: nowrap; }
- #WB_Card .CardB .useroperat #More .a { border-bottom: 1px solid #DDD; }
复制代码 打开:source/language/lang_template.php
在最后加入: |