Example Channel Script
<HTML>
<%
Set MC = Server.CreateObject("MobileChannels.Utilities")
URL = Request.ServerVariables("URL")
DataID = Request.QueryString("DATAID")
Pieces = Split(URL,"/")
ChanID = Pieces(2)
' Get logo and title of channel
TopElem = MC.Locate(ChanID)
ChanTitle = ""
LogoHref = 0
If TopElem Then
ChanTitle = MC.Title(TopElem)
LogoElem = TopElem
LogoElem = MC.Navigate(LogoElem, "INMATCH", "LOGO")
Do While LogoElem
LogoStyleElem = MC.Navigate(LogoElem, "INMATCH", "STYLE")
If LogoStyleElem Then
If StrComp(MC.Value(LogoStyleElem), "IMAGE", 1) = 0 Then
LogoHref = MC.Href(LogoElem)
If LogoHref Then
If MC.HrefExists(LogoHref) Then
Exit Do
Else
LogoHref = 0
End If
End If
End If
End If
LogoElem = MC.Navigate(LogoElem,"NEXT")
If LogoElem Then
LogoElem = MC.Navigate(LogoElem,"MATCH","LOGO")
End If
Loop
End If
NeedTitle = 1
Response.Write("<HEAD><TITLE>" & ChanTitle & "</TITLE></HEAD>")
If LogoHref Then
Response.Write("<BODY><A HREF=mctp://" & ChanID & ">
<IMG SRC=" & LogoHref & "></A><BR> <BR>")
ElseIf ChanTitle And Len(ChanTitle) Then
Response.Write("<BODY><A HREF=mctp://" & ChanID & ">
<H3>" & ChanTitle & "</H3></a>")
NeedTitle = 0
Else
Response.Write("<BODY>")
End If
' Decide whether you need a title for this channel or subchannel.
If DataID And (DataID <> ChanID) Then
NeedTitle = 1
Else
DataID = ChanID
End If
SubTitle = 0
SubElem = MC.Locate(DataID)
If SubElem Then
SubTitle = MC.Title(SubElem)
If SubTitle And NeedTitle Then
Response.Write("<B>" & SubTitle & "</B><BR> <BR>")
End If
' Display contents of chan/subchan
Response.Write("<TABLE BORDER=0 CELLPADDING=-2 CELLSPACING=-2>")
ChildElem = MC.Navigate(SubElem,"IN")
Do While ChildElem
ShowIt = 1
IsChan = 0
If MC.Tag(ChildElem) = "CHANNEL" Then
IsChan = 1
If Not MC.IsSubscribed(ChildElem) Then
ShowIt = 0
End If
ElseIf MC.Tag(ChildElem) = "ITEM" Then
VisParElem = MC.Navigate(ChildElem,"INMATCH","USAGE")
If VisParElem Then
Usage = MC.Value(VisParElem)
If Usage Then
If StrComp(Usage,"NONE",1) = 0 Then
ShowIt = 0
End If
End If
End If
' Be sure item exists
If ShowIt Then
ChildHref = MC.Href(ChildElem)
If ChildHref Then
If Not MC.HrefExists(ChildHref) Then
ShowIt = 0
End If
Else
ShowIt = 0
End If
End If
Else
ShowIt = 0
End If
If ShowIt Then
' Be sure you can get the ID
IDVal = 0
IDElem = MC.Navigate(ChildElem,"InMatchINMATCH","ID")
If IDElem Then
IDVal = MC.Value(IDElem)
End If
If Not IDVal Then
ShowIt = 0
End If
End If
' Get title
If ShowIt Then
ItemTitle = MC.Title(ChildElem)
If Not ItemTitle Or (Len(ItemTitle) = 0) Then
ShowIt = 0
Else
If Len(ItemTitle) > 26 Then
ItemTitle = Mid(ItemTitle,0,25) & "…"
End If
End If
End If
' You know what it is and are going to try to show it
If ShowIt Then
If IsChan Then
Response.Write("<TR><TD>*")
Else
Response.Write("<TR><TD>")
End If
Response.Write("<TD> <a href=mctp://" & ChanID & "/"
& IDVal & ">" & ItemTitle & "</A>")
End If
ChildElem = MC.Navigate(ChildElem,"NEXT")
Loop
Response.Write("</TABLE>")
Else
Response.Write("Data ID not found.")
End If
%>
<BR> <BR><HR>
<B>Note:</B> This page was automatically generated because the correct
scripts could not be found. If this problem persists after synchronization,
please contact the content provider.
</BODY>
</HTML>