Example #1
0
	public function recommendGoods () {
		$article_id = isset($_GET['id']) ? intval($_GET['id']) : 14;
		$article = array();
		if($article_id > 0)
		{
			//文章详细信息
			$article = get_article_info($article_id);
			//文章关联产品
			$article_related_goods = article_related_goods($article_id);		
			$articleArr = array('article'=>$article,'article_related_goods'=>$article_related_goods);
		}
		//var_dump($articleArr);exit;
		jsonExit($articleArr);
	}
Example #2
0
    $ip = $_REQUEST['ip'];
    insertInto($ip);
}
/*------------------------------------------------------ */
//-- PROCESSOR
/*------------------------------------------------------ */
$cache_id = sprintf('%X', crc32($_REQUEST['id'] . '-' . $_CFG['lang']));
if (!$smarty->is_cached('article.dwt', $cache_id)) {
    /* 文章详情 */
    if ($_REQUEST['type'] == 'sjs') {
        $article = get_article_info_sjs($article_id);
    } else {
        if ($_REQUEST['type'] == 'fu') {
            $article = get_article_info0($article_id);
        } else {
            $article = get_article_info($article_id);
        }
    }
    if (empty($article)) {
        ecs_header("Location: ./\n");
        exit;
    }
    if (!empty($article['link']) && $article['link'] != 'http://' && $article['link'] != 'https://') {
        ecs_header("location:{$article['link']}\n");
        exit;
    }
    $smarty->assign('article_categories', article_categories_tree($article_id));
    //文章分类树
    $smarty->assign('categories', get_categories_tree());
    // 分类树
    $smarty->assign('helps', get_shop_help());
Example #3
0
<?php

define('IN_ECTOUCH', true);
require 'include/init.php';
$do = array('www.bswtg.com', 'wsc.bswtg.com');
$do99 = $_SERVER['HTTP_HOST'];
if (!in_array($do99, $do)) {
    $todo = 'error';
}
$action = isset($_REQUEST['act']) ? $_REQUEST['act'] : 'default';
if ($_REQUEST['act'] == 'contact') {
    assign_template();
    $article = get_article_info(5);
    $smarty->assign('article', $article);
    $smarty->assign('action', $action);
    $smarty->display('ectouch.dwt');
} elseif ($_REQUEST['act'] == 'share') {
    assign_template();
    $smarty->assign('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
    $smarty->assign('action', $action);
    $smarty->display('ectouch.dwt');
} elseif ($_REQUEST['act'] == 'map') {
    $smarty->assign('action', $action);
    $smarty->display('ectouch.dwt');
}
function get_article_info($article_id)
{
    $sql = "SELECT a.*, IFNULL(AVG(r.comment_rank), 0) AS comment_rank " . "FROM " . $GLOBALS['ecs']->table('article') . " AS a " . "LEFT JOIN " . $GLOBALS['ecs']->table('comment') . " AS r ON r.id_value = a.article_id AND comment_type = 1 " . "WHERE a.is_open = 1 AND a.article_id = '{$article_id}' GROUP BY a.article_id";
    $row = $GLOBALS['db']->getRow($sql);
    if ($row !== false) {
        $row['comment_rank'] = ceil($row['comment_rank']);
Example #4
0
 * ECSHOP 文章
 * ============================================================================
 * 版权所有 2005-2010 上海商派网络科技有限公司,并保留所有权利。
 * 网站地址: http://www.ecshop.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: liubo $
 * $Id: article.php 16455 2009-07-13 09:57:19Z liubo $.
 */
define('IN_ECS', true);
require dirname(__FILE__) . '/includes/init.php';
$a_id = !empty($_GET['id']) ? intval($_GET['id']) : '';
if ($a_id > 0) {
    $article_row = get_article_info($a_id);
    if (empty($article_row)) {
        mobile_error('返回首页', $url = 'index.php', '未找到对应的文章');
    }
    if (!empty($article_row['link']) && $article_row['link'] != 'http://' && $article_row['link'] != 'https://') {
        mobile_error('返回首页', $url = 'index.php', '未找到对应的文章');
    }
    $smarty->assign('common_header_title', encode_output($article_row['title']));
    $article_row['title'] = encode_output($article_row['title']);
    $replace_tag = array('<br />', '<br/>', '<br>', '</p>');
    $article_row['content'] = htmlspecialchars_decode(encode_output($article_row['content']));
    $article_row['content'] = str_replace($replace_tag, '{br}', $article_row['content']);
    $article_row['content'] = strip_tags($article_row['content']);
    $article_row['content'] = str_replace('{br}', '<br />', $article_row['content']);
    $smarty->assign('article_data', $article_row);
    $smarty->display('article_desc.dwt');
Example #5
0
function render_article_summary($dbc, $article_id, $word_count = 0)
{
    $article_info = get_article_info($dbc, $article_id);
    echo "<h4><a href = \"article.php?id={$article_id}\">" . $article_info[title] . "</a></h4>";
    echo "{$article_info['creators']}创建于{$article_info['create_time']}";
    $abstract = get_abstract($dbc, $article_id);
    if ($word_count != 0) {
        $abstract = tcmks_substr($abstract);
    }
    echo '<p>' . $abstract . '</p>';
}
Example #6
0
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    $has_right_to_edit = isset($_GET['view']) ? false : has_right_to_edit($dbc, $_SESSION['id'], $id);
    if (isset($_GET['delete_image'])) {
        delete_image_from_segment($dbc, $_GET['segment_id'], $_GET['delete_image']);
    }
    if (isset($_GET['deleted_segment_id'])) {
        delete_segment_from_article($dbc, $id, $_GET['deleted_segment_id']);
    }
    if (isset($_GET['insert'])) {
        insert_segment_into_article($dbc, $id, $_GET['insert'], $_GET['prev']);
    }
    if (isset($_GET['copy'])) {
        copy_and_insert_segment($dbc, $id, $_GET['copy'], $_GET['prev']);
    }
    $article_info = get_article_info($dbc, $id);
    $segments = get_segments($dbc, $id);
    $images = set_image_no($dbc, $segments);
    ?>
    <script type ="text/javascript">
        function jump(link) {
            window.location = "#" + link;
        }
    </script>
    <div class="container">
        <div class="row">
            <div class="span3  bs-docs-sidebar">
                <ul class="nav nav-list bs-docs-sidenav">

    <?php 
    $is_first_segment = true;
Example #7
0
 *  HQ China:
 *    2319 Est.Tower Van Palace 
 *    No.2 Guandongdian South Street 
 *    Beijing , China
 *
 *  U.S. Office:
 *    One Park Place, Elmira College, NY, 14901, USA
 *
 *  QQ Group:   329673575
 *  BBS:        bbs.ecmobile.cn
 *  Fax:        +86-10-6561-5510
 *  Mail:       info@geek-zoo.com
 */
require EC_PATH . '/includes/init.php';
$id = _POST('article_id', 0);
if (empty($id)) {
    GZ_Api::outPut(101);
}
if (!($article = get_article_info($id))) {
    GZ_Api::outPut(13);
}
function get_article_info($article_id)
{
    /* 获得文章的信息 */
    $sql = "SELECT a.article_id as id, a.title, a.content " . "FROM " . $GLOBALS['ecs']->table('article') . " AS a " . "WHERE a.is_open = 1 AND a.article_id = '{$article_id}'";
    $row = $GLOBALS['db']->getRow($sql);
    return $row;
}
$base = sprintf('<base href="%s/" />', dirname($GLOBALS['ecs']->url()));
$html = '<!DOCTYPE html><html><head><title>' . $article['title'] . '</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0"><style>img {width: auto\\9;height: auto;vertical-align: middle;border: 0;-ms-interpolation-mode: bicubic;max-width: 100%; }html { font-size:100%; } </style>' . $base . '</head><body>' . $article['content'] . '</body></html>';
GZ_Api::outPut(array('data' => $html));