Is their a secret to show an actual ansi file from the bbs on my website in HTML Page. Let's say I want to show the actual grafiti wall ansi, but it's not in html, how do I go about this, or is there a program that will help me. I know it can be done, as I have seen it, but I don't know where to find the code. I' using a text editor to do all my web pages, so basicly it's trial and error for me as I don't know html... I borrow code and make it work. Thanks for the help in advance if you can figure out what I'm trying to do... LOL
Is their a secret to show an actual ansi file from the bbs on my website in HTML Page. Let's say I want to show the actual grafiti wall ansi, but it's not in html, how do I go about this, or is there a program that will help me. I know it can be done, as I have seen it, but I don't know where to
find the code. I' using a text editor to do all my web pages, so basicly it's trial and error for me as I don't know html... I borrow code and make it work. Thanks for the help in advance if you can figure out what I'm
Are you using the Synchronet web server? If so, double-check that your ctrl/web_handler.ini file has the following in the [JavaScript] section: asc = asc_handler.js
utility) into HTML. You can *also* use this handler to convert raw ANSI (*.ans) files by adding the following the [JavaScript] section of your ctrl/web_handler.ini file: ans = asc_handler.js
you can use synchronet's content handler for ansi, or you can use ansilove. ansilove does a great job of outputting png from ansi on the fly
ctrl/web_handler.ini file has the following in the [JavaScript] section: asc = asc_handler.js
utility) into HTML. You can *also* use this handler to convert raw
ANSI (*.ans) files by adding the following the [JavaScript] section of your ctrl/web_handler.ini file: ans = asc_handler.js
Ok, awesome, Thank You. I'll let you know.
What this does is execute asc_handler.js whenever a *.asc file is served up by your Synchronet web server. asc_handler.js converts Ctrl-A encoded files (which can be easily converted from raw ANSI using the ans2asc utility) into HTML. You can *also* use this handler to convert raw ANSI (*.ans) files by adding the following the [JavaScript] section of your ctrl/web_handler.ini file:
ans = asc_handler.js
Is there any type of help doc or something in the way of syntax and
options? I'm just trying to get it to display some ASC game score files.
you just link to the .ans or .asc file on your web. then it works.
PSSST use ansilove instead
LOL. I may try it out if I fail with the built-in handler. I'd like to see if I can wrap my brain around the Synch one. But I appreciate the tip. :-)
you just link to the .ans or .asc file on your web. then it works.
I honestly tried. But I'm not getting something basic about this. Though I did notice if I went to the ASC file directly it worked... but not inside
of another SSJS/INC page. I don't want to link to them, I want a fluid page that shows all the different scores.
What this does is execute asc_handler.js whenever a *.asc file is served up by your Synchronet web server. asc_handler.js converts Ctrl-A encoded files (which can be easily converted from raw ANSI using the ans2asc utility) into HTML. You can *also* use this handler to convert raw ANSI (*.ans) files by adding the following the [JavaScript] section of your ctrl/web_handler.ini file:
ans = asc_handler.js
Digital Man,
I'm actually trying to work with asc_handler.js and I'm not really sure what I am doing. I tried looking at a page that uses it (like members/sysinfo.ssjs) but I'm pretty hopeless when I don't really understand the code I am trying to mess around with.
Is there any type of help doc or something in the way of syntax and options? I'm just trying to get it to display some ASC game score files.
Re: Re: HTML
By: KenDB3 to Mro on Fri May 08 2015 09:12 pm
LOL. I may try it out if I fail with the built-in handler. I'd like to see if I can wrap my brain around the Synch one. But I appreciate the tip. :-)
http://eob-bbs.com:8080/test/index.html
looks like a job for good ole iframe!
you just link to the .ans or .asc file on your web. then it works.
I honestly tried. But I'm not getting something basic about this. Though I did notice if I went to the ASC file directly it worked... but not inside
That's how it's meant to work. When a document is requested from the webserver, and the webserver sees that the document's extension is mapped to a handler script in 'ctrl/web_handler.ini', then it passes the document through the handler before sending it to the client.
However that magic won't happen with most other methods of 'including' the .ans/.asc file inside of an HTML, SSJS, INC, XJS, etc. file, because the server will just read the file and dump its unmodified contents into what you send to the client.
of another SSJS/INC page. I don't want to link to them, I want a fluid page that shows all the different scores.
Something like this would work for inline display:
<iframe src="/path/to/my.ans"></iframe>
Because it will cause the client's browser to request that document on its own from the server, then load it into the iframe. You'll need to mess with the width and height properties of the iframe, and probably hide borders, etc. to get a nice display.
Someone will say "iframes are bad because people say iframes are bad" at this point. Sometimes they're what works. In this case they're a good way to go since asc_handler.js barfs out a complete HTML document, which belongs in its own context.
If you have it installed in your web_handler.ini, then anytime the web server sends a .asc file to the client (browser/user) it will convert it to HTML on the fly.
So if you copied a file, say sync.asc, to your sbbs/web/root directory, then a request for that file should look like this: http://vert.synchro.net/sync.asc
If you have it installed in your web_handler.ini, then anytime the web server sends a .asc file to the client (browser/user) it will convert it to HTML on the fly.
So if you copied a file, say sync.asc, to your sbbs/web/root directory, then a request for that file should look like this: http://vert.synchro.net/sync.asc
Thanks DM, I was going about it in probably the most complicated manner I could. ec and Mro pointed me in the right direction. I was trying to get the ASC/ANS files to display in-line within another html/ssjs file and didn't realize how the handler was meant to work on an individual file.
You actually don't need the asc_handler.js if you're already using SSJS to generate the page. You could use the Synchronet html_encode() function and insert the results inline with the rest of the output of the SSJS file. The asc_handler.js is just a small wrapper for html_encode().
You actually don't need the asc_handler.js if you're already using SSJS to generate the page. You could use the Synchronet html_encode() function and insert the results inline with the rest of the output of the SSJS file. The asc_handler.js is just a small wrapper for html_encode().
Thanks DM! I'll have to play with it a bit and see what I can do. I liked the output that I got with iframes, but one could possibly run into an ANS/ASC that gets longer than you originally planned for, so I'd like to see if I can figure it out.
By tenacity and some luck I got it working: http://bbs.kd3.us/scores/scores_inline3.ssjs
(that says 3 in there, but it was more like 13 tries... lol)
I ran into a snag that took me a while to sort out, until I remembered its a damn web server and not Windows, lol.
I was defining the file path as
f=new File("c:\sbbs\web\root\scores\LORD.ANS");
when I should have been using
f=new File("C:/sbbs/web/root/scores/LORD.ANS");
Just wanted to say thanks and also share, if anyone wants my code so they can play with it and modify for their own use, feel free to ask. Hit me up at <kendb3 at bbs.kd3.us>. Also, if anyone is using BBSLink.net on a Windows machine and wants a batch file that uses (Win32) wget to grab the ANS score files, I can give you that too, just ask.
That issue (with the backslashes) is actually more to due with JavaScript than anything else. In JavaScript, backslashes must be "escaped", like so: "C:\\WINDOWS\\SYSTEM32".
Forward slashes work too.
So, I originally solved the problem with iframes: http://bbs.kd3.us/scores/scores.ssjs
but ran into the problem I was worried about, where, as the score files got longer than I first expected, I got scroll bars where I didn't want them.
Re: Re: HTML
By: KenDB3 to Digital Man on Tue May 12 2015 01:39 am
So, I originally solved the problem with iframes: http://bbs.kd3.us/scores/scores.ssjs
but ran into the problem I was worried about, where, as the score files got longer than I first expected, I got scroll bars where I didn't want them.
if you notice the example i gave you was a very large ansi file. i chose that one because it was so long. i have the scroll bars turned off and it's displaying the entire height and width.
if you notice the example i gave you was a very large ansi file. i chose that one because it was so long. i have the scroll bars turned off and it's displaying the entire height and width.
I couldn't use what you did on the test page you showed me, where you had 100% for the width and height of the iframe, even though it worked really well for single ANSI files. In fact I gave that a try to see what it looked like with multiple files:
Sysop: | MCMLXXIX |
---|---|
Location: | Prospect, CT |
Users: | 333 |
Nodes: | 10 (0 / 10) |
Uptime: | 35:18:32 |
Calls: | 576 |
Messages: | 236643 |