Turn the--http://www.ecshoptemplate.com/article-1710.html
This ecshop is very common, because now compared to flash difficult to modify, JS more in line with people's usage habits, and the default ecshop or Flash to do, this is very bad, the following say how to modify
Step One: index.php add a method to invoke the XML file; function Get_flash_xml ()
function Get_flash_xml ()
{
$flashdb = Array ();
if (File_exists (Root_path. Data_dir. '/flash_data.xml '))
{
Compatible with v2.7.0 and previous versions
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;
}
Step Two:
Find $smarty->assign (' Shop_notice ', $_cfg[' Shop_notice ') in index.php; Shop Announcements
Add the following
/*jdy Add 0816 adds the home slide plugin */$smarty->assign ("Flash", Get_flash_xml ());
$smarty->assign (' Flash_count ', Count (Get_flash_xml ()));
Third:
The loop will be called in the Index_ad.lbi.
<!--{foreach from= $flash name=myflash item=flash}--> <li><a href= "{$flash. URL}" target=_blank>< IMG height=425 src= "{$flash. src}" width=734></a> </LI> <!--{/foreach}-->
Finally, the JS effect can be found on the Internet itself, the use of cyclic call data can be, but not with jquery JS, otherwise, and Ecshop conflict.
Upload an attachment to you. There is a JS effect inside.
(go) How to replace Flash carousel with Ecshop Home primary ad bit with JS Carousel