'.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_Microsoft_YaHei')."".L('nc_simsun')."".L('nc_simhei')."ArialVerdanaHelveticaTahoma
"; $_size = "".L('nc_font_size')."
12px14px16px18px20px22px24px
"; $_bold = ""; $_italic= ""; $_underline = ""; $_color = "
"; $_affix = "
".L('nc_upload_affix')."
"; $_url = "".L('nc_line')."
"; $_flash = "".L('nc_video')."
"; $_image = "".L('nc_image').""; $_goods = "".L('nc_goods').""; $_smilier = "".L('nc_smilier')."
"; $_highReply= "".L('nc_advanced_reply').""; // Spell the editor contents $__content = ''; $__content .= "
"; foreach ($items as $val){ $val = '_'.$val; $__content .= $$val; } $__content .= "
"; // The attachment part $__affix = ''; $__affix .= "

".L('nc_relevance_adjunct')."

".L('nc_relevance_adjunct_help_one')."

".L('nc_relevance_adjunct_help_two')."

"; $__maffix = str_replace("nctype=\"affix_delete\"", "nctype=\"maffix_delete\"", $__affix); // After insert part of goods $__goods = ''; $__goods .= "

".L('nc_select_insert_goods,nc_colon')."

"; if(!empty($goods)){ foreach($goods as $val){ $__goods .= "
".$val['goods_name']."
".$val['goods_price']."
".L('nc_delete')."
"; } } $__goods .= "
"; // Part read permissions $__readperm = ''; if(!empty($readperm)){ $__readperm .= "
".L('nc_read_perm,nc_colon')."
"; } eval('$return = '.$return.';'); return $return; } /** * Recently two voters */ function recentlyTwoVoters($str){ $str = explode(' ', $str, 3); $rs = ''; if(isset($str[0]) && !empty($str[0])) $rs .= $str[0]; if(isset($str[1]) && !empty($str[1])) $rs .= ', '.$str[1]; return $rs; } /** * member rank html */ function memberLevelHtml($param){ return "
".($param['cm_levelname'] == ''?L('circle_violation'):$param['cm_levelname'])."".$param['cm_level']."
"; } /** * 文本过滤 * @param $param string $subject * @return string */ function circleCenterCensor($subject){ $replacement = '***'; if(C('circle_wordfilter') == '') return $subject; $find = explode(',', C('circle_wordfilter')); foreach ($find as $val){ if(preg_match('/^\/(.+?)\/$/', $val, $a)){ $subject = preg_replace($val, $replacement, $subject); }else{ $val = preg_replace("/\\\{(\d+)\\\}/", ".{0,\\1}", preg_quote($val, '/')); $subject = preg_replace("/".$val."/", $replacement, $subject); } } return $subject; }