private function view()
 {
     $id = intval($_REQUEST['id']);
     if ($id == 0) {
         app_redirect(url("index", "usagetip"));
     }
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 6000;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . "view" . $id);
     if (!$GLOBALS['tmpl']->is_cached("page/usagetip_view.html", $cache_id)) {
         $article = get_article($id);
         $GLOBALS['tmpl']->assign("article", $article);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
         //使用技巧
         $use_tech_list = get_article_list(6, 6);
         $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list);
     }
     $GLOBALS['tmpl']->display("page/usagetip_view.html", $cache_id);
 }
 public function index()
 {
     $ajax = intval($_REQUEST["is_ajax"]);
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['title']) . $GLOBALS['deal_city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('page/article_index.html', $cache_id)) {
         $article_name = urldecode($_REQUEST['title']);
         $article = get_article_buy_uname($article_name);
         if ($article) {
             $article_list = get_article_list(12, $article["cate_id"], "", "");
         }
         if ($article["title"] == "") {
             $article["title"] = $article_name;
         }
         $GLOBALS['tmpl']->assign("article", $article);
         $GLOBALS['tmpl']->assign("article_list", $article_list["list"]);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->assign("ajax", $ajax);
     $GLOBALS['tmpl']->display("debit/debit_article.html", $cache_id);
 }
 public function detail()
 {
     $id = intval($_REQUEST['id']);
     $aid = intval($_REQUEST['aid']);
     if ($id == 0) {
         app_redirect(url("index", "guarantee"));
     }
     $article_cate = get_acate_tree(12);
     $info = null;
     foreach ($article_cate as $k => $v) {
         if ($id == $v['id']) {
             $info = $v;
         }
         $article_cate[$k]['article'] = get_article_list(100, $v['id'], "", "", true);
     }
     $GLOBALS['tmpl']->assign("article_cate", $article_cate);
     $GLOBALS['tmpl']->assign("id", $id);
     $GLOBALS['tmpl']->assign("aid", $aid);
     $seo_title = $info['seo_title'] != '' ? $info['seo_title'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_title", $seo_title . " - 安全保障");
     $seo_keyword = $info['seo_keyword'] != '' ? $info['seo_keyword'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",安全保障,");
     $seo_description = $info['seo_description'] != '' ? $info['seo_description'] : $info['title'];
     $GLOBALS['tmpl']->assign("page_description", $seo_description . ",安全保障,");
     $GLOBALS['tmpl']->display("page/guarantee_detail.html");
 }
 public function __construct()
 {
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['fcache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['fcache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_shop_nav_list();
     $nav_list = init_nav_list($nav_list);
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     $qq = explode("|", app_conf("ONLINE_QQ"));
     $msn = explode("|", app_conf("ONLINE_MSN"));
     $GLOBALS['tmpl']->assign("online_qq", $qq);
     $GLOBALS['tmpl']->assign("online_msn", $msn);
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("shop_info", get_shop_info());
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     //输出热门关键词
     // 热门搜索词
     $hot_kw = get_hot_kw();
     $GLOBALS['tmpl']->assign("hot_kw", $hot_kw);
     if (MODULE_NAME == "index" && ACTION_NAME == "index" || MODULE_NAME == "acate" && ACTION_NAME == "index" || MODULE_NAME == "article" && ACTION_NAME == "index" || MODULE_NAME == "brand" && ACTION_NAME == "index" || MODULE_NAME == "cate" && ACTION_NAME == "index" || MODULE_NAME == "city" && ACTION_NAME == "index" || MODULE_NAME == "comment" && ACTION_NAME == "index" || MODULE_NAME == "daren" && ACTION_NAME == "index" || MODULE_NAME == "daren" && ACTION_NAME == "submit" || MODULE_NAME == "discount" && ACTION_NAME == "index" || MODULE_NAME == "discover" && ACTION_NAME == "index" || MODULE_NAME == "exchange" && ACTION_NAME == "index" || MODULE_NAME == "goods" && ACTION_NAME == "index" || MODULE_NAME == "group" && ACTION_NAME == "index" || MODULE_NAME == "group" && ACTION_NAME == "forum" || MODULE_NAME == "group" && ACTION_NAME == "create" || MODULE_NAME == "help" && ACTION_NAME == "index" || MODULE_NAME == "link" && ACTION_NAME == "index" || MODULE_NAME == "mall" && ACTION_NAME == "index" || MODULE_NAME == "mobile" && ACTION_NAME == "index" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "list_notice" || MODULE_NAME == "rec" && ACTION_NAME == "rhot" || MODULE_NAME == "rec" && ACTION_NAME == "rnew" || MODULE_NAME == "rec" && ACTION_NAME == "rbest" || MODULE_NAME == "rec" && ACTION_NAME == "rsale" || MODULE_NAME == "score" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "fav" || MODULE_NAME == "space" && ACTION_NAME == "fans" || MODULE_NAME == "space" && ACTION_NAME == "focus" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "pick" || MODULE_NAME == "sys" && ACTION_NAME == "index" || MODULE_NAME == "sys" && ACTION_NAME == "list_notice" || MODULE_NAME == "topic" && ACTION_NAME == "index" || MODULE_NAME == "vote" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
 public function __construct()
 {
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['fcache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['fcache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_nav_list();
     $nav_list = init_nav_list($nav_list);
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     $qq = explode("|", app_conf("ONLINE_QQ"));
     $msn = explode("|", app_conf("ONLINE_MSN"));
     $GLOBALS['tmpl']->assign("online_qq", $qq);
     $GLOBALS['tmpl']->assign("online_msn", $msn);
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("shop_info", get_shop_info());
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出热门关键词
     $hot_kw = get_hot_kw();
     $GLOBALS['tmpl']->assign("hot_kw", $hot_kw);
     if (MODULE_NAME == "deal" && ACTION_NAME == "index" || MODULE_NAME == "deals" && ACTION_NAME == "index" || MODULE_NAME == "dhapi" && ACTION_NAME == "index" || MODULE_NAME == "index" && ACTION_NAME == "index" || MODULE_NAME == "message" && ACTION_NAME == "index" || MODULE_NAME == "order" && ACTION_NAME == "index" || MODULE_NAME == "search" && ACTION_NAME == "index" || MODULE_NAME == "second" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
 public function __construct()
 {
     if ($GLOBALS['distribution_cfg']['OSS_TYPE'] && $GLOBALS['distribution_cfg']['OSS_TYPE'] == "ES_FILE") {
         logger::write($GLOBALS['distribution_cfg']['OSS_DOMAIN'] . "/es_file.php");
         global $syn_image_ci;
         global $curl_param;
         //global $syn_image_idx;
         $syn_image_idx = 0;
         $syn_image_ci = curl_init($GLOBALS['distribution_cfg']['OSS_DOMAIN'] . "/es_file.php");
         curl_setopt($syn_image_ci, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($syn_image_ci, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($syn_image_ci, CURLOPT_SSL_VERIFYHOST, false);
         curl_setopt($syn_image_ci, CURLOPT_NOPROGRESS, true);
         curl_setopt($syn_image_ci, CURLOPT_HEADER, false);
         curl_setopt($syn_image_ci, CURLOPT_POST, TRUE);
         curl_setopt($syn_image_ci, CURLOPT_TIMEOUT, 1);
         curl_setopt($syn_image_ci, CURLOPT_TIMECONDITION, 1);
         $curl_param['username'] = $GLOBALS['distribution_cfg']['OSS_ACCESS_ID'];
         $curl_param['password'] = $GLOBALS['distribution_cfg']['OSS_ACCESS_KEY'];
         $curl_param['act'] = 2;
     }
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['cache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['cache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['cache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_nav_list();
     $nav_list = init_nav_list($nav_list);
     foreach ($nav_list as $k => $v) {
         $nav_list[$k]['sub_nav'] = init_nav_list($v['sub_nav']);
     }
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     if (app_conf("ONLINE_QQ") != "") {
         $qq = unserialize(app_conf("ONLINE_QQ"));
         $GLOBALS['tmpl']->assign("online_qq", $qq);
     }
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("site_info", get_site_info());
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     if (MODULE_NAME == "acate" && ACTION_NAME == "index" || MODULE_NAME == "article" && ACTION_NAME == "index" || MODULE_NAME == "cate" && ACTION_NAME == "index" || MODULE_NAME == "comment" && ACTION_NAME == "index" || MODULE_NAME == "help" && ACTION_NAME == "index" || MODULE_NAME == "link" && ACTION_NAME == "index" || MODULE_NAME == "mobile" && ACTION_NAME == "index" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "list_notice" || MODULE_NAME == "rec" && ACTION_NAME == "rhot" || MODULE_NAME == "rec" && ACTION_NAME == "rnew" || MODULE_NAME == "rec" && ACTION_NAME == "rbest" || MODULE_NAME == "rec" && ACTION_NAME == "rsale" || MODULE_NAME == "score" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "fav" || MODULE_NAME == "space" && ACTION_NAME == "fans" || MODULE_NAME == "space" && ACTION_NAME == "focus" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "pick" || MODULE_NAME == "sys" && ACTION_NAME == "index" || MODULE_NAME == "sys" && ACTION_NAME == "list_notice" || MODULE_NAME == "vote" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
Exemple #7
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('notice_list.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $id = intval($_REQUEST['act']);
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0");
         if ($id > 0 && !$cate_item) {
             app_redirect(APP_ROOT . "/");
         } elseif ($cate_item && $cate_item['type_id'] != 2) {
             if ($cate_item['type_id'] == 1) {
                 app_redirect(url("index", "help"));
             }
             if ($cate_item['type_id'] == 0) {
                 app_redirect(url("index", "acate"));
             }
             if ($cate_item['type_id'] == 3) {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $cate_id = intval($cate_item['id']);
         $cate_tree = get_acate_tree('', 2, "news");
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         //分页
         $page = intval($_REQUEST['p']);
         if ($page <= 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_article_list($limit, $cate_id, 'ac.type_id = 2', '', false);
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $GLOBALS['tmpl']->assign("cur_id", $cate_id);
         $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
         $GLOBALS['tmpl']->assign("page_title", $cate_item['title']);
         $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ",");
         $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ",");
     }
     $GLOBALS['tmpl']->display("notice_list.html", $cache_id);
 }
 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached('page/helpcenter.html', $cache_id)) {
         $article_cate = get_acate_tree(13);
         $info = null;
         foreach ($article_cate as $k => $v) {
             $article_cate[$k]['article'] = get_article_list(100, $v['id'], "", "", true);
         }
         $GLOBALS['tmpl']->assign("article_cate", $article_cate);
         $GLOBALS['tmpl']->assign("page_title", "帮助中心");
         $GLOBALS['tmpl']->assign("page_keyword", "帮助中心");
         $GLOBALS['tmpl']->assign("page_description", "帮助中心");
     }
     $GLOBALS['tmpl']->display("page/helpcenter.html", $cache_id);
 }
 public function __construct()
 {
     $GLOBALS['tmpl']->assign("MODULE_NAME", MODULE_NAME);
     $GLOBALS['tmpl']->assign("ACTION_NAME", ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/page_static_cache/");
     $GLOBALS['dynamic_cache'] = $GLOBALS['fcache']->get("APP_DYNAMIC_CACHE_" . APP_INDEX . "_" . MODULE_NAME . "_" . ACTION_NAME);
     $GLOBALS['fcache']->set_dir(APP_ROOT_PATH . "public/runtime/data/avatar_cache/");
     $GLOBALS['dynamic_avatar_cache'] = $GLOBALS['fcache']->get("AVATAR_DYNAMIC_CACHE");
     //头像的动态缓存
     //输出导航菜单
     $nav_list = get_nav_list();
     $nav_list = init_nav_list($nav_list);
     foreach ($nav_list as $k => $v) {
         $nav_list[$k]['sub_nav'] = init_nav_list($v['sub_nav']);
     }
     $GLOBALS['tmpl']->assign("nav_list", $nav_list);
     //输出在线客服与时间
     if (app_conf("ONLINE_QQ") != "") {
         $qq = unserialize(app_conf("ONLINE_QQ"));
         $GLOBALS['tmpl']->assign("online_qq", $qq);
     }
     //输出页面的标题关键词与描述
     $GLOBALS['tmpl']->assign("site_info", get_site_info());
     //输出系统文章
     $system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
     $GLOBALS['tmpl']->assign("system_article", $system_article['list']);
     //输出帮助
     $deal_help = get_help();
     $GLOBALS['tmpl']->assign("deal_help", $deal_help);
     //输出热门关键词
     $hot_kw = app_conf("SHOP_SEARCH_KEYWORD");
     $hot_kw = preg_split("/[ ,]/i", $hot_kw);
     $GLOBALS['tmpl']->assign("hot_kw", $hot_kw);
     if (MODULE_NAME == "acate" && ACTION_NAME == "index" || MODULE_NAME == "article" && ACTION_NAME == "index" || MODULE_NAME == "cate" && ACTION_NAME == "index" || MODULE_NAME == "comment" && ACTION_NAME == "index" || MODULE_NAME == "help" && ACTION_NAME == "index" || MODULE_NAME == "link" && ACTION_NAME == "index" || MODULE_NAME == "mobile" && ACTION_NAME == "index" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "index" || MODULE_NAME == "notice" && ACTION_NAME == "list_notice" || MODULE_NAME == "rec" && ACTION_NAME == "rhot" || MODULE_NAME == "rec" && ACTION_NAME == "rnew" || MODULE_NAME == "rec" && ACTION_NAME == "rbest" || MODULE_NAME == "rec" && ACTION_NAME == "rsale" || MODULE_NAME == "score" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "index" || MODULE_NAME == "space" && ACTION_NAME == "fav" || MODULE_NAME == "space" && ACTION_NAME == "fans" || MODULE_NAME == "space" && ACTION_NAME == "focus" || MODULE_NAME == "msg" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "index" || MODULE_NAME == "ss" && ACTION_NAME == "pick" || MODULE_NAME == "sys" && ACTION_NAME == "index" || MODULE_NAME == "sys" && ACTION_NAME == "list_notice" || MODULE_NAME == "vote" && ACTION_NAME == "index") {
         set_gopreview();
     }
 }
 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached("page/index.html", $cache_id)) {
         make_deal_cate_js();
         make_delivery_region_js();
         change_deal_status();
         //开始输出友情链接
         $f_link_group = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link_group where is_effect = 1 order by sort desc");
         foreach ($f_link_group as $k => $v) {
             $g_links = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link where is_effect = 1 and show_index = 1 and group_id = " . $v['id'] . " order by sort desc");
             if ($g_links) {
                 foreach ($g_links as $kk => $vv) {
                     if (substr($vv['url'], 0, 7) == 'http://') {
                         $g_links[$kk]['url'] = str_replace("http://", "", $vv['url']);
                     }
                 }
                 $f_link_group[$k]['links'] = $g_links;
             } else {
                 unset($f_link_group[$k]);
             }
         }
         //最新借款列表
         $deal_list = get_deal_list(11, 0, "publish_wait =0 AND deal_status in(1,2,4) ", " deal_status ASC,is_recommend DESC,sort DESC,id DESC");
         $GLOBALS['tmpl']->assign("deal_list", $deal_list['list']);
         //输出最新转让
         $transfer_list = get_transfer_list(11, " and d.deal_status >= 4 ", '', '', " d.create_time DESC , dlt.id DESC ");
         $GLOBALS['tmpl']->assign('transfer_list', $transfer_list['list']);
         //输出公告
         $notice_list = get_notice(7);
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //输出公司动态
         $art_id = $GLOBALS['db']->getOne("SELECT id FROM " . DB_PREFIX . "article_cate where title='公司动态'");
         if ($art_id > 0) {
             $compnay_active_list = get_article_list(5, $art_id);
             $GLOBALS['tmpl']->assign("art_id", $art_id);
             $GLOBALS['tmpl']->assign("compnay_active_list", $compnay_active_list['list']);
         }
         //投资排行
         //天
         $now_time = to_timespan(to_date(TIME_UTC, "Y-m-d"), "Y-m-d");
         $day_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $now_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 5");
         //周
         $week_time = to_timespan(to_date(TIME_UTC - to_date(TIME_UTC, "w") * 24 * 3600, "Y-m-d"), "Y-m-d");
         $week_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $week_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 5 ");
         //月
         $month_time = to_timespan(to_date(TIME_UTC, "Y-m") . "-01", "Y-m-d");
         $month_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $month_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 5");
         $GLOBALS['tmpl']->assign("day_load_top_list", $day_load_top_list);
         $GLOBALS['tmpl']->assign("week_load_top_list", $week_load_top_list);
         $GLOBALS['tmpl']->assign("month_load_top_list", $month_load_top_list);
         //收益排名
         $load_repay_list = $GLOBALS['db']->getAll("SELECT us.*,u.user_name FROM " . DB_PREFIX . "user_sta us LEFT JOIN " . DB_PREFIX . "user u ON us.user_id=u.id WHERE u.is_effect =1 and u.is_delete=0 and us.load_earnings > 0  ORDER BY us.load_earnings DESC LIMIT 5");
         $GLOBALS['tmpl']->assign("load_repay_list", $load_repay_list);
         //使用技巧
         $use_tech_list = get_article_list(12, 6);
         $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list);
         $now = TIME_UTC;
         $vote = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote where is_effect = 1 and begin_time < " . $now . " and (end_time = 0 or end_time > " . $now . ") order by sort desc limit 1");
         $GLOBALS['tmpl']->assign("vote", $vote);
         $GLOBALS['tmpl']->assign("f_link_data", $f_link_group);
         //累计投资金额
         $stats['total_load'] = $GLOBALS['db']->getOne("SELECT sum(money) FROM " . DB_PREFIX . "deal_load where is_repay= 0 ");
         $stats['total_load_format'] = format_conf_count(number_format($stats['total_load'], 2));
         //成交笔数
         $stats['deal_total_count'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal where  deal_status >=4 ");
         //累计创造收益
         $stats['total_rate'] = $GLOBALS['db']->getOne("SELECT sum(repay_money-self_money) FROM " . DB_PREFIX . "deal_load_repay where  has_repay = 1 ");
         $stats['total_rate_format'] = format_conf_count(number_format($stats['total_rate'], 2));
         //本息保证金(元)
         $stats['total_bzh'] = $GLOBALS['db']->getOne("SELECT sum(guarantor_real_freezen_amt+real_freezen_amt) FROM " . DB_PREFIX . "deal where deal_status= 4 ");
         $stats['total_bzh_format'] = format_conf_count(number_format($stats['total_bzh'], 2));
         //待收资金(元)
         $stats['total_repay'] = $GLOBALS['db']->getOne("SELECT sum(repay_money) FROM " . DB_PREFIX . "deal_load_repay where has_repay = 1 ");
         $stats['total_repay_format'] = format_conf_count(number_format($stats['total_repay'], 2));
         //待投资金(元)
         $statsU = $GLOBALS['db']->getRow("SELECT sum(money) as total_usermoney ,count(*) total_user FROM " . DB_PREFIX . "user where is_effect = 1 and is_delete=0 ");
         $stats['total_usermoney'] = $statsU['total_usermoney'];
         $stats['total_usermoney_format'] = format_conf_count(number_format($stats['total_usermoney'], 2));
         $stats['total_user'] = $statsU['total_user'];
         $GLOBALS['tmpl']->assign("stats", $stats);
         //格式化统计代码
         $VIRTUAL_MONEY_1_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_1"))) + $stats['total_load']);
         $VIRTUAL_MONEY_2_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_2"))) + $stats['total_rate']);
         $VIRTUAL_MONEY_3_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_3"))) + $stats['total_bzh']);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_1_FORMAT", $VIRTUAL_MONEY_1_FORMAT);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_2_FORMAT", $VIRTUAL_MONEY_2_FORMAT);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_3_FORMAT", $VIRTUAL_MONEY_3_FORMAT);
         $GLOBALS['tmpl']->assign("show_site_titile", 1);
     }
     $GLOBALS['tmpl']->display("page/index.html", $cache_id);
 }
Exemple #11
0
 public function about()
 {
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 6000;
     //首页缓存10分钟
     $name = trim($_REQUEST['u']) == "" ? "financing" : trim($_REQUEST['u']);
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $name);
     if (!$GLOBALS['tmpl']->is_cached("page/deals_about.html", $cache_id)) {
         $info = get_article_buy_uname($name);
         $info['content'] = $GLOBALS['tmpl']->fetch("str:" . $info['content']);
         $GLOBALS['tmpl']->assign("info", $info);
         $about_list = get_article_list(20, 7, "", "id ASC", true);
         $GLOBALS['tmpl']->assign("about_list", $about_list['list']);
         $seo_title = $info['seo_title'] != '' ? $info['seo_title'] : $info['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $info['seo_keyword'] != '' ? $info['seo_keyword'] : $info['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $info['seo_description'] != '' ? $info['seo_description'] : $info['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->display("page/deals_about.html", $cache_id);
 }
 public function index()
 {
     $field = es_cookie::get("shop_sort_field");
     $field_sort = es_cookie::get("shop_sort_type");
     require APP_ROOT_PATH . 'app/Lib/page.php';
     $level_list = load_auto_cache("level");
     $GLOBALS['tmpl']->assign("level_list", $level_list['list']);
     if (check_ipop_limit(get_client_ip(), "transfer_status", 10)) {
         syn_transfer_status();
     }
     if (trim($_REQUEST['cid']) == "last") {
         $cate_id = "-1";
         $page_title = $GLOBALS['lang']['LAST_SUCCESS_DEALS'] . " - ";
     } else {
         $cate_id = intval($_REQUEST['cid']);
     }
     if ($cate_id == 0) {
         $page_title = $GLOBALS['lang']['ALL_TRANSFER'] . " - ";
     }
     $keywords = trim(htmlspecialchars($_REQUEST['keywords']));
     $GLOBALS['tmpl']->assign("keywords", $keywords);
     $level = intval($_REQUEST['level']);
     $GLOBALS['tmpl']->assign("level", $level);
     $interest = intval($_REQUEST['interest']);
     $GLOBALS['tmpl']->assign("interest", $interest);
     $months = intval($_REQUEST['months']);
     $GLOBALS['tmpl']->assign("months", $months);
     $months_type = intval($_REQUEST['months_type']);
     $GLOBALS['tmpl']->assign("months_type", $months_type);
     $lefttime = intval($_REQUEST['lefttime']);
     $GLOBALS['tmpl']->assign("lefttime", $lefttime);
     $city = intval($_REQUEST['city']);
     $GLOBALS['tmpl']->assign("city_id", $city);
     $scity = intval($_REQUEST['scity']);
     $GLOBALS['tmpl']->assign("scity_id", $scity);
     //输出分类
     $deal_cates_db = load_auto_cache("cache_deal_cate");
     $deal_cates = array();
     foreach ($deal_cates_db as $k => $v) {
         if ($cate_id == $v['id']) {
             $v['current'] = 1;
             $page_title = $v['name'] . " - ";
         }
         $v['url'] = url("index", "transfer", array("cid" => $v['id']));
         $deal_cates[] = $v;
     }
     unset($deal_cates_db);
     //输出投标列表
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $page_args = array();
     $sfield = "";
     switch ($field) {
         case "borrow_amount":
             $sfield = "dlt.transfer_amount";
             break;
         case "rate":
             $sfield = "d.rate";
             break;
         case "repay_time":
             $sfield = "dlt.last_repay_time";
             break;
         case "remain_time":
             $sfield = "dlt.near_repay_time";
             break;
         default:
             $sfield = "";
     }
     $condition = " AND dlt.status=1 ";
     if ($cate_id > 0) {
         $condition .= "AND d.deal_status >=4 and cate_id=" . $cate_id;
         if ($sfield && $field_sort) {
             $orderby = "{$sfield} {$field_sort} ,d.deal_status desc , d.sort DESC,d.id DESC";
         } else {
             $orderby = "d.update_time DESC ,d.sort DESC,d.id DESC";
         }
     } elseif ($cate_id == 0) {
         if ($sfield && $field_sort) {
             $orderby = "{$sfield} {$field_sort}, dlt.create_time DESC , dlt.id DESC ";
         } else {
             $orderby = " d.create_time DESC , dlt.id DESC";
         }
     } elseif ($cate_id == "-1") {
         $condition .= "AND d.deal_status >=4 AND dlt.t_user_id > 0 ";
         $orderby = "dlt.transfer_time DESC,d.create_time DESC , dlt.id DESC";
     }
     if ($keywords) {
         $kw_unicode = str_to_unicode_string($keywords);
         $condition .= " and (match(d.name_match,d.deal_cate_match,d.tag_match,d.type_match) against('" . $kw_unicode . "' IN BOOLEAN MODE))";
     }
     if ($level > 0) {
         $point = $level_list['point'][$level];
         $condition .= " AND d.user_id in(SELECT u.id FROM " . DB_PREFIX . "user u LEFT JOIN " . DB_PREFIX . "user_level ul ON ul.id=u.level_id WHERE ul.point >= {$point})";
     }
     if ($interest > 0) {
         $condition .= " AND d.rate >= " . $interest;
     }
     if ($months > 0) {
         if ($months == 12) {
             $condition .= " AND d.repay_time <= " . $months;
         } elseif ($months == 18) {
             $condition .= " AND d.repay_time >= " . $months;
         }
     }
     if ($months_type > 0) {
         if ($months_type == 1) {
             $condition .= " AND ((d.repay_time < 3 and d.repay_time_type = 1) or d.repay_time_type = 0) ";
         } else {
             if ($months_type == 2) {
                 $condition .= " AND d.repay_time in (3,4,5)  and d.repay_time_type = 1 ";
             } else {
                 if ($months_type == 3) {
                     $condition .= " AND d.repay_time in (6,7,8)  and d.repay_time_type = 1 ";
                 } else {
                     if ($months_type == 4) {
                         $condition .= " AND d.repay_time in (9,10,11)  and d.repay_time_type = 1 ";
                     } else {
                         $condition .= " AND d.repay_time >= 12  and d.repay_time_type = 1 ";
                     }
                 }
             }
         }
     }
     if ($city > 0) {
         if ($scity > 0) {
             $dealid_list = $GLOBALS['db']->getAll("SELECT deal_id FROM " . DB_PREFIX . "deal_city_link where city_id = " . $scity);
         } else {
             $dealid_list = $GLOBALS['db']->getAll("SELECT deal_id FROM " . DB_PREFIX . "deal_city_link where city_id = " . $city);
         }
         $flatmap = array_map("array_pop", $dealid_list);
         $s2 = implode(',', $flatmap);
         $condition .= " AND id in (" . $s2 . ") ";
     }
     if ($lefttime > 0) {
         $condition .= " AND (d.next_repay_time + 24*3600 - 1 - " . TIME_UTC . ") <= " . $lefttime * 24 * 3600 . " AND dlt.t_user_id = 0 ";
     }
     if (es_cookie::get("shop_sort_field") == "ulevel") {
         $union_sql = ' LEFT join ' . DB_PREFIX . 'user u ON d.user_id = u.id ';
         $extfield = ",u.level_id ";
     }
     $limit = ($page - 1) * app_conf("DEAL_PAGE_SIZE") . "," . app_conf("DEAL_PAGE_SIZE");
     $result = get_transfer_list($limit, $condition, $extfield, $union_sql, $orderby);
     if ($result['rs_count'] > 0) {
         $page_args['cid'] = $cate_id;
         $page_args['keywords'] = $keywords;
         $page_args['level'] = $level;
         $page_args['interest'] = $interest;
         $page_args['months'] = $months;
         $page_args['lefttime'] = $lefttime;
         $page_args['months_type'] = $months_type;
         $page_args['city'] = $city;
         $page_pram = "";
         foreach ($page_args as $k => $v) {
             $page_pram .= "&" . $k . "=" . $v;
         }
         $page = new Page($result['rs_count'], app_conf("DEAL_PAGE_SIZE"), $page_pram);
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $GLOBALS['tmpl']->assign('transfer_list', $result['list']);
     }
     //分类
     $cate_list_url = array();
     $tmp_args = $page_args;
     $tmp_args['cid'] = 0;
     $cate_list_url[0]['url'] = url("index", "deals#index", $tmp_args);
     $cate_list_url[0]['name'] = "不限";
     $cate_list_url[0]['id'] = 0;
     foreach ($deal_cates as $k => $v) {
         $cate_list_url[$k + 1] = $v;
         $tmp_args = $page_args;
         $tmp_args['cid'] = $v['id'];
         $cate_list_url[$k + 1]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('cate_list_url', $cate_list_url);
     //利率
     $interest_url = array(array("interest" => 0, "name" => "不限"), array("interest" => 10, "name" => "10%"), array("interest" => 12, "name" => "12%"), array("interest" => 15, "name" => "15%"), array("interest" => 18, "name" => "18"));
     foreach ($interest_url as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['interest'] = $v['interest'];
         $interest_url[$k]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('interest_url', $interest_url);
     //几天内
     $lefttime_url = array(array("lefttime" => 0, "name" => "不限"), array("lefttime" => 1, "name" => "1天"), array("lefttime" => 3, "name" => "3天"), array("lefttime" => 6, "name" => "6天"), array("lefttime" => 9, "name" => "9天"), array("lefttime" => 12, "name" => "12天"));
     foreach ($lefttime_url as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['lefttime'] = $v['lefttime'];
         $lefttime_url[$k]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('lefttime_url', $lefttime_url);
     //借款期限
     $months_type_url = array(array("name" => "不限"), array("name" => "3 个月以下"), array("name" => "3-6 个月"), array("name" => "6-9 个月"), array("name" => "9-12 个月"), array("name" => "12 个月以上"));
     foreach ($months_type_url as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['months_type'] = $k;
         $months_type_url[$k]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('months_type_url', $months_type_url);
     //城市
     $temp_city_urls = load_auto_cache("deal_city");
     $city_urls[0]['id'] = 0;
     $city_urls[0]['name'] = "全部";
     if (count($temp_city_urls) == 1) {
         $temp_city_urls = $temp_city_urls[key($temp_city_urls)]['child'];
     }
     $temp_city_urls = array_merge($city_urls, $temp_city_urls);
     $city_urls = array();
     foreach ($temp_city_urls as $k => $v) {
         $city_urls[$v['id']] = $v;
         $tmp_args = $page_args;
         $tmp_args['city'] = $v['id'];
         $city_urls[$v['id']]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('city_urls', $city_urls);
     $sub_citys = $city_urls[$city]['child'];
     foreach ($sub_citys as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['city'] = $v['pid'];
         $tmp_args['scity'] = $v['id'];
         $sub_citys[$k]['url'] = url("index", "transfer#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('sub_citys', $sub_citys);
     //使用技巧
     $use_tech_list = get_article_list(4, 6);
     $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list);
     //输出公告
     $notice_list = get_notice(3);
     $GLOBALS['tmpl']->assign("notice_list", $notice_list);
     //会员等级
     $level_list_url = array();
     $tmp_args = $page_args;
     $tmp_args['level'] = 0;
     $level_list_url[0]['url'] = url("index", "deals#index", $tmp_args);
     $level_list_url[0]['name'] = "不限";
     foreach ($level_list['list'] as $k => $v) {
         $tmp_args = $page_args;
         $tmp_args['level'] = $v['id'];
         $level_list_url[$k + 1] = $v;
         $level_list_url[$k + 1]['url'] = url("index", "deals#index", $tmp_args);
     }
     $GLOBALS['tmpl']->assign('level_list_url', $level_list_url);
     $GLOBALS['tmpl']->assign("page_title", $page_title . $GLOBALS['lang']['FINANCIAL_MANAGEMENT']);
     $GLOBALS['tmpl']->assign("cate_id", $cate_id);
     $GLOBALS['tmpl']->assign("cid", strim($_REQUEST['cid']));
     $GLOBALS['tmpl']->assign("keywords", $keywords);
     $GLOBALS['tmpl']->assign("deal_cate_list", $deal_cates);
     $GLOBALS['tmpl']->assign("field", $field);
     $GLOBALS['tmpl']->assign("field_sort", $field_sort);
     $GLOBALS['tmpl']->display("page/transfers.html");
 }
Exemple #13
0
 public function list_notice()
 {
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . "list_notice" . trim($_REQUEST['id']) . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('page/notice_list.html', $cache_id)) {
         //分页
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_article_list($limit, 0, 'ac.type_id = 3', '', true);
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //开始输出当前的site_nav
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         $site_nav[] = array('name' => $GLOBALS['lang']['SHOP_SYSTEM'], 'url' => url("shop", "sys#list"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出当前的site_nav
         $GLOBALS['tmpl']->assign('page_title', $GLOBALS['lang']['SHOP_SYSTEM']);
         $GLOBALS['tmpl']->assign('page_keyword', $GLOBALS['lang']['SHOP_SYSTEM']);
         $GLOBALS['tmpl']->assign('page_description', $GLOBALS['lang']['SHOP_SYSTEM']);
     }
     $GLOBALS['tmpl']->display("page/notice_list.html", $cache_id);
 }
Exemple #14
0
function insert_artile_list($param)
{
    if ($param['cate'] == "" || $param['tpl'] == "") {
        return "";
    }
    if ($param['limit'] == "") {
        $param['limit'] = 5;
    }
    $cate_id = $GLOBALS['db']->getOne("SELECT id FROM " . DB_PREFIX . "article_cate where title='" . $param['cate'] . "'", false);
    if ($cate_id > 0) {
        $article_list = get_article_list($param['limit'], $cate_id);
        if ($article_list) {
            $GLOBALS['tmpl']->assign($param['datakey'] . "_id", $cate_id);
            $GLOBALS['tmpl']->assign($param['datakey'] . "_list", $article_list['list']);
        }
    }
    return $GLOBALS['tmpl']->fetch($param['tpl']);
}
Exemple #15
0
        }
    }
}
$GLOBALS['tmpl']->assign("nav_list", $nav_list);
$now = get_gmtime();
$vote = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote where is_effect = 1 and begin_time < " . $now . " and (end_time = 0 or end_time > " . $now . ") order by sort desc limit 1");
$GLOBALS['tmpl']->assign("vote", $vote);
//输出在线客服与时间
$qq = explode("|", app_conf("ONLINE_QQ"));
$msn = explode("|", app_conf("ONLINE_MSN"));
$GLOBALS['tmpl']->assign("online_qq", $qq);
$GLOBALS['tmpl']->assign("online_msn", $msn);
//输出页面的标题关键词与描述
$GLOBALS['tmpl']->assign("shop_info", get_shop_info());
//输出系统文章
$system_article = get_article_list(8, 0, "ac.type_id = 3", "", true);
$GLOBALS['tmpl']->assign("system_article", $system_article['list']);
//输出帮助
$deal_help = get_help();
$GLOBALS['tmpl']->assign("deal_help", $deal_help);
//开始输出友情链接
$f_link_group = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link_group where is_effect = 1 order by sort desc");
foreach ($f_link_group as $k => $v) {
    $g_links = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link where is_effect = 1 and show_index = 1 and group_id = " . $v['id'] . " order by sort desc");
    if ($g_links) {
        foreach ($g_links as $kk => $vv) {
            if (substr($vv['url'], 0, 7) == 'http://') {
                $g_links[$kk]['url'] = str_replace("http://", "", $vv['url']);
            }
        }
        $f_link_group[$k]['links'] = $g_links;
Exemple #16
0
 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached("page/index.html", $cache_id)) {
         make_deal_cate_js();
         make_delivery_region_js();
         change_deal_status();
         //借款预告列表
         $advance_deal_list = get_deal_list(5, 0, "publish_wait =0 AND deal_status =1 AND is_advance=1 AND start_time >" . TIME_UTC, " deal_status ASC, is_recommend DESC,sort DESC,id DESC");
         $GLOBALS['tmpl']->assign("advance_deal_list", $advance_deal_list['list']);
         //最新借款列表
         $deal_list = get_deal_list(11, 0, "publish_wait =0 AND deal_status in(1,2,4) AND start_time <=" . TIME_UTC, " deal_status ASC, is_recommend DESC,sort DESC,id DESC");
         $GLOBALS['tmpl']->assign("deal_list", $deal_list['list']);
         //输出最新转让
         $transfer_list = get_transfer_list(11, " and d.deal_status >= 4 ", '', '', " d.create_time DESC , dlt.id DESC ");
         $GLOBALS['tmpl']->assign('transfer_list', $transfer_list['list']);
         //输出公告
         $notice_list = get_notice(0);
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //输出公司动态
         $art_id = $GLOBALS['db']->getOne("SELECT id FROM " . DB_PREFIX . "article_cate where title='公司动态'");
         if ($art_id > 0) {
             $compnay_active_list = get_article_list(5, $art_id);
             $GLOBALS['tmpl']->assign("art_id", $art_id);
             $GLOBALS['tmpl']->assign("compnay_active_list", $compnay_active_list['list']);
         }
         //输出媒体报道
         $mtbd_id = $GLOBALS['db']->getOne("SELECT id FROM " . DB_PREFIX . "article_cate where title='媒体报道'");
         if ($mtbd_id > 0) {
             $mtbd_list = get_article_list(5, $mtbd_id);
             foreach ($mtbd_list['list'] as $k => $v) {
                 $mtbd_list['list'][$k]['contents'] = msubstr($mtbd_list['list'][$k]['content'], 0, 25);
             }
             $GLOBALS['tmpl']->assign("mtbd_id", $mtbd_id);
             $GLOBALS['tmpl']->assign("mtbd_list", $mtbd_list['list']);
         }
         //投资排行
         //天
         $now_time = to_timespan(to_date(TIME_UTC, "Y-m-d"), "Y-m-d");
         $day_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $now_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 10");
         //周
         $week_time = to_timespan(to_date(TIME_UTC - to_date(TIME_UTC, "w") * 24 * 3600, "Y-m-d"), "Y-m-d");
         $week_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $week_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 10 ");
         //月
         $month_time = to_timespan(to_date(TIME_UTC, "Y-m") . "-01", "Y-m-d");
         $month_load_top_list = $GLOBALS['db']->getAll("SELECT * FROM (SELECT user_name,sum(money) as total_money FROM " . DB_PREFIX . "deal_load where create_time >= " . $month_time . " group by user_id ORDER BY total_money DESC) as tmp LIMIT 10");
         $GLOBALS['tmpl']->assign("day_load_top_list", $day_load_top_list);
         $GLOBALS['tmpl']->assign("week_load_top_list", $week_load_top_list);
         $GLOBALS['tmpl']->assign("month_load_top_list", $month_load_top_list);
         //收益排名
         $load_repay_list = $GLOBALS['db']->getAll("SELECT us.*,u.user_name FROM " . DB_PREFIX . "user_sta us LEFT JOIN " . DB_PREFIX . "user u ON us.user_id=u.id WHERE u.is_effect =1 and u.is_delete=0 and us.load_earnings > 0  ORDER BY us.load_earnings DESC LIMIT 5");
         $GLOBALS['tmpl']->assign("load_repay_list", $load_repay_list);
         //使用技巧
         $use_tech_list = get_article_list(12, 6);
         $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list);
         $now = TIME_UTC;
         $vote = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "vote where is_effect = 1 and begin_time < " . $now . " and (end_time = 0 or end_time > " . $now . ") order by sort desc limit 1");
         $GLOBALS['tmpl']->assign("vote", $vote);
         //累计投资金额
         $stats['total_load'] = $GLOBALS['db']->getOne("SELECT sum(money) FROM " . DB_PREFIX . "deal_load where is_repay= 0 ");
         $stats['total_load_format'] = format_conf_count(number_format($stats['total_load'], 2));
         //成交笔数
         $stats['deal_total_count'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal where  deal_status >=4 ");
         //累计创造收益
         $stats['total_rate'] = $GLOBALS['db']->getOne("SELECT sum(true_interest_money + impose_money + true_reward_money - true_manage_money - true_manage_interest_money) FROM " . DB_PREFIX . "deal_load_repay where  has_repay = 1 ");
         $stats['total_rate'] += $GLOBALS['db']->getOne("SELECT sum(rebate_money) FROM " . DB_PREFIX . "deal_load where  is_has_loans = 1 ");
         //加上返利
         $stats['total_rate'] -= $GLOBALS['db']->getOne("SELECT sum(fee_amount) FROM " . DB_PREFIX . "payment_notice WHERE  is_paid =1  ");
         //减去充值手续费
         $stats['total_rate'] -= $GLOBALS['db']->getOne("SELECT sum(fee) FROM " . DB_PREFIX . "user_carry WHERE status =1  ");
         //减去提现手续费
         $stats['total_rate'] += $GLOBALS['db']->getOne("SELECT sum(money) FROM " . DB_PREFIX . "referrals WHERE pay_time >0  ");
         //加上邀请返利
         $stats['total_rate_format'] = format_conf_count(number_format($stats['total_rate'], 2));
         //本息保证金(元)
         $stats['total_bzh'] = $GLOBALS['db']->getOne("SELECT sum(guarantor_real_freezen_amt+real_freezen_amt) FROM " . DB_PREFIX . "deal where deal_status= 4 ");
         $stats['total_bzh_format'] = format_conf_count(number_format($stats['total_bzh'], 2));
         //待收资金(元)
         $stats['total_repay'] = $GLOBALS['db']->getOne("SELECT sum(repay_money) FROM " . DB_PREFIX . "deal_load_repay where has_repay = 1 ");
         $stats['total_repay_format'] = format_conf_count(number_format($stats['total_repay'], 2));
         //待投资金(元)
         $statsU = $GLOBALS['db']->getRow("SELECT sum(money) as total_usermoney ,count(*) total_user FROM " . DB_PREFIX . "user where is_effect = 1 and is_delete=0 ");
         $stats['total_usermoney'] = $statsU['total_usermoney'];
         $stats['total_usermoney_format'] = format_conf_count(number_format($stats['total_usermoney'], 2));
         $stats['total_user'] = $statsU['total_user'];
         $GLOBALS['tmpl']->assign("stats", $stats);
         //格式化统计代码
         $VIRTUAL_MONEY_1_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_1"))) + $stats['total_load']);
         $VIRTUAL_MONEY_2_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_2"))) + $stats['total_rate']);
         $VIRTUAL_MONEY_3_FORMAT = format_conf_count(floatval(trim(app_conf("VIRTUAL_MONEY_3"))) + $stats['total_bzh']);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_1_FORMAT", $VIRTUAL_MONEY_1_FORMAT);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_2_FORMAT", $VIRTUAL_MONEY_2_FORMAT);
         $GLOBALS['tmpl']->assign("VIRTUAL_MONEY_3_FORMAT", $VIRTUAL_MONEY_3_FORMAT);
         $GLOBALS['tmpl']->assign("show_site_titile", 1);
     }
     $GLOBALS['tmpl']->display("page/index.html", $cache_id);
 }
Exemple #17
0
    function sp_get_macros()
    {
        global $page, $mod_comments, $_CATEGORIES, $ver, $categories, $my_lang_profile, $ENGINE_URL, $SITE_URL;
        $tmpl_list = array();
        // staff
        $tmpl_list['index']['site_name'] = SITE_NAME;
        $tmpl_list['index']['main'] = my_lang('main');
        $tmpl_list['index']['url'] = SITE_URL;
        $tmpl_list['index']['crumbs'] = get_crumbs();
        $tmpl_list['index']['header'] = get_head();
        //Заголовки [модуль headers]
        $tmpl_list['index']['path'] = ENGINE_URL . '/themes/' . THEME;
        $tmpl_list['index']['site_description'] = SITE_DESC;
        //подзаголовок
        $tmpl_list['index']['Y'] = date("Y");
        $tmpl_list['index']['te_version'] = $ver;
        $tmpl_list['index']['rss'] = SITE_RSS;
        $tmpl_list['index']['auth_menu'] = bc_auth_menu();
        //<li> меню авторизации
        if (isset($_SESSION['name'])) {
            $tmpl_list['index']['user'] = $_SESSION['name'];
            /* $tmpl_list['index']['profile_link'] = <<<_MPF
                                                <a href="$SITE_URL/lib/window/profile.php" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=500,top=10'); return false;">$my_lang_profile</a>
            _MPF; */
        }
        //рубрики <li>
        foreach ($categories as $cat) {
            if ($cat['cat_count'] !== "0") {
                $tmpl_list['index']['cat_list'] .= '
                <li><a href="' . get_link('category', $cat['category_id']) . '">' . $cat['name'] . ' 
                <small>(' . $cat['cat_count'] . ')</small></a></li>
                ';
            }
        }
        //список страниц <li>
        $menu = get_static_list_rank();
        foreach ($menu as $link) {
            $tmpl_list['index']['menu'] .= '<li><a href="' . SITE_URL . '/' . $link['sef'] . '">' . $link['title'] . '</a></li>';
        }
        ## Cтраница
        if ($page == 'static' || isset($_REQUEST['s'])) {
            $tmpl_list['static']['title'] = print_static("title");
            $tmpl_list['static']['static'] = print_static("content");
            $f = TE_DIR . '/themes/' . THEME . '/static.html';
            if (is_file($f)) {
                $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['static']);
            }
        } elseif (($page == 'article' || $page == 'main') && !isset($_REQUEST['id'])) {
            //список записей
            $DB = get_article_list();
            if (!empty($DB)) {
                if (isset($_REQUEST['category_id'])) {
                    $tmpl_list['index']['title'] = $_CATEGORIES[$_REQUEST['category_id']]['name'];
                }
                foreach ($DB as $p) {
                    if ($p['approve'] == 1) {
                        //формируем ссылку
                        if (!USE_SEF) {
                            $link = SITE_URL . '/?id=' . $p['id'];
                        } elseif (SEF_TYPE == 1) {
                            $link = SITE_URL . '/article/' . $_CATEGORIES[$p['category_id']]['sef'] . '/' . $p['sef'];
                        } elseif (SEF_TYPE == 2) {
                            $link = SITE_URL . '/' . $_CATEGORIES[$p['category_id']]['sef'] . '/' . $p['sef'];
                        }
                    }
                    if (@$_SESSION['status'] == 'admin') {
                        $tmpl_list['post_list']['post_edit_link'] = <<<_le
                    <a href="{$SITE_URL}/window/ca/?id={$p['id']}&action=edit" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=850,left=150,height=640,top=10'); return false;">Редактор</a>
_le;
                        $tmpl_list['post_list']['post_edit_url'] = "{$SITE_URL}/window/ca/?id={$p['id']}&action=edit";
                    }
                    $tmpl_list['post_list']['title'] = $p['title'];
                    if ($p['description'] !== '') {
                        $tmpl_list['post_list']['post'] = $p['description'] . ' <a href="' . $link . '">' . my_lang("article_more") . '</a>';
                    } else {
                        $tmpl_list['post_list']['post'] = $p['content'];
                    }
                    $tmpl_list['post_list']['post_url'] = $link;
                    $tmpl_list['post_list']['post_date'] = date(DATE_FORMAT, gm2local($p['stamp'], TZ));
                    $tmpl_list['post_list']['post_category_url'] = get_link('category', $p['category_id']);
                    $tmpl_list['post_list']['post_category'] = $_CATEGORIES[$p['category_id']]['name'];
                    $tmpl_list['post_list']['post_author'] = $p['author'];
                    $f = TE_DIR . '/themes/' . THEME . '/post_list.html';
                    if (is_file($f)) {
                        $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['post_list']);
                    }
                }
                $tmpl_list['index']['navi'] = get_navi(get_artcl_sum(), ARTCLS_PER_PAGE);
            }
        } elseif (isset($_REQUEST['id'])) {
            //$tmpl_post = array_merge($tmpl_list, $tmpl_post);
            $profile = get_profile(print_article('author_id'));
            ## тело записи
            $tmpl_list['post']['title'] = print_article("title");
            $tmpl_list['post']['post'] = print_article("content");
            $tmpl_list['post']['post_category_url'] = get_link('category');
            $tmpl_list['post']['post_author'] = $profile['name'];
            $a_id = print_article("author_id");
            $tmpl_list['post']['post_author_link'] = <<<_APF
                                    <a href="{$SITE_URL}/window/profile/?author_id={$a_id}" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=250,top=10'); return false;">{$profile["name"]}</a>
_APF;
            if (@$_SESSION['status'] == 'admin') {
                $tmpl_list['post']['post_edit_link'] = <<<_APE
                                    <a href="{$SITE_URL}/window/ca/?id={$_REQUEST['id']}&action=edit" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=850,left=150,height=640,top=10'); return false;">Редактор</a>
_APE;
                $tmpl_list['post']['post_edit_url'] = "{$SITE_URL}/window/ca/?id={$_REQUEST['id']}&action=edit";
            }
            $tmpl_list['post']['post_date'] = date(DATE_FORMAT, gm2local(print_article('stamp'), TZ));
            $tmpl_list['post']['post_category'] = $_CATEGORIES[$_REQUEST['category_id']]['name'];
            $f = TE_DIR . '/themes/' . THEME . '/post.html';
            $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['post']);
            ## комментарии
            if ($mod_comments) {
                //если модуль "вкл"
                function del_link($id)
                {
                    if ($_SESSION['status'] == 'admin') {
                        return '  <a href="' . SITE_URL . '/?id=' . $_REQUEST['id'] . '&cid=' . $id . '&com_act=del">X</a>';
                    } else {
                        return '';
                    }
                }
                $comm_data = get_comments();
                //получаем список комментов и начинаем обходить шаблон комментария
                if (isset($comm_data[0])) {
                    foreach ($comm_data as $p) {
                        $profile = get_profile($p['author_id']);
                        //комментатор не зарег-н
                        if (empty($p['author_id'])) {
                            $tmpl_list['comment']['name'] = $p['author'];
                            //if (!empty($p['email'])) {
                            $gra = get_gravatar($p['email'], $size = 35);
                            //}
                        } else {
                            $gra = get_gravatar($profile['email'], $size = 35);
                            $tmpl_list['comment']['name'] = <<<_PF
                        <a href="{$SITE_URL}/window/profile?author_id={$p["author_id"]}" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=250,top=10'); return false;">{$profile['name']}</a>
_PF;
                        }
                        $tmpl_list['comment']['name'] .= del_link($p['id']);
                        $tmpl_list['comment']['gravatar'] = $gra['img'];
                        $tmpl_list['comment']['gravatar_url'] = $gra['url'];
                        $tmpl_list['comment']['date'] = date(DATE_FORMAT, gm2local($p['date'], TZ));
                        //[lib.php, date = stamp]
                        $tmpl_list['comment']['comment'] = $p['content'];
                        $f = TE_DIR . '/themes/' . THEME . '/comment.html';
                        $tmpl_list['comment_list']['comments'] .= sp_get_skin($f, $tmpl_list['comment']);
                    }
                }
                $tmpl_list['comment_list']['comments_form'] = print_comments_form();
                //и вставляем полученный список комментариев в шаблон списка комментариев (вот неожиданность:)
                if (is_file(TE_DIR . '/themes/' . THEME . '/comment_list.html')) {
                    $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/comment_list.html', $tmpl_list['comment_list']);
                }
            }
        } elseif ($page == "album") {
            if (is_file(TE_DIR . '/themes/' . THEME . '/album.html')) {
                $album = get_album();
                if (!empty($album)) {
                    foreach ($album as $img) {
                        $tmpl_list['album']['album'] .= '<a target="_blank" href="' . $img['url'] . '"> 
                <img src="' . $img['url'] . '" HSPACE="0" VSPACE="0" border="0"
                title="Добавлена ' . date("d.m.Y H:i:s", $img['time']) . '" style="max-height: 70px;">
                </a>';
                    }
                } else {
                    $tmpl_list['album']['album'] .= my_lang('album_empty');
                }
                $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/album.html', $tmpl_list['album']);
            } else {
                $tmpl_list['index']['content'] .= 'Не обнаружено файла-шаблона для альбома(';
            }
        } elseif ($page == "feedback") {
            if (is_file(TE_DIR . '/themes/' . THEME . '/feedback.html')) {
                $tmpl_list['feedback']['sid'] = get_sid();
                $reg = Registry::instance();
                $tmpl_list['feedback']['feedback_msg'] = $reg->get('feedback_msg');
                $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/feedback.html', $tmpl_list['feedback']);
            }
        }
        //список последних записей <li><a>link</a></li>
        $tmpl_list['index']['post_list'] = bc_postlist(7);
        $tmpl_list['index']['theme_list'] = bc_theme_list();
        $tmpl_list['index']['time'] = microtime(true) - ST;
        return $tmpl_list;
    }
 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('acate_index.html', $cache_id)) {
         $id = intval($_REQUEST['id']);
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0");
         if ($id > 0 && !$cate_item) {
             app_redirect(APP_ROOT . "/");
         } elseif ($cate_item['type_id'] != 0) {
             if ($cate_item['type_id'] == 1) {
                 app_redirect(url("shop", "help#index"));
             }
             if ($cate_item['type_id'] == 2) {
                 app_redirect(url("shop", "notice#list"));
             }
             if ($cate_item['type_id'] == 3) {
                 app_redirect(url("shop", "sys#list"));
             }
         }
         $cate_id = intval($cate_item['id']);
         $cate_tree = get_acate_tree();
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         //分页
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_article_list($limit, $cate_id, 'ac.type_id = 0', '', false);
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         //开始输出当前的site_nav
         $cates = array();
         $cate = $cate_item;
         do {
             $cates[] = $cate;
             $pid = intval($cate['pid']);
             $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where is_effect =1 and is_delete =0 and id = " . $pid);
         } while ($pid != 0);
         foreach ($cates as $cate_row) {
             $page_title .= $cate_row['title'] . " - ";
             $page_kd .= $cate_row['title'] . ",";
         }
         $page_title = substr($page_title, 0, -3);
         krsort($cates);
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         if ($cate_item) {
             foreach ($cates as $cate_row) {
                 $site_nav[] = array('name' => $cate_row['title'], 'url' => url("shop", "acate#index", array("id" => $cate_row['id'])));
             }
         } else {
             $site_nav[] = array('name' => $GLOBALS['lang']['ARTICLE_CATE'], 'url' => url("shop", "acate#index"));
         }
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         //输出当前的site_nav
         $GLOBALS['tmpl']->assign("page_title", $cate_item['title']);
         $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ",");
         $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ",");
     }
     $GLOBALS['tmpl']->display("acate_index.html", $cache_id);
 }
function get_article_feed($args = array())
{
    global $root;
    $articles = array();
    $articles_content = array();
    $output = '';
    $button_link = '';
    $limit = isset($args['limit']) && !empty($args['limit']) ? $args['limit'] : 10;
    $sort = isset($args['sort']) && !empty($args['sort']) ? $args['sort'] : 'LMOD_DESC';
    $list_view = isset($args['list_view']) && !empty($args['list_view']) ? $args['list_view'] : false;
    if (!$list_view) {
        $image_switch = isset($args['image']) && !empty($args['image']) ? $args['image'] : false;
    } else {
        $image_switch = false;
    }
    $article_list = get_article_list();
    // Slice the original array if the count of the array
    // is higher than the limit
    if (count($article_list) > $limit) {
        $article_list = array_slice($article_list, 0, $limit);
    }
    // Attach last modified date to the files array
    if ($sort == 'LMOD_ASC' || $sort == 'LMOD_DESC') {
        foreach ($article_list as $article_file) {
            $art_key = get_site_url() . '/content/' . $article_file;
            $articles[$art_key] = filemtime($root . '/content/' . $article_file);
        }
    } else {
        foreach ($article_list as $art_name) {
            $article_path = get_site_url() . '/content/' . $art_name;
            array_push($articles, $article_path);
        }
    }
    // Sort the files array depending in the sort option
    switch ($sort) {
        case 'LMOD_ASC':
            asort($articles);
            $articles = array_keys($articles);
            break;
        case 'ASC':
            sort($articles);
            break;
        case 'DESC':
            rsort($articles);
            break;
        default:
            arsort($articles);
            $articles = array_keys($articles);
            break;
    }
    // Retrieve data from files
    foreach ($articles as $article_name) {
        $full_art = json_decode(file_get_contents($article_name), true);
        $the_article = $full_art['article'];
        $output .= sprintf('<div id="%s" class="article-list-item">', 'post-' . $the_article['id']);
        $output .= '<div class="article-list-card">';
        if ($image_switch) {
            $output .= '<figure class="article-head-image">';
            $output .= sprintf('<img src="%1$s" alt="%2$s">', $the_article['image'], $the_article['title']);
            $output .= '</figure>';
        }
        $output .= sprintf('<h2 class="article-list-title"><a href="%1$s">%2$s</a></h2>', $the_article['url'], $the_article['title']);
        if (!$list_view) {
            $output .= sprintf('<div class="article-list-excerpt"><p class="excerpt-text"><i>%s</i></p></div>', $the_article['excerpt']);
            $button_link = sprintf('<div class="listing-link button-wrapper"><a href="%s">Continue reading</a></div>', $the_article['url']);
        }
        $output .= $button_link;
        $output .= '</div><!-- .article-list-card --></div><!-- .article-list-item -->';
    }
    echo $output;
}