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 chan/subchan
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,"InMatch","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>