How to replace Flash carousel with Ecshop Home primary ad bit with JS Carousel

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.