smf论坛自定义添加勋章(头衔)

首先找到内容页模板 display.template.php

[code lang=”php”]
$request = $smcFunc[‘db_query’](”, ‘SELECT package FROM {db_prefix}members where id_member = ‘.$message[‘member’][‘id’].”);//查询当前用户的package
$a = $smcFunc[‘db_fetch_assoc’]($request);
$smcFunc[‘db_free_result’]($request);
$pack = $a[‘packageid’];
switch($pack){//输出
case A3:
echo ‘<li class="A3"><a href="http://shanmao.me" title=""></a></li>’;
break;
case A2:
echo ‘<li class="A2"><a href="http://shanmao.me" title=""></a></li>’;
break;
case A4:
echo ‘<li class="A4"><a href="http://shanmao.me" title=""></a></li>’;
break;
case A5:
echo ‘<li class="A5"><a href="http://shanmao.me" title=""></a></li>’;
break;
case A6:
echo ‘<li class="A6"><a href="http://shanmao.me" title=""></a></li>’;
break;
case A7:
echo ‘<li class="A7"><a href="http://shanmao.me" title=""></a></li>’;
break;
default:
echo ‘<li class="A1"></li>’;
}
[/code]
这里配合你的CSS就可以实现你需要的自定义勋章(头衔)功能

查看demo : http://forum.cityofsteam.com/index.php?topic=1721.0