第1步 在index.php 约147行 1 $smarty->assign('data_dir', DATA_DIR); // 数据目录 下面增加: | |
1 //字母索引 begin 2 //热门分类 3 $sqlhot= 'SELECT * FROM ' . $GLOBALS['ecs']->table('category').' where sort_order < "50" order by cat_name'; 4 $cathot_array = $GLOBALS['db']->getall($sqlhot); 5 foreach ($cathot_array AS $row=>$hot){$showhot .= "<span><a href='category.php?id=$hot[cat_id]' style=\"color:#00509f;text-decoration:none\">$hot[cat_name]</a> </span>";} 6 $smarty->assign("showhot",$showhot); 7 8 //字母索引分类 9 //取分类字符串首字母函数. 10 function getFirstLetter($str){ 11 $fchar = ord($str{0}); 12 if($fchar >= ord("A") and $fchar <= ord("z") )return strtoupper($str{0}); 13 $s1 = iconv("UTF-8","gb2312", $str); 14 $s2 = iconv("gb2312","UTF-8", $s1); 15 if($s2 == $str){$s = $s1;} 16 else{$s = $str;} 17 $asc = ord($s{0}) * 256 + ord($s{1}) - 65536; 18 if($asc >= -20319 and $asc <= -20284) return "A"; 19 if($asc >= -20283 and $asc <= -19776) return "B"; 20 if($asc >= -19775 and $asc <= -19219) return "C"; 21 if($asc >= -19218 and $asc <= -18711) return "D"; 22 if($asc >= -18710 and $asc <= -18527) return "E"; 23 if($asc >= -18526 and $asc <= -18240) return "F"; 24 if($asc >= -18239 and $asc <= -17923) return "G"; 25 if($asc >= -17922 and $asc <= -17418) return "I"; 26 if($asc >= -17417 and $asc <= -16475) return "J"; 27 if($asc >= -16474 and $asc <= -16213) return "K"; 28 if($asc >= -16212 and $asc <= -15641) return "L"; 29 if($asc >= -15640 and $asc <= -15166) return "M"; 30 if($asc >= -15165 and $asc <= -14923) return "N"; 31 if($asc >= -14922 and $asc <= -14915) return "O"; 32 if($asc >= -14914 and $asc <= -14631) return "P"; 33 if($asc >= -14630 and $asc <= -14150) return "Q"; 34 if($asc >= -14149 and $asc <= -14091) return "R"; 35 if($asc >= -14090 and $asc <= -13319) return "S"; 36 if($asc >= -13318 and $asc <= -12839) return "T"; 37 if($asc >= -12838 and $asc <= -12557) return "W"; 38 if($asc >= -12556 and $asc <= -11848) return "X"; 39 if($asc >= -11847 and $asc <= -11056) return "Y"; 40 if($asc >= -11055 and $asc <= -10247) return "Z"; 41 return null; 42 } 43 //取得 栏目ID 27(热门游戏栏目)下的所有子分类 44 $sql2 = 'SELECT * FROM ' . $GLOBALS['ecs']->table('category').' where parent_id = "27" order by cat_name'; 45 $cat_array = $GLOBALS['db']->getall($sql2); 46 $cat_list = array(); 47 for($i=0;$i<count($cat_array);$i++) 48 { $cat_list[getFirstLetter($cat_array[$i]['cat_name'])][$cat_array[$i]['cat_id']] = $cat_array[$i]['cat_name']."-".$cat_array[$i]['cat_id']; 49 } 50 $cat_list2 =Array ("A" => Array (),"B" => Array (),"C" => Array (),"D" => Array (),"E" => Array (),"F" => Array (),"G" => Array (),"H" => Array (),"I" => Array (),"J" => Array (),"K" => Array (),"L" => Array (),"M" => Array (),"N" => Array (),"O" => Array (),"P" => Array (),"Q" => Array (),"R" => Array (),"S" => Array (),"T" => Array (),"W" => Array (),"X" => Array (),"Y" => Array (),"Z" => Array ()); 51 $cat_list=array_merge_recursive($cat_list2,$cat_list); 52 53 $a=1;//初始化tabID 54 foreach ($cat_list AS $row=>$idx){ 55 $a++; 56 $show .="<div id='con_two_$a' style='DISPLAY: none'>"; 57 58 foreach($idx AS $row2=>$idx2) 59 { 60 61 $idx2 = explode('-',$idx2); 62 $show .= "<span><a href='category.php?id=$idx2[1]' style=\"color:#00509f;text-decoration:none\">$idx2[0]</a> </span>"; 63 } 64 $show .="</div>"; 65 } 66 $smarty->assign("show",$show); 67 //字母索引 end |
|
1 |
<!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem --> |
1 |
<!-- #BeginLibraryItem "/library/zimu.lbi" --><!-- #EndLibraryItem --> |
1 |
{insert_scripts files='common.js,index.js'} |
1 |
<script type="text/javascript">function setTab(name,cursel,n){for(i=1;i<=n;i++){var menu=document.getElementById(name+i);var con=document.getElementById("con_"+name+"_"+i);menu.className=i==cursel?"hover":"";con.style.display=i==cursel?"block":"none";}}</script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <div class="game"> <div class="right" id="Tab2"> <div class="Menubox"> <ul> <li class="hover" id="two1" onclick="setTab('two',1,25)" style="width:65px">热门点卡</li> <li id="two2" onclick="setTab('two',2,25)">A</li> <li id="two3" onclick="setTab('two',3,25)">B</li> <li id="two4" onclick="setTab('two',4,25)">C</li> <li id="two5" onclick="setTab('two',5,25)">D</li> <li id="two6" onclick="setTab('two',6,25)">E</li> <li id="two7" onclick="setTab('two',7,25)">F</li> <li id="two8" onclick="setTab('two',8,25)">G</li> <li id="two9" onclick="setTab('two',9,25)">H</li> <li id="two10" onclick="setTab('two',10,25)">I</li> <li id="two11" onclick="setTab('two',11,25)">J</li> <li id="two12" onclick="setTab('two',12,25)">K</li> <li id="two13" onclick="setTab('two',13,25)">L</li> <li id="two14" onclick="setTab('two',14,25)">M</li> <li id="two15" onclick="setTab('two',15,25)">N</li> <li id="two16" onclick="setTab('two',16,25)">O</li> <li id="two17" onclick="setTab('two',17,25)">P</li> <li id="two18" onclick="setTab('two',18,25)">Q</li> <li id="two19" onclick="setTab('two',19,25)">R</li> <li id="two20" onclick="setTab('two',20,25)">S</li> <li id="two21" onclick="setTab('two',21,25)">T</li> <li id="two22" onclick="setTab('two',22,25)">W</li> <li id="two23" onclick="setTab('two',23,25)">X</li> <li id="two24" onclick="setTab('two',24,25)">Y</li> <li id="two25" onclick="setTab('two',25,25)">Z</li> <li id="two26" onclick="document.location.href="/game.php"" style="float:right; width:30px">全部</li> </ul> </div> <div class="Contentbox"> <div id="con_two_1"> {$showhot} </div> {$show} </div> </div> </div> <div class="clear"></div>
很多时候 ecshop 分类页的品牌都是以名称的形式显示的,下面就解析 ecshop 如何实现商品列表页... 有时候我们安装了 或是修改了某些程序文件,导致了后台的商品列表、会员列表、广告列表等... {foreach},{foreachelse} {foreach} 用于像循环访问一个数字索引数组一样循环访问一个关联数组,与仅... 熟悉 都知道, ECSHOP 是有缓存机制的。 ECSHOP 的缓存机制从一定程度上可以减少 ECSHOP 反复读取... 1 、 include/lib_order.php 去掉函数 check_consignee_info 第 1577 行 “!empty($consignee['email']) ” 这句。 2... 打开 /includes/lib_base.php 文件 找到 (大概在代码62-66行) if ($append $str != $newstr) { $newstr .= ...; ... |