风格装多了,总想了解各个风格都有多少用户使用,很小的改动,可以一目了然在风格下拉菜单中显示各个风格被选择的数量。
修改\includes\functions.php文件,1325行
后面,照下面修改
global $DB, $forums, $bbuserinfo;
$select_style = "<optgroup label='{$forums->lang['_selected_style']}'>\n";
$forums->func->check_cache('style');
foreach( $forums->cache['style'] AS $id => $style ) {
$selected = ($id == $bbuserinfo['style']) ? " selected='selected'" : "";
$select_style .= "<option value='$id'{$selected}>";
$parentlist = explode(',', $style['parentlist']);
$style_prefix = "";
for( $i=1; $i < count($parentlist); $i++ ) {
$style_prefix .= "--";
}
//----风格选择人数
$stylesl = $DB->query_first("SELECT COUNT(style) AS count FROM ".TABLE_PREFIX."user WHERE style = ".$id."");
$stylenum = $stylesl['count'];
$select_style .= $style_prefix . " " . $style['title']."(".$stylenum.")";
//----风格选择人数
$select_style .="</option>\n";
}
以上红色为添加部分。
Processed in 0.140227 second(s), 10 queries, GZIP On;
安装了几个风格,就多出几次queries,自己看着办吧。
For2.6.1了,更新。
修改\includes\functions.php文件,1373行
后面,照下面修改
以上红色为添加部分。