独立页页怎么调用菜单和底部的内容啊;;

2016-07-07 15:14 来源:www.chinab4c.com 作者:ecshop专家

  1. <?php

  2. define('IN_ECS', true);

  3. require(dirname(__FILE__) . '/includes/init.php');

  4. $smarty->assign('group_buy_goods', index_get_group_buyex());

  5. $smarty->display("time.dwt");

  6. function index_get_group_buyex( )
  7. {
  8. $time = gmtime( );

  9. $sql = "SELECT gb.act_id AS group_buy_id, gb.goods_id, gb.ext_info, gb.goods_name,gb.end_time, g.goods_thumb,g.market_price, g.goods_img, gb.act_desc 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 40" );
  10. $res = $GLOBALS['db']->query( $sql );
  11. while ( $row = $GLOBALS['db']->fetchRow( $res ) )
  12. {
  13. $row['market_price_no_format'] = $row['market_price'];
  14. $row['goods_img'] = get_image_path( $row['goods_id'], $row['goods_img'] );
  15. $row['thumb'] = get_image_path( $row['goods_id'], $row['goods_thumb'], TRUE );
  16. $ext_info = unserialize( $row['ext_info'] );
  17. $row = array_merge( $row, $ext_info );
  18. $price_ladder = $ext_info['price_ladder'];
  19. if ( !is_array( $price_ladder ) && empty( $price_ladder ) )
  20. {
  21. $row['last_price'] = price_format( 0 );
  22. }
  23. else
  24. {
  25. foreach ( $price_ladder as $amount_price )
  26. {
  27. $price_ladder[$amount_price['amount']] = $amount_price['price'];
  28. }
  29. }
  30. ksort( $price_ladder );
  31. $row['last_price_no_format'] = end( $price_ladder );
  32. $row['last_price'] = price_format( end( $price_ladder ) );
  33. $stat = group_buy_stat( $row['group_buy_id'], $row['deposit'] );
  34. $row['valid_order'] = $stat['valid_order'];
  35. $row['url'] = build_uri( "group_buy", array(
  36. "gbid" => $row['group_buy_id']
  37. ) );
  38. $row['short_name'] = 0 < $GLOBALS['_CFG']['goods_name_length'] ? sub_str( $row['goods_name'], $GLOBALS['_CFG']['goods_name_length'] ) : $row['goods_name'];
  39. $row['short_style_name'] = add_style( $row['short_name'], "" );
  40. $row['market_price'] = price_format( $row['market_price'] );
  41. $row['end_time'] = $row['end_time'];
  42. $group_buy_list[] = $row;
  43. }

  44. return $group_buy_list;
  45. }
  46. function get_goods_saving( $price, $market_price )
  47. {
  48. $total = array( "saving" => 0, "save_rate" => 0 );
  49. $total['saving'] = $market_price - $price;
  50. $total['save_rate'] = $market_price != 0 ? round( $price / $market_price, 2 ) * 10 : 0;
  51. return $total;
  52. }
复制代码
这是别人做的一个独立的团购列表页,,,调用头部和底部信息时都不显示,,头部的不显示菜单,,,底部的什么内容也不显示,,要怎么改 能让他调用出底部信息啊,,

高手们帮帮忙;;;;

回答:
把公共的程序包含进去。。。。。。page_headerpage_footer

把公共的程序包含进去。。。。。。page_headerpage_footer
netaxcess 发表于 2012-8-2 20:54


什么是公共程序啊,要怎么加上去啊,,我在基他页面上搜索page_headerpage_footer 也没看到有这个代码啊,,,不懂程序不知道要怎么改啊;;

在你的模板文件中找到time.dwt,打开time.dwt在<body>下面添加:
<!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem -->

在</body>上面添加:<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->

具体可以参考一下你模板文件index.dwt

楼主,你程序文件是新建的,除了4、5楼说的修改模板,你还需要参照系统原有的程序文件,修改你新建的php文件,保证 $smarty->assign 读取上你所要的信息。

还有,如果功能够用,只是想更改外观,就别动程序文件,只修改模板就好了。。。。