演示
http://www.young100.net/bbs/
根据liverxing的修改
[quote]
改法是这样,在“常规设置->添加常规选项”中,添加一个用户差数:
标题:是否允许使用QQ秀?
显示顺序: (这一项自动生成)
所在设置组:用户参数
类型:是或否按钮
变量值:qqshowavatar
当前值:0 (“1”代表默认打开此功能,“0”代表默认关闭此功能)
添加这个选项到 setting 缓冲 CACHE 文件?:选择“是”[/quote]
当用户填写了QQ&论坛开启了显示选项,才会显示按钮。
在header>headerjs内添加
代码:
<script type="text/javascript">
function avatar(a_id,h_id) {
document.getElementById(a_id).innerHTML=document.getElementById(h_id).innerHTML;
}
function qqshow(qq_num,a_id,h_id) {
var qqshow_html="<img src=http://qqshow-user.tencent.com/"+qq_num+"/10/00/ border=0 align=absmiddle>"
document.getElementById(h_id).innerHTML=document.getElementById(a_id).innerHTML;
document.getElementById(a_id).innerHTML=qqshow_html;
}
</script>
修改showthread>showthread_post 查找avatar
代码:
<if="$post['poster']['avatar']">
<br />
<if="$post['poster']['avatar']['type']=='img'">
<img class='avatar' src='{$post['poster']['avatar']['src']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' border='0' alt='' />
<elseif='$post['poster']['avatar']['type']=='object''>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}'>
<param name='movie' value='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}'>
<param name='play' value='true'>
<param name='loop' value='true'>
<param name='quality' value='high'>
<embed src='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' play='true' loop='true' quality='high'></embed>
</object>
<elseif='$post['poster']['avatar']['type']=='sysimg''>
<img class='avatar' src='{$post['poster']['avatar']['src']}' border='0' alt='' />
</if>
<br />
</if>
换成
代码:
<if="$post['poster']['avatar']">
<div id='avatar_{$post['row']['pid']}'>
<if="$post['poster']['avatar']['type']=='img'">
<img class='avatar' src='{$post['poster']['avatar']['src']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' border='0' alt='' />
<elseif='$post['poster']['avatar']['type']=='object''>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}'>
<param name='movie' value='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}'>
<param name='play' value='true'>
<param name='loop' value='true'>
<param name='quality' value='high'>
<embed src='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' play='true' loop='true' quality='high'></embed>
</object>
<elseif='$post['poster']['avatar']['type']=='sysimg''>
<img class='avatar' src='{$post['poster']['avatar']['src']}' border='0' alt='' />
</if>
</div>
<div style="visibility: hidden;height:1px;overflow:hidden;" id='h_{$post['row']['pid']}'><if="$post['poster']['avatar']['type']=='img'">
<img class='avatar' src='{$post['poster']['avatar']['src']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' border='0' alt='' />
<elseif='$post['poster']['avatar']['type']=='object''>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}'>
<param name='movie' value='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}'>
<param name='play' value='true'>
<param name='loop' value='true'>
<param name='quality' value='high'>
<embed src='{$bboptions['uploadurl']}/avatar/{$post['poster']['avatar']['value']}' width='{$post['poster']['avatar']['width']}' height='{$post['poster']['avatar']['height']}' play='true' loop='true' quality='high'></embed>
</object>
<elseif='$post['poster']['avatar']['type']=='sysimg''>
<img class='avatar' src='{$post['poster']['avatar']['src']}' border='0' alt='' />
</if>
</div>
<if="$bboptions['qqshowavatar']==1">
<if="$post['poster']['qq']">
<div><span style="cursor:hand;" onclick="javascript:avatar('avatar_{$post['row']['pid']}','h_{$post['row']['pid']}');">头像</span>|<span style="cursor:hand;" onclick="javascript:qqshow('{$post['poster']['qq']}','avatar_{$post['row']['pid']}','h_{$post['row']['pid']}');">QQ秀</span></div>
</if>
</if>
</if>
完成。 :smile: