Aspcms Slides with list calls

Source: Internet
Author: User
Tags type null

First find the Site Directory/inc/aspcms_mainclass.asp

Add Main function

 Public FunctionParseslidelist (Str)if  notIsexiststr (Content,"{aspcms:"&Str&"slidelist") Then Exit FunctionDimMatch,matches,matchfield,matchesfieldDimLabelattrlinklist,loopstrlinklist,loopstrlinklistnew,loopstrtotalDimVtype,vnum,wherestr,linkarray,linkurlarray,linktextarrayDimFieldname,fieldattr,fieldnameandattr,fieldattrlenDimI,labelrulefieldDimM,namelen,deslen,m_deslabelrule="{aspcms:"&Str&"slidelist ([\s\s]*?)} ([\s\s]*?) {/aspcms:"&Str&"Slidelist}"Labelrulefield="\["&Str&"slidelist: ([\s\s]+?) \]"Regexpobj.pattern=LabelruleSetmatches=Regexpobj.execute (content) for  eachMatchinchmatcheslabelattrlinklist=match. Submatches (0) Loopstrlinklist=match. Submatches (1) VType=parsearr (Labelattrlinklist) ("type")ifIsnul (VType)or(vtype<>"a"  andVtype<>"b"  andVtype<>"C") ThenVtype="" 'type null a b cifVtype=""  ThenLinkArray=Split(Slideimgs&vtype,",") Linkurlarray=Split(Slidelinks&vtype,",") Linktextarray=Split(Slidetexts&vtype,",")ElseLinkArray=Split(eval (Slideimgs&vtype),",") Linkurlarray=Split(eval (Slidelinks&vtype),",") Linktextarray=Split(eval (Slidetexts&vtype),",")End ifif  not IsArray(LinkArray) Thenvnum=-1 Elsevnum=UBound(LinkArray) Regexpobj.pattern=LabelrulefieldSetMatchesfield=Regexpobj.execute (loopstrlinklist) loopstrtotal="" forI=0  tovnum-1loopstrlinklistnew=loopstrlinklist for  eachMatchfieldinchmatchesfieldfieldnameandattr=regexpreplace (Matchfield. Submatches (0),"[\s]+",CHR( +)) Fieldnameandattr=Trimouter (fieldnameandattr) m=InStr(Fieldnameandattr,CHR( +))ifM >0  ThenFieldName= Left(Fieldnameandattr,m-1) fieldattr= Right(Fieldnameandattr,Len(fieldnameandattr)-m)ElseFieldName=fieldnameandattrfieldattr=""End ifSelect  CaseFieldName Case "T"loopstrlinklistnew=Replace(loopstrlinklistnew,matchfield.value,vnum+1) Case "Imgurl"loopstrlinklistnew=Replacestr (Loopstrlinklistnew,matchfield.value,linkarray (i)) Case "Link"loopstrlinklistnew=Replacestr (Loopstrlinklistnew,matchfield.value,linkurlarray (i)) Case "title"loopstrlinklistnew=Replacestr (Loopstrlinklistnew,matchfield.value,linktextarray (i)) Case "width"loopstrlinklistnew=replacestr (Loopstrlinklistnew,matchfield.value,eval (slidewidth&vtype)) Case "Height"loopstrlinklistnew=replacestr (Loopstrlinklistnew,matchfield.value,eval (slideheight&vtype)) Case "I"loopstrlinklistnew=replacestr (loopstrlinklistnew,matchfield.value,i+1)End SelectNextLoopstrtotal=loopstrtotal&loopstrlinklistnewNextSetMatchesfield= Nothingcontent=replacestr (content,match.value,loopstrtotal) Strdictionary.removeallNextSetmatches= NothingEnd Function

Then find the function Parseglobal () in the file to increase the parsing tag code

Content=replacestr (content,"{aspcms:slidelist}", Parseslidelist (""))

Done!

On the homepage we can call this

where the fields

[Slidelist:link] [Slidelist:imgurl]

{Aspcms:slidelist Type=a}

{/aspcms:slidelist}

{Aspcms:slidelist Type=b}

{/aspcms:slidelist}

{Aspcms:slidelist Type=d}

{/aspcms:slidelist}

Aspcms Slides with list calls

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.