Announcement

Collapse
No announcement yet.

Addressbook.xml - help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Addressbook.xml - help

    I'm not really sure I know how to write an HTML or ASP or whatever is needed to put the file - addressbook.xml onto a web page.
    Is anybody willing to do this, or at least give some pointers on how to get this done?
    What I would like to do is manage the address book from the web page.
    [img]/infopop/emoticons/icon_confused.gif[/img]

    -------------
    GenevaDude

    #2
    Look at the Web Phonebook Script -from Al Pappa- right here in the forum, it works great.

    The New CarlosHouse.com

    Comment


      #3
      I get this when I run Al Pappa phonebook sript
      any ideas?
      thanks



      Script Error:
      -2147024894:Invalid root in registry key "HKCU\Software\VB and VBA Program Settings\AutoHome\Settings\gNavigationLoc". in line 259



      <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Carlos Castillo:
      Look at the http://ubb.homeseer.com/6/ubb.x?a=tp...4&m=8122925211 -from Al Pappa- right here in the forum, it works great.

      http://www.carloshouse.com<HR></BLOCKQUOTE>

      Comment


        #4
        That script is looking for really old registry settings that HS no longer sets. Post the first few lines of the script and we can help you remove these calls.

        -Rupp
        -Rupp
        sigpic

        Comment


          #5
          <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Rupp:
          That script is looking for really old registry settings that HS no longer sets. Post the first few lines of the script and we can help you remove these calls.

          -Rupp<HR></BLOCKQUOTE>
          thanks rupp

          here it is----below



          Option Explicit

          ' Display HS Phone phonebook
          '
          ' This script will display the HSP phonebook via a custom HTML page
          ' The phonebook display can be sorted by the various columns by simply
          ' clicking the column label.
          '
          ' Installation
          ' Place this script and associated GIFs in the Homeseer HTML directory
          ' Edit the HomeSeer Web Options to call this script
          '
          ' Version History
          '
          ' Date Version Author Description
          '=========================================================== ==================
          ' 6/18/01 1.0 Al Pappa Initial Version
          '

          Const CT_CIDFLAGS_BLOCKED = 1 ' callers with this CID are blocked
          Const CT_CIDFLAGS_ANNOUNCE = 2 ' this ID is announced
          Const CT_CIDFLAGS_SPARE1 = 4 ' spare, not used
          Const CT_CIDFLAGS_SPEC_ANN = 8 ' play special announcement to caller
          Const CT_CIDFLAGS_POPUP = &H10 ' pop up window with CID info
          Const CT_CIDFLAGS_PRIVATE = &H20 ' entry matches private CID calls
          Const CT_CIDFLAGS_OUTOFAREA = &H40 ' entry matches out of area calls

          Const CT_FLAGS_VRENABLED = 1 ' address book entry is enabled as voice command
          Const CT_FLAGS_HANGUP = 2 ' hang up after speaking announcement

          Const DefaultAnswerRings = 5 ' Default rings to answer in
          ' Change this to match your default setting
          ' This value is not avialable via any documented interfaces in HSP

          Sub main(lnk)
          dim i, iAdrCount, objContact
          dim ContactAnswer
          dim PhoneList()
          dim Display
          dim SortKey, SortKeyOffset, OldSortKey, CurrentSortKey, SortDirection
          dim Flags

          ' Headers
          response.Send customheader("Phone Book")

          ' Define Main Table
          response.Send "&lt;br&gt;"_
          & "&lt;table border='0' cellpadding='0' cellspacing='1' width='100%'&gt;"

          hs.CreateVar("CurrentSort")
          OldSortKey = Left (hs.GetVar ("CurrentSort"),1)
          SortDirection = Right (hs.GetVar ("CurrentSort"),1)
          if SortDirection = "" Then
          SortDirection = "D"
          End If

          SortKeyOffset = InStr (lnk,"?")
          If SortKeyOffset = 0 Then
          SortKey = "1 A" ' First Name, Ascending
          Else
          CurrentSortKey = Mid (lnk,SortKeyOffset+1,1)
          if CurrentSortKey = OldSortKey Then
          if SortDirection = "A" Then
          SortDirection = "D"
          Else
          SortDirection = "A"
          End If
          Else
          SortDirection = "A"
          End If
          SortKey = Mid (lnk,SortKeyOffset+1,1) & " " & SortDirection
          End If
          hs.SaveVar "CurrentSort",SortKey

          ' Send Table Header
          response.Send "&lt;tr&gt;&lt;tr&gt;&lt;td class='tableheader' colspan='7'&gt;Phone Book&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?1'&gt;&lt;b&gt;First Name&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?2'&gt;&lt;b&gt;Last Name&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?3'&gt;&lt;b&gt;Home Phone&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?4'&gt;&lt;b&gt;Work Phone&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?5'&gt;&lt;b&gt;Cell Phone&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;a href='phonebook.asp?6'&gt;&lt;b&gt;Answer in Rings&lt;/b&gt;&lt;/a&gt;&lt;/font&gt;&lt;/td&gt;"_
          & "&lt;td class='tablecolumn'&gt;&lt;font face='Arial, Arial, Helvetica'&gt;&lt;b&gt;Flags&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"

          iAdrCount = hsp.ADRCount ' number of address book entries
          Redim PhoneList (iAdrCount)

          for i = 1 to iAdrCount ' look thru address book for number
          set objContact = hsp.ADRGet(i) ' get the reference to the addrbk entry

          If objContact.answer_rings = True Then
          ContactAnswer = objContact.answer_rings_count
          if ContactAnswer = 0 Then
          ContactAnswer = DefaultAnswerRings
          End If
          Else
          ContactAnswer = "N/A"
          End If

          PhoneList(i) = objContact.first & ","_
          & objContact.last & ","_
          & objContact.home_phone & ","_
          & objContact.business_phone & ","_
          & objContact.cell_phone & ","_
          & ContactAnswer & ","_
          & CStr(objContact.cidflags And CT_CIDFLAGS_BLOCKED) & ","_
          & CStr(objContact.cidflags And CT_CIDFLAGS_ANNOUNCE) & ","_
          & CStr(objContact.cidflags And CT_CIDFLAGS_POPUP) & ","_
          & CStr(objContact.flags And CT_FLAGS_VRENABLED) & ","_
          & CStr(objContact.flags And CT_FLAGS_HANGUP)
          next

          ShellSort "P", PhoneList, ",", SortKey

          for i = 1 to iAdrCount
          Display = Split (PhoneList(i), "," , -1, 1)
          if UBound(Display) &lt;&gt; 10 Then
          Exit For
          End If
          response.Send "&lt;tr&gt;&lt;td nowrap class='tableroweven'&gt;" & Display(0) & "&lt;/td&gt;"_
          & "&lt;td nowrap class='tablerowodd'&gt; " & Display(1) & "&lt;/td&gt;"_
          & "&lt;td nowrap class='tableroweven' align='center'&gt;" & Display(2) & "&lt;/td&gt;"_
          & "&lt;td nowrap class='tablerowodd' align='center'&gt;" & Display(3) & "&lt;/td&gt;"_
          & "&lt;td nowrap class='tableroweven' align='center'&gt;" & Display(4) & "&lt;/td&gt;"_
          & "&lt;td nowrap class='tablerowodd' align='center'&gt;" & Display(5) & "&lt;/td&gt;"

          Flags = "&lt;td nowrap class='tableroweven'&gt;"
          if Display(6) &lt;&gt; 0 Then
          Flags = Flags & "&lt;img align='absmiddle' src='blocked.gif' &gt;&nbsp;"
          Else
          Flags = Flags & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
          End If

          if Display(7) &lt;&gt; 0 Then
          Flags = Flags & "&lt;img align='absmiddle' src='speaker.gif' &gt;&nbsp;"
          Else
          Flags = Flags & "&nbsp;&nbsp;&nbsp;&nbsp;"
          End If

          if Display(8) &lt;&gt; 0 Then
          Flags = Flags & "&lt;img align='absmiddle' src='popup.gif' &gt;&nbsp;"
          Else
          Flags = Flags & "&nbsp;&nbsp;&nbsp;&nbsp;"
          End If

          if Display(9) &lt;&gt; 0 Then
          Flags = Flags & "&lt;img align='absmiddle' src='talker.gif' &gt;&nbsp;"
          Else
          Flags = Flags & "&nbsp;&nbsp;&nbsp;&nbsp;"
          End If

          if Display(10) &lt;&gt; 0 Then
          Flags = Flags & "&lt;img align='absmiddle' src='handfon.gif' &gt;&nbsp;"
          Else
          Flags = Flags & "&nbsp;&nbsp;&nbsp;&nbsp;"
          End If

          Flags = Flags & "&lt;/tr&gt;"
          response.Send Flags
          next

          ' Send Footer
          response.Send customfooter()
          End Sub

          #Include /vbs/customheader.vbs
          #Include /vbs/customfooter.vbs

          ' ----------------------------------------------------------------------
          '
          ' DESCRIPTION
          '
          ' Following generic sort routine is based on the
          ' ShellSort algorithm.
          '
          ' Although there are many options available to ASP
          ' developers when it comes to sorting, I was unable
          ' to find an available sort routine that allowed a record
          ' to be sorted on multiple keys in ascending and
          ' descending orders.
          '
          ' This subroutine sorts an array of records in-place
          ' using 1 to n sort key definitions.
          ' The sort keys can be defined as offsets into the record or
          ' as relative word positions.
          '
          ' If your data record contain fixed offsets and no delimiters,
          ' you should use the "Offset" method.
          '
          ' If your data can be parsed into columns by using a common
          ' delimiter, the "Parse" method is the better choice.
          '
          ' In either case, you will be able to specify multiple levels
          ' of sort keys. They must be the same type. All keys within
          ' one call must either be "Offsets" or "Parse" definitions.
          '
          ' ----------------------------------------------------------------------
          '
          ' Functions and Subroutines
          '
          ' ShellSort - Sorts 1-dimensional arrays.
          ' Swap - Swaps the position of two rows within an array.
          '
          '
          ' Method: Offset
          ' --------------
          '
          ' Sort key definition is defined as offsets into the array element.
          '
          ' Syntax:
          '
          ' ShellSort "Offset", array, "*", sortkey { sortkey }
          '
          ' sortkey = StartColumn Length Order
          '
          ' StartColumn - Offset into record, relative to 1
          ' Length - Data length
          ' * = max record length
          ' Order - A = Ascending
          ' D = Descending
          '
          ' Example: ShellSort "O", phonelist, "*", "50 20 A 1 40 A"
          '
          ' Method: Parse
          ' -------------
          '
          ' Sort key definition is defined "word number" with the array.
          '
          ' Syntax:
          '
          ' ShellSort "Parse", array, delim, sortkey { sortkey }
          '
          ' delim - Word parsing delimeter such as "|" or ","
          ' This is used by the Split function
          ' sortkey = WordNumber Order
          '
          ' WordNumber - Word number within the record,
          ' relative to 1
          ' Order - A = Ascending
          ' D = Descending
          '
          ' Example: ShellSort "O", phonelist, "3 A 1 A"
          '
          ' ----------------------------------------------------------------------
          Function ShellSort(byval iParm1, _
          byref iArray, _
          byval iParm3, _
          byval iParm4)

          Dim sKey1, sKey2
          Dim sPad
          Dim arrayRecord
          Dim sortStyle, sortOrder, sortColumn, sortLength, sortDelim
          Dim iFldLen
          Dim iRecords
          Dim sortDef, sortDefCnt, sortDefStep
          Dim iKeyGroup
          Dim irdx, itap, ilap


          ' ----------------------------------------------------------------------
          ' Parse input parameters
          '
          ' Determine sort style - Offset or Parse
          ' Get sort key definition groups
          ' Get number of definition groups
          ' ----------------------------------------------------------------------
          sortStyle = Left(iParm1,1)
          Select Case sortStyle
          Case "O"
          sortDef = Split(iParm4, " ")
          sortDefStep = 3
          Case "P"
          sortDelim = iParm3
          sortDef = Split(iParm4, " ")
          sortDefStep = 2
          End Select
          sortDefCnt = (UBound(sortDef)+1) \ sortDefStep

          iRecords = UBound(iArray)+1

          irdx = 1
          While (irdx * 3 + 1) &lt; iRecords
          irdx = irdx * 3 + 1
          Wend


          While irdx &gt; 0
          For itap = irdx - 1 To iRecords - 2
          For ilap = (itap - irdx + 1) To 0 Step -irdx

          ' ----------------------------------------------------------------------
          ' Determine which key group is going to be used for sort comparision
          ' ----------------------------------------------------------------------
          For iKeyGroup = 1 To sortDefCnt

          Select Case sortStyle

          Case "O"
          sortColumn = sortDef((iKeyGroup-1) * sortDefStep+0)
          sortLength = sortDef((iKeyGroup-1) * sortDefStep+1)
          sortOrder = sortDef((iKeyGroup-1) * sortDefStep+2)

          iFldLen = sortLength
          If sortLength = "*" Then
          iFldLen = Len(iArray(ilap)) - sortColumn+1
          End If
          sKey1 = Mid(iArray(ilap) ,sortColumn,iFldLen)

          iFldLen = sortLength
          If sortLength = "*" Then
          iFldLen = Len(iArray(ilap+irdx)) - sortColumn+1
          End If
          sKey2 = Mid(iArray(ilap+irdx) ,sortColumn,iFldLen)

          Case "P"
          sortColumn = sortDef((iKeyGroup-1) * sortDefStep+0)
          sortOrder = sortDef((iKeyGroup-1) * sortDefStep+1)

          sPad = String(sortColumn+1,sortDelim)
          arrayRecord = Split(iArray(ilap) & sPad, sortDelim)
          sKey1 = arrayRecord(sortColumn-1)
          arrayRecord = Split(iArray(ilap+irdx) & sPad, sortDelim)
          sKey2 = arrayRecord(sortColumn-1)

          End Select

          If sKey1 &lt;&gt; sKey2 Then Exit For

          Next

          ' -------------------------------------------------------------
          ' Sort key has been determined
          ' Sort based on Ascending/Descending
          ' -------------------------------------------------------------
          Select Case sortOrder
          Case "A"
          If sKey1 &gt; sKey2 Then
          Swap iArray(ilap), iArray(ilap + irdx)
          Else
          Exit For
          End If
          Case "D"
          If sKey1 &lt; sKey2 Then
          Swap iArray(ilap), iArray(ilap + irdx)
          Else
          Exit For
          End If
          End Select


          Next
          Next

          irdx = irdx \ 3

          Wend

          End Function

          ' ----------------------------------------------------------------------
          ' Swap record elements
          ' ----------------------------------------------------------------------
          Sub Swap(byref p1, byref p2)
          Dim temp
          temp = p1
          p1 = p2
          p2 = temp
          End Sub

          Comment

          Working...
          X