Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?lc
- global gControllerHandlers, gData
- put "index" into gControllerHandlers
- start using stack (gAPPPATH & "stacks/lib_Fedwiki.livecode")
- on index
- -- put "Hello" into testArray ["World"]
- -- put json_FromArray (testArray) into someJSON
- -- put $_SERVER ["DOCUMENT_ROOT"] into documentRoot
- put fedwiki_GetDroppedUrl ($_POST_RAW) into imageURL
- set the itemdelimiter to "."
- if item -1 of imageURL is not among the items of "jpg.jpeg.png.gif" then
- put fedwiki_ConstructErrorJSON ("Not an image.", "Pity") into someJSON
- else
- -- fedwiki_ConstructNewImagePageArray pageTitle, someImage, imageType, pImageCaption, pSourceArray
- put "Dropped Image" into pageTitle
- put "This is a simple image dropped on to a wiki." into someText
- put fedwiki_ConstructNewPageArray (pageTitle, someText) into pageArray
- put "This is an image" into imageCaption
- put html_ExtractTLD (imageURL, true) into tldBit
- put "-" && tldBit into linkInfo
- put imageURL into descriptionURL
- put fedwiki_ConstructImageHtml (imageURL, imageCaption, descriptionURL, linkInfo) into imageHTML
- fedwiki_AddHtmlToPageArray pageArray, imageHTML
- put json_FromArray (pageArray) into someJSON
- end if
- fedwiki_ReturnJSON someJSON
- end index
- function html_ExtractTLD someURL, pLastTwo
- set the itemdelimiter to slash
- put item 3 of someURL into someTLD
- if pLastTwo is not true then return someTLD
- set the itemdelimiter to "."
- put item -2 to -1 of someTLD into tldBit
- return tldBit
- end html_ExtractTLD
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement