'.L('circle_manager').'';
break;
case 2:
return ''.L('circle_administrate').'';
break;
case 3:
default:
break;
}
}
/**
* 买家秀图像
*/
function showImgUrl($param){
return UPLOAD_SITE_URL.'/'.ATTACH_MALBUM.'/'.$param['member_id'].'/'.str_ireplace('.', '_240.', $param['ap_cover']);
}
/**
* 根据会员id生成部分附件路径
*/
function themePartPath($id){
$a = $id%20;
$b = $id%10;
return $a.'/'.$b.'/'.$id;
}
/**
* Inform Url link
*/
function spellInformUrl($param){
if($param['reply_id'] == 0) return $url = 'index.php?act=theme&op=theme_detail&c_id='.$param['circle_id'].'&t_id='.$param['theme_id'];
$where = array();
$where['circle_id'] = $param['circle_id'];
$where['theme_id'] = $param['theme_id'];
$where['reply_id'] = array('elt', $param['reply_id']);
$count = Model()->table('circle_threply')->where($where)->count();
$page = ceil($count/15);
return $url = 'index.php?act=theme&op=theme_detail&c_id='.$param['circle_id'].'&t_id='.$param['theme_id'].'&curpage='.$page.'#f'.$param['reply_id'];
}
/**
* Replace the UBB tag
*
* @param string $ubb
* @param int $video_sign
* @return string
*/
function replaceUBBTag($ubb, $video_sign = 1){
if($video_sign){
$flash_sign = preg_match("/\[FLASH\](.*)\[\/FLASH\]/iU", $ubb);
}
$ubb = str_replace(array(
'[B]', '[/B]', '[I]', '[/I]', '[U]', '[/U]', '[/FONT]', '[/FONT-SIZE]', '[/FONT-COLOR]'
), array(
'', '', '', '', '', '', '', '', ''
), preg_replace(array(
"/\[URL=(.*)\](.*)\[\/URL\]/iU",
"/\[FONT=([A-Za-z ]*)\]/iU",
"/\[FONT-SIZE=([0-9]*)\]/iU",
"/\[FONT-COLOR=([A-Za-z0-9]*)\]/iU",
"/\[SMILIER=([A-Za-z_]*)\/\]/iU",
"/\[IMG\](.*)\[\/IMG\]/iU",
"/\[FLASH\](.*)\[\/FLASH\]/iU",
"",
), array(
'['.L('nc_link').']',
"",
"",
"",
"",
'['.L('nc_img').']',
($video_sign == 1?'':'['.L('nc_video').']'),
""
), $ubb));
if($video_sign && !empty($flash_sign)){
$ubb .= "
";
}
return $ubb;
}
/**
* tidy theme goods information
*
* @param array $array
* @param string $key
* @param int $deep 1 one-dimensional array 2 two dimension array
* @param string $type
* @return array
*/
function tidyThemeGoods($array, $key, $deep=1, $type= 60){
if (is_array($array)){
$tmp = array();
foreach ($array as $v) {
if($v['thg_type'] == 0){
$v['image'] = thumb($v, $type);
$v['thg_url'] = urlShop('goods', 'index', array('goods_id'=>$v['goods_id']));
}else{
$v['image'] = $v['goods_image'];
}
if ($deep === 1){
$tmp[$v[$key]] = $v;
}elseif($deep === 2){
$tmp[$v[$key]][] = $v;
}
}
return $tmp;
}else{
return $array;
}
}
/**
* The editor
*
* @param string $cname The content of the editor 'id' and the 'name' of the name
* @param string $content The editor content
* @param string $type The toolbar type
* @param array $affix The affix content
* @param string $gname The name of the goods content
* @param array $goods The goods content
* @param array $readperm Optional permissions array
* @param int $rpvalue Has chosen the permissions
*/
function showMiniEditor($cname, $content = '', $type = 'all', $affix = array(), $gname = '', $goods = array(), $readperm = array(), $rpvalue = 0){
switch ($type){
case 'manage':
$items = array('font', 'size', 'line', 'bold', 'italic', 'underline', 'color', 'line', 'url', 'flash', 'image', 'line', 'smilier');
$return = '$__content.$__maffix.$__goods.$__readperm';
break;
case 'quickReply':
$items = array('font', 'size', 'line', 'bold', 'italic', 'underline', 'color', 'line', 'url', 'flash', 'line', 'smilier');
$return = '$__content';
break;
case 'hQuickReply':
$items = array('font', 'size', 'line', 'bold', 'italic', 'underline', 'color', 'line', 'url', 'flash', 'line', 'smilier', 'highReply');
$return = '$__content';
break;
default:
$items = array('font', 'size', 'line', 'bold', 'italic', 'underline', 'color', 'line', 'affix', 'line', 'url', 'flash', 'image', 'goods', 'line', 'smilier');
$return = '$__content.$__affix.$__goods.$__readperm';
break;
}
// toolbar items
$_line = "";
$_font = "".L('nc_font')."
".L('nc_relevance_adjunct_help_one')."
".L('nc_relevance_adjunct_help_two')."