Phpcms V9 AD module cycle call AD Carousel (first ad with last ad style)

Source: Internet
Author: User

Let's take a look at the blinds ad list:

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/9B/B0/wKioL1ll6BGB6ohFAADRVJGNF8Y016.jpg-wh_500x0-wm_ 3-wmp_4-s_1431726707.jpg "title=" qq20170712171149.jpg "alt=" Wkiol1ll6bgb6ohfaadrvjgnf8y016.jpg-wh_50 "/>

Take a look at the HTML code section:

<div class= "Flash4"  style= "margin-top: 50px" >                   <ul>                   <li class= "First"   Style= "width: 538px;" >            <div class= "ImgTop" > </div>             <div class= "Imgcen"  style= "display: block;" > New category </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > New category </p><p class= "Bt_2"   Style= "display: block;"><span> Shock coming </span></p></a></div>         </li>             <li  Style= "width: 107px;" >        <div class= "Imgtop" ></div>            < div class= "Imgcen"  style= "display: none;" > Original category </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > Original category </p><p class= "Bt_2"   Style= "display: none;" ><span> Original Category </span></p></a></div>         </li> &nbSp;           <li style= "width: 107px;" >        <div class= "Imgtop" ></div>            < div class= "Imgcen"  style= "display: none;" > Import Classification </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > Import category </p><p class= "Bt_2"   Style= "display: none;" ><span> Import Classification </span></p></a></div>         </li>             <li  Style= "width: 107px;" >         <div class= "Imgtop" ></ Div>            <div class= "ImgCen"  style= "display: none;" > Spot Classification </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > Spot category </p><p class= "Bt_2"   Style= "display: none;" ><span> Spot Classification </span></p></a></div>         </li>             <li  Style= "width: 107px;" >        <div class= "Imgtop" ></div>             <div class= "Imgcen"  style= "display:  none; " > Light Luxury category </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > Light luxury category </p><p class= "Bt_2"   Style= "display: none;" ><span> Light Luxury Category </span></p></a></div>         </li>             <li  Style= "width: 107px;" >        <div class= "Imgtop" > Custom Classification </div>            <div class = "Imgbot" ><a href= "#" ><p class= "bt_1" > Custom classification </p><p class= "Bt_2"   Style= "display: none;" ><span></span></p></a></div>         </li>             <li class= " Fast " style=" width: 107px; " >        <div class= "Imgtop" ></div>            < div class= "Imgcen"  style= "display: none;" > Other Categories </div>            <div class= "ImgBot" ><a href= "#" ><p class= "Bt_1" > Other categories </p><p class= "Bt_2"  style= "display: none;" ><span></span></p></a></div>         </li>                   </ul>             </div >


Look at the label call:

      {pc:content  action= "Ads"  spaceid= " order=" Listorder asc " num=" 7 "}            < ul>     {php  $a = 0;}         {loop  $data   $r}{php  $a + +;}      <li {if  $a ==1}class= "first" {elseif  $a ==7}class= "Fast" {/if}>         <div class= "Imgtop" ></div>             <div class= "ImgCen" >{$r [' title ']} </div>            <div class= "ImgBot "><a href=" {$r [' url ']} "><p class=" bt_1 ">{$r [' title ']}</p><p class= "Bt_2" ><span>{$r [' Alt ']}</span></p></a></div>         </li>        {/loop}           </ul>          &NBSP;&NBSP;{/PC}


Here spaceid= "12", 12 is my ad here for ID,

Here's the {PHP $a = 0;} {Loop $data $r} {PHP $a + +;} To do the increment loop no other meaning, as is 7 ads by 1-7 sort output, here we can use if to determine the first ad in 1-7 ads and the last ad style, do not need to output $ A. When $a==1 is the first advertisement, when $a==7 is the last advertisement.


The following {$r [' ImageUrl '} is the ad's image address, {$r [' title '} is the title of the ad, {$r [' url '} is the ad link, {$r [' Alt '} is the text of the ad.


Here is the last picture:

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/9B/B1/wKiom1ll6xLiSbeoAACc72-EGMw713.jpg-wh_500x0-wm_ 3-wmp_4-s_2231759270.jpg "title=" qq20170712172442.jpg "alt=" Wkiom1ll6xlisbeoaacc72-egmw713.jpg-wh_50 "/>

This article is from the "jack_phpcms" blog, make sure to keep this source http://maifang158.blog.51cto.com/5433990/1946794

Phpcms V9 AD module cycle call AD Carousel (first ad with last ad style)

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.