NetTalk Central

Recent Posts

Pages: [1] 2 3 ... 10
1
Web Server - Ask For Help / Re: Convert text to HTML text for display
« Last post by Bruce on October 03, 2024, 07:48:20 AM »
if you have a bunch of plain text, and you surround it with
<pre>


</pre>

Then I think you'll get what you;re looking for.

Cheers
Bruce
2
Argh!
Yes, sorry, Johan.  Appears that I zipped it before saving from IDE.
Attached is an updated zip. 
But looks as if you put the code in about the same place as I did.

Jane

3
Hi Jane

Thank you again for your help and effort,

I used the code and all working fine, hope I have it correct and will test.

The new zipped app does not have any embed code in webhandler, perhaps just zipped the wrong app, unless I'm missing something.
My code and embed point I used.

thanks again,

Johan



p_web._SendFile PROCEDURE(string p_FileName,Long p_header=NET:SendHeader)
! Start of "NetTalk Method Data Section"
! [Priority 1500]
loc:parent  string(252)   ! should always be a lower-case string
loc:done        Long
loc:filename    string(252)
! [Priority 6500]
! End of "NetTalk Method Data Section"

  CODE
  ! Start of "NetTalk Method Executable Code Section"
  ! [Priority 1500]
 
    loc:parent = self.PlainText(Lower(self.GetValue('_parentProc_')))
    loc:filename = SELF.GetPageName(Lower(p_FileName))
 
  ! Start of "Before SendFiles in DLLs"
  ! [Priority 5000]

    !############################# 
          block# = false
          case loc:filename
          of 'nwp_wineshop'
             block# = true
          of 'aboutus'
             block# = true
          of 'nwp_aboutus'
             block# = true
          end !case   
          if block# = true
             p_web.trace('case triggered:' & loc:filename)
             p_web.SendError (404,'The page cannot be found', 'The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.')
             return
          end   
    !############################# 

         
 
  ! End of "Before SendFiles in DLLs"
    loc:done = NetWebDLL_avc_b_SendFile(p_web, loc:Filename, loc:Parent)
    If loc:Done then Return.
    loc:done = NetWebDLL_avcfunc_SendFile(p_web, loc:Filename, loc:Parent)
    If loc:Done then Return.
  ! [Priority 3040]
 
    do Remap:tvcweb
    do CaseStart:tvcweb




4
Web Server - Ask For Help / Re: Errors after upgrade to NT 14.27
« Last post by Poul Jensen on October 01, 2024, 10:10:53 PM »
Thanks Alberto, that was it.

I thought I had upgraded all Capesoft products, but Stringtheory slipped under the radar :-)
5
Web Server - Ask For Help / Re: Errors after upgrade to NT 14.27
« Last post by Alberto on October 01, 2024, 12:49:08 PM »
Hi, you need to upgrade StringTheory
6
Web Server - Ask For Help / Errors after upgrade to NT 14.27
« Last post by Poul Jensen on October 01, 2024, 11:16:43 AM »
Hi,

I am getting these compile errors:
No matching prototype available - D:\Clarion11\Accessory\libsrc\win\NetMaps.Clw:3605,27
Field not found: FLEXPOLYLINEDECODE - D:\Clarion11\Accessory\libsrc\win\NetMaps.Clw:3605,9

This points to this procedure:
NetMapsHEREPlatform.ParseCalcRouteReplyJSON Procedure(StringTheory pReply)

I do not use any HEREmaps in this app.
Another app give same errors.

What to do?

Cheers
/Poul
7
C10?  Guess you like skinny templates ;)
Are you on NT 14, I hope?

Revised example C10/NT14 attached.

My code in the webhandler (line 14288 in p_web.SendFile procedure) looks for both procedure name and page name as specified on the procedure template.  Forced to lower-case a few lines above.

Code in this example is:

        case loc:filename
            of 'johan' orof 'johanpage'
            orof 'john' orof 'johnpage'
                p_web.trace('case triggered')
                p_web.SendError (404,'The page cannot be found', 'The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.')
                return
        end !case   


Seems to work OK.

Cheers,

Jane

8
Hi Jane

thanks!

Unfortunately I'm still on C10, so could not open the example you so kindly created.
It was an idea I had to consider and pursue, and with your suggestion and example it seems like it's a good plan.

Any chance of posting the code and where to pop it in to the webhandler procedure.


thanks

Johan
9
Web Server - Ask For Help / Re: Settings for making web procedures not visible/accessible
« Last post by Jane on September 30, 2024, 12:12:24 PM »
Quote
Something I have not looked at,
is to add code to serve "page not found" HTML

Fairly easy to do with a few lines of code in the webhandler.
Maybe something like the attached? 

(Bruce page will serve, Johan and John pages will 404.)
10
Hi Ron,

Just to add,

There really are 3 situations,

Login required - Pops the login page
Only serve if true - This procedure or page might be embedded on another procedure/page , so if false, send the blank, however it is a valid procedure, but only if certain conditions are met.
Hide - Send "page not found"

Something I have not looked at,
is to add code to serve "page not found" HTML

regards

Johan

Pages: [1] 2 3 ... 10