Scripts in $AD_TOP/sql

Oracle SQL 脚本实用指南
本文列举了Oracle环境下多种实用的SQL脚本,包括编译对象、复制责任、检查编译错误等功能,适用于不同版本如11.0.x、10.7NCA等。这些脚本能够帮助数据库管理员进行维护、优化和故障排查。

$AD_TOP/sql 下有许多非常有用的脚本。



Script 11.0.x 10.7NCA 10.7SC/16.1 Description
adcompsc.pls x x x Compile objects in a given schema
adcpresp.sql x     The script duplicates rows in FND_RESPONSIBILITY in the following way: 
Find data_group_id dg_id for the given data_group_name.
For each row with data_group_id 0 in FND_RESPONSIBILITY, look fora corresponding row with data_group_id dg_id, with the same application_id,and responsibility_name that only differs in the given suffix string suffix_string.If such a row does not exist for the data_group_id dg_id, insert it.
aderrch2.sql x x x Reports all compilation errorsfor a given schema.
aderrchk.sql x x x Same as aderrch2.sql plus itfails if there are any errors
adtresp.sql x     A fix for customers who havemore than one set of books and they installed languages other than AMERICANEnglish. The symptom of the bug is that responsibility names are not translatedproperly for non-Standard data groups.
adutcobj.sql x x x Count objects by object typein schema
adutconf.sql x x x Utility script to display configurationof Applications
adutfip.sql x x x Utility script to display workerinformation
adutfpd.sql x x x Utility script to display productdependency information
ADXANLYZ.sql x x x Analyze all tables in an ORACLEID with estimate sample 20%
ADXCKPIN.sql x x x Query the shared_pool area todetermine space used by PL/SQL objects and whether they have been pinned.
ADXGNPIN.sql x x x Creates and runs a "pin" scriptfor all packages and functions in a give schema
ADXGNPNS.sql x x x Creates and runs a "pin" scriptfor all sequences in a give schema
ADXINMAI.sql x x x Install tables and views usedby the Applications*DBA sql scripts.
adxirc.sql x x x AD - index - report columns
adxirn.sql x x x Drops and recreates an indexas nonunique.
ADXLMCBC.sql x x x Live Monitor, Categorize BlockContention
ADXLMLSO.sql x x x Live Monitor, List Session Objects
ADXLMQMS.sql x x x Live Monitor, Query Monitor Statistics
ADXLPFLS.sql x x x Lock Problem, Find Lock Source
ADXLPSLU.sql x x x Lock Problem, Show Lock Users
adxpriv7.sql x x x grant privileges to a user
ADXRCSDC.sql x x x Report Configuration, Show DatabaseConfiguration formerly, config.sql (rollback, tablespace, data files)
ADXRCSTG.sql x x x Report Configuration, SelectTable Grants
adxrfmi.sql x x x report installed modules fromfnd_module_installations
adxrfpi.sql x x x report rows from fnd_product_installationsand related tables
ADXRSEBH.sql x x x Estimate the effect of a biggerSGA cache on cache hit rate.
ADXRSESH.sql x x x Estimate the effect of a smallerSGA cache on cache hit rate.
ADXRSFIS.sql x x x Find the size (blocks, extents,extpct) of the given index.
ADXRSFTS.sql x x x Find the size (blocks, extents,extpct) of the given table.
ADXRSFUA.sql x x x Report the number of blocks usedand the number of extents used for every table or index in every user inthe database.
ADXRSLFS.sql x x x Report free extents in each tablespace.
ADXRSQDP.sql x x x Check for cache effectivenessfor dc_xxxxx parameters' values.
ADXRSRTS.sql x x x Produce a brief database usedspace report.
ADXRSSIE.sql x x x Generate a list of tables andindexes whose next extent to be grabbed would be too large to be allocatedin their corresponding tablespaces.
ADXRSSMF.sql x x x List tables and indexes witha number of allocated extents close to their max_extents.
ADXRSSMS.sql x x x Find space used for one's ownsegments.
ADXRSSRS.sql x x x Show v$rollstat statistics.
ADXRSSSU.sql x x x For a username, report the numberof blocks used and the number of extents used for every table or indexin that username.
ADXRSSTF.sql x x x Produce a brief report of databasefragmentation by tablespace.
ADXRSSUS.sql x x x Report how much space each userhas.
ADXUPLUP.sql x x x Generate a list of processeswhich the given user (NOT the database account's username) owns.
ADXUPSRU.sql x x x Show all users that have activetransactions per Rollback Segment that they are writing to.
applcrt.sql   x x Modified CRT definitions forApplications Environment


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22816976/viewspace-2126039/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22816976/viewspace-2126039/

<?php /** * 鸿宇多用户商城 动态内容函数库 - 已修复兼容 PHP 5.6 * ============================================================================ * 版权所有 2005-2010 鸿宇多用户商城科技有限公司,并保留所有权利。 * 网站地址: http://bbs.hongyuvip.com; * ---------------------------------------------------------------------------- * 仅供学习交流使用,如需商用请购买正版版权。鸿宇不承担任何法律责任。 * 踏踏实实做事,堂堂正正做人。 * ============================================================================ * $Author: liuhui $ * $Id: lib_insert.php 17063 2010-03-25 06:35:46Z liuhui $ */ if (!defined('IN_ECS')) { die('Hacking attempt'); } /** * 获得查询次数以及查询时间 * * @access public * @return string */ function insert_query_info() { if (empty($GLOBALS['db']->queryTime)) { $query_time = 0; } else { if (PHP_VERSION >= '5.0.0') { $start = microtime(true); $query_time = number_format($start - $GLOBALS['db']->queryTime, 6); } else { list($now_usec, $now_sec) = explode(' ', microtime()); list($start_usec, $start_sec) = explode(' ', $GLOBALS['db']->queryTime); $query_time = number_format(($now_sec - $start_sec) + ($now_usec - $start_usec), 6); } } /* 内存占用情况 */ $memory_usage = ''; if ($GLOBALS['_LANG']['memory_info'] && function_exists('memory_get_usage')) { $memory_usage = sprintf($GLOBALS['_LANG']['memory_info'], memory_get_usage() / 1048576); } /* 是否启用了 gzip */ $gzip_enabled = gzip_enabled() ? $GLOBALS['_LANG']['gzip_enabled'] : $GLOBALS['_LANG']['gzip_disabled']; $online_count = intval($GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('sessions'))); /* 加入触发cron代码 */ $cron_method = empty($GLOBALS['_CFG']['cron_method']) ? '<img src="api/cron.php?t=' . gmtime() . '" alt="" style="width:0px;height:0px;" />' : ''; return sprintf($GLOBALS['_LANG']['query_info'], $GLOBALS['db']->queryCount, $query_time, $online_count) . $gzip_enabled . $memory_usage . $cron_method; } /** * 调用浏览历史 * * @access public * @return string */ function insert_history() { $str = ''; if (!empty($_COOKIE['ECS']['history'])) { $goods_ids = array_filter(array_map('intval', explode(',', $_COOKIE['ECS']['history']))); if (empty($goods_ids)) { return ''; } $where = db_create_in($goods_ids, 'goods_id'); $sql = 'SELECT goods_id, goods_name, goods_thumb, shop_price FROM ' . $GLOBALS['ecs']->table('goods') . " WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 LIMIT 5"; $res = $GLOBALS['db']->query($sql); while ($row = $GLOBALS['db']->fetch_array($res)) { $goods = array(); $goods['goods_id'] = $row['goods_id']; $goods['goods_name'] = htmlspecialchars($row['goods_name']); $goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $goods['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $goods['shop_price'] = price_format($row['shop_price']); $goods['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); $str .= '<li> <div class="p-img"><a target="_blank" href="' . $goods['url'] . '"> <img src="' . $goods['goods_thumb'] . '" alt="' . $goods['goods_name'] . '" width="50" height="50" /> </a></div> <div class="p-name"><a target="_blank" href="' . $goods['url'] . '">' . $goods['goods_name'] . '</a></div> <div class="p-price"><strong>' . $goods['shop_price'] . '</strong></div> </li>'; } } return $str; } /** * 获取“猜你喜欢”商品列表(基于浏览历史) * * @return array */ function get_cainixihuan() { if (empty($_COOKIE['ECS']['history'])) { return array(); } $goods_ids = array_filter(array_map('intval', explode(',', $_COOKIE['ECS']['history']))); if (empty($goods_ids)) { return array(); } $where = db_create_in($goods_ids, 'goods_id'); $sql = 'SELECT cat_id FROM ' . $GLOBALS['ecs']->table('goods') . " WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 LIMIT 1"; $cat_id = intval($GLOBALS['db']->getOne($sql)); if (!$cat_id) { $cat_id = 0; } $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('goods') . " WHERE cat_id = '$cat_id' AND is_best = 1 AND is_delete = 0 LIMIT 8"; $list = $GLOBALS['db']->getAll($sql); $arr = array(); foreach ($list as $key => $row) { $arr[$key]['goods_id'] = $row['goods_id']; $arr[$key]['goods_name'] = $row['goods_name']; $arr[$key]['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $arr[$key]['shop_price'] = price_format($row['shop_price']); $arr[$key]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); $arr[$key]['evaluation'] = get_evaluation_sumss($row['goods_id']); } return $arr; } /** * 获取商品评论总数 * * @param int $goods_id * @return int */ function get_evaluation_sumss($goods_id) { $goods_id = intval($goods_id); $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('comment') . " WHERE status=1 AND comment_type=0 AND id_value='$goods_id'"; return intval($GLOBALS['db']->getOne($sql)); } /* 代码增加_start By bbs.hongyuvip.com */ /** * 调用浏览历史列表(带比价按钮) * * @access public * @return string */ function insert_history_list() { $str = ''; if (!empty($_COOKIE['ECS']['history'])) { $goods_ids = array_filter(array_map('intval', explode(',', $_COOKIE['ECS']['history']))); if (empty($goods_ids)) { return ''; } $where = db_create_in($goods_ids, 'goods_id'); $sql = 'SELECT goods_id, goods_name, goods_thumb, shop_price, promote_price, market_price, goods_type FROM ' . $GLOBALS['ecs']->table('goods') . " WHERE $where AND is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 LIMIT 10"; $res = $GLOBALS['db']->query($sql); $str .= '<ul>'; while ($row = $GLOBALS['db']->fetch_array($res)) { $goods = array(); $goods['goods_id'] = $row['goods_id']; $goods['goods_name'] = htmlspecialchars($row['goods_name']); $goods['goods_type'] = $row['goods_type']; $goods['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $goods['goods_thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $goods['shop_price'] = price_format($row['shop_price']); $goods['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); // 会员价 or 市场价 if ($_SESSION['user_id'] > 0) { $showprice = !empty($row['promote_price']) ? price_format($row['promote_price']) : $goods['shop_price']; } else { $showprice = price_format($row['market_price']); } $str .= '<li><div class="item_wrap"> <div class="dt"><a href="' . $goods['url'] . '"><img width="50" height="50" src="' . $goods['goods_thumb'] . '" /></a></div> <div class="dd"> <a class="name" href="' . $goods['url'] . '">' . $goods['goods_name'] . '</a> <div class="btn" style="padding-top:15px;"> <a class="compare-btn" data-goods="' . $goods['goods_id'] . '" onClick="Compare.add(' . $goods['goods_id'] . ',\'' . addslashes($goods['goods_name']) . '\',' . $goods['goods_type'] . ', \'' . $goods['goods_thumb'] . '\', \'' . $showprice . '\')"></a> <span class="price" style="float:left"><strong>' . $showprice . '</strong></span> </div> </div> </div></li>'; } $str .= '</ul>'; } return $str; } /* 代码增加_end By bbs.hongyuvip.com */ /** * 调用购物车信息 * * @access public * @return string */ function insert_cart_info() { $sess_id = SESS_ID; $sql_where = $_SESSION['user_id'] > 0 ? "c.user_id = '" . intval($_SESSION['user_id']) . "'" : "c.session_id = '$sess_id' AND c.user_id = 0"; $sql = 'SELECT c.*, IF(c.extension_code = "package_buy", pa.act_name, g.goods_name) AS goods_name, ' . 'IF(c.extension_code = "package_buy", "package_img", g.goods_thumb) AS goods_thumb, ' . 'g.goods_id, c.goods_number, c.goods_price ' . 'FROM ' . $GLOBALS['ecs']->table('cart') . ' AS c ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('goods') . ' AS g ON g.goods_id = c.goods_id ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('goods_activity') . ' AS pa ON pa.act_id = c.goods_id ' . "WHERE $sql_where AND rec_type = '" . CART_GENERAL_GOODS . "'"; $rows = $GLOBALS['db']->getAll($sql); $arr = array(); foreach ($rows as $k => $v) { $arr[$k]['goods_thumb'] = get_image_path($v['goods_id'], $v['goods_thumb'], true); $arr[$k]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($v['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $v['goods_name']; $arr[$k]['url'] = ($v['extension_code'] == 'package_buy') ? '' : build_uri('goods', array('gid' => $v['goods_id']), $v['goods_name']); $arr[$k]['goods_number'] = $v['goods_number']; $arr[$k]['goods_name'] = $v['goods_name']; $arr[$k]['goods_price'] = price_format($v['goods_price']); $arr[$k]['rec_id'] = $v['rec_id']; } $sql = 'SELECT SUM(goods_number) AS number, SUM(goods_price * goods_number) AS amount ' . 'FROM ' . $GLOBALS['ecs']->table('cart') . " AS c " . "WHERE $sql_where AND rec_type = '" . CART_GENERAL_GOODS . "'"; $row = $GLOBALS['db']->getRow($sql); $number = !empty($row['number']) ? intval($row['number']) : 0; $amount = !empty($row['amount']) ? floatval($row['amount']) : 0; $GLOBALS['smarty']->assign('str', sprintf($GLOBALS['_LANG']['cart_info'], $number, price_format($amount, false))); $GLOBALS['smarty']->assign('goods', $arr); $output = $GLOBALS['smarty']->fetch('library/cart_info.lbi'); return $output; } /* 代码增加_start By bbs.hongyuvip.com */ /** * 调用三方客服信息 * * @access public * @return string */ function insert_customer_service() { $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('chat_third_customer') . ' ORDER BY cus_type, cus_name'; $rows = $GLOBALS['db']->getAll($sql); $arr = array(); foreach ($rows as $k => $v) { $arr[$k]['cus_id'] = intval($v['cus_id']); $arr[$k]['cus_name'] = htmlspecialchars($v['cus_name']); $arr[$k]['cus_no'] = htmlspecialchars($v['cus_no']); $arr[$k]['cus_type'] = intval($v['cus_type']); $arr[$k]['is_master'] = intval($v['is_master']); } $GLOBALS['smarty']->assign('customer', $arr); $output = $GLOBALS['smarty']->fetch('library/customer_service.lbi'); return $output; } /* 代码增加_end By bbs.hongyuvip.com */ /** * 调用指定广告位的广告 * * @param array $arr 包含 id 和 num * @return string */ function insert_ads($arr) { static $static_res = null; $time = gmtime(); $position_id = intval($arr['id']); $num = isset($arr['num']) ? max(1, min(10, intval($arr['num']))) : 1; if ($num != 1) { $sql = "SELECT a.ad_id, a.position_id, a.media_type, a.ad_link, a.ad_code, a.ad_name, p.ad_width, p.ad_height, p.position_style, RAND() AS rnd " . "FROM " . $GLOBALS['ecs']->table('ad') . " AS a " . "LEFT JOIN " . $GLOBALS['ecs']->table('ad_position') . " AS p ON a.position_id = p.position_id " . "WHERE a.position_id = '$position_id' AND enabled = 1 AND start_time <= '$time' AND end_time >= '$time' " . "ORDER BY rnd LIMIT $num"; $res = $GLOBALS['db']->getAll($sql); } else { if (!isset($static_res[$position_id])) { $sql = "SELECT a.ad_id, a.position_id, a.media_type, a.ad_link, a.ad_code, a.ad_name, p.ad_width, p.ad_height, p.position_style, RAND() AS rnd " . "FROM " . $GLOBALS['ecs']->table('ad') . " AS a " . "LEFT JOIN " . $GLOBALS['ecs']->table('ad_position') . " AS p ON a.position_id = p.position_id " . "WHERE a.position_id = '$position_id' AND enabled = 1 AND start_time <= '$time' AND end_time >= '$time' " . "ORDER BY rnd LIMIT 1"; $static_res[$position_id] = $GLOBALS['db']->getAll($sql); } $res = $static_res[$position_id]; } $ads = array(); $position_style = ''; foreach ($res as $row) { if ($row['position_id'] != $position_id) continue; $position_style = $row['position_style']; switch ($row['media_type']) { case 0: // 图片广告 $src = strpos($row['ad_code'], 'http://') === 0 || strpos($row['ad_code'], 'https://') === 0 ? $row['ad_code'] : DATA_DIR . "/afficheimg/" . $row['ad_code']; $ads[] = "<a href='affiche.php?ad_id={$row['ad_id']}&uri=" . urlencode($row["ad_link"]) . "' target='_blank'>" . "<img src='$src' width='{$row['ad_width']}' height='{$row['ad_height']}' border='0' /></a>"; break; case 1: // Flash $src = strpos($row['ad_code'], 'http://') === 0 || strpos($row['ad_code'], 'https://') === 0 ? $row['ad_code'] : DATA_DIR . "/afficheimg/" . $row['ad_code']; $ads[] = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width='{$row['ad_width']}' height='{$row['ad_height']}'> <param name='movie' value='$src'> <param name='quality' value='high'> <embed src='$src' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='{$row['ad_width']}' height='{$row['ad_height']}'></embed> </object>"; break; case 2: // CODE $ads[] = $row['ad_code']; break; case 3: // TEXT $ads[] = "<a href='affiche.php?ad_id={$row['ad_id']}&uri=" . urlencode($row["ad_link"]) . "' target='_blank'>" . htmlspecialchars($row['ad_code']) . '</a>'; break; } } if (empty($position_style)) { return ''; } $need_cache = $GLOBALS['smarty']->caching; $GLOBALS['smarty']->caching = false; $GLOBALS['smarty']->assign('ads', $ads); $val = $GLOBALS['smarty']->fetch("str:$position_style"); $GLOBALS['smarty']->caching = $need_cache; return $val; } /** * 调用会员信息 * * @access public * @return string */ function insert_member_info() { $need_cache = $GLOBALS['smarty']->caching; $GLOBALS['smarty']->caching = false; if ($_SESSION['user_id'] > 0) { $GLOBALS['smarty']->assign('user_info', get_user_info()); } else { if (!empty($_COOKIE['ECS']['username'])) { $GLOBALS['smarty']->assign('ecs_username', stripslashes($_COOKIE['ECS']['username'])); } $captcha = intval($GLOBALS['_CFG']['captcha']); if (($captcha & CAPTCHA_LOGIN) && ((!($captcha & CAPTCHA_LOGIN_FAIL)) || (($captcha & CAPTCHA_LOGIN_FAIL) && $_SESSION['login_fail'] > 2)) && gd_version() > 0) { $GLOBALS['smarty']->assign('enabled_captcha', 1); $GLOBALS['smarty']->assign('rand', mt_rand()); } } $output = $GLOBALS['smarty']->fetch('library/member_info.lbi'); $GLOBALS['smarty']->caching = $need_cache; return $output; } // 其他函数省略(结构相同),仅列出关键修复点... ?>是要放入下面这段代码吗 if (!function_exists('insert_ads')) { function insert_ads($arr) { global $db, $ecs; $id = intval($arr['id']); $num = intval($arr['num']); if ($id <= 0) return ''; $sql = "SELECT ad_code, ad_link FROM " . $ecs->table('ad') . " WHERE position_id = '$id' AND enabled = 1 " . " ORDER BY sort_order ASC LIMIT $num"; $res = $db->getAll($sql); $str = ''; foreach ($res as $row) { $src = strpos($row['ad_code'], 'http') === 0 ? $row['ad_code'] : '../data/afficheimg/' . $row['ad_code']; $str .= '<a href="' . htmlspecialchars($row['ad_link']) . '" target="_blank"><img src="' . $src . '" border="0" /></a>'; } return $str; } }
11-10
<?php /** * 鸿宇多用户商城 首页文件 * ============================================================================ * 版权所有 2005-2010 鸿宇多用户商城科技有限公司,并保留所有权利。 * 网站地址: http://bbs.hongyuvip.com; * ---------------------------------------------------------------------------- * 仅供学习交流使用,如需商用请购买正版版权。鸿宇不承担任何法律责任。 * 踏踏实实做事,堂堂正正做人。 * ============================================================================ * $Author: liuhui $ * $Id: index.php 17063 2010-03-25 06:35:46Z liuhui $ */ define('IN_ECS', true); require(dirname(__FILE__) . '/includes/init.php'); if ((DEBUG_MODE & 2) != 2) { $smarty->caching = true; } /* 修改 by bbs.hongyuvip.com start */ if (isset($_REQUEST['is_c'])) { $is_c = intval($_REQUEST['is_c']); } if($is_c == 1){ }else { //$ua = strtolower($_SERVER['HTTP_USER_AGENT']); //$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i"; //if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap')) $ua = strtolower($_SERVER['HTTP_USER_AGENT']); $uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i"; $smartuachar = "/(ipad)/i"; //if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap')) if(!(preg_match($smartuachar, $ua)) && ($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap')) { $Loaction = 'mobile/'; if (!empty($Loaction)) { ecs_header("Location: $Loaction\n"); exit; } } /* 修改 by bbs.hongyuvip.com end */ } /*------------------------------------------------------ */ //-- Shopex系统地址转换 /*------------------------------------------------------ */ if (!empty($_GET['gOo'])) { if (!empty($_GET['gcat'])) { /* 商品分类。*/ $Loaction = 'category.php?id=' . $_GET['gcat']; } elseif (!empty($_GET['acat'])) { /* 文章分类。*/ $Loaction = 'article_cat.php?id=' . $_GET['acat']; } elseif (!empty($_GET['goodsid'])) { /* 商品详情。*/ $Loaction = 'goods.php?id=' . $_GET['goodsid']; } elseif (!empty($_GET['articleid'])) { /* 文章详情。*/ $Loaction = 'article.php?id=' . $_GET['articleid']; } if (!empty($Loaction)) { ecs_header("Location: $Loaction\n"); exit; } } //判断是否有ajax请求 $act = !empty($_GET['act']) ? $_GET['act'] : ''; if ($act == 'cat_rec') { $rec_array = array(1 => 'best', 2 => 'new', 3 => 'hot'); $rec_type = !empty($_REQUEST['rec_type']) ? intval($_REQUEST['rec_type']) : '1'; $cat_id = !empty($_REQUEST['cid']) ? intval($_REQUEST['cid']) : '0'; include_once('includes/cls_json.php'); $json = new JSON; $result = array('error' => 0, 'content' => '', 'type' => $rec_type, 'cat_id' => $cat_id); $children = get_children($cat_id); $smarty->assign($rec_array[$rec_type] . '_goods', get_category_recommend_goods($rec_array[$rec_type], $children)); // 推荐商品 $smarty->assign('cat_rec_sign', 1); $result['content'] = $smarty->fetch('library/recommend_' . $rec_array[$rec_type] . '.lbi'); die($json->encode($result)); } /*------------------------------------------------------ */ //-- 判断是否存在缓存,如果存在则调用缓存,反之读取相应内容 /*------------------------------------------------------ */ /* 缓存编号 */ $cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang'])); if (!$smarty->is_cached('index.dwt', $cache_id)) { assign_template(); $position = assign_ur_here(); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 /* meta information */ $smarty->assign('keywords', htmlspecialchars($_CFG['shop_keywords'])); $smarty->assign('description', htmlspecialchars($_CFG['shop_desc'])); $smarty->assign('flash_theme', $_CFG['flash_theme']); // Flash轮播图片模板 $smarty->assign('feed_url', ($_CFG['rewrite'] == 1) ? 'feed.xml' : 'feed.php'); // RSS URL $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 ///llx添加start $smarty->assign('top_goods1', get_top10(16)); $smarty->assign('top_goods2', get_top10(81)); $smarty->assign('top_goods3', get_top10(17)); $smarty->assign('top_goods4', get_top10(93)); ///llx添加end $smarty->assign('best_goods', get_recommend_goods('best')); // 推荐商品 $smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品 $smarty->assign('hot_goods', get_recommend_goods('hot')); // 热点文章 $smarty->assign('promotion_goods', get_promote_goods()); // 特价商品 $smarty->assign('brand_list', get_brands()); $smarty->assign('promotion_info', get_promotion_info()); // 增加一个动态显示所有促销信息的标签栏 $smarty->assign('invoice_list', index_get_invoice_query()); // 发货查询 $smarty->assign('new_articles', index_get_new_articles()); // 最新文章 $smarty->assign('group_buy_goods', index_get_group_buy()); // 团购商品 $smarty->assign('auction_list', index_get_auction()); // 拍卖活动 $smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告 /* 首页主广告设置 */ $smarty->assign('index_ad', $_CFG['index_ad']); if ($_CFG['index_ad'] == 'cus') { $sql = 'SELECT ad_type, content, url FROM ' . $ecs->table("ad_custom") . ' WHERE ad_status = 1'; $ad = $db->getRow($sql, true); $smarty->assign('ad', $ad); } /* links */ $links = index_get_links(); $smarty->assign('img_links', $links['img']); $smarty->assign('txt_links', $links['txt']); $smarty->assign('data_dir', DATA_DIR); // 数据目录 /*jdy add 0816 添加首页幻灯插件*/ $smarty->assign("flash",get_flash_xml()); $smarty->assign('flash_count',count(get_flash_xml())); /* 首页推荐分类 */ $cat_recommend_res = $db->getAll("SELECT c.cat_id, c.cat_name, cr.recommend_type FROM " . $ecs->table("cat_recommend") . " AS cr INNER JOIN " . $ecs->table("category") . " AS c ON cr.cat_id=c.cat_id"); if (!empty($cat_recommend_res)) { $cat_rec_array = array(); foreach($cat_recommend_res as $cat_recommend_data) { $cat_rec[$cat_recommend_data['recommend_type']][] = array('cat_id' => $cat_recommend_data['cat_id'], 'cat_name' => $cat_recommend_data['cat_name']); } $smarty->assign('cat_rec', $cat_rec); } /* 页面中的动态内容 */ assign_dynamic('index'); } //$pro_goods=get_promote_goods(); //echo "<pre>"; //print_r($pro_goods); $sql = "SELECT bonus_code,type_id,send_start_date,send_end_date FROM " .$GLOBALS['ecs']->table('bonus_type') . " WHERE send_type = '4'"; $row = $GLOBALS['db']->GetAll($sql); $time=time(); date_default_timezone_set('PRC'); $smarty->assign('time',$time); $smarty->assign('row',$row); $smarty->display('index.dwt', $cache_id); /*------------------------------------------------------ */ //-- PRIVATE FUNCTIONS /*------------------------------------------------------ */ /** * 调用发货单查询 * * @access private * @return array */ function index_get_invoice_query() { $sql = 'SELECT o.order_sn, o.invoice_no, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' . ' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' . " WHERE invoice_no > '' AND shipping_status = " . SS_SHIPPED . ' ORDER BY shipping_time DESC LIMIT 10'; $all = $GLOBALS['db']->getAll($sql); foreach ($all AS $key => $row) { $plugin = ROOT_PATH . 'includes/modules/shipping/' . $row['shipping_code'] . '.php'; if (file_exists($plugin)) { include_once($plugin); $shipping = new $row['shipping_code']; $all[$key]['invoice_no'] = $shipping->query((string)$row['invoice_no']); } } clearstatcache(); return $all; } /** * 获得最新的文章列表。 * * @access private * @return array */ function index_get_new_articles() { $sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name ' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . ' WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_type = 1' . ' ORDER BY a.article_type DESC, a.add_time DESC LIMIT ' . $GLOBALS['_CFG']['article_number']; $res = $GLOBALS['db']->getAll($sql); $arr = array(); foreach ($res AS $idx => $row) { $arr[$idx]['id'] = $row['article_id']; $arr[$idx]['title'] = $row['title']; $arr[$idx]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ? sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title']; $arr[$idx]['cat_name'] = $row['cat_name']; $arr[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']); $arr[$idx]['url'] = $row['open_type'] != 1 ? build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']); $arr[$idx]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id']), $row['cat_name']); } return $arr; } /** * 获得最新的团购活动 * * @access private * @return array */ function index_get_group_buy() { $time = gmtime(); $limit = get_library_number('group_buy', 'index'); $group_buy_list = array(); if ($limit > 0) { $sql = 'SELECT gb.*,g.*,gb.act_id AS group_buy_id, gb.goods_id, gb.ext_info, gb.goods_name, g.goods_thumb, g.goods_img ' . 'FROM ' . $GLOBALS['ecs']->table('goods_activity') . ' AS gb, ' . $GLOBALS['ecs']->table('goods') . ' AS g ' . "WHERE gb.act_type = '" . GAT_GROUP_BUY . "' " . "AND g.goods_id = gb.goods_id " . "AND gb.start_time <= '" . $time . "' " . "AND gb.end_time >= '" . $time . "' " . "AND g.is_delete = 0 " . "ORDER BY gb.act_id DESC " . "LIMIT $limit" ; $res = $GLOBALS['db']->query($sql); while ($row = $GLOBALS['db']->fetchRow($res)) { /* 如果缩略图为空,使用默认图片 */ $row['goods_img'] = get_image_path($row['goods_id'], $row['goods_img']); $row['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); /* 根据价格阶梯,计算最低价 */ $ext_info = unserialize($row['ext_info']); $price_ladder = $ext_info['price_ladder']; if (!is_array($price_ladder) || empty($price_ladder)) { $row['last_price'] = price_format(0); } else { foreach ($price_ladder AS $amount_price) { $price_ladder[$amount_price['amount']] = $amount_price['price']; } } ksort($price_ladder); $row['last_price'] = price_format(end($price_ladder)); $row['url'] = build_uri('group_buy', array('gbid' => $row['group_buy_id'])); $row['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $row['short_style_name'] = add_style($row['short_name'],''); $stat = group_buy_stat($row['act_id'], $row['deposit']); $row['valid_goods'] = $stat['valid_goods']; $group_buy_list[] = $row; } } return $group_buy_list; } /** * 取得拍卖活动列表 * @return array */ function index_get_auction() { $now = gmtime(); $limit = get_library_number('auction', 'index'); $sql = "SELECT a.act_id, a.goods_id, a.goods_name, a.ext_info, g.goods_thumb ". "FROM " . $GLOBALS['ecs']->table('goods_activity') . " AS a," . $GLOBALS['ecs']->table('goods') . " AS g" . " WHERE a.goods_id = g.goods_id" . " AND a.act_type = '" . GAT_AUCTION . "'" . " AND a.is_finished = 0" . " AND a.start_time <= '$now'" . " AND a.end_time >= '$now'" . " AND g.is_delete = 0" . " ORDER BY a.start_time DESC" . " LIMIT $limit"; $res = $GLOBALS['db']->query($sql); $list = array(); while ($row = $GLOBALS['db']->fetchRow($res)) { $ext_info = unserialize($row['ext_info']); $arr = array_merge($row, $ext_info); $arr['formated_start_price'] = price_format($arr['start_price']); $arr['formated_end_price'] = price_format($arr['end_price']); $arr['thumb'] = get_image_path($row['goods_id'], $row['goods_thumb'], true); $arr['url'] = build_uri('auction', array('auid' => $arr['act_id'])); $arr['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($arr['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $arr['goods_name']; $arr['short_style_name'] = add_style($arr['short_name'],''); $list[] = $arr; } return $list; } /** * 获得所有的友情链接 * * @access private * @return array */ function index_get_links() { $sql = 'SELECT link_logo, link_name, link_url FROM ' . $GLOBALS['ecs']->table('friend_link') . ' ORDER BY show_order'; $res = $GLOBALS['db']->getAll($sql); $links['img'] = $links['txt'] = array(); foreach ($res AS $row) { if (!empty($row['link_logo'])) { $links['img'][] = array('name' => $row['link_name'], 'url' => $row['link_url'], 'logo' => $row['link_logo']); } else { $links['txt'][] = array('name' => $row['link_name'], 'url' => $row['link_url']); } } return $links; } function get_flash_xml() { $flashdb = array(); if (file_exists(ROOT_PATH . DATA_DIR . '/flash_data.xml')) { // 兼容v2.7.0及以前版本 if (!preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"\ssort="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER)) { preg_match_all('/item_url="([^"]+)"\slink="([^"]+)"\stext="([^"]*)"/', file_get_contents(ROOT_PATH . DATA_DIR . '/flash_data.xml'), $t, PREG_SET_ORDER); } if (!empty($t)) { foreach ($t as $key => $val) { $val[4] = isset($val[4]) ? $val[4] : 0; $flashdb[] = array('src'=>$val[1],'url'=>$val[2],'text'=>$val[3],'sort'=>$val[4]); //print_r($flashdb); } } } return $flashdb; } //LLX function get_hot_cat_goods($type = '',$cat_id, $num = 7) { $children = get_children($cat_id); $sql = 'SELECT g.goods_id,g.cat_id, g.goods_name, g.market_price, g.shop_price AS org_price, ' . "IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ". 'g.promote_price, promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img ' . "FROM " . $GLOBALS['ecs']->table('goods') . ' AS g '. "LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ". "ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ". 'WHERE g.is_on_sale = 1 AND g.is_alone_sale = 1 AND g.is_delete = 0' ; switch ($type) { case 'best': $sql .= ' AND is_best = 1'; break; case 'new': $sql .= ' AND is_new = 1'; break; case 'hot': $sql .= ' AND is_hot = 1'; break; case 'promote': $time = gmtime(); $sql .= " AND is_promote = 1 AND promote_start_date <= '$time' AND promote_end_date >= '$time'"; break; } $sql.=' AND (' . $children . 'OR ' . get_extension_goods($children) . ') ' .'ORDER BY g.sort_order, g.goods_id DESC'; if ($num > 0) { $sql .= ' LIMIT ' . $num; } //echo $sql; $res = $GLOBALS['db']->getAll($sql); $goods = array(); foreach ($res AS $idx => $row) { if ($row['promote_price'] > 0) { $promote_price = bargain_price($row['promote_price'], $row['promote_start_date'], $row['promote_end_date']); $goods[$idx]['promote_price'] = $promote_price > 0 ? price_format($promote_price) : ''; } else { $goods[$idx]['promote_price'] = ''; } $temp=$row['cat_id']; $cat_info=get_hot_cat_info($temp); $goods[$idx]['id'] = $row['goods_id']; $goods[$idx]['cat_id'] = $row['cat_id']; $goods[$idx]['cat_name'] = $cat_info['name']; $goods[$idx]['cat_url'] = $cat_info['url']; $goods[$idx]['name'] = $row['goods_name']; $goods[$idx]['brief'] = $row['goods_brief']; $goods[$idx]['market_price'] = price_format($row['market_price']); $goods[$idx]['short_name'] = $GLOBALS['_CFG']['goods_name_length'] > 0 ? sub_str($row['goods_name'], $GLOBALS['_CFG']['goods_name_length']) : $row['goods_name']; $goods[$idx]['shop_price'] = price_format($row['shop_price']); $goods[$idx]['thumb'] = empty($row['goods_thumb']) ? $GLOBALS['_CFG']['no_picture'] : $row['goods_thumb']; $goods[$idx]['goods_img'] = empty($row['goods_img']) ? $GLOBALS['_CFG']['no_picture'] : $row['goods_img']; $goods[$idx]['url'] = build_uri('goods', array('gid' => $row['goods_id']), $row['goods_name']); } return $goods; } function get_hot_cat_info($cat_id) { /* 分类信息 */ $sql = 'SELECT cat_name FROM ' . $GLOBALS['ecs']->table('category') . " WHERE cat_id = '$cat_id'"; $cat['name'] = $GLOBALS['db']->getOne($sql); $cat['url'] = build_uri('category', array('cid' => $cat_id), $cat['name']); $cat['id'] = $cat_id; return $cat; } //LSJ /** * ============================================================================ * 文章自定义数据调用函数 * ============================================================================ */ //取得文章里面的图片 function GetImageSrc($body) { if( !isset($body) ) { return ''; } else { preg_match_all ("/<(img|IMG)(.*)(src|SRC)=[\"|'|]{0,}([h|\/].*(jpg|JPG|gif|GIF|png|PNG))[\"|'|\s]{0,}/isU",$body,$out); return $out[4]; } } //提取文里面的URL function GetArticleUrl($body) { if( !isset($body) ) { return ''; } else { preg_match_all("/<(a|A)(.*)(href|HREF)=[\"|'|](.*)[\"|'|\s]{0,}>(.*)<\/(a|A)>/isU",$body,$out); return $out; } } function get_article_children_new ($cat = 0) { return db_create_in(array_unique(array_merge(array($cat), array_keys(article_cat_list($cat, 0, false)))), 'a.cat_id'); } /** * 按文章ID号/分类ID/商品ID号/商品分类ID号取得文章 * @param array $id 文章ID或文章分类ID * @param string $getwhat 以何种方式取文章其中可选参数有: [1]art_cat(以文章分类ID获取) [2]art_id(以文章ID获取) [3]goods_cat(以商品分类ID获取) [4]goods_id(以商品ID获取) 其中的[3]和[4]必须有商品关联文章或文章关联商品 * @param integer $num 控制显示多少条文章.当参数为0时则全部显示 * @param integer $start 从第几条数据开始取 * @param boolean $isrand 是否随机显示文章(默认为不显示) * @param boolean $showall 是否显示隐藏的文章(黑认为不显示隐藏文章) * @return array */ function get_article_new( $id = array(0), $getwhat = 'art_id', $num = 0, $isrand = false, $showall = true, $start = 0 ) { $sql = ''; $findkey = ''; $search = ''; $wherestr = ''; for( $i=0; $i<count($id); $i++ ) { if( $i<count($id)-1 ) { $findkey .= $id[$i] .','; } else { $findkey .= $id[$i]; } } if( $getwhat == 'art_cat' ){ for( $i=0; $i<count($id); $i++ ) { if( $i<count($id)-1 ) { $search .= get_article_children_new($id[$i]) . ' OR '; } else { $search .= get_article_children_new($id[$i]); } } } elseif($getwhat == 'goods_cat') { for( $i=0; $i<count($id); $i++) { if( $i<count($id)-1 ) { $search .= get_children($id[$i]) . ' OR '; } else { $search .= get_children($id[$i]); } } } elseif( $getwhat == 'art_id' ) { $search = 'a.article_id IN' . '(' . $findkey . ')'; } elseif( $getwhat == 'goods_id' ) { $search = 'g.goods_id IN' . '(' . $findkey . ')'; } $wherestr = '(' . $search . ')'; if( $getwhat == 'art_cat' || $getwhat == 'art_id' ) { $sql = 'SELECT a.*,ac.cat_id,ac.cat_name,ac.keywords as cat_keywords,ac.cat_desc FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . ' WHERE (a.cat_id = ac.cat_id) AND ' . $wherestr; } elseif( $getwhat == 'goods_cat' || $getwhat == 'goods_id' ) { $sql = 'SELECT DISTINCT a.*,ac.cat_id,ac.cat_name,ac.keywords as cat_keywords,ac.cat_desc FROM ' . $GLOBALS['ecs']->table('goods') .' AS g ' . 'LEFT JOIN ' . $GLOBALS['ecs']->table('goods_article') . ' AS ga ON g.goods_id=ga.goods_id INNER JOIN ' . $GLOBALS['ecs']->table('article') . ' AS a ON ga.article_id = a.article_id, ' . $GLOBALS['ecs']->table('article_cat') . 'AS ac ' . 'WHERE (a.cat_id = ac.cat_id) AND ' . $wherestr; } if( ($showall == false) && ( $getwhat == 'art_cat' || $getwhat == 'art_id' ) ) { $sql .= ' AND a.is_open=1'; } elseif( ($showall == false) && ( $getwhat == 'goods_cat' || $getwhat == 'goods_id' ) ) { $sql .= ' AND a.is_open=1'; } if( $isrand == true ) { $sql .= ' ORDER BY rand()'; } elseif( ($isrand == false) && ( $getwhat == 'art_cat' || $getwhat == 'art_id' ) ) { $sql .= ' ORDER BY a.add_time DESC, a.article_id DESC'; } elseif( ($isrand == false) && ( $getwhat == 'goods_cat' || $getwhat == 'goods_id' ) ) { $sql .= ' ORDER BY a.add_time DESC, a.article_id DESC'; } if( $start == 0 && $num>0 ) { $sql .= ' LIMIT ' . $num; } elseif( $start>0 && $num>0 ) { $sql .= ' LIMIT ' . $start . ',' . $num; } //开始查询 $arr = $GLOBALS['db']->getAll($sql); $articles = array(); foreach ($arr AS $id => $row) { $articles[$id]['cat_id'] = $row['cat_id']; $articles[$id]['cat_name'] = $row['cat_name']; $articles[$id]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id'])); $articles[$id]['cat_keywords'] = $row['cat_keywords']; $articles[$id]['cat_desc'] = $row['cat_desc']; $articles[$id]['title'] = $row['title']; $articles[$id]['url'] = build_uri('article', array('aid'=>$row['article_id']), $row['title']); $articles[$id]['author'] = $row['author']; $articles[$id]['content'] = $row['content']; $articles[$id]['keywords'] = $row['keywords']; $articles[$id]['description'] = $row['description']; $articles[$id]['file_url'] = $row['file_url']; $articles[$id]['link'] = $row['link']; $articles[$id]['addtime'] = date($GLOBALS['_CFG']['date_format'], $row['add_time']); $articles[$id]['content'] = $row['content']; $imgsrc = GetImageSrc($row['content']); $articles[$id]['img'] = $imgsrc; //提取文章中所有的图片 $link = GetArticleUrl($row['content']); $articles[$id]['link_url'] = $link[4]; //提取文章中所有的链接地址 $articles[$id]['link_title'] = $link[5]; //提取文章中所有的链接名称 } return $articles; } /* 代码增加_start By bbs.hongyuvip.com */ make_html(); /* 代码增加_end By bbs.hongyuvip.com */ ?> 检查下 下面这个出在哪里了 554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:1:"1";s:3:"num";s:1:"1";}554fcae493e564ee0dc75bdf2ebf94ca554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:1:"2";s:3:"num";s:1:"1";}554fcae493e564ee0dc75bdf2ebf94ca554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:1:"3";s:3:"num";s:1:"1";}554fcae493e564ee0dc75bdf2ebf94ca554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:1:"4";s:3:"num";s:1:"1";}554fcae493e564ee0dc75bdf2ebf94ca554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:1:"5";s:3:"num";s:1:"1";}554fcae493e564ee0dc75bdf2ebf94ca 热门品牌 554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:21:"$this->_var['ads_id']";s:3:"num";s:22:"$this->_var['ads_num']";}554fcae493e564ee0dc75bdf2ebf94ca 554fcae493e564ee0dc75bdf2ebf94casupplier_list|a:1:{s:4:"name";s:13:"supplier_list";}554fcae493e564ee0dc75bdf2ebf94ca 554fcae493e564ee0dc75bdf2ebf94caads|a:3:{s:4:"name";s:3:"ads";s:2:"id";s:21:"$this->_var['ads_id']";s:3:"num";s:22:"$this->_var['ads_num']";}554fcae493e564e
11-10
# # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/kernel.mk include $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/device_info.config define mkcmdline $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3)) endef define Build/Fs/squashfs-64k $(CP) -f $1 $1.raw $(STAGING_DIR_HOST)/bin/padjffs2 $1 64 dd if=$1 of=$1-64k bs=128k conv=sync endef define Build/Fs/Attr define Build/Fs/general $$(call Build/Fs/$$(1)-$(1),$$(2)) endef endef define Build_fw_dir/File_Init $(call Build/Fs/general,$1,$(KDIR)/root.$1) find $(BIN_DIR)/build_fw_dir/* | grep -v '\(device_info\)' | xargs -i rm -rf {} $(CP) $(STAGING_DIR)/mini_compile/*.bin $(BIN_DIR)/build_fw_dir/ $(CP) $(STAGING_DIR_HOST)/include/device_info $(BIN_DIR)/build_fw_dir/ $(call SAFE_COPY,$(KDIR)/uImage.xz,partition_export_kernel_name) $(call SAFE_COPY,$(KDIR)/root.$1-64k,partition_export_rootfs_name) $(call SAFE_COPY,$(BIN_DIR)/build_fw_dir/appfs_uc.bin,partition_export_appfs_uc_name) cd $(BIN_DIR)/build_fw_dir;echo 7777777 > empty.bin mkdir -p $(BIN_DIR)/isp_config # 添加json检查 $(TOPDIR)/scripts/json_check.sh $(BUILD_DIR)/root*/etc/default $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/isp_config/ cd $(BIN_DIR)/build_fw_dir; \ $(STAGING_DIR_HOST)/bin/mkslpfw_dynamic \ --build_extfw \ --build_extfw_out $(BIN_DIR) \ --factory_info_out $(partition_export_fac_info_name) \ --isp_partition $(partition_export_isp_name) \ --version $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/version.config \ --deviceinfo $(BIN_DIR)/build_fw_dir/device_info \ --buildroot $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/buildroot.config \ --prConf $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME) \ --extFwFile $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/ext_fw.config \ --fwListFile $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/firmware.config; \ ifneq ($(partition_export_isp_name),isp) mv ./isp.bin $(partition_export_isp_name).bin endif cd $(BIN_DIR)/build_fw_dir; \ $(STAGING_DIR_HOST)/bin/mkslpfw_dynamic \ --table_name $(partition_export_tpheader_name) \ --boot_uboot $(partition_export_uboot_name) \ --boot_kernel $(partition_export_kernel_name) \ --build_fw \ --build_extfw_out $(BIN_DIR) rm -rf $(BIN_DIR)/order_dynamic*.txt cd $(BIN_DIR)/build_fw_dir;make -f $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/device_info.config $(BIN_DIR)/order_dynamic.txt cd $(BIN_DIR)/build_fw_dir;cat firmware_name.txt |xargs -i mv ../{}_p8k.bin ../{}_flash_padded.bin; cd $(BIN_DIR)/build_fw_dir;cat firmware_name.txt |xargs -i rm -rf ../partition_p8k.bin endef define Image/Build mkdir -p $(BIN_DIR)/build_fw_dir $(SCRIPT_DIR)/nvt_build_isp_pre $(T_PRODUCT_CONFIG_DIR)/$(PR_NAME)/isp_config $(call Build_fw_dir/File_Init,$1) endef #配置不同属性的根文件系统 $(eval $(call Build/Fs/Attr,64k)) 他是怎么检查json的,该怎么过滤掉对spdy48的检查
10-24
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值