爱秀代码's Archiver

icode 发表于 2020-4-14 19:47

论坛装扮中心

准备工作:
在后台进入“用户栏目定制”新建11个栏目
如图:
[attach]807[/attach]

1、新建模板命名为 my_diy 代码是[code]<!--{if ($_GET["item"] == "diy")}-->
{subtemplate header}

<style>
.my_diy {border-bottom: 1px solid rgb(208,208,208);  padding: 5px 0 5px 0;}
.my_diy h2 {color: #369;text-align: center;background: #efefef;padding: 3px 0;border: 1px solid #C2D5E3;font-weight: 700;margin-bottom: 5px;}
.my_diy span {color: #f00;}
.avt_diy img {padding: 2px;width: 64px;background: #FFF;border: 1px solid;border-color: #F2F2F2 #CDCDCD #CDCDCD #F2F2F2;margin: 2px;}
.avt_diy {margin-top: 0px;display: inline;}
</style>

<div id="nav"><a href="$indexname">$bbname</a> &raquo; 装扮中心</div>
<div id="wrap" class="wrap with_side s_clear">
        <div class="main">
                <div class="content">
{eval $xunzs = $db->fetch_array($db->query("SELECT * FROM cdb_memberfields WHERE uid=$discuz_uid"));}
<!--{if strpos($xunzs[medals],"10") !== false}-->
<!--{else}-->
<div class="xzwm" style="position: absolute;z-index: 1;font-size: 25px;padding: 59px 205px;"><a style="cursor: pointer;border: 4px solid #FFEB00;float: left;margin-left: 146px;padding: 12px;" href="plugin.php?id=dps_medalcenter">还没有装扮勋章,快去购买吧!</a></div>
<div class="xzwm" style="position: absolute;width: 802px;opacity: 0.5;background-color: #fff;height: 498px;"></div>
<!--{/if}-->
<form method="post" action="memcp.php?item=diy">
<!--{if ($_POST['okdiy'])}-->
{eval $mycard = $db->query("UPDATE cdb_memberfields SET field_3='" . $_POST['mycard1'] . "',field_4='" . $_POST['mycard2'] . "',field_5='" . $_POST['mycard3'] . "',field_13='" . $_POST['mycard5'] . "',field_14='" . $_POST['mycard6'] . "',field_6='" . $_POST['mycard4'] . "',field_2='" . $_POST['avtbg1'] . "',field_8='" . $_POST['postbg1'] . "',field_9='" . $_POST['postbg2'] . "',field_11='" . $_POST['postbg3'] . "',field_7='" . $_POST['bodybg1'] . "' WHERE uid='" . $discuz_uid . "'");}
<!--{/if}-->
{eval $diy =$db->fetch_array($db->query("SELECT * FROM cdb_memberfields WHERE uid=$discuz_uid"));}
<tr>
<th style="width:0px">
<h2 style="color: #369;text-align: center;background: #efefef;padding: 3px 0;border: 1px solid #C2D5E3;font-weight: 700;">当前个人名片</h2></th>
<td>

<!--{if $diy[field_3]}-->
<div style="width: 310px;  height: 150px; margin-top: 5px; margin-bottom: 5px; border: 1px solid #DDD;  background: {if $diy[field_4]}$diy[field_4]{else}#ffffff{/if}">
<!--{if $diy[field_2]}-->
<div class="avt_diy">
<a><img onerror="this.onerror=null;this.src='http://tlb.258club.com/attachments/month_1408/140811041292b86a00c533c584.gif'" src="$diy[field_2]" ></a>
</div><br />
<!--{else}-->
<div class="avt_diy">
{echo discuz_uc_avatar($member[uid])}
</div><br />
<!--{/if}-->
<img  src="$diy[field_3]" style="width: 80px;margin: 0px 0 0 230px;">
</div>
<!--{else}-->
<div style="width: 310px;  height: 150px; margin-top: 5px; margin-bottom: 5px; border: 1px solid #DDD;  {if $gendercheck[1]}background:rgb(187, 235, 249) url(http://www.discuz.net/static/image/common/gentlemanbg.png{elseif $gendercheck[2]}background:rgb(252, 224, 223) url(http://www.discuz.net/static/image/common/ladybg.png{else}background:#efefef url(http://www.discuz.net/static/image/common/nosexbg.png{/if}) no-repeat bottom right;  filter: alpha(opacity=96);  opacity: 0.96;">
<!--{if $diy[field_2]}-->
<div class="avt_diy">
<a><img onerror="this.onerror=null;this.src='http://tlb.258club.com/attachments/month_1408/140811041292b86a00c533c584.gif'" src="$diy[field_2]" ></a>
</div><br />
<!--{else}-->
<div class="avt_diy">
{echo discuz_uc_avatar($member[uid])}
</div><br />
<!--{/if}-->
</div>
<!--{/if}-->
</td>
</tr>

<div class="my_diy">
个人头像链接:<input size="70" type="text" name="avtbg1" value="$diy[field_2]" style="width: 200px;margin: 2px 10px 2px 24px;">头像链接地址<br />
个人名片图片链接:<input size="70" type="text" name="mycard1" value="$diy[field_3]" style="width: 200px;margin-right: 10px;">贴上图片地址,建议尺寸不要超过200x200。<br />
个人名片背景颜色:<input size="70" type="text" name="mycard2" value="$diy[field_4]" style="width: 200px;margin-right: 10px;">填写与背景图片较为融合的颜色,格式rgb(239, 239, 239)<br />
</div>

<div class="my_diy">
<h2>当前心情音乐</h2>
个人心情音乐:<input size="70" type="text" name="mycard3" value="$diy[field_5]" style="width: 200px;margin: 2px 10px 2px 24px;">音乐标题<br />
个人音乐地址:<input size="70" type="text" name="mycard4" value="$diy[field_6]" style="width: 200px;margin: 2px 10px 2px 24px;">音乐链接地址<br />
</div>

<div class="my_diy">
<h2>我的打赏码</h2>
支付宝打赏码:<input size="70" type="text" name="mycard5" value="$diy[field_13]" style="width: 200px;margin: 2px 10px 2px 24px;"><br />
微信打赏码:<input size="70" type="text" name="mycard6" value="$diy[field_14]" style="width: 200px;margin: 2px 10px 2px 36px;"><br />
</div>

<div class="my_diy">
<h2>当前论坛背景</h2>
<!--{if $diy[field_7]}-->
<div style="width: 780px;  height: 200px;  border: 1px solid #DDD; "><img src="$diy[field_7]" style="width: 100%;height: 200px;"></div>
<!--{else}-->
<div style="width: 780px;  height: 50px;  border: 1px solid #DDD; "><span>还没有个人论坛背景哦</span></div>
<!--{/if}-->
个人论坛背景:<input size="70" type="text" name="bodybg1" value="$diy[field_7]" style="width: 200px;margin: 2px 10px 2px 24px;">背景链接地址<br />
</div>

<div class="my_diy">
<h2>当前个人帖子背景</h2>
<div class="wdwd" style="background: url(http://icode.258club.com/attachments/month_2004/2004141842774f324f5abec52b.png);">
<!--{if $diy[field_8]}-->
<div style="width: 780px;  height: 380px; margin-bottom: 5px; border: 1px solid #DDD;background: #fff0 url($diy[field_8]) no-repeat bottom right;"></div>
<!--{else}-->
<div style="width: 780px;  height: 50px; margin-bottom: 5px; border: 1px solid #DDD;"><span>还没有设置帖子背景哦</span></div>
<!--{/if}-->
</div>
个人帖子背景链接:<input size="70" type="text" name="postbg1" value="$diy[field_8]" style="width: 200px;margin-right: 10px;">放入图片链接,定制属于自己的帖子背景。建议尺寸小于350x350<br />
个人帖子背景颜色:<input size="70" type="text" name="postbg2" value="$diy[field_9]" style="width: 200px;margin-right: 10px;">填写与背景图片较为融合的颜色,格式rgb(239, 239, 239)<br />
帖子背景位置:
<select name="postbg3" style="width: 80px;margin: 2px 2px 2px 20px;height: 24px;">
<option value="1" $diy[field_11][1]>左上</option>
<option value="2" $diy[field_11][2]>右上</option>
<option value="3" $diy[field_11][3]>左下</option>
<option value="4" $diy[field_11][4]>右下</option>
</select>
选择背景位置<br />
</div>
<input type="hidden" name="okdiy" value="1">
<button type="submit" id="fastpostsubmit" style="margin-top: 10px;"><strong>确 定</strong></button>
</form>
                </div>
        </div>
        <div class="side">
                {subtemplate personal_navbar}
        </div>
</div>
{subtemplate footer}
<!--{/if}-->[/code]2、在memcp_profile模板最上边加[code]{subtemplate my_diy}[/code]3、在personal_navbar模板找到[code]<div class="sideinner">[/code]在上边加[code]<div class="sideinner">
        <ul class="tabs">
                <li{if CURSCRIPT=='memcp' && $item == 'diy'} class="current"{/if}><a href="memcp.php?item=diy">装扮中心</a></li>
        </ul>
</div>
[/code]说明比如:[color=Red]field_3='" . $_POST['mycard2'] .[/color]

field_3代表刚才新建的用户栏目组id号为3 “个人名片背景颜色”

那么[code]个人名片背景颜色:<input size="70" type="text" name="mycard2" value="$diy[field_3]" style="width: 200px;margin-right: 10px;">填写与背景图片较为融合的颜色,格式rgb(239, 239, 239)<br />[/code]里边有一个[code]name="mycard2"[/code]和$_POST['mycard2']一致就可以了。

icode 发表于 2020-4-14 19:50

[code]<!--{if strpos($xunzs[medals],"10") !== false}-->[/code]这句代码的意思是设定id为10的勋章为“装扮勋章”,对应自己论坛想作为“装扮勋章”的勋章id填写进去就可以了

天使小小 发表于 2020-4-15 10:37

[b]回复 [url=http://icode.258club.com/redirect.php?goto=findpost&pid=44190&ptid=1733]2#[/url] [i]icode[/i] [/b]

[attach]849[/attach]

[b][size=7][color=Red]出现这样是什么问题[/color][/size][/b]

icode 发表于 2020-4-15 10:49

[b]回复 [url=http://icode.258club.com/redirect.php?goto=findpost&pid=44200&ptid=1733]3#[/url] [i]天使小小[/i] [/b]


    你要对应你自己的用户栏目组的id

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.