• template/javascript vars

    From Ragnarok@VERT/DOCKSUD to DOVE-Net.Sync_JavaScript on Tue Nov 29 03:14:00 2005
    --nextPart1760213.LhHTNVu6d8
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: 8Bit

    hi im still playing with js and the webserver
    im still write the search for messajes
    i use three steps
    1)search.ssjs (main page, it have one form with a select control for the
    areas and text control for user input)
    2)search_result.ssjs (it show brief from the messages founds)
    3)showmsg.ssjs (it show the select message)

    i make a "search" directory on /sbbs/web/html
    and /sbbs/web/templates/default/ too
    the templates are same name with .inc extension. (templates seems to work
    for me)

    step 1 and stem 2 work fine, in step 2 y make a url "showmsg.ssjs?sub=sub_name&id=numbre_of_message" (you can see it in action http://bbs.docksud.com.ar:8088/search/search.ssjs)
    in step 3 im get the id of message from a http get var and save it in var called idx
    but if i use this var on msg_get_header, it fails (line 43)
    (i test with more pass from more variables (template.msgid)but the issue is same)

    hdr = msgbase2.get_msg_header(true,idx);

    if i print idx it contain the number correctly.
    if i force the value to var idx to some value its work.
    the server log do not say any error messages
    i think that is a runtime problem

    sorry my long explanation, it difficult for my write this behavior in
    english =)

    im attach a zip file that contain the 3 files ssjs
    --nextPart1760213.LhHTNVu6d8
    Content-Type: application/x-zip; name="files.zip"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="files.zip"

    UEsDBBQAAAAIAE6WfDNT8pq6zwIAAG4HAAASABUAc2VhcmNoX3Jlc3VsdC5zc2pzVVQJAAOje4tD q3uLQ1V4BAAAAAAAjVVNb9swDD3Xv4I1CsRpUzv7OmUp0AE77LB12I7FECg2HauTrUxS1gZr//tI S3aTtC6ag2LR75GPH5KzUzj5UpzAaRZFSosiidM0u8VlpuQyc1ivlXCYWntj4/EsinqLk07hHOzW kiltRI1wBjGcw08UJq/gB9qNcjbe5aAx2sAcRqNZVInt57AthbI4i2QJSeXcemHwzwatS2k12+uR 3SxHv2A+h01TYCkbLMb/IqDfE7+xfyB/TkAu6rUGIpMERu8EdGZD8R4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ySfjwCAADyBQAADAANAAAAAAABAAAApIFBBAAAc2hvd21zZy5zc2pzVVQFAAMSfYtD VXgAAFBLBQYAAAAAAwADANoAAAC8BgAAAAA=
    --nextPart1760213.LhHTNVu6d8--

    ---
    þ Synchronet þ Dock Sud BBS TLD 24 HS - www.docksud.com.ar
  • From Digital Man@VERT to Ragnarok on Tue Nov 29 01:36:58 2005
    Re: template/javascript vars
    By: Ragnarok to DOVE-Net.Sync_JavaScript on Mon Nov 28 2005 07:14 pm

    --nextPart1760213.LhHTNVu6d8
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: 8Bit

    hi im still playing with js and the webserver
    im still write the search for messajes
    i use three steps
    1)search.ssjs (main page, it have one form with a select control for the areas and text control for user input)
    2)search_result.ssjs (it show brief from the messages founds)
    3)showmsg.ssjs (it show the select message)

    i make a "search" directory on /sbbs/web/html
    and /sbbs/web/templates/default/ too
    the templates are same name with .inc extension. (templates seems to work for me)

    step 1 and stem 2 work fine, in step 2 y make a url "showmsg.ssjs?sub=sub_name&id=numbre_of_message" (you can see it in action http://bbs.docksud.com.ar:8088/search/search.ssjs)
    in step 3 im get the id of message from a http get var and save it in var called idx
    but if i use this var on msg_get_header, it fails (line 43)
    (i test with more pass from more variables (template.msgid)but the issue is same)

    hdr = msgbase2.get_msg_header(true,idx);

    The ID of a message is a string.
    "idx" usually refers to the message's index record (an object).
    You're calling get_msg_header() with "by_offset" set to "true" and passing either an index record or a string (I can't tell). Either way, it's incorrect.

    if i print idx it contain the number correctly.

    If idx is a number, then it's not the message ID.

    if i force the value to var idx to some value its work.

    What's "idx" stand for?

    digital man

    Snapple "Real Fact" #49:
    Despite its hump...camel's have a straight spine.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Ragnarok@VERT/DOCKSUD to Digital Man on Tue Nov 29 10:47:00 2005
    ok seems to found the mistake here
    i was think that the message id is a number.

    The ID of a message is a string.
    "idx" usually refers to the message's index record (an object).
    idx are from hdr.number (hdr = msgbase.get_msg_header())

    You're calling get_msg_header() with "by_offset" set to "true" and passing
    i want to pass a message number (is hdr.number correct?)
    i want to identify the message in my 2d stage to pass to the 3th stage
    i want to search by the number (i think)

    either an index record or a string (I can't tell). Either way, it's incorrect.

    if i print idx it contain the number correctly.

    If idx is a number, then it's not the message ID.
    its true, the idx is a number.

    if i force the value to var idx to some value its work.

    What's "idx" stand for?



    digital man

    Snapple "Real Fact" #49:
    Despite its hump...camel's have a straight spine.
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ telnet://vert.synchro.net

    ---
    þ Synchronet þ Dock Sud BBS TLD 24 HS - www.docksud.com.ar
  • From Ragnarok@VERT/DOCKSUD to Ragnarok on Tue Nov 29 11:32:00 2005
    Ragnarok wrote:

    ok seems to found the mistake here
    i was think that the message id is a number.

    The ID of a message is a string.
    "idx" usually refers to the message's index record (an object).
    idx are from hdr.number (hdr = msgbase.get_msg_header())

    You're calling get_msg_header() with "by_offset" set to "true" and
    passing
    i want to pass a message number (is hdr.number correct?)
    i want to identify the message in my 2d stage to pass to the 3th stage
    i want to search by the number (i think)

    either an index record or a string (I can't tell). Either way, it's
    incorrect.

    if i print idx it contain the number correctly.

    If idx is a number, then it's not the message ID.
    its true, the idx is a number.

    if i force the value to var idx to some value its work.


    yeah all of mi nightmare was a bad cast from string to intenger i use parseInt() and all work fine.
    i go to sleep now =)
    tnx dm!

    ---
    þ Synchronet þ Dock Sud BBS TLD 24 HS - www.docksud.com.ar
  • From Digital Man@VERT to Ragnarok on Tue Nov 29 21:12:55 2005
    Re: Re: template/javascript v
    By: Ragnarok to Digital Man on Tue Nov 29 2005 02:47 am

    ok seems to found the mistake here
    i was think that the message id is a number.

    The ID of a message is a string.
    "idx" usually refers to the message's index record (an object).
    idx are from hdr.number (hdr = msgbase.get_msg_header())

    You're calling get_msg_header() with "by_offset" set to "true" and passing
    i want to pass a message number (is hdr.number correct?)
    i want to identify the message in my 2d stage to pass to the 3th stage
    i want to search by the number (i think)

    Yes, hdr.number is the message number (not its offset).

    digital man

    Snapple "Real Fact" #97:
    A turkey can run at 20mph.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net