WORKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

man I'm happy. wasted the weekend on this but it was worth it... I quess...

it does not understand UDFs yet, so it marks them as unkown (bold operator color)

also, it was a horror to work with ascan and think it has to be fixed to work same way as normal kix functions.

the "stats":
quote:

script size: 6010
html size: 22820
execution time: 04:47:21.225 - 04:47:21.736

{edit} due to a request by shawn and les, enabled word-wrap
{/edit}
and the code:



;
; BBCodeParser - KiXtart Bulleting Board Code Parser
;
; Dependencies:
;    Wkix32 - KiXtart 4.12
;    kixforms.dll - KiXForms (version 2.1.1)
;
; -Lonkero
;
; 3.1.1.4 main improvements:
;    removed the winhttp from dependencies
;    improved parsing
;    removed the status display
;    
$VERSION = "3.1.1.7"
$CRLF = @crlf

$form = createobject("kixtart.form")
$form.caption = "BBCodeParser"
$form.width = $form.screen.width-100
$form.height = 530
$form.center
$form.font.name = "arial"
$form.font.size = 20
$form.forecolor = $form.rgb(200,200,200)
$form.printxy(8,6,"BBCodeParser")
$form.forecolor = $form.rgb(51,153,255)
$form.printxy(6,4,"BBCodeParser")
$form.font.size = 10
$form.font.bold = 1
$form.printxy(185,6,"$VERSION")
$form.font.name = "arial"
$form.font.size = 10
$form.forecolor = 0
$form.font.bold = 0
$form.printxy(8,48,"Topic:")

$address = $form.textbox
$address.top = 45
$address.left = 55
$address.width = $form.width-250
$address.height = 20
$address.text = ""

$download = $form.commandbutton
$download.caption = "Download!"
$download.top = 42
$download.left = $form.width-175
$download.width = 75
$download.height = 25
$download.onclick = '$$=download() $$edit.text="Choose the script from left panel." $$save.enabled=1 $$print.enabled=1'
$download.fontbold = 0
$download.default = 1

$edit = $form.textbox
$edit.multiline = 1
$edit.scrollbars=3
$edit.wordwrap=0
$edit.top = 85
$edit.left =  215
$edit.width = $form.width - 220
$edit.height = 365
$edit.text = "Enter the URL of the page you want to retrieve code from to topic field and click download@crlfhint: easiest way is to cut'n paste it from your webbrowser!"

$index = $form.listbox
$index.top = 85
$index.left = 5
$index.width = 200
$index.height = $form.height - 120
$index.onclick = '$$edit.text = $$code[$$index.listindex]'

$save = $form.commandbutton
$save.top = 465
$save.left = 215
$save.width = 75
$save.height = 25
$save.caption = "Save"
$save.onclick = "$$=save($$form.filesavedialog)"
$save.enabled = 0

$print = $form.commandbutton
$print.top = 465
$print.left = 310
$print.width = 75
$print.height = 25
$print.caption = "Print"
$print.onclick = "$$=print()"
$print.enabled = 0

$about = $form.commandbutton
$about.top = 465
$about.left = $form.width-270
$about.width = 75
$about.height = 25
$about.caption = "About"
$about.onclick = "$$=TkAboutBox($$VERSION)"

$exit = $form.commandbutton
$exit.top = 465
$exit.left = $form.width-175
$exit.width = 75
$exit.height = 25
$exit.caption = "Exit"
$exit.onclick = "$$form.visible=0"
$exit.cancel = 1

$form.show
while $form.visible
$=execute($form.doevents)
loop

exit 1

function download()
dim $data,$,$c,$httpObj
if not instr($address.text,"kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic")
 $ = messagebox("You didn't give kixBB url-address. This script supports only BB found at kixtart.org!","Usage error",48)
 return
else
 $page="http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=print_topic"+substr($address.text,instr($address.text,"?ubb=")+14)
endif

$httpObj = createobject("microsoft.xmlhttp")
$httpObj.open("GET",$page,not 1)
$httpObj.send()
$data=$httpObj.Responsetext
$data=split($data,'<hr />Posted by <b>')
for $=0 to ubound($data)
 $data[$]=split($data[$],'>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">')
 if ubound($data[$])
   $data[$][0]=left($data[$][0],instr($data[$][0],"</b>")-1)
   for $c=1 to ubound($data[$])
       $index.additem($data[$][0]+" (post #"+$+")")
       $data[$][$c]=left($data[$][$c],instr($data[$][$c],"</pre><hr />")-1)
       if instr($data[$][$c],"&lt;") $data[$][$c]=join(split($data[$][$c],"&lt;"),"<") endif
       if instr($data[$][$c],"&gt;") $data[$][$c]=join(split($data[$][$c],"&gt;"),">") endif
       if instr($data[$][$c],"&quot;") $data[$][$c]=join(split($data[$][$c],"&quot;"),chr(32)) endif
       if instr($data[$][$c],"<br />") $data[$][$c]=join(split($data[$][$c],"<br />"),@crlf) endif
       $code=$code+$data[$][$c]+chr(7)
   next
 endif
next
$code=split($code,chr(7))
endfunction

Function TkAboutBox($Version)
$former = createobject("kixtart.form")
$former.scalewidth = 500
$former.scaleheight = 180
$former.center
$former.caption = "About "+$name
$former.fontname = "times new roman"
$former.fontsize = 14
$former.fontbold = 1
$former.printxy(10,20,"BBCodeParser")
$former.fontsize = 8
$former.fontbold = 0
$former.printxy(10,40,"version "+$Version)
$former.fontsize = 12
$former.fontbold = 1
$former.printxy(10,60,"created and authored since 2001 By Lonkero")
$former.fontsize = 10
$former.fontbold = 0
$former.printxy(20,100,"Special thanks of bringing us kixforms and of great help to Shawn.")
$former.printxy(40,120,"Thanks to also Ruud who has given us kiXtart!")
$oker = $former.commandbutton
$oker.onclick = "$$former.visible=0"
$oker.center
$oker.top = 150
$oker.left = 400
$oker.width = 75
$oker.height = 25
$oker.caption = "OK"
$former.visible=1
while $former.doevents = 1 loop
$former=0
EndFunction

function save($file)
dim $
if len($file)
del $file
$=open(1,$file,5)
$=writeline(1,"; "+$index.text+" from topic "+$address.text+@crlf+@crlf)
$=writeline(1,$edit.text)
$=writeline(1,"@crlf@crlf; brought to you by BBCodeParser "+$VERSION+@crlf)
$=close(1)
$= $$form.msgbox("Code saved In:@crlf"+$file,"note",64)
endif
endfunction

function print()
dim $formi,$
$formi = createobject("kixtart.form")
$formi.caption = "BBCodeParser"+$VERSION+" by Lonkero"
$formi.width = 450
$formi.height = 100
$formi.center
$formi.fontbold = 1
$formi.printxy(10,10,"Printing in Progress...")
$formi.visible = 1
sleep 1
$=open(1,"%temp%\BBCodeParser "+$VERSION,5)
$=writeline(1,"code:"+$index.text+" from topic "+$address.text+@crlf+@crlf)
$=writeline(1,$line)
$=close(1)
shell "notepad /p %temp%\BBCodeParser "+$VERSION
sleep 1
del "%temp%\BBCodeParser "+$VERSION
endfunction




[ 20. January 2003, 05:29: Message edited by: Lonkero ]
_________________________
!

download KiXnet