public function get_theme_listOp() { $result = ''; $data_count = intval($_GET['data_count']); if ($data_count <= 0) { $data_count = 2; } $model = Model(); $theme_list = $model->table('circle_theme')->field('*, is_recommend*rand()*10000 + has_affix*rand() as rand')->where(array('circle_status' => 1, 'is_closed' => 0))->where(array('has_affix' => 1))->order('rand desc')->limit($data_count)->select(); if (!empty($theme_list)) { $theme_list = uk86_array_under_reset($theme_list, 'theme_id'); $themeid_array = array_keys($theme_list); // 附件 $affix_list = $model->table('circle_affix')->where(array('theme_id' => array('in', $themeid_array), 'affix_type' => 1))->group('theme_id')->select(); if (!empty($affix_list)) { $affix_list = uk86_array_under_reset($affix_list, 'theme_id'); } foreach ($theme_list as $key => $val) { if (isset($affix_list[$val['theme_id']])) { $theme_list[$key]['affix'] = uk86_themeImageUrl($affix_list[$val['theme_id']]['affix_filethumb']); } } } if ($this->data_type === 'json') { $result = json_encode($theme_list); } else { Tpl::output('theme_list', $theme_list); ob_start(); Tpl::showpage('api_theme_list', 'null_layout'); $result = ob_get_clean(); } $this->return_result($result); }
/** * 首页 */ public function indexOp() { $model = Model(); //我的圈子,话题,和回复数 $my_counts['circle_count'] = $model->table('circle_member')->where(array('member_id' => $_SESSION['member_id']))->count(); $my_counts['theme_count'] = $model->table('circle_theme')->where(array('member_id' => $_SESSION['member_id']))->count(); $my_counts['threply_count'] = $model->table('circle_threply')->where(array('member_id' => $_SESSION['member_id']))->count(); Tpl::output('circle_counts', $my_counts); // 热门圈子 **显示3个圈子,按推荐随机排列,推荐不够按成员数主题数降序排列** $circle_list = $model->table('circle')->field('*, is_hot*rand() as rand')->where(array('circle_status' => 1, 'is_hot' => 1, 'is_official' => 0))->order('rand desc')->limit(4)->select(); if (!empty($circle_list)) { $circle_list = uk86_array_under_reset($circle_list, 'circle_id'); $circleid_array = array_keys($circle_list); // 查询圈子最新主题 foreach ($circle_list as $key => $val) { // 最新的两条数据 $theme_list = $model->table('circle_theme')->where(array('circle_id' => $val['circle_id'], 'is_closed' => 0))->order('theme_id desc')->find(); $circle_list[$key]['theme_list'] = $theme_list; } Tpl::output('circle_list', $circle_list); //var_dump($circle_list); /*$now = strtotime(date('Y-m-d',time())); // 今天发表的主题 $nowthemecount_array = $model->table('circle_theme')->field('count(circle_id) as count,circle_id')->group('circle_id')->where(array('theme_addtime'=>array('gt', $now), 'circle_id'=>array('in', $circleid_array), 'is_closed'=>0))->select(); if(!empty($nowthemecount_array)){ $nowthemecount_array = uk86_array_under_reset($nowthemecount_array, 'circle_id'); Tpl::output('nowthemecount_array', $nowthemecount_array); } // 今天新加入的成员 $nowjoincount_array = $model->table('circle_member')->field('count(circle_id) as count,circle_id')->group('circle_id')->where(array('cm_jointime'=>array('gt', $now), 'circle_id'=>array('in', $circleid_array)))->select(); if(!empty($nowjoincount_array)){ $nowjoincount_array = uk86_array_under_reset($nowjoincount_array, 'circle_id'); Tpl::output('nowjoincount_array', $nowjoincount_array); }*/ } //官方圈子及其活动 $official_list = $model->table('circle')->field('circle_id')->where(array('circle_status' => 1, 'is_official' => 1))->select(); if (!empty($official_list)) { $arr = array(); foreach ($official_list as $official) { array_push($arr, intval($official['circle_id'])); } $condition['is_closed'] = 0; $condition['has_affix'] = 1; $condition['circle_id'] = array("in", $arr); $condition['is_shut'] = 0; $official_theme_list = $model->table('circle_theme')->where($condition)->limit(8)->order('theme_addtime desc')->select(); if (!empty($official_theme_list)) { foreach ($official_theme_list as $key => $official_theme) { $affix = $model->table('circle_affix')->where(array('theme_id' => $official_theme['theme_id'], 'affix_type' => 1))->find(); $official_theme_list[$key]['affix'] = $affix; unset($affix); } } Tpl::output('official_theme_list', $official_theme_list); } // 圈子分类 $class_list = $model->table('circle_class')->where(array('class_status' => 1, 'is_recommend' => 1))->order('class_sort asc')->select(); Tpl::output('class_list', $class_list); // 推荐圈子 $rcircle_list = $model->table('circle')->field('*, is_recommend*rand() as rand')->where(array('circle_status' => 1, 'is_recommend' => 1, 'is_official' => 0))->order('rand desc')->limit('20')->select(); Tpl::output('rcircle_list', $rcircle_list); // 推荐话题 $theme_list = $model->table('circle_theme')->field('*, is_recommend*rand() as rand')->where(array('has_affix' => 1, 'is_closed' => 0, 'is_recommend' => 1, 'is_official' => 0))->order('rand desc')->limit(8)->select(); if (!empty($theme_list)) { $theme_list = uk86_array_under_reset($theme_list, 'theme_id'); $themeid_array = array_keys($theme_list); // 附件 $affix_list = $model->table('circle_affix')->where(array('theme_id' => array('in', $themeid_array), 'affix_type' => 1))->group('theme_id')->select(); if (!empty($affix_list)) { $affix_list = uk86_array_under_reset($affix_list, 'theme_id'); } foreach ($theme_list as $key => $val) { if (isset($affix_list[$val['theme_id']])) { $theme_list[$key]['affix'] = uk86_themeImageUrl($affix_list[$val['theme_id']]['affix_filethumb']); } } Tpl::output('theme_list', $theme_list); } // 商品话题 $gtheme_list = $model->table('circle_theme')->where(array('has_goods' => 1, 'is_closed' => 0))->order('theme_id desc')->limit(6)->select(); //var_dump($gtheme_list); if (!empty($gtheme_list)) { $gtheme_list = uk86_array_under_reset($gtheme_list, 'theme_id'); $themeid_array = array_keys($gtheme_list); // 圈子商品 $thg_list = $model->table('circle_thg')->where(array('theme_id' => array('in', $themeid_array), 'reply_id' => 0))->select(); $thg_list = tidyThemeGoods($thg_list, 'theme_id', 2); Tpl::output('thg_list', $thg_list); //var_dump($thg_list); Tpl::output('gtheme_list', $gtheme_list); } // 优秀成员 $member_list = $model->table('circle_member')->field('*, is_recommend*rand() as rand')->where(array('is_recommend' => 1))->order('rand desc')->limit(5)->select(); if (!empty($member_list)) { $member_list = array_reverse($member_list); $one_member = array_pop($member_list); $where = array(); $where['member_id'] = $one_member['member_id']; $where['circle_id'] = $one_member['circle_id']; $one_membertheme = $model->table('circle_theme')->where($where)->order('theme_id desc')->limit(4)->select(); Tpl::output('one_member', $one_member); Tpl::output('one_membertheme', $one_membertheme); if (!empty($member_list)) { $where = ''; foreach ($member_list as $val) { $where .= '( circle_member.member_id = ' . $val['member_id'] . ' and circle_member.circle_id = ' . $val['circle_id'] . ') or '; } $where = rtrim($where, 'or '); $more_membertheme = $model->table('circle_member,circle_theme')->join('inner')->on('circle_member.member_id = circle_theme.member_id and circle_member.circle_id = circle_theme.circle_id')->where($where)->group('circle_member.member_id,circle_member.circle_id')->select(); Tpl::output('more_membertheme', $more_membertheme); } } // 最新话题/热门话题/人气回复 $this->themeTop(); //有附件图片的热门话题(非官方) $hot_theme_list_with_img = $model->table('circle_theme')->where(array('is_closed' => 0, 'has_affix' => 1, 'is_official' => 0))->limit(5)->order('theme_browsecount desc')->select(); if (!empty($hot_theme_list_with_img)) { $hot_theme_list_with_img = uk86_array_under_reset($hot_theme_list_with_img, 'theme_id'); $themeid_array2 = array_keys($hot_theme_list_with_img); // 附件 $affix_list2 = $model->table('circle_affix')->where(array('theme_id' => array('in', $themeid_array2), 'affix_type' => 1))->group('theme_id')->select(); if (!empty($affix_list2)) { $affix_list2 = uk86_array_under_reset($affix_list2, 'theme_id'); } foreach ($hot_theme_list_with_img as $key => $val) { if (isset($affix_list2[$val['theme_id']])) { $hot_theme_list_with_img[$key]['affix'] = uk86_themeImageUrl($affix_list2[$val['theme_id']]['affix_filethumb']); } } Tpl::output('hot_theme_list_with_img', $hot_theme_list_with_img); } //无附件图片的热门话题(非官方) $hotThemeListWithoutImg = $model->table('circle_theme')->where(array('is_closed' => 0, 'has_affix' => 0, 'is_official' => 0))->limit(6)->order('theme_browsecount desc')->select(); Tpl::output('hot_theme_list_without_img', $hotThemeListWithoutImg); //var_dump($hotThemeListWithoutImg); // 首页幻灯 $loginpic = unserialize(C('circle_loginpic')); Tpl::output('loginpic', $loginpic); $this->circleSEO(); Tpl::setLayout('null_layout'); Tpl::showpage('circle_index'); }
/** * 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 = "<span class=\"line\"></span>"; $_font = "<a href=\"javascript:void(0);\" nctype=\"font-family\" class=\"font-family\">" . L('nc_font') . "\n\t\t\t\t\t<div class=\"ubb-layer font-family-layer\">\n\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t<span class=\"ff01\" data-param=\"Microsoft YaHei\">" . L('nc_Microsoft_YaHei') . "</span><span class=\"ff02\" data-param=\"simsun\">" . L('nc_simsun') . "</span><span class=\"ff03\" data-param=\"simhei\">" . L('nc_simhei') . "</span><span class=\"ff04\" data-param=\"Arial\">Arial</span><span class=\"ff05\" data-param=\"Verdana\">Verdana</span><span class=\"ff06\" data-param=\"Helvetica\">Helvetica</span><span class=\"ff07\" data-param=\"Tahoma\">Tahoma</span>\n\t\t\t\t\t</div>\n\t\t\t\t</a>"; $_size = "<a href=\"javascript:void(0);\" nctype=\"font-size\" class=\"font-size\">" . L('nc_font_size') . "\n\t\t\t\t\t<div class=\"ubb-layer font-size-layer\">\n\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t<span class=\"s12\">12px</span><span class=\"s14\">14px</span><span class=\"s16\">16px</span><span class=\"s18\">18px</span><span class=\"s20\">20px</span><span class=\"s22\">22px</span><span class=\"s24\">24px</span>\n\t\t\t\t\t</div>\n\t </a>"; $_bold = "<a href=\"javascript:void(0);\" nctype=\"b\" title=\"" . L('nc_font_bold') . "\"><i class=\"font-b\"></i></a>"; $_italic = "<a href=\"javascript:void(0);\" nctype=\"i\" title=\"" . L('nc_font_italic') . "\"><i class=\"font-i\"></i></a>"; $_underline = "<a href=\"javascript:void(0);\" nctype=\"u\" title=\"" . L('nc_font_underline') . "\"><i class=\"font-u\"></i></a>"; $_color = "<a href=\"javascript:void(0);\" nctype=\"color\" title=\"" . L('nc_font_color') . "\" class=\"font-color-handle\"><i class=\"font-color\"></i>\n\t\t\t\t\t<div class=\"ubb-layer font-color-layer\">\n\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t<span class=\"c-000000\"></span><span class=\"c-A0522D\"></span><span class=\"c-556B2F\"></span><span class=\"c-006400\"></span><span class=\"c-483D8B\"></span><span class=\"c-000080\"></span><span class=\"c-4B0082\"></span><span class=\"c-2F4F4F\"></span> <span class=\"c-8B0000\"></span><span class=\"c-FF8C00\"></span><span class=\"c-808000\"></span><span class=\"c-008000\"></span><span class=\"c-008080\"></span><span class=\"c-0000FF\"></span><span class=\"c-708090\"></span><span class=\"c-696969\"></span><span class=\"c-FF0000\"></span><span class=\"c-F4A460\"></span><span class=\"c-9ACD32\"></span><span class=\"c-2E8B57\"></span><span class=\"c-48D1CC\"></span><span class=\"c-4169E1\"></span><span class=\"c-800080\"></span><span class=\"c-808080\"></span><span class=\"c-FF00FF\"></span><span class=\"c-FFA500\"></span><span class=\"c-FFFF00\"></span><span class=\"c-00FF00\"></span><span class=\"c-00FFFF\"></span><span class=\"c-00BFFF\"></span><span class=\"c-9932CC\"></span><span class=\"c-C0C0C0\"></span><span class=\"c-FFC0CB\"></span><span class=\"c-F5DEB3\"></span><span class=\"c-FFFACD\"></span><span class=\"c-98FB98\"></span><span class=\"c-AFEEEE\"></span><span class=\"c-ADD8E6\"></span><span class=\"c-DDA0DD\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</a>"; $_affix = "<div class=\"upload-btn\" title=\"" . L('nc_upload_image_affix') . "\">\n\t\t\t\t\t<span><i class=\"upload-img\"></i>\n\t\t\t\t\t\t<div class=\"upload-button\">" . L('nc_upload_affix') . "</div>\n\t\t\t\t\t</span>\n\t\t\t\t\t<input type=\"file\" name=\"test_file\" id=\"test_file\" multiple=\"multiple\" file_id=\"0\" class=\"upload-file\" size=\"1\" hidefocus=\"true\" maxlength=\"0\" style=\"cursor: pointer;\" />\n\t\t\t\t\t<input id=\"submit_button\" style=\"display:none\" type=\"button\" value=\" \" onClick=\"submit_form(\$(this))\" />\n\t\t\t\t</div>"; $_url = "<a href=\"javascript:void(0);\" nctype=\"url\" title=\"" . L('nc_insert_link_address') . "\" class=\"mr5 url-handle\"><i class=\"url\"></i>" . L('nc_line') . "\n\t\t\t\t\t<div class=\"ubb-layer url-layer\" style=\"display: none;\">\n\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t<label>" . L('nc_link_content') . "</label>\n\t\t\t\t\t\t<input name=\"content\" type=\"text\" class=\"text w180\" />\n\t\t\t\t\t\t<label>" . L('nc_link_address') . "</label>\n\t\t\t\t\t\t<input name=\"url\" type=\"text\" class=\"text w180\" placeholder=\"http://\" />\n\t\t\t\t\t\t<input name=\"" . L('nc_submit') . "\" type=\"submit\" class=\"button\" value=\"" . L('nc_submit') . "\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</a>"; $_flash = "<a href=\"javascript:void(0);\" nctype=\"flase\" title=\"" . L('nc_video_address') . "\" class=\"mr5 flash-handle\"><i class=\"flash\"></i>" . L('nc_video') . "\n\t\t\t\t\t<div class=\"ubb-layer flash-layer\" style=\"display: none;\">\n\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t<label>" . L('nc_video_address') . "</label>\n\t\t\t\t\t\t<input name=\"flash\" type=\"text\" class=\"text w180\" placeholder=\"http://\" />\n\t\t\t\t\t\t<input name=\"" . L('nc_submit') . "\" type=\"submit\" class=\"button\" value=\"" . L('nc_submit') . "\"/>\n\t\t\t\t\t</div>\n\t\t\t\t</a>"; $_image = "<a href=\"javascript:void(0);\" nctype=\"uploadImage\" title=\"" . L('nc_insert_network_image') . "\" class=\"mr5\"><i class=\"url-img\"></i>" . L('nc_image') . "</a>"; $_goods = "<a href=\"javascript:void(0);\" nctype=\"chooseGoods\" title=\"" . L('nc_insert_relevance_goods') . "\"><i class=\"url-goods\"></i>" . L('nc_goods') . "</a>"; $_smilier = "<a href=\"javascript:void(0);\" nctype=\"smilier\" title=\"" . L('nc_insert_smilier') . "\" class=\"smilier-handle\"><i class=\"smilier\"></i>" . L('nc_smilier') . "\n\t\t\t\t\t\t<div class=\"ubb-layer smilier-layer\">\n\t\t\t\t\t\t\t<div class=\"arrow\"></div>\n\t\t\t\t\t\t\t<span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/adore.png\" data-param=\"adore\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/after_boom.png\" data-param=\"after_boom\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/ah.png\" data-param=\"ah\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/amazing.png\" data-param=\"amazing\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/anger.png\" data-param=\"anger\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/angry.png\" data-param=\"angry\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/baffle.png\" data-param=\"baffle\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/batman.png\" data-param=\"batman\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/beat_brick.png\" data-param=\"beat_brick\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/bigsmile.png\" data-param=\"bigsmile\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/bye_bye.png\" data-param=\"bye_bye\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/confuse.png\" data-param=\"confuse\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/cool.png\" data-param=\"cool\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/crazy.png\" data-param=\"crazy\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/crazy_rabbit.png\" data-param=\"crazy_rabbit\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/cry.png\" data-param=\"cry\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/dead.png\" data-param=\"dead\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/devil.png\" data-param=\"devil\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/diver.png\" data-param=\"diver\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/doubt.png\" data-param=\"doubt\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/evilgrin.png\" data-param=\"evilgrin\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/exciting.png\" data-param=\"exciting\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/flower_dead.png\" data-param=\"flower_dead\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/go.png\" data-param=\"go\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/greedy.png\" data-param=\"greedy\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/haha.png\" data-param=\"haha\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/hand_flower.png\" data-param=\"hand_flower\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/happy.png\" data-param=\"happy\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/horror.png\" data-param=\"horror\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/hypnotized.png\" data-param=\"hypnotized\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/kiss.png\" data-param=\"kiss\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/love.png\" data-param=\"love\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/mad.png\" data-param=\"mad\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/matrix.png\" data-param=\"matrix\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/misdoubt.png\" data-param=\"misdoubt\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/money.png\" data-param=\"money\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/nerd.png\" data-param=\"nerd\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/ninja.png\" data-param=\"ninja\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/nosebleed.png\" data-param=\"nosebleed\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/pirate.png\" data-param=\"pirate\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/question.png\" data-param=\"question\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/sad.png\" data-param=\"sad\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/shame.png\" data-param=\"shame\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/shocked.png\" data-param=\"shame\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/silent.png\" data-param=\"silent\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/sleep.png\" data-param=\"sleep\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/sweat.png\" data-param=\"sweat\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/star.png\" data-param=\"star\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/whist.png\" data-param=\"whist\"></span> <span><img src=\"" . CIRCLE_TEMPLATES_URL . "/images/smilier/surrender.png\" data-param=\"surrender\"></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>"; $_highReply = "<a href=\"javascript:void(0);\" nctype=\"highReply\" class=\"high-reply\"><i class=\"high\"></i>" . L('nc_advanced_reply') . "</a>"; // Spell the editor contents $__content = ''; $__content .= "<div class=\"content\">\n\t\t\t<div class=\"ubb-bar\">"; foreach ($items as $val) { $val = '_' . $val; $__content .= ${$val}; } $__content .= "</div>\n\t\t\t<div class=\"textarea\">\n\t\t\t\t<textarea id=\"" . $cname . "\" name=\"" . $cname . "\">" . $content . "</textarea>\n\t\t\t</div>\n\t\t\t<div class=\"smilier\"></div>\n\t\t</div>"; // The attachment part $__affix = ''; $__affix .= "<div class=\"affix\">\n\t <h3><i></i>" . L('nc_relevance_adjunct') . "</h3>\n\t <div class=\"help\" nctype=\"affix\" " . (empty($affix) ? "" : "style=\"display: none;\"") . ">\n\t <p>" . L('nc_relevance_adjunct_help_one') . "</p>\n\t <p>" . L('nc_relevance_adjunct_help_two') . "</p>\n\t </div>\n\t <div id=\"scrollbar\">\n\t <ul>"; if (!empty($affix)) { foreach ($affix as $val) { $__affix .= "<li>\n\t <p><img src=\"" . uk86_themeImageUrl($val['affix_filethumb']) . "\"> </p>\n\t <div class=\"handle\"> <a data-param=\"" . uk86_themeImageUrl($val['affix_filename']) . "\" nctype=\"affix_insert\" href=\"javascript:void(0);\"><i class=\"c\"></i>" . L('nc_insert') . "</a> <a data-param=\"" . $val['affix_id'] . "\" nctype=\"affix_delete\" href=\"javascript:void(0);\"><i class=\"d\"></i>" . L('nc_delete') . "</a> </div>\n\t </li>"; } } $__affix .= "</ul>\n\t </div>\n\t </div>"; $__maffix = str_replace("nctype=\"affix_delete\"", "nctype=\"maffix_delete\"", $__affix); // After insert part of goods $__goods = ''; $__goods .= "<div class=\"insert-goods\" " . (empty($goods) ? "style=\"display:none;\"" : "") . ">\n\t <h3><i></i>" . L('nc_select_insert_goods,nc_colon') . "</h3>"; if (!empty($goods)) { foreach ($goods as $val) { $__goods .= "<dl>\n\t <dt class=\"goods-name\">" . $val['goods_name'] . "</dt>\n\t <dd class=\"goods-pic\"><a href=\"javascript:void(0);\"><img src=\"" . $val['image'] . "\"></a></dd>\n\t <dd class=\"goods-price\"><em>" . $val['goods_price'] . "</em></dd>\n\t <dd class=\"goods-del\">" . L('nc_delete') . "</dd>\n\t <input type=\"hidden\" value=\"" . $val['goods_id'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][id]\">\n\t <input type=\"hidden\" value=\"" . $val['goods_name'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][name]\">\n\t <input type=\"hidden\" value=\"" . $val['goods_price'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][price]\">\n\t <input type=\"hidden\" value=\"" . $val['goods_image'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][image]\">\n\t <input type=\"hidden\" value=\"" . $val['store_id'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][storeid]\">\n\t <input type=\"hidden\" value=\"" . $val['thg_type'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][type]\">\n\t <input type=\"hidden\" value=\"" . $val['thg_url'] . "\" name=\"" . $gname . "[" . $val['themegoods_id'] . "][uri]\">\n\t </dl>"; } } $__goods .= "</div>"; // Part read permissions $__readperm = ''; if (!empty($readperm)) { $__readperm .= "<div class=\"readperm\"><span>" . L('nc_read_perm,nc_colon') . "</span><span><select name=\"readperm\">"; foreach ($readperm as $key => $val) { $__readperm .= "<option value=\"" . $key . "\" " . ($rpvalue == $key ? "selected=\"selected\"" : "") . ">" . $val . " lv" . $key . "</option>"; } $__readperm .= "</select></span></div>"; } eval('$return = ' . $return . ';'); return $return; }
/** * 获得未使用附件 */ public function unused_imgOp() { $affix_list = Model()->table('circle_affix')->field('affix_id,affix_filename,affix_filethumb')->where(array('member_id' => $_SESSION['member_id'], 'affix_type' => 1, 'theme_id' => 0))->select(); if (!empty($affix_list)) { $affix_array = array(); foreach ($affix_list as $key => $val) { $affix_array[$key]['file_id'] = $val['affix_id']; $affix_array[$key]['file_url'] = uk86_themeImageUrl($val['affix_filethumb']); $affix_array[$key]['file_insert'] = uk86_themeImageUrl($val['affix_filename']); } } echo json_encode($affix_array); }
/** * trace content */ private function traceContent($theme_info, $affix_list) { $content = "<div class='fd-media'>"; $url = CIRCLE_SITE_URL . "/index.php?act=theme&op=theme_detail&c_id=" . $this->c_id . "&t_id=" . $theme_info['theme_id']; if (!empty($affix_list[0])) { $content .= "<div class='goodsimg'><a target='_blank' href='" . $url . "'><img src='" . uk86_themeImageUrl($affix_list[0]['affix_filethumb']) . "' onload='javascript:DrawImage(this,120,120);'></a></div>"; } $content .= "<div class=\"goodsinfo\"><p>" . $_SESSION['member_name'] . L('circle_at,nc_quote1') . $theme_info['circle_name'] . L('nc_quote2') . L('circle_share,sharebind_theme') . L('nc_colon') . '</p><p>' . L('nc_quote1') . $theme_info['theme_name'] . L('nc_quote2') . " <a href='" . $url . "'>" . L('sharebind_go_and_see') . "</a></p></div></div>"; return $content; }
<?php foreach ($arr2 as $key => $item) { ?> <span class="t02_box"> <a href="<?php echo CIRCLE_SITE_URL; ?> /index.php?act=theme&op=theme_detail&c_id=<?php echo $item['circle_id']; ?> &t_id=<?php echo $item['theme_id']; ?> "> <img src="<?php echo uk86_themeImageUrl($item['affix']['affix_filethumb']); ?> " /> <h2> <?php echo uk86_str_cut($item['theme_name'], 18); ?> </h2> <p> <?php echo uk86_str_cut($item['theme_content'], 50); ?> </p> </a> </span> <?php
/** * 话题列表 */ public function theme_listOp() { $model = Model(); if (uk86_chksubmit()) { if (!empty($_POST['check_theme_id']) && is_array($_POST['check_theme_id'])) { foreach ($_POST['check_theme_id'] as $t_id) { $theme_info = $model->table('circle_theme')->where(array('theme_id' => $t_id))->find(); if (empty($theme_info)) { continue; } // 删除附件 $affix_list = $model->table('circle_affix')->where(array('theme_id' => $t_id))->select(); if (!empty($affix_list)) { foreach ($affix_list as $val) { @unlink(uk86_themeImagePath($val['affix_filename'])); @unlink(uk86_themeImagePath($val['affix_filethumb'])); } $model->table('circle_affix')->where(array('theme_id' => $t_id))->delete(); } // 删除商品 $model->table('circle_thg')->where(array('theme_id' => $t_id))->delete(); // 删除赞表相关 $model->table('circle_like')->where(array('theme_id' => $t_id))->delete(); // 删除回复 $model->table('circle_threply')->where(array('theme_id' => $t_id))->delete(); // 更新圈子主题数量 $model->table('circle')->update(array('circle_id' => $theme_info['circle_id'], 'circle_thcount' => array('exp', 'circle_thcount-1'))); // The recycle bin add delete records $param = array(); $param['theme_id'] = $t_id; $param['op_id'] = 0; $param['op_name'] = L('cirlce_administrator'); $param['type'] = 'admintheme'; Model('circle_recycle')->saveRecycle($param, $theme_info); // 删除话题 $model->table('circle_theme')->delete($t_id); // Experience if (intval($theme_info['theme_exp']) > 0) { $param = array(); $param['member_id'] = $theme_info['member_id']; $param['member_name'] = $theme_info['member_name']; $param['circle_id'] = $theme_info['circle_id']; $param['itemid'] = $t_id; $param['type'] = 'delRelease'; $param['exp'] = $theme_info['theme_exp']; Model('circle_exp')->saveExp($param); } } } uk86_showMessage(L('nc_common_op_succ'), 'index.php?act=circle_theme&op=theme_list'); } $where = array(); if ($_GET['searchname'] != '') { $where['theme_name'] = array('like', '%' . $_GET['searchname'] . '%'); } if ($_GET['classname'] != '') { $where['circle_name'] = array('like', '%' . $_GET['classname'] . '%'); } if ($_GET['searchtop'] != '' && in_array($_GET['searchtop'], array(0, 1))) { $where['is_stick'] = intval($_GET['searchtop']); } if ($_GET['searchcream'] != '' && in_array($_GET['searchcream'], array(0, 1))) { $where['is_digest'] = intval($_GET['searchcream']); } if ($_GET['searchrecommend'] != '' && in_array($_GET['searchrecommend'], array(0, 1))) { $where['is_recommend'] = intval($_GET['searchrecommend']); } $theme_list = $model->table('circle_theme')->where($where)->order('theme_id desc')->page(10)->select(); if (!empty($theme_list)) { $theme_list = uk86_array_under_reset($theme_list, 'theme_id'); $themeid_array = array_keys($theme_list); // 附件 $affix_list = $model->table('circle_affix')->where(array('theme_id' => array('in', $themeid_array), 'affix_type' => 1))->group('theme_id')->select(); if (!empty($affix_list)) { $affix_list = uk86_array_under_reset($affix_list, 'theme_id'); } foreach ($theme_list as $key => $val) { if (isset($affix_list[$val['theme_id']])) { $theme_list[$key]['affix'] = uk86_themeImageUrl($affix_list[$val['theme_id']]['affix_filethumb']); } } } Tpl::output('theme_list', $theme_list); Tpl::output('page', $model->showpage(2)); Tpl::showpage('circle_theme.list'); }
echo $val['theme_name']; ?> </a><span>(<?php echo @date('Y-m-d', $val['theme_addtime']); ?> )</span></dt> <dd class="theme-file"> <?php if (!empty($output['affix_list'][$val['theme_id']])) { $array = array_slice($output['affix_list'][$val['theme_id']], 0, 3); ?> <?php foreach ($array as $v) { ?> <div class="thumb-cut"><a href="Javascript: void(0);"><img src="<?php echo uk86_themeImageUrl($v['affix_filethumb']); ?> " class="t-img" /></a></div> <?php } ?> <?php } ?> </dd> <dd class="theme-txt"><p><?php echo uk86_removeUBBTag($val['theme_content']); ?> </p><a href="<?php echo CIRCLE_SITE_URL; ?>