{"id":59368,"date":"2025-04-23T11:18:11","date_gmt":"2025-04-23T03:18:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/59368\/"},"modified":"2025-04-23T11:18:11","modified_gmt":"2025-04-23T03:18:11","slug":"ecshop%e7%9a%84%e9%a6%96%e9%a1%b5%e4%b8%bb%e5%b9%bf%e5%91%8a%e8%bd%ae%e6%92%ad%e6%9b%bf%e6%8d%a2%e4%b8%bajs%e7%bf%bb%e8%bd%ac%e6%95%88%e6%9e%9c%e5%a5%bd%e6%a8%a1%e6%9d%bf%e6%96%b9%e6%b3%95%e4%ba%8c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/59368\/","title":{"rendered":"ecshop\u7684\u9996\u9875\u4e3b\u5e7f\u544a\u8f6e\u64ad\u66ff\u6362\u4e3ajs\u7ffb\u8f6c\u6548\u679c,\u597d\u6a21\u677f\u65b9\u6cd5\u4e8c"},"content":{"rendered":"<p>&nbsp;\u627e\u5230ecshop \u7a0b\u5e8f\uff0c\u6253\u5f00\u6a21\u677findex_ad.lbi,\u8f93\u5165\u6216\u66ff\u6362\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=utf-8&#8243;&gt;<\/p>\n<p>&lt;!&#8211; {if $index_ad eq &#8216;sys&#8217;} &#8211;&gt;<\/p>\n<p>&nbsp; &lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n<p>&nbsp; &nbsp;var swf_width=725;<\/p>\n<p>&nbsp; &nbsp;var swf_height=300;<\/p>\n<p>&nbsp; &lt;\/script&gt;<\/p>\n<p>&nbsp; &lt;script type=&#8221;text\/javascript&#8221; src=&#8221;data\/flashdata\/{$flash_theme}\/cycle_image.js&#8221;&gt;&lt;\/script&gt;<\/p>\n<p>&lt;!&#8211; {elseif $index_ad eq &#8216;cus&#8217;} &#8211;&gt;<\/p>\n<p>&lt;?php<\/p>\n<p>&nbsp;<\/p>\n<p>if(!function_exists(&#8220;get_ads&#8221;)){<\/p>\n<p>function get_ads($num)<\/p>\n<p>{<\/p>\n<p><span> <\/span>$sql = &#8216;select * from &#8216;.$GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;ad_custom&#8217;).&#8217; ORDER BY add_time DESC&#8217;;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; if ($num &gt; 0)<\/p>\n<p>&nbsp; {<\/p>\n<p>&nbsp; &nbsp;$sql .= &#8216; LIMIT &#8216; . $num;<\/p>\n<p>&nbsp; }<\/p>\n<p>&nbsp; \/\/echo $sql;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/p>\n<p>&nbsp; $res = $GLOBALS[&#8216;db&#8217;]-&gt;getAll($sql);<\/p>\n<p>&nbsp; $ads = array();<\/p>\n<p>&nbsp; foreach ($res AS $idx =&gt; $row)<\/p>\n<p>&nbsp; {<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; &nbsp;$ads[$idx][&#8216;ad_name&#8217;] &nbsp; &nbsp; &nbsp; = $row[&#8216;ad_name&#8217;];<\/p>\n<p>&nbsp; &nbsp;$ads[$idx][&#8216;content&#8217;] &nbsp; &nbsp; &nbsp; &nbsp; = $row[&#8216;content&#8217;];<\/p>\n<p>&nbsp; &nbsp;$ads[$idx][&#8216;url&#8217;] &nbsp; &nbsp; &nbsp; &nbsp;= $row[&#8216;url&#8217;];<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp; }<\/p>\n<p>&nbsp; return $ads;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;$this-&gt;assign(&#8216;my_ads&#8217;,get_ads(9)); \/\/ 9\u4ee3\u8868\u4f1a\u6761\u6570\u636e<\/p>\n<p>?&gt;<\/p>\n<p>&nbsp; &lt;!&#8211; nav middle right ad box &nbsp;div end &#8211;&gt;<\/p>\n<p>&nbsp; &lt;div class=&#8221;nav_leftbox&#8221;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; nav left box menu div start &#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;div class=&#8221;nav_leftmenu&#8221;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{foreach from=$my_ads item=ads name=ad_num}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration le 5}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;span id=&#8221;leftmenu_content{$smarty.foreach.ad_num.iteration}&#8221;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration eq 1}&#8211;&gt; style=&#8221;display:block&#8221;&lt;!&#8211; {\/if}&#8211;&gt;&gt;&lt;a href=&#8221;{$ads.url}&#8221; target=&#8221;_blank&#8221; title=&#8221;{$ads.ad_name}&#8221;&gt;&lt;img src=&#8221;{$ads.content}&#8221; \/&gt;&lt;\/a&gt;&lt;\/span&gt;&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;!&#8211; {\/if}&#8211;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{\/foreach}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;div class=&#8221;nav_lefttab&#8221;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{foreach from=$my_ads item=ads name=ad_num}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration le 5}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;a id=&#8221;leftmenu_tab{$smarty.foreach.ad_num.iteration}&#8221;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration eq 1}&#8211;&gt; class=&#8221;thisselected&#8221;&lt;!&#8211; {\/if}&#8211;&gt; href=&#8221;{$ads.url}&#8221; target=&#8221;_blank&#8221; onmouseover=&#8221;chooseLeftMenu({$smarty.foreach.ad_num.iteration})&#8221;&gt;&lt;font color=&#8221;white&#8221;&gt;{$ads.ad_name}&lt;\/font&gt;&lt;\/a&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;!&#8211; {\/if}&#8211;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{\/foreach}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &lt;!&#8211; nav left box menu div end &#8211;&gt;<\/p>\n<p>&lt;script&gt;<\/p>\n<p>function chooseLeftMenu(id){<\/p>\n<p>&nbsp; &nbsp; for (var i = 1; i &lt;= 5; i++){<\/p>\n<p><span> <\/span> &nbsp; &nbsp;if (i == id){<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_tab&#8217;+i).className = &#8216;thisselected&#8217;;<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_content&#8217;+i).fade(&#8216;in&#8217;);<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_content&#8217;+i).style.display = &#8216;block&#8217;;<\/p>\n<p><span> <\/span> &nbsp; &nbsp;}else{<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_tab&#8217;+i).removeClass(&#8216;thisselected&#8217;);<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_content&#8217;+i).fade(&#8216;out&#8217;);<\/p>\n<p><span> <\/span> &nbsp; &nbsp; &nbsp; &nbsp;$(&#8216;leftmenu_content&#8217;+i).style.display = &#8216;none&#8217;;<\/p>\n<p><span> <\/span> &nbsp; &nbsp;}<\/p>\n<p><span> <\/span>}<\/p>\n<p>}<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&nbsp; &lt;div class=&#8221;nav_middlebox&#8221;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; nav middle focus box &nbsp;div start &#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;div id=&#8221;f_a&#8221; class=&#8221;focusimg&#8221;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{foreach from=$my_ads item=ads name=ad_num}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration ge 6}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;!&#8211; {if $smarty.foreach.ad_num.iteration eq 6}&#8211;&gt;&lt;div style=&#8221;display:block;&#8221;&gt;&lt;!&#8211; {else}&#8211;&gt;&lt;div style=&#8221;display:none;&#8221;&gt;&lt;!&#8211; {\/if}&#8211;&gt;&lt;a target=&#8221;_blank&#8221; href=&#8221;{$ads.url}&#8221;&gt;&lt;img border=&#8221;0&#8243; onmouseout=&#8221;setAuto();&#8221; onmouseover=&#8221;clearAuto();&#8221; src=&#8221;{$ads.content}&#8221;\/&gt;&lt;\/a&gt;&lt;\/div&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;!&#8211; {\/if}&#8211;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211;{\/foreach}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;div class=&#8221;focusimg_number&#8221;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&#8221;1&#8243; cellpadding=&#8221;0&#8243; border=&#8221;0&#8243; align=&#8221;right&#8221; id=&#8221;num_tag&#8221; height=&#8221;30&#8243;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<\/p>\n<p>&lt;!&#8211;{foreach from=$my_ads item=ads name=ad_num}&#8211;&gt;<\/p>\n<p>&nbsp;&lt;!&#8211; {if $smarty.foreach.ad_num.iteration ge 6}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; {if $smarty.foreach.ad_num.iteration eq 6}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;center&#8221; width=&#8221;130&#8243; style=&#8221;cursor:pointer;&#8221; onmouseout=&#8221;setAuto();&#8221; onmouseover=&#8221;clearAuto(0);&#8221; onclick=&#8221;Mea(0);&#8221; class=&#8221;bigon&#8221;&gt;{$ads.ad_name}&lt;\/td&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; {elseif $smarty.foreach.ad_num.iteration eq 7}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;center&#8221; width=&#8221;130&#8243; style=&#8221;cursor:pointer;&#8221; onmouseout=&#8221;setAuto();&#8221; onmouseover=&#8221;clearAuto(1);&#8221; onclick=&#8221;Mea(1);&#8221; class=&#8221;bigoff&#8221;&gt;{$ads.ad_name}&lt;\/td&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; {elseif $smarty.foreach.ad_num.iteration eq 8}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;center&#8221; width=&#8221;130&#8243; style=&#8221;cursor:pointer;&#8221; onmouseout=&#8221;setAuto();&#8221; onmouseover=&#8221;clearAuto(2);&#8221; onclick=&#8221;Mea(2);&#8221; class=&#8221;bigoff&#8221;&gt;{$ads.ad_name}&lt;\/td&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; {else}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;center&#8221; width=&#8221;130&#8243; style=&#8221;cursor:pointer;&#8221; onmouseout=&#8221;setAuto();&#8221; onmouseover=&#8221;clearAuto(3);&#8221; onclick=&#8221;Mea(3);&#8221; class=&#8221;bigoff&#8221;&gt;{$ads.ad_name}&lt;\/td&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;!&#8211; {\/if}&#8211;&gt;<\/p>\n<p>&nbsp; &lt;!&#8211; {\/if}&#8211;&gt;<\/p>\n<p>&lt;!&#8211;{\/foreach}&#8211;&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &lt;\/div&gt;<\/p>\n<p>&nbsp; &lt;!&#8211; nav middle focus box &nbsp;div end &#8211;&gt;<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;var n=0;var t=4;var showNum=document.getElementById(&#8220;num_tag&#8221;); function Mea(value){n=value;setBg(value);plays(value);} function setBg(value){for(var i=0;i&lt;t;i++)if(value==i){showNum.getElementsByTagName(&#8220;td&#8221;)[i].className=&#8217;bigon&#8217;;}else{showNum.getElementsByTagName(&#8220;td&#8221;)[i].className=&#8217;bigoff&#8217;;}} function plays(value){try{with(f_a){children[value].getElementsByTagName(&#8220;img&#8221;)[0].filters[0].Apply();for(i=0;i&lt;t;i++)i==value?children[i].style.display=&#8221;block&#8221;:children[i].style.display=&#8221;none&#8221;;children[value].getElementsByTagName(&#8220;img&#8221;)[0].filters[0].Play();}}catch(e){var divlist=document.getElementById(&#8220;f_a&#8221;).getElementsByTagName(&#8220;div&#8221;);for(i=0;i&lt;t;i++){i==value?divlist[i].style.display=&#8221;block&#8221;:divlist[i].style.display=&#8221;none&#8221;;}}} function clearAuto(k){clearInterval(autoStart);if(k != null)Mea(k);}function setAuto(){autoStart=setInterval(&#8220;auto(n)&#8221;, 5000);}function auto(){n++;if(n&gt;t-1)n=0;Mea(n);}function sub(){n&#8211;;if(n&lt;0)n=t-1;Mea(n);} setAuto();&lt;\/script&gt;<\/p>\n<p>&lt;!&#8211; {\/if} &#8211;&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u91cc\u52a0\u4e86\u4e2a\u51fd\u6570&nbsp;get_ads\uff0c\u8c03\u7528\u540e\u53f0\u81ea\u5b9a\u4e49\u5e7f\u544azuimoban<i>_ad_custom\u8868<\/i>\uff0c\u5177\u4f53\u957f\u9ad8\u5ea6\u81ea\u884c\u66ff\u6362\uff01\u597d\u6a21\u677f\u63d0\u4f9b\uff01<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;\u627e\u5230ecshop \u7a0b\u5e8f\uff0c\u6253\u5f00\u6a21\u677findex_ad.lbi,\u8f93\u5165\u6216\u66ff\u6362\u4ee5\u4e0b\u4ee3\u7801\uff1a &nbsp; &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=utf-8&#8243;&gt; &lt;!&#8211; {if $index_ad eq &#8216;sys&#8217;} &#8211;&gt; &nbsp; &lt;script type=&#8221;text\/javascript&#8221;&gt; &nbsp; &nbsp;var swf_width=725; &nbsp; &nbsp;var swf_height=300; &nbsp; &lt;\/script&gt; &nbsp; &lt;script type=&#8221;text\/javascript&#8221; src=&#8221;data\/flashdata\/{$flash_theme}\/cycle_image.js&#8221;&gt;&lt;\/script&gt; &lt;!&#8211; {elseif $index_ad eq &#8216;cus&#8217;} &#8211;&gt; &lt;?php &nbsp; if(!function_exists(&#8220;get_ads&#8221;)){ function get_ads($num) { $sql = &#8216;select * from &#8216;.$GLOBALS[&#8216;ecs&#8217;]-&gt;table(&#8216;ad_custom&#8217;).&#8217; ORDER BY add_time DESC&#8217;; &nbsp; &nbsp; if ($num &gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-59368","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=59368"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/59368\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=59368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=59368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=59368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}