:
0) { ?>
'primary', 'video'=>'danger', 'audio'=>'warning', 'document'=>'info', 'archive'=>'success', 'other'=>'secondary'); $type_labels = array('image'=>lang('admin_attach_type_image'), 'video'=>lang('admin_attach_type_video'), 'audio'=>lang('admin_attach_type_audio'), 'document'=>lang('admin_attach_type_document'), 'archive'=>lang('admin_attach_type_archive'), 'other'=>lang('admin_attach_type_other')); foreach($stats['type_stats'] as $type => $count) { $pct = $stats['total'] > 0 ? round($count / $stats['total'] * 100, 1) : 0; $color = isset($type_colors[$type]) ? $type_colors[$type] : 'secondary'; $label = isset($type_labels[$type]) ? $type_labels[$type] : $type; if($count == 0) continue; ?>
0) { $ref_tid = isset($tid_from_pid[$attach['pid']]) ? $tid_from_pid[$attach['pid']] : 0; if($is_orphan) { $ref_html = ''.lang('admin_attach_deleted').''; } else { $ref_html = ''.lang('admin_attach_reply').' #'.$attach['pid'].''; } } elseif($attach['tid'] > 0) { if($is_orphan) { $ref_html = ''.lang('admin_attach_deleted').''; } else { $ref_html = ''.lang('admin_attach_thread').' #'.$attach['tid'].''; } } else { $ref_html = ''.lang('admin_attach_no_ref').''; } // 确定类型标签 $ext = pathinfo($attach['orgfilename'], PATHINFO_EXTENSION); $type_label = lang('admin_attach_type_other'); $type_badge = 'secondary'; $ext_lower = strtolower($ext); $is_image = in_array($ext_lower, array('jpg','jpeg','png','gif','bmp','webp')); $is_video = in_array($ext_lower, array('mp4','avi','rm','rmvb','wmv','webm')); $is_audio = in_array($ext_lower, array('mp3','wav','wma','ogg')); $is_previewable = $is_image || $is_video || $is_audio; if($is_image) { $type_label = lang('admin_attach_type_image'); $type_badge = 'primary'; } elseif($is_video) { $type_label = lang('admin_attach_type_video'); $type_badge = 'danger'; } elseif($is_audio) { $type_label = lang('admin_attach_type_audio'); $type_badge = 'warning'; } elseif(in_array($ext_lower, array('doc','docx','xls','xlsx','ppt','pptx','pdf','txt','c','cpp'))) { $type_label = lang('admin_attach_type_document'); $type_badge = 'info'; } elseif(in_array($ext_lower, array('zip','rar','7z','gz','tar','bz'))) { $type_label = lang('admin_attach_type_archive'); $type_badge = 'success'; } // 构建附件URL $attach_url = $conf['upload_url'].'attach/'.$attach['filename']; ?>
()
$pagesize) { ?>
$count))?>