public function index() { require_once APP_ROOT_PATH . "app/Lib/page.php"; $s_account_info = es_session::get("account_info"); $account_id = intval($s_account_info['id']); $f = addslashes(htmlspecialchars(trim($_REQUEST['f']))); if ($f == '' || !in_array($f, array("is_buy", "tuan", "event", "youhui", "daijin", "shop"))) { $condition = " "; } elseif ($f == 'is_buy') { $condition = " and is_buy = 1 "; } else { $condition = " and from_data = '{$f}' "; } $GLOBALS['tmpl']->assign("f", $f); $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $dp_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier_location_dp where status = 1 {$condition} and supplier_location_id in (" . implode(",", $s_account_info['location_ids']) . ") order by create_time desc limit " . $limit); $dp_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp where status = 1 {$condition} and supplier_location_id in (" . implode(",", $s_account_info['location_ids']) . ")"); $page = new Page($dp_count, app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("dp_list", $dp_list); $html = decode_topic_without_img($GLOBALS['tmpl']->fetch("biz/biz_dp_list_content.html")); $GLOBALS['tmpl']->assign("html", $html); $GLOBALS['tmpl']->assign("page_title", "点评列表"); $GLOBALS['tmpl']->display("biz/biz_dp.html"); }
public function index() { global_run(); init_app_page(); $GLOBALS['tmpl']->assign("no_nav", true); //无分类下拉 if (check_save_login() != LOGIN_STATUS_LOGINED) { app_redirect(url("index", "user#login")); } $GLOBALS['tmpl']->assign("page_title", "我的点评"); assign_uc_nav_list(); //begin review require_once APP_ROOT_PATH . "system/model/review.php"; require_once APP_ROOT_PATH . "app/Lib/page.php"; //分页 $page_size = 10; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $dp_res = get_dp_list($limit, "", " user_id = " . $GLOBALS['user_info']['id']); $dp_list = $dp_res['list']; $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp where " . $dp_res['condition']); $page = new Page($total, $page_size); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); foreach ($dp_list as $k => $v) { if ($v['deal_id'] > 0) { $data_info = load_auto_cache("deal", array("id" => $v['deal_id'])); } elseif ($v['youhui_id'] > 0) { $data_info = load_auto_cache("youhui", array("id" => $v['youhui_id'])); } elseif ($v['event_id'] > 0) { $data_info = load_auto_cache("event", array("id" => $v['event_id'])); } if (empty($data_info)) { $data_info = load_auto_cache("store", array("id" => $v['supplier_location_id'])); } $dp_list[$k]['data_info'] = $data_info; } $GLOBALS['tmpl']->assign('dp_list', $dp_list); require_once APP_ROOT_PATH . "system/model/topic.php"; global $no_lazy; $no_lazy = true; $review_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/uc_review_list.html")); $GLOBALS['tmpl']->assign("review_html", $review_html); //end review $no_lazy = false; $GLOBALS['tmpl']->display("uc/uc_review_index.html"); }
public function load_reply_col_form() { $topic_id = intval($_REQUEST['id']); $list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "topic_reply where topic_id = " . $topic_id . " and is_effect = 1 and is_delete = 0 order by create_time desc limit 3"); $GLOBALS['tmpl']->assign("reply_list", $list); $GLOBALS['tmpl']->assign("topic_id", $topic_id); header("Content-Type:text/html; charset=utf-8"); echo decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/col_reply_list.html")); }
public function mycomment() { $ajax = intval($_REQUEST['ajax']); if ($ajax == 0) { $this->init_main(); $is_merchant = intval($GLOBALS['user_info']['is_merchant']); $GLOBALS['tmpl']->assign('is_merchant', $is_merchant); } $user_id = intval($GLOBALS['user_info']['id']); //输出发言列表 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); //输出回复 $sql = "select r.* from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $user_id . " or r.user_id = " . $user_id . ") and r.is_effect = 1 and r.is_delete = 0 \r\n\t\t\t\torder by r.create_time desc limit " . $limit; $sql_count = "select count(*) from " . DB_PREFIX . "topic_reply as r left join " . DB_PREFIX . "topic as t on r.topic_id = t.id \r\n\t\t\t\twhere (t.user_id = " . $user_id . " or r.user_id = " . $user_id . ") and r.is_effect = 1 and r.is_delete = 0"; $list = $GLOBALS['db']->getAll($sql); $count = $GLOBALS['db']->getOne($sql_count); $tmp_topic_list = array(); foreach ($list as $k => $v) { if (isset($tmp_topic_list[$v['topic_id']])) { $list[$k]['topic'] = $tmp_topic_list[$v['topic_id']]; } else { $topic = $GLOBALS['db']->getRow("select id,title,content from " . DB_PREFIX . "topic where id = " . $v['topic_id']); if ($topic) { $content_link = decode_topic_without_allmedia($topic['content']); if (!$content_link) { $content_link = $GLOBALS['lang']['THIS_TOPIC']; } $content_link = " [<a href='" . url("shop", "topic#index", array("id" => $topic['id'])) . "'>" . msubstr($content_link, 0, 50) . "</a>] "; } else { $content_link = " [<span style='text-decoration:line-through;'>" . $GLOBALS['lang']['ORIGIN_DELETE'] . "</span>] "; } $list[$k]['topic'] = $tmp_topic_list[$v['topic_id']] = $content_link; } } $GLOBALS['tmpl']->assign("reply_list", $list); $page = new Page($count, app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); if ($ajax == 0) { $list_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/topic_reply_list.html")); $GLOBALS['tmpl']->assign("list_html", $list_html); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_CENTER_MYCOMMENT']); $GLOBALS['tmpl']->assign("post_title", $GLOBALS['lang']['UC_CENTER_MYCOMMENT']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_center_index.html"); $GLOBALS['tmpl']->display("uc.html"); } else { header("Content-Type:text/html; charset=utf-8"); echo decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/topic_reply_list.html")); } }
function load_topic_col_list() { return decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/topic_col_list.html")); }
/** * 载入主题评论 */ public function load_topic_reply_list() { global_run(); if ($GLOBALS['user_info']) { $GLOBALS['tmpl']->assign("user_info", $GLOBALS['user_info']); } $topic_id = $_POST['topic_id']; require_once APP_ROOT_PATH . 'system/model/topic.php'; require_once APP_ROOT_PATH . "app/Lib/page.php"; //分页 $page_size = 5; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $reply_list = get_topic_reply_list($topic_id, $limit); foreach ($reply_list as $k => $v) { $reply_list[$k]['content'] = decode_topic_without_img($v['content']); } $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_reply where is_effect=1 and is_delete=0 and topic_id=" . $topic_id); $page = new Page($total, $page_size); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign('reply_list', $reply_list); $GLOBALS['tmpl']->assign('user_auth', get_user_auth()); $data['html'] = $GLOBALS['tmpl']->fetch("inc/topic_reply_list.html"); ajax_return($data); }
public function load_topic() { $GLOBALS['tmpl']->assign('user_auth', get_user_auth()); $cid = intval($_REQUEST['cid']); $tag = addslashes(htmlspecialchars(trim($_REQUEST['tag']))); $page = intval($_REQUEST['page']); if ($page == 0) { $page = 1; } $step = intval($_REQUEST['step']); $step_size = intval($_REQUEST['step_size']); $limit = ($page - 1) * PAGE_SIZE + ($step - 1) * SECTOR . "," . SECTOR; if ($step == 0 || $step > $step_size) { //超出 $result['doms'] = array(); $result['step'] = 0; $result['status'] = 0; $result['info'] = 'end'; ajax_return($result); } if ($cid > 0) { $cate_name = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "topic_tag_cate where id = " . $cid); if ($cate_name) { $unicode_cate_name = str_to_unicode_string($cate_name); $condition .= " and match(cate_match) against('" . $unicode_cate_name . "' IN BOOLEAN MODE) "; } } if ($tag != "") { $unicode_tag = str_to_unicode_string($tag); $condition .= " and match(keyword_match) against('" . $unicode_tag . "' IN BOOLEAN MODE) "; } $sql = "select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0 and fav_id = 0 and relay_id = 0 and type in ('share','sharetuan','sharegoods','sharefyouhui','sharebyouhui','shareevent') " . $condition . " order by create_time desc limit " . $limit; $result_list = $GLOBALS['db']->getAll($sql); if ($result_list) { $result['doms'] = array(); foreach ($result_list as $k => $v) { $topic = get_topic_item($v); if (msubstr(preg_replace("/<[^>]+>/i", "", $topic['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $topic['content'])) { $topic['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $topic['content']), 0, 50); } else { $topic['short_content'] = preg_replace("/<br[^>]+>/i", "", $topic['content']); } if ($topic['origin']) { if (msubstr(preg_replace("/<[^>]+>/i", "", $topic['origin']['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $topic['origin']['content'])) { $topic['origin']['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $topic['origin']['content']), 0, 50); } else { $topic['origin']['short_content'] = preg_replace("/<br[^>]+>/i", "", $topic['origin']['content']); } } $GLOBALS['tmpl']->assign("message_item", $topic); $result['doms'][] = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/discover_item.html")); } if ($step == 0 || $step >= $step_size) { //超出 $result['step'] = 0; $result['status'] = 0; $result['info'] = 'end'; ajax_return($result); } else { $result['status'] = 1; $result['step'] = $step + 1; $result['info'] = 'next'; ajax_return($result); } } else { $result['doms'] = array(); $result['step'] = 0; $result['status'] = 0; $result['info'] = 'end'; // $result['sql'] = $sql; ajax_return($result); } }