X PLPL V6PL  #< H  PL# +author David Davies authorEmaild.a.davies@bham.ac.uk descriptionPlease select 'Refresh Picture Gallery...' from the AssetManager menu in the tools menu inside the Radio application before starting! homePageUrl!http://radio.weblogs.com/0001161/name assetManager releaseDateversion0.994b8VGeneva tQ?8W 55 n$Geneva 5v&?LANDmac on any (pta) //boilerplate for your responder temp.tpta = pta^ pta^.responseHeaders.["Content-Type"] = "text/html" pta^.code = 200 //everything was OK pta^.responseBody = "" //build response return (true) n2.55 any2.5N ?G O condition1(string.lower (path) beginsWith "/assetmanager/")enabledmethods zGeneva oykoyk"RLANDmac on getmanilaMessage (msgNum) local (adrtable = @scratchpad.manilaRpcSettings) bundle // set up Manila site prefs This script makes sure that the scratchpad.manilaRpcSettings table required by all the other scripts in the manila.examples table is properly set up. if not defined (adrtable^) new (tableType, adrtable) if not defined (adrtable^.host) local (s = "weblogs.userland.com") if not dialog.ask ("Host:", @s) return (false) adrtable^.host = s if not defined (adrtable^.port) local (s = "80") if not dialog.ask ("Port:", @s) return (false) adrtable^.port = s if not defined (adrtable^.rpcPath) local (s = "/RPC2") if not dialog.ask ("RPC path:", @s) return (false) adrtable^.rpcPath = s if not defined (adrtable^.sitename) local (s = "manilaRpc") if not dialog.ask ("Site name:", @s) return (false) adrtable^.sitename = s if not defined (adrtable^.username) local (s = "name@server.com") if not dialog.ask ("Username:", @s) return (false) adrtable^.username = s if not defined (adrtable^.password) local (s = "") if not dialog.getPassword ("Password:", @s) return (false) adrtable^.password = s tabledata = manila.message.get (adrtable, msgnum) local (adrMsg = @temp.manilaRpcMessageTable) table.assign (adrMsg, tabledata) return (adrMsg^.body) webbrowser.displaytext (getmanilaMessage (3))  0Geneva o|mjLANDmac on pictureGallery (keyword) local f filename shortPath pathChar = file.getPathChar () wwwRoot = user.radio.prefs.wwwfolder imagesList = {} htmlText = "" bundle // log search term s = sizeOf (workspace.["web services"].gallerymacroct) + 1 s = string.padWithZeros (s, 4) new (tableType, @workspace.["web services"].gallerymacroct.[s]) workspace.["web services"].gallerymacroct.[s].date = clock.now () workspace.["web services"].gallerymacroct.[s].client = client workspace.["web services"].gallerymacroct.[s].keyword = keyword on add (s) htmlText = htmlText + s + cr for n = 1 to sizeOf (user.radio.settings.files) f = nameOf (user.radio.settings.files [n]) filename = file.fileFromPath (f) shortPath = string.replace (f, wwwRoot, "") if shortPath beginsWith "images" shortPath = string.replace (shortPath, "images" + pathChar, "") if shortPath beginsWith "2002" if not file.isFolder (f) and not (filename beginsWith "#") and not (system.environment.isCarbon and filename beginsWith ".") if keyword == "" imagesList = imagesList + f else if string.lower (shortPath) contains string.lower(keyword) imagesList = imagesList + f if imagesList == {} return ("No pictures to display!") else add ("

") add ("") local (c = 0) for n = 1 to sizeOf (imagesList) f = imagesList [n] adrImage = @user.radio.settings.files.[imagesList [n]] fname = string.lower (file.filefrompath (imagesList [n])) shortPath = string.replace (f, wwwRoot, "") url = adrImage^.upstream.url local (thumbnail = radio.file.getAbsolutePath ("images/thumbnails/" + fname)) if file.exists (thumbnail) thumbnail = radio.upstream.getfileurl (thumbnail) thumbnail = radio.file.getRelativePath (thumbnail) else thumbnail = url bundle // render images page bundle // build table bundle //get height, width local height = 0 width = 0 hw l scale try if fname endswith ".gif" local (hw = html.getgifheightwidth (f)) height = hw [1] width = hw [2] else if (fname endswith ".jpg") or (fname endswith ".jpeg") hw = html.getjpegheightwidth (f) height = hw [1] width = hw [2] bundle // calculate suitable display size if height > width l = height else l = width if l > 120 scale = single (l) / 120 else scale = 1 height = height / scale width = width / scale imageHTML = "\"An" add ("") if c == 4 add ("") c = 0 else c = c + 1 if c != 0 add ("") add ("
" + imageHTML + "
" + fname + "

") return (htmlText) webbrowser.displaytext (pictureGallery ("")) $datatablT E E$datatablT E E$datatablT E E$datatabl E E$datatablT E E$datatablT E E$datatablT E E Geneva jmOp~YLANDmac on rssSearch (searchArgs) local servicesNum = sizeof (aggregatorData.services) htmlResult = "" h serviceLink itemList = "" adrRSS adrChannel adrItemList adrItem itemLink itemDescription itemTitle feedType on add (s) htmlResult = htmlResult + s + cr on addToList (s) itemList = itemList + s + cr bundle // log search term s = sizeOf (workspace.["RSS Stuff"].radiosearches) + 1 s = string.padWithZeros (s, 4) new (tableType, @workspace.["RSS Stuff"].radiosearches.[s]) workspace.["RSS Stuff"].radiosearches.[s].date = clock.now () workspace.["RSS Stuff"].radiosearches.[s].search = searchArgs for n = 1 to servicesNum thisService = aggregatorData.services [n].compilation.channeltitle serviceLink = nameof (aggregatorData.services [n]) try try adrRSS = xml.getAddress (@aggregatorData.services [n].xmlstruct, "rss") else try adrRSS = xml.getAddress (@aggregatorData.services [n].xmlstruct, "RDF") else continue h = 0 itemList = "" adrChannel = xml.getAddress (adrRSS, "channel") adrItemList = xml.getAddressList (adrChannel, "item") for i = 1 to sizeOf (adrItemList) try itemLink = xml.getValue (adrItemList [i], "link") else itemLink = "" try itemTitle = xml.getValue (adrItemList [i], "title") else itemTitle = "" try itemDescription = xml.getValue (adrItemList [i], "description") else itemDescription = "" itemText = itemTitle + " " + itemDescription if string.lower (itemText) contains string.lower (searchArgs) if itemTitle != "" addToList ("
  • " + itemTitle + "
  • ") else addToList ("
  • " + itemDescription + "
  • ") h = h + 1 if h != 0 add ("

    " + thisService + "

    ") add ("
      ") add (itemList) add ("
    ") else msg (tryError) msg (serviceLink) if htmlResult == "" add ("Sorry, no items match your keyword " + searchArgs + ". Please try another keyword.") return (htmlResult) bundle // test code webBrowser.displayText (rssSearch ("smokers")) webBrowser.bringtofront () $datatablT E E$datatablT E E$datatablT E E$datatabl E E$datatablT E E$datatablT E E uGeneva jjCLANDmac on rssSearchResults (params) if not defined (scratchpad.rssResources) new (tabletype, @scratchpad.rssResources) else if typeOf (scratchpad.rssResources) != tableType new (tabletype, @scratchpad.rssSearchResults) s = clock.now () op.rssToOutline (params, @scratchpad.rssResources.[s]) Frontier.bringToFront () edit (@scratchpad.rssResources.[s]) return (true) $datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl85o|  ,8 BN _getmanilamessagepictureGallery rssSearchrssSearchResults'VGeneva s2VH 55 Geneva 55$&?LANDmac This script runs every hour. Geneva 55$&?LANDmac This script runs every minute. Geneva 55$&?LANDmac This script runs every night. {w.55  ". 9 everyHour, everyMinute-m everyNight.{k Geneva {ԸЏ'u1LANDmac on buildGemsPage (fileList) local htmlText = "" p = file.getPathChar () f = frontier.pathString + "www" + p + "gems" + p + "index.txt" copyandpaste filePath filename if FileList == "" return bundle // render gems page on add (s) htmlText = htmlText + s + cr bundle // header of catalogue file add ("#title \"My Gems\"") add ("#postTime \""+ clock.now () + "\"") add ("") for i = sizeof (assetManagerData.assets.gems) downto 1 adrGem = @assetManagerData.assets.gems [i] filePath = nameOf (adrGem^) dateCreated = adrGem^.created fileName = file.fileFromPath (filePath) url = "/" + adrGem^.relativePath add ("") add ("
    " + fileName + "File created " + dateCreated + "
    ") file.writeWholeFile (f, htmlText) $datatablPy¸y$datatablPy¸yGeneva {Ը.>.?6ILANDmac on buildImageGallery (fileList) local s url p = file.getPathChar () htmlText f = frontier.pathString + "www" + p + "picturegallery.txt" on add (s) htmlText = htmlText + s + cr if fileList == "" return bundle // header of catalogue file add ("#title \"My Pictures\"") add ("#postTime \""+ clock.now () + "\"") add (assetManagerSuite.simpleGallery ()) file.writeWholeFile (f, htmlText) $datatablPy¸y 5V 5X RN$55  fileMenu6user6RArial ?'oII_LLANDmac Changes 2/2/02; 0:13:00 AM by DAD Shamelessly stole Dave's code freshener script! 1/15/02; 5:21:20 PM by DW Runs on the user's machine, when refreshing. local (adrtable = @system.temp.assetmanagerSnapshot) assetManagerInfo = adrtable^.info assetManagerSuite = adrtable^.suite assetManagerThread = adrtable^.thread assetManagerWebsite = adrtable^.website assetManagerRpcHandlers = adrtable^.rpchandlers assetManagerSoapHandlers = adrtable^.soaphandlershandlers assetManagerNodeTypes = adrtable^.NodeTypes filemenu.savemyroot (@assetManagerSuite) local (x = string.parseAddress (@assetManagerSuite), f = x [1]) frontier.tools.install (f) dialog.notify ("Thanks for updating to version " + assetManagerInfo.version) NArial ?PL/fLANDmac 2/2/02; 0:13:00 AM by DAD Shamelessly stole Dave's code freshener script! 1/15/02; 5:18:06 PM by DW This is the Refresh menu command. local (url = "http://david.davies.name/weblog/publictools/assetmanager/assetmanager.fttb") local (urllist = string.urlsplit (url)) local (s = tcp.httpclient (server:urllist [2], path:urllist [3])) local (f = frontier.pathstring + "assetmanager.fttb") file.writewholefile (f, s) fatpages.importfatfile (f) thread.callscript (@system.temp.assetManagerSnapshot.loader, {}) FArial =o+2ULANDmac Changes 2/2/02; 0:13:00 AM by DAD Shamelessly stole Dave's code freshener script! 1/15/02; 5:08:55 PM by DW Created. I run this on my machine to create a package for refreshCode to load. Talk about a Mobius Strip. It's really simple code, but it's fun to walk your mind through it. local (oldassetManagerData) bundle //get assetManagerData ready for ship oldassetManagerData = assetManagerData new (tabletype, @assetManagerData) assetManagerThread.enabled = true assetManagerInfo.releaseDate = clock.now () local (adrtable = @system.temp.assetManagerSnapshot) new (tabletype, adrtable) adrtable^.info = assetManagerInfo adrtable^.suite = assetManagerSuite adrtable^.thread = assetManagerThread adrtable^.website = assetManagerWebsite adrtable^.rpchandlers = assetManagerRpcHandlers adrtable^.soaphandlershandlers = assetManagerSoapHandlers adrtable^.NodeTypes = assetManagerNodeTypes adrtable^.loader = assetManagerSuite.codeFreshener.loadNewCode local (f = radio.file.getSubFolder ("publictools/assetmanager") + "assetmanager.fttb") file.surefilepath (f) export.sendobject (adrtable, f) f = radio.file.getSubFolder ("publictools/assetmanager") + "assetmanager.root" target.set (this) fileMenu.saveCopy (f) assetManagerData = oldassetManagerData dialog.alert (file.filefrompath (f) + " is " + string.megabytestring (file.size (f))) }.R?RG  $0 ? loadNewCode7n refreshCode;JreleaseNewCode>VArial 3x161Geneva #uV=:LANDmac on notify (adrMsg) local pta = html.getpagetableaddress () if pta^.method == "POST" if defined (pta^.radioResponder.postArgs.notify) notifyemail = pta^.radioResponder.postArgs.notifyemail if notifyemail != "" assetManagerSuite.emailnotification.handlepost (adrMsg, notifyemail) return ("") T*Geneva #\ӼN}yLANDmac on notify (adrPost) local htmlText = "" checked = "" on add (s) htmlText = htmlText + s + cr if defined (assetmanagerdata.emailnotificationcategories.homepage) notifyemail = assetmanagerdata.emailnotificationcategories.homepage else notifyemail = "" if assetManagerData.defaultemailnotificationenabled checked = "checked " add ("

    Check this box to email this post to

    ") return (htmlText)  LGeneva .2 ϱ 7LANDmac on notify (adrMsg) assetManagerSuite.emailnotification.handlepost (adrMsg) Geneva ĉ) 8P_OLANDmac on handlepost (adrpost, recipient) temp.adrpostnotify = adrpost^ try onhome = not adrpost^.flNotOnHomePage weblog = user.radio.prefs.defaultCloudData.weblogTitle mimetype = assetManagerData.emailnotificationmimetype case mimetype "text/plain" postText = string.htmlToEmail (string (adrpost^.text)) "text/html" postText = string (adrpost^.text) if defined (adrpost^.title) subject = adrpost^.title else subject = "A new weblog post from " + weblog if defined (adrpost^.link) message = "

    " + adrpost^.link + "

    " else message = "

    A new weblog post has been posted to " + weblog + "

    " message = message + "

    " + postText + "

    " + weblog + "

    " if onhome url = "" + user.radio.prefs.defaultCloudData.url message = message + "

    " + url + "

    " if defined (adrPost^.categories) for n = 1 to sizeOf (adrPost^.categories) category = nameof (adrPost^.categories [n]) url = "

    " + weblogdata.categories.[category].htmlUrl + "" message = message + url + "
    " case mimetype "text/plain" message = string.htmlToEmail (message) tcp.sendmail (recipient:recipient, subject:subject, message:message, mimetype:mimetype) return ("") handlepost (@system.temp.adrpost, "d.a.davies@bham.ac.uk") 8 "պ#v-  5A [g rafterWeblogPostFormEbeforeWeblogPostFormGemailnotificationcallbackJ handlepostK`VGeneva 2%{ @Geneva {Ժ,^f,6ZLANDmac on galleryForWebsite () local s url pathChar = file.getPathChar () htmlText = "" originalWidth originalHeight template = myPicturesData.prefs.template copyandpaste filePath filename pta = html.getPageTableAddress () imagesToDelete on buildGallery () // render images page local galleryText = "" on addToGallery (s) galleryText = galleryText + s + cr addToGallery ("

    ") for i = sizeof (assetManagerData.assets.images) downto 1 adrImage = @assetManagerData.assets.images [i] filePath = nameOf (assetManagerData.assets.images [i]) filename = file.filefrompath (filePath) if string.lower (filename) == "thumbs.db" break if string.lower (filename) endswith ".png" break url = user.radio.settings.files.[filePath].upstream.url url = "/" + adrImage^.relativePath adrImage^.url = url bundle // calculate suitable display size originalHeight = adrImage^.height height = originalHeight originalWidth = adrImage^.width width = originalWidth if height > width l = height else l = width if l > 160 scale = single (l) / 160 else scale = 1 height = height / scale width = width / scale copyandpaste = (string (string.multipleReplaceAll (template, adrImage, false, "[[", "]]"))) imageHTML = "\"An" filename = file.filefrompath (filePath) addToGallery ("") addToGallery ("") addToGallery ("") addToGallery ("
    " + filename + " created: " + adrImage^.created + "" + imageHTML + "
    Copy and paste the HTML in this box to include this image:

    ") return (galleryText) on add (s) htmlText = htmlText + s + cr if pta^.method == "POST" temp.formpta = pta^ if defined (pta^.radioResponder.postArgs.delete) if pta^.radioResponder.postArgs.delete == "No" return (buildGallery ()) if defined (pta^.radioResponder.postArgs.deleteme) imagesToDelete = pta^.radioResponder.postArgs.deleteme add ("

    The selected pictures have been deleted!

    ") for f in imagesToDelete delete (@assetManagerData.assets.images [f]) file.delete (f) add (buildGallery ()) return (htmlText) else return (buildgallery ()) if defined (pta^.radioResponder.postArgs.deleteme) imagesToDelete = pta^.radioResponder.postArgs.deleteme add ("

    Are you sure you want to delete the following pictures?

    ") add ("
    ") for f in imagesToDelete add ("" + f + "
    ") add ("

    ") return (htmlText) else return (buildgallery ()) else return (buildgallery ())   N Geneva {YLANDmac on handleUpstreamedFiles (fileList) local wwwRoot = user.radio.prefs.wwwfolder pathChar = file.getPathChar () f gemsList = {} imagesList = {} filename destFolder = myPicturesData.prefs.destFolder height width hw assetManagerData.ct = assetManagerData.ct + 1 if fileList == "" return for n in fileList if system.environment.isCarbon and file.fileFromPath (n) beginsWith "." break if file.fileFromPath (n) beginsWith "#" break if file.isFolder (n) break if not file.isVisible (n) break filename = string.lower (file.filefrompath (n)) if filename == "thumbs.db" break if string.lower (filename) endswith ".png" break if string.lower (n) beginswith string.lower (user.radio.prefs.upstream.folder + "images" + pathchar + "thumbnails") break if f beginsWith "gems" gemsList = gemsList + n if not defined (assetManagerData.assets.gems.[n]) new (tableType, @assetManagerData.assets.gems.[n]) assetManagerData.assets.gems.[n] = user.radio.settings.files.[n] else table.assign (@assetManagerData.assets.gems.[n], user.radio.settings.files.[n]) if n beginsWith destFolder if not string.patternmatch (pathchar, n - destfolder) break if file.filefromPath (n) endswith ".gif" or file.filefromPath (n) endswith ".jpg" or file.filefromPath (n) endswith ".jpeg" try // get height and width bundle //set height, width height = 0 width = 0 local (fname = string.lower (file.filefrompath (n))) if fname endswith ".gif" local (hw = html.getgifheightwidth (n)) height = hw [1] width = hw [2] else if (fname endswith ".jpg") or (fname endswith ".jpeg") hw = html.getjpegheightwidth (n) height = hw [1] width = hw [2] if height == 0 msg ("Oops, we couldn't read the height of " + fname + " for some reason. Please tell david Davies") break else // skip this file and write an event log item local logtext = tryError +": " + n startticks = clock.ticks () radio.log.add ("assetManager picture gallery", logtext, startticks) break if not defined (assetManagerData.assets.images.[n]) new (tableType, @assetManagerData.assets.images.[n]) assetManagerData.assets.images.[n] = user.radio.settings.files.[n] else table.assign (@assetManagerData.assets.images.[n], user.radio.settings.files.[n]) imagesList = imagesList + n assetManagerData.assets.images.[n].filename = file.filefromPath (n) assetManagerData.assets.images.[n].height = height assetManagerData.assets.images.[n].width = width if imagesList != {} assetManagerSuite.buildImageGallery (imagesList) local imagelist for n = sizeof (assetManagerData.assets.images) downto 1 imagelist = imagelist + {nameof (assetManagerData.assets.images [n])} handleUpstreamedFiles (imagelist) Geneva :S for fixing the code for handling multiple picture attachments bundle // debug features temp.emailpta = adrmsg^ if not defined (workspace.assetmanagerdebug) new (tabletype, @workspace.assetmanagerdebug) workspace.assetmanagerdebug.[clock.now ()] = adrMsg^ // capture the message table local pathChar = file.getPathChar () p = user.radio.prefs.upstream.folder adrblog=radio.weblog.init () adrPost startticks = clock.ticks () hit = 0 height width align tpath bundle // set up assetManager picture prefs table if not defined (assetManagerData.picturesize) assetManagerData.picturesize = "scale" if not defined (assetManagerData.pictureheight) assetManagerData.pictureheight = 120 if not defined (assetManagerData.picturewidth) assetManagerData.picturewidth = 160 if not defined (assetManagerData.picturealign) assetManagerData.picturealign = "right" bundle // get picture display prefs if assetManagerData.picturesize == "scale" height = " height=\"" + assetManagerData.pictureheight + "\"" width = " width=\"" + assetManagerData.picturewidth + "\"" align = assetManagerData.picturealign bundle // set up images folder fpath = p + "images" + pathchar + "mailedimages" if not (file.exists (fpath)) file.newfolder (fpath) if defined (adrmsg^.parts) // got a MIME message for nparts = 1 to sizeOf (adrmsg^.parts) d = adrmsg^.parts[nparts].["Content-Type"] if string.lower (d) contains ".jpg" or string.lower (d) contains ".gif" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break fpath = assetmanagerSuite.mailToBlog.createDateFolders () d = binary (base64.decode (adrmsg^.parts[nparts].data)) file.writeWholeFile (fpath + fn, d) bundle // create thumbnail tpath = assetmanagerSuite.mailToBlog.createDateFolders ("thumbnails") file.writeWholeFile (tpath + fn, d) temp.temppath = tpath + fn assetmanagerSuite.mailToBlog.makethumbnail (tpath + fn, 160) turl = assetmanagerSuite.mailToBlog.createDateURL ("thumbnails") + fn bundle // imagemagick // Now the stuff that is MacOS X only with ImageMagick required //local (fullUnixPath = string.replaceAll (fpath + pathchar + fn, ":", "/")) //fullUnixPath = string.replaceAll (fullUnixPath, "Macintosh HD", "") // hack! it works for me only! //sys.unixShellCommand ("/usr/local/bin/mogrify -scale 200x200 \"" + fullUnixPath +"\"") // end of the MacOS X stuff url = assetmanagerSuite.mailToBlog.createDateURL () + fn adrMsg^.text = "" + adrMsg^.text if string.lower (d) contains "audio/mpeg" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break d = binary (base64.decode (adrmsg^.parts[nparts].data)) if not file.exists ("testarea") workspace.mount () file.writeWholeFile ("testarea:movies" + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn url = "http://medweb2.bham.ac.uk/testarea/movies/" + fn file.writeWholeFile (fpath + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn adrMsg^.text = "" + adrMsg^.text if string.lower (d) contains "text/html" or string.lower (d) contains "multipart/alternative" try htmlText = adrMsg^.parts [nparts].data htmlTextl = string.lower (htmlText) if htmltextl contains "content-type: text/enriched" continue a = 6+ string.patternmatch ("", htmlTextl) b = string.patternmatch ("", htmlTextl) s = string.mid (htmlText, a, b - a) s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") adrmsg^.text = radio.string.untaint (s) on error () msg (tryerror) if string.lower (d) contains "application/octet-stream" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break if fn endswith ".3gp" d = binary (base64.decode (adrmsg^.parts[nparts].data)) fpath = assetmanagerSuite.mailToBlog.createDateFolders () file.writeWholeFile (fpath + fn, d) url = assetmanagerSuite.mailToBlog.createDateURL () + fn embedtext = assetmanagersuite.mailtoblog.qtembedsnippet embedtext = string.replaceall (embedtext, "*", url) adrMsg^.text = embedtext + adrMsg^.text if fn endswith ".mp3" d = binary (base64.decode (adrmsg^.parts[nparts].data)) if not file.exists ("testarea") workspace.mount () file.writeWholeFile ("testarea:movies" + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn url = "http://medweb2.bham.ac.uk/testarea/movies/" + fn adrMsg^.text = "" + adrMsg^.text if fn endswith ".jpg" or fn endswith ".gif" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break d = binary (base64.decode (adrmsg^.parts[nparts].data)) file.writeWholeFile (fpath + pathchar + fn, d) // Now the stuff that is MacOS X only with ImageMagick required //local (fullUnixPath = string.replaceAll (fpath + pathchar + fn, ":", "/")) //fullUnixPath = string.replaceAll (fullUnixPath, "Macintosh HD", "") // hack! it works for me only! //sys.unixShellCommand ("/usr/local/bin/mogrify -scale 200x200 \"" + fullUnixPath +"\"") // end of the MacOS X stuff url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn adrMsg^.text = "" + adrMsg^.text secret = adrmsg^.subject if secret contains weblogdata.prefs.mailposting.secretsubject hit ++ bundle // create the table for the post adrPost = @adrblog^.posts.[string.padwithzeros (adrblog^.prefs.nextPostNum++, 8)] local (postid = number (nameOf (adrpost^))) new (tabletype, adrpost) adrmsg^.text = "

    " + adrmsg^.text + "

    " bundle // try to work out if there should be a post title from the subject line if secret != weblogdata.prefs.mailposting.secretsubject if secret beginswith weblogdata.prefs.mailposting.secretsubject adrpost^.title = secret - (weblogdata.prefs.mailposting.secretsubject + " ") bundle // do the posting local (s = adrmsg^.text) s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") s = radio.string.untaint (s) adrpost^.flNotOnHomePage = false adrpost = radio.weblog.post (posttext:s, adrPost:adrPost) radio.weblog.updatePagesForPost (adrpost) temp.adrpost = adrpost^ adrblog^.stats.ctMailToBlogPosts++ bundle // add an event log logtext = "A new mailtoblog message was successfully added to the home page." radio.log.add ("assetManager mailtoblog", logtext, startticks) else if defined (assetManagerData.categories) for n = 1 to sizeOf (assetManagerData.categories) ss = string.lower (assetManagerData.categories [n]) if string.lower (secret) contains ss hit++ if not defined (adrMsg^.categories) new (tableType, @adrMsg^.categories) category = nameOf (assetManagerData.categories [n]) bundle // create the table for the post adrPost = @adrblog^.posts.[string.padwithzeros (adrblog^.prefs.nextPostNum++, 8)] local (postid = number (nameOf (adrpost^))) new (tabletype, adrpost) bundle // set up the category table new (tabletype, @adrpost^.categories) adrpost^.categories.[category] = true adrmsg^.text = "

    " + adrmsg^.text + "

    " bundle // try to work out if there should be a post title from the subject line if secret != ss if secret beginswith ss adrpost^.title = secret - (ss + " ") bundle // do the posting local (s = adrmsg^.text) s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") s = radio.string.untaint (s) adrpost^.flNotOnHomePage = true adrpost = radio.weblog.post (posttext:s, adrPost:adrPost) radio.weblog.updatePagesForPost (adrpost) if not (weblogdata.categories.[category].storyList contains postid) weblogdata.categories.[category].storyList = weblogdata.categories.[category].storyList + postid temp.adrpost = adrpost^ adrblog^.stats.ctMailToBlogPosts++ bundle // add an event log logtext = "A new mailtoblog message was successfully added to the category: " + category radio.log.add ("assetManager mailtoblog", logtext, startticks) if hit == 0 bundle // add an event log for debug purposes logtext = "Failed mailtoblog post:
    Subject: " + adrmsg^.subject + "
    From: " + adrmsg^.from radio.log.add ("assetManager mailtoblog", logtext, startticks) handlepost (@temp.emailpta) ,"mGeneva ~^Q-zLANDmac on handlepost (adrMsg) bundle // changes // 23/02/2003 Thanks to JY Stervinou for fixing the code for handling multiple picture attachments temp.ptae = adrMsg^ workspace.newyear.[clock.now ()] = adrMsg^ edit (@temp.ptae) local pathChar = file.getPathChar () p = user.radio.prefs.upstream.folder adrblog=radio.weblog.init () adrPost startticks = clock.ticks () hit = 0 height width align bundle // set up assetManager picture prefs table if not defined (assetManagerData.picturesize) assetManagerData.picturesize = "scale" if not defined (assetManagerData.pictureheight) assetManagerData.pictureheight = 120 if not defined (assetManagerData.picturewidth) assetManagerData.picturewidth = 160 if not defined (assetManagerData.picturealign) assetManagerData.picturealign = "right" bundle // get picture display prefs if assetManagerData.picturesize == "scale" height = " height=\"" + assetManagerData.pictureheight + "\"" width = " width=\"" + assetManagerData.picturewidth + "\"" align = assetManagerData.picturealign bundle // set up images folder fpath = p + "images" + pathchar + "mailedimages" if not (file.exists (fpath)) file.newfolder (fpath) if defined (adrmsg^.parts) // got a MIME message for nparts = 1 to sizeOf (adrmsg^.parts) d = adrmsg^.parts[nparts].["Content-Type"] if string.lower (d) contains ".jpg" or string.lower (d) contains ".gif" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break fpath = assetmanagerSuite.mailToBlog.createDateFolders () d = binary (base64.decode (adrmsg^.parts[nparts].data)) file.writeWholeFile (fpath + fn, d) // Now the stuff that is MacOS X only with ImageMagick required //local (fullUnixPath = string.replaceAll (fpath + pathchar + fn, ":", "/")) //fullUnixPath = string.replaceAll (fullUnixPath, "Macintosh HD", "") // hack! it works for me only! //sys.unixShellCommand ("/usr/local/bin/mogrify -scale 200x200 \"" + fullUnixPath +"\"") // end of the MacOS X stuff url = assetmanagerSuite.mailToBlog.createDateURL () + fn adrMsg^.text = "" + adrMsg^.text if string.lower (d) contains "audio/mpeg" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break d = binary (base64.decode (adrmsg^.parts[nparts].data)) if not file.exists ("testarea") workspace.mount () file.writeWholeFile ("testarea:movies" + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn url = "http://medweb2.bham.ac.uk/testarea/movies/" + fn file.writeWholeFile (fpath + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn adrMsg^.text = "" + adrMsg^.text if string.lower (d) contains "text/html" or string.lower (d) contains "multipart/alternative" try htmlText = adrMsg^.parts [nparts].data htmlTextl = string.lower (htmlText) if htmltextl contains "content-type: text/enriched" continue a = 6+ string.patternmatch ("", htmlTextl) b = string.patternmatch ("", htmlTextl) s = string.mid (htmlText, a, b - a) s = string.trimWhitespace (s) s = string.replaceAll (s, "3D", "") s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") adrmsg^.text = radio.string.untaint (s) on error () msg (tryerror) if string.lower (d) contains "application/octet-stream" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break if fn endswith ".3gp" d = binary (base64.decode (adrmsg^.parts[nparts].data)) fpath = assetmanagerSuite.mailToBlog.createDateFolders () file.writeWholeFile (fpath + fn, d) url = assetmanagerSuite.mailToBlog.createDateURL () + fn embedtext = assetmanagersuite.mailtoblog.qtembedsnippet embedtext = string.replaceall (embedtext, "*", url) adrMsg^.text = embedtext + adrMsg^.text if fn endswith ".mp3" d = binary (base64.decode (adrmsg^.parts[nparts].data)) if not file.exists ("testarea") workspace.mount () file.writeWholeFile ("testarea:movies" + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn url = "http://medweb2.bham.ac.uk/testarea/movies/" + fn adrMsg^.text = "" + adrMsg^.text if fn endswith ".jpg" or fn endswith ".gif" bundle // work out filename field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break d = binary (base64.decode (adrmsg^.parts[nparts].data)) file.writeWholeFile (fpath + pathchar + fn, d) // Now the stuff that is MacOS X only with ImageMagick required //local (fullUnixPath = string.replaceAll (fpath + pathchar + fn, ":", "/")) //fullUnixPath = string.replaceAll (fullUnixPath, "Macintosh HD", "") // hack! it works for me only! //sys.unixShellCommand ("/usr/local/bin/mogrify -scale 200x200 \"" + fullUnixPath +"\"") // end of the MacOS X stuff url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn adrMsg^.text = "" + adrMsg^.text secret = adrmsg^.subject try category = "NewYear2004" bundle // create the table for the post adrPost = @adrblog^.posts.[string.padwithzeros (adrblog^.prefs.nextPostNum++, 8)] local (postid = number (nameOf (adrpost^))) new (tabletype, adrpost) bundle // set up the category table new (tabletype, @adrpost^.categories) adrpost^.categories.[category] = true adrmsg^.text = "

    " + adrmsg^.text + "

    " adrpost^.title = secret bundle // do the posting local (s = adrmsg^.text) s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") s = radio.string.untaint (s) adrpost^.flNotOnHomePage = true adrpost = radio.weblog.post (posttext:s, adrPost:adrPost) radio.weblog.updatePagesForPost (adrpost) if not (weblogdata.categories.[category].storyList contains postid) weblogdata.categories.[category].storyList = weblogdata.categories.[category].storyList + postid temp.adrpost = adrpost^ adrblog^.stats.ctMailToBlogPosts++ bundle // add an event log logtext = "A new mailtoblog message was successfully added to the category: " + category radio.log.add ("assetManager mailtoblog", logtext, startticks) else bundle // add an event log for debug purposes logtext = "Failed mailtoblog post:
    Subject: " + adrmsg^.subject + "
    From: " + adrmsg^.from radio.log.add ("assetManager mailtoblog", logtext, startticks) handlepost (@temp.ptae) " h8Geneva ĉ)~գ!LANDmac on handlepost (adrMsg) temp.ptae = adrMsg^ local pathChar = file.getPathChar () p = user.radio.prefs.upstream.folder adrblog=radio.weblog.init () adrPost bundle // set up images folder fpath = p + "images" + pathchar + "mailedimages" if not (file.exists (fpath)) file.newfolder (fpath) if defined (adrmsg^.parts) // got a MIME message bundle // work out filename d = adrmsg^.parts.["0002"].["Content-Type"] field = string.patternmatch ("name=\"", d) fn = "" for n = field + 6 to string.length (d) if string.nthchar (d, n) != "\"" fn = fn + string.nthchar (d, n) else break d = binary (base64.decode (adrmsg^.parts.["0002"].data)) file.writeWholeFile (fpath + pathchar + fn, d) url = user.radio.prefs.defaultclouddata.url + "images/mailedimages/" + fn adrMsg^.text = "" + adrMsg^.text secret = adrmsg^.subject if defined (assetManagerData.categories) for n = 1 to sizeOf (assetManagerData.categories) ss = assetManagerData.categories [n] if secret == ss if not defined (adrMsg^.categories) new (tableType, @adrMsg^.categories) category = nameOf (assetManagerData.categories [n]) bundle // create the table for the post adrPost = @adrblog^.posts.[string.padwithzeros (adrblog^.prefs.nextPostNum++, 8)] new (tabletype, adrpost) bundle // set up the category table new (tabletype, @adrpost^.categories) adrpost^.categories.[category] = true bundle // do the posting local (s = adrmsg^.text) s = string.trimWhitespace (s) s = string.quotedPrintableDecode (s) s = string.replaceAll (s, "\r\n", "\r") s = radio.string.untaint (s) adrpost^.flNotOnHomePage = true adrpost = radio.weblog.post (posttext:s, adrPost:adrPost) radio.weblog.updatePagesForPost (adrpost) temp.adrpost = adrpost^ adrblog^.stats.ctMailToBlogPosts++ handlepost (@temp.ptae)  h KGeneva .297LANDmac on assetmanager (adrMsg) assetManagerSuite.mailtoblog.handlepost (adrMsg) TKGeneva /J/  9ascrmac on makethumbnail(source_file, size) try set this_file to source_file as alias tell Application "Image Events" launch set this_image to open this_file scale this_image to size size save this_image without icon close this_image end tell on error error_message return error_message end try end makethumbnail  QGeneva //.mLANDmac dialog.notify (assetmanagerSuite.mailToBlog.makethumbnail (temp.temppath, 160)) j.m/  ,8 CO _k y  createDateFoldersy createDateURL| handlepost~handlepost open handlepostoldΎmailtoblogcallback makethumbnailqtembedsnippet2 testVGeneva 2@8%Geneva !҃Җ$&?LANDmac assetManagerSuite.init () /Arial R{B_'-LANDmac assetManagerSuite.codeFreshener.refreshCode () ,Geneva !Ӹ&?LANDmac assetManagerSuite.rightClickmenu.install () 6WGeneva 5n&?LANDmac AssetManager Refresh Picture Gallery... Refresh Code.. Install right-click menus... m &p5$Geneva t pGeneva $PGMLANDmac on refreshImageGallery () bundle // render images page local htmlText = "" p = file.getPathChar () f = frontier.pathString + "www" + p + "picturegallery.txt" on add (s) htmlText = htmlText + s + cr bundle // header of catalogue file add ("#title \"My Pictures\"") add ("#postTime \""+ clock.now () + "\"") add (assetManagerSuite.simpleGallery ()) file.writeWholeFile (f, htmlText) refreshImageGallery () $datatablPy¸y$datatablPy¸yxGeneva |Һ$9>[LANDmac on removeAssets (adrUpstreamTable) local s url = adrUpstreamTable^.url pathChar = file.getPathChar () hit = false temp.adrUpstreamTable = adrUpstreamTable^ if adrUpstreamTable^.flError return for i = 1 to sizeOf (assetManagerData.assets.images) iUrl = assetManagerData.assets.images [i].upstream.url if url == iUrl delete (@assetManagerData.assets.images [i]) hit = true break if hit assetManagerSuite.refreshImageGallery () if url contains "/gems/" return }Geneva T''?LANDmac bundle // script to add a buddy by right-clicking if not op.attributes.getOne ("type", @type) dialog.notify ("No buddy to subscribe to here, bud!") return (false) case type "buddyOutlineElement" name = op.getLineText () What follows is essentially Jake's code from radio.outliner.menuCommands.subscribeToOutline () local (url = "http://") if dialog.yesno ("Subscribe to " + name + "'s outline?") op.attributes.getOne ("url", @url) if not (url beginsWith "http://") url = "http://" + url local (adrdata = radio.outliner.init ()) local (author = "Anonymous") local (adrsubscription = @adrdata^.subscriptions.[url]) if defined (adrsubscription^) frontier.bringtofront () radio.outliner.openBuddies (true, true) return local (localoutline) try try //to get the author from the OPML local (adrincache = radio.outliner.preCacheUrl (url)) local (xstruct) xml.compile (adrincache^.xmltext, @xstruct) local (nomad = xml.getAddress (@xstruct, "opml")) nomad = xml.getAddress (nomad, "head") nomad = xml.getAddress (nomad, "ownerName") author = nomad^ radio.outliner.read (url, @localoutline) else scriptError ("Can't subscribe to the outline because there was an error reading it. \"" + tryerror + "\".") new (tabletype, adrsubscription) adrsubscription^.author = author adrsubscription^.outline = localoutline adrsubscription^.whenCreated = clock.now () adrsubscription^.whenLastPoll = date (0) radio.outliner.openBuddies (true) else dialog.notify ("No buddy to subscribe to here, bud!") return (false) $datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl$datatabl+Geneva ظ/'?LANDmac Buddies Add this buddy to Buddies list... "p16$YGeneva d|p Geneva 袸:'?LANDmac bundle // Search using Google local htmlText itemStruct text xmlText starttext on add (s) htmlText = htmlText + s + cr on makeRssFile () bundle //build xmltext local (indentlevel = 0) on add (s) xmltext = xmltext + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add ("") add ("") add (""); indentlevel++ add (""); indentlevel++ add ("" + encode ("Google Search Results") + "") add ("" + encode ("http://www.google.com/") + "") add ("" + encode ("Results of a Google search") + "") if language != "none" add ("" + language + "") add ("" + "Copyright " + date.year () + " " + "Probably Google" + "") add ("" + date.netstandardstring (clock.now ()) + "") add ("http://backend.userland.com/rss092") add ("" + encode (user.prefs.name) + "") add ("" + encode (user.prefs.name) + "") bundle //add cloud element if flCloud with user.radio.prefs.rssCloud add ("") add (itemStruct) add (""); indentlevel-- add (""); indentlevel-- on addRSSitem (title, link, description) title = searchengine.stripmarkup (title) description = searchengine.stripmarkup (description) bundle //build xmltext local (indentlevel = 2) on add (s) itemStruct = itemStruct + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add (""); indentlevel++ add ("" + encode (title) + "") add ("" + link + "") add ("" + encode (description) + "") add (""); indentlevel-- bundle // ask for what to search for dialog.run (@dialog.cards.moreinfo) starttext = text dialog.ask ("Enter Google search term", @text) if starttext == text or text == "" return system.temp.googleSearch = google.search (text) if system.temp.googleSearch.endIndex == 0 dialog.notify ("Sorry, nothing found at Google.") for n = 1 to system.temp.googleSearch.endIndex title = system.temp.googleSearch.resultElements [n].title if title == "" title = system.temp.googleSearch.resultElements [n].summary snippet = system.temp.googleSearch.resultElements [n].snippet url = system.temp.googleSearch.resultElements [n].url add ("

    " + n + ". " + title + "

    ") addRSSitem (title, url, snippet) makeRssFile () op.rssToOutline (xmlText, @system.temp.googleRSSResults) edit (@system.temp.googleRSSResults) datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata\r rGeneva 薸 '?LANDmac bundle // Search using Google local htmlText itemStruct text = op.getLineText () xmlText on add (s) htmlText = htmlText + s + cr on makeRssFile () bundle //build xmltext local (indentlevel = 0) on add (s) xmltext = xmltext + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add ("") add ("") add (""); indentlevel++ add (""); indentlevel++ add ("" + encode ("Google Search Results") + "") add ("" + encode ("http://www.google.com/") + "") add ("" + encode ("Results of a Google search") + "") if language != "none" add ("" + language + "") add ("" + "Copyright " + date.year () + " " + "Probably Google" + "") add ("" + date.netstandardstring (clock.now ()) + "") add ("http://backend.userland.com/rss092") add ("" + encode (user.prefs.name) + "") add ("" + encode (user.prefs.name) + "") bundle //add cloud element if flCloud with user.radio.prefs.rssCloud add ("") add (itemStruct) add (""); indentlevel-- add (""); indentlevel-- on addRSSitem (title, link, description) title = searchengine.stripmarkup (title) description = searchengine.stripmarkup (description) bundle //build xmltext local (indentlevel = 2) on add (s) itemStruct = itemStruct + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add (""); indentlevel++ add ("" + encode (title) + "") add ("" + link + "") add ("" + encode (description) + "") add (""); indentlevel-- if text == "" return system.temp.googleSearch = google.search (text) if system.temp.googleSearch.endIndex == 0 dialog.notify ("Sorry, nothing found at Google.") for n = 1 to system.temp.googleSearch.endIndex title = system.temp.googleSearch.resultElements [n].title if title == "" title = system.temp.googleSearch.resultElements [n].summary snippet = system.temp.googleSearch.resultElements [n].snippet url = system.temp.googleSearch.resultElements [n].url add ("

    " + n + ". " + title + "

    ") addRSSitem (title, url, snippet) makeRssFile () op.rssToOutline (xmlText, @system.temp.googleRSSResults) edit (@system.temp.googleRSSResults) datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata\O ;Geneva 袸'?LANDmac bundle // Search using Google local htmlText itemStruct text = op.getLineText () xmlText starttext on add (s) htmlText = htmlText + s + cr on makeRssFile () bundle //build xmltext local (indentlevel = 0) on add (s) xmltext = xmltext + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add ("") add ("") add (""); indentlevel++ add (""); indentlevel++ add ("" + encode ("Google Search Results") + "") add ("" + encode ("http://www.google.com/") + "") add ("" + encode ("Results of a Google search") + "") if language != "none" add ("" + language + "") add ("" + "Copyright " + date.year () + " " + "Probably Google" + "") add ("" + date.netstandardstring (clock.now ()) + "") add ("http://backend.userland.com/rss092") add ("" + encode (user.prefs.name) + "") add ("" + encode (user.prefs.name) + "") bundle //add cloud element if flCloud with user.radio.prefs.rssCloud add ("") add (itemStruct) add (""); indentlevel-- add (""); indentlevel-- on addRSSitem (title, link, description) title = searchengine.stripmarkup (title) description = searchengine.stripmarkup (description) bundle //build xmltext local (indentlevel = 2) on add (s) itemStruct = itemStruct + string.filledstring ("\t", indentlevel) + s + "\r\n" on encode (s) if system.environment.isMac //02/22/2001 JES: convert to Latin text return (xml.entityEncode (latinToMac.macToLatin (s), true)) else return (xml.entityEncode (s, true)) add (""); indentlevel++ add ("" + encode (title) + "") add ("" + link + "") add ("" + encode (description) + "") add (""); indentlevel-- if text == "" return bundle // ask for what to search for dialog.run (@dialog.cards.moreinfo) starttext = text dialog.ask ("Enter Google search term", @text) if starttext == text or text == "" return system.temp.googleSearch = google.search (text) if system.temp.googleSearch.endIndex == 0 dialog.notify ("Sorry, nothing found at Google.") for n = 1 to system.temp.googleSearch.endIndex title = system.temp.googleSearch.resultElements [n].title if title == "" title = system.temp.googleSearch.resultElements [n].summary snippet = system.temp.googleSearch.resultElements [n].snippet url = system.temp.googleSearch.resultElements [n].url add ("

    " + n + ". " + title + "

    ") addRSSitem (title, url, snippet) makeRssFile () op.rssToOutline (xmlText, @system.temp.googleRSSResults) edit (@system.temp.googleRSSResults) datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datata datataOGGeneva !)+ &?LANDmac local url if not op.attributes.getone ("url", @url) dialog.notify ("This is not a Radio link so can't find related items!") return (false) if url == "" dialog.notify ("This is not a Radio link so can't find related items!") return (false) op.insert ("Google's items related to this...", right) system.temp.googleSearch = google.search ("related: " + url) if system.temp.googleSearch.endIndex == 0 dialog.notify ("Sorry, nothing found at Google.") return (true) for n = 1 to system.temp.googleSearch.endIndex title = system.temp.googleSearch.resultElements [n].title if title == "" title = system.temp.googleSearch.resultElements [n].summary title = searchengine.stripmarkup (title) snippet = system.temp.googleSearch.resultElements [n].snippet snippet = searchengine.stripmarkup (snippet) url = system.temp.googleSearch.resultElements [n].url if n == 1 op.insert (title + " - " + snippet, right) else op.insert (title + " - " + snippet, down) bundle // set atts new (tabletype, @atts) atts.type = "link" atts.url = url op.attributes.addGroup (@atts) return (true) datata datata datata datata datata datata datata datata datataFSGeneva ظ),'?LANDmac Google Search for... Search for this... Search for parts of this... Related... r   .Xp4=6$YGeneva d|plGeneva 9LANDmac menu.addSubMenu (@user.tools.menus.rightclickmenu, "Asset Manager", @assetManagerSuite.rightClickmenu.googleRightClickmenu) menu.addSubMenu (@user.tools.menus.rightclickmenu, "Asset Manager", @assetManagerSuite.rightClickmenu.manilaRightClickmenu) menu.addSubMenu (@user.tools.menus.rightclickmenu, "Asset Manager", @assetManagerSuite.rightClickmenu.buddiesRightClickmenu) dialog.notify ("Right-click menus installed. Have fun!") edit (@user.tools.menus.rightclickmenu) llGeneva T;>'?LANDmac bundle // script to add stuff to Manila on init () if not defined (user.manilasite) new (tabletype, @user.manilasite) user.manilasite.url = "" user.manilasite.username = "" user.manilasite.password = "" dialog.ask ("Manila server IP address e.g. mysite.weblogs.com", @user.manilasite.manilaServer) dialog.ask ("Manila site URL e.g. http://mysite.weblogs.com/manilaSite", @user.manilasite.url) dialog.ask ("Manila site username - usually your email", @user.manilasite.username) dialog.ask ("Manila site password", @user.manilasite.password) filemenu.save () on addToManila (maniladata) local manilasite = user.manilasite.url manilaServer = user.manilasite.manilaServer manilausername = user.manilasite.username manilapassword = user.manilasite.password params ={manilausername, manilapassword, manilasite, maniladata} betty.rpc.client (manilaServer, 80, "manila.homepage.addtohomepage", @params) local type = "" adrtable init () if not op.attributes.getOne ("type", @type) bundle // probably a regular outline, ask the user what to do local s = "" sendToManila = dialog.threeWay ("What should I send to Manila?", "This Outline", "This line", "Nothing") case sendToManila "1" manilaData = op.getSubOutline () op.newOutlineObject (manilaData, @scratchpad.outline) s = s + html.getOutlineHtml (@scratchpad.outline, "\r
      ", "\r
    ", "\r", "") op.go (left,infinity) s = "" + op.getLineText () + " said: " + s addToManila (s) dialog.notify ("The selected text has been added to your Manila site!") "2" s = s + op.getLineText () op.go (left,infinity) s = "" + op.getLineText () + " said: " + s addToManila (s) dialog.notify ("The selected text has been added to your Manila site!") return (false) name = op.getLineText () case type "user" op.attributes.getOne ("url", @url) bundle // add to Manila maniladata = "A user from Radio Userland: " maniladata = maniladata + "" + name + "" addToManila (maniladata) dialog.alert (name + " has been added to your Manila home page") "link" op.attributes.getOne ("url", @url) bundle // add to Manila op.go (left,infinity) s = "" + op.getLineText () + " said: " s = s + "" + name + "" addToManila (s) dialog.alert (name + " has been added to your Manila home page") "file" op.attributes.getOne ("url", @url) op.go (left, op.level () - 2) owner = op.getLineText () bundle // add to Manila maniladata = "A file belonging to " + owner + ": " maniladata = maniladata + "" + name + "" addToManila (maniladata) dialog.alert (owner + "'s file has been added to your Manila home page") "remoteSong" op.attributes.getOne ("song", @song) op.attributes.getOne ("artist", @artist) op.go (left, 2) name = op.getLineText () bundle // add to Manila maniladata = name + " likes \"" + song + "\" by \"" + artist + "\"" addToManila (maniladata) dialog.alert (name + "'s song choice has been added to your Manila home page") "song" songname = op.getLineText () bundle // add to Manila maniladata = "I like the song \"" + songname + "\"" addToManila (maniladata) dialog.alert ("My song choice has been added to my Manila home page") "buddyOutlineElement" op.attributes.getOne ("url", @url) bundle // add to Manila maniladata = "A user from Radio Userland: " maniladata = maniladata + "" + name + "" addToManila (maniladata) dialog.alert (name + " has been added to your Manila home page") return (false) $datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl.-.$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...$datatabl...Geneva ظ .'?LANDmac Manila Add this to Manila... 8NpV6$YGeneva d|p8Ǹ " 7C KW lbuddiesRightClickmenugoogleRightClickmenu5Zinstall5manilaRightClickmenuWVGeneva 2< 0 Geneva {ԻIf_qLANDmac on simpleGallery () local s url pathChar = file.getPathChar () htmlText = "" originalWidth originalHeight template = myPicturesData.prefs.template copyandpaste filePath thumburl filename height width bundle // render images page on add (s) htmlText = htmlText + s + cr add ("

    ") local (c = 0) add ("") for i = sizeof (assetManagerData.assets.images) downto 1 adrImage = @assetManagerData.assets.images [i] filePath = nameOf (assetManagerData.assets.images [i]) filename = file.filefrompath (filePath) if string.lower (filename) == "thumbs.db" continue if string.lower (filename) endswith ".png" continue if string.lower (filename) endswith ".txt" continue if string.lower (filename) endswith ".html" continue if string.lower (filename) endswith ".gif" or string.lower (filename) endswith ".jpg" or string.lower (filename) endswith ".jpeg" url = user.radio.settings.files.[filePath].upstream.url url = "/" + adrImage^.relativePath adrImage^.url = url try bundle // calculate suitable display size originalHeight = adrImage^.height height = originalHeight originalWidth = adrImage^.width width = originalWidth if height > width l = height else l = width if l > 120 scale = single (l) / 120 else scale = 1 height = height / scale width = width / scale else local logtext = tryError +": " + n startticks = clock.ticks () radio.log.add ("assetManager picture gallery", logtext, startticks) break bundle // if thumbnail exists then use that if file.exists (user.radio.prefs.upstream.folder + "images" + pathchar + "thumbnails" + pathchar + filename) thumburl = user.radio.prefs.defaultclouddata.url + "images/thumbnails/" + filename else thumburl = url imageHTML = "\"An" add ("") copyandpaste = (string (string.multipleReplaceAll (template, adrImage, false, "[[", "]]"))) if c == 4 add ("") c = 0 else c = c + 1 if c != 0 add ("") add ("
    " + imageHTML + "
    " + filename + "

    ") return (htmlText) webbrowser.displaytext (simpleGallery ()) 0 }Geneva 56$&?LANDmac This script returns a string which appears in the Status Center on the Radio UserLand home page. return ("I'm a cool Tool!") ` Geneva ߼ N4;&LANDmac bundle // my stuff local (pta = html.getpagetableaddress ()) temp.mypta = pta^ pta^.title = "Asset Manager Tool v" + assetmanagerinfo.version local (htmltext = "") on add (s) htmltext = htmltext + s + "\r\n" add ("

    Thanks for trying out my asset managment tool! Please send comments & suggestions to me via email.


    ") add ("

    Menu

    ") add ("
    ") add ("

    Mobile weblogging preferences

    ") add ("

    Weblog post email notification

    ") add ("

    Manage your picture gallery

    ") add ("
    ") add (assetManagerSuite.galleryForWebsite ()) return (htmlText)  ~5 "  %1 CO Ye s    *6 CO ^j x   background. buildGemsPage/EbuildImageGallery4 callbacks7 codeFreshenerDemailnotificationRQgalleryForWebsiteSqhandleUpstreamedFilesc'initp mailtoblogmenurefreshImageGalleryi removeAssets:rightClickmenuX simpleGalleryY5statusCenterMessageeqwebSiteHomePagef~V Lucida GrandeHYG?2VCGeneva ;~/M(&?LANDmac background buildGemsPage buildImageGallery callbacks codeFreshener loadNewCode refreshCode releaseNewCode emailnotification afterWeblogPostForm beforeWeblogPostForm emailnotificationcallback handlepost galleryForWebsite handleUpstreamedFiles init mailtoblog createDateFolders createDateURL handlepost handlepost open handlepostold mailtoblogcallback makethumbnail qtembedsnippet test menu refreshImageGallery removeAssets rightClickmenu buddiesRightClickmenu googleRightClickmenu install manilaRightClickmenu simpleGallery statusCenterMessage webSiteHomePage ]x_]x_]x_]x_]x_]x]x]x]x_]x]x]x]x]x_]x_]x_]x_]x]x]x]x]x]x]x]x]x]x_]x_]x_]x_]x]x]x]x]x_]x_]x_ Geneva 66$&?LANDmac This script runs in its own thread. loop //loop until the application quits Add your code here. thread.sleepFor (10) //sleep for ten seconds P.6PL ctenabledscripttnVGeneva <?8tArial FFL2LANDmac on finalFilter (pta) pta^.renderedText = string.replace (pta^.renderedText, "[[title]]", "") return (true) ����������������������������� ���-����Geneva���������������������������� ��������������Eu`Q�������2LAND������mac ������������on firstFilter (adrPageTable) return (true) �����������������������*��[����Geneva���������������������������� ��������������Eu7a������L�3*lLAND������mac ������������on pageFilter (pta) if typeOf (pta^.template) == outlineType or typeOf (pta^.template) == wpTextType table.assign (@pta^.template, string (pta^.template)) if typeOf (pta^.template) == stringType and not pta^.indirectTemplate pta^.template = string.replace (pta^.template, "<title>", "[[title]]") html.addPageToGlossary (pta) return (true) �����������������������������������������������y���.���EF�������� ���� ��� ����$���0 ����; finalFilter�����vO firstFilter�����wY pagefilter�����x��VGeneva���������������������������� �����������P�E��$����������������������������H�������D������76�������� ����url���http://127.0.0.1/assetManager/���H���]�������Y���$����������� ���� ��� ����$linetext���Asset Manager Toolpath��� index.wsf���]���O�������K���$���vv�������� ���� ��� ����linetext���Homepath��� index.wsf���O����������X���$��������������� ������� ����$Asset Manager Tool�����{RHome�����{��VArial����������������������������� ����������������������������������������������������������W����������������������space���/GIFfGIF89a�������!����,�������D�;��VArial����������������������������� ������������������������������������������������������������V��������������� ������� �������"�������+ ����0���: ����C���L ����Q���[ ����aalink���008000bgcolor���FFFFFFflRenderlink���0000FFspaceGif���spacetext���000000vlink���800080��VArial����������������������������� ��������������������������������������������������n�����������������8>������VArial����������������������������� ������������������������������������������������n���������b��� ��Geneva���������������������������� ������������/ N���0��LAND������mac ������������local pta = html.getpagetableaddress () htmlText checked = "" categories category secret defaultnotifychecked pta^.title = "Weblog post email notification preferences" on add (s) htmlText = htmlText + s + cr add ("<p>Using the assetManager weblog post email notification feature you can have Radio send an email to an address or addresses you specify whenever you post to your weblog. If you activate this feature a new field will be added to <a href=\"http://127.0.0.1:5335\">your weblog home page</a> whenever you create a new post item. Multiple email addresses can be entered seperated by a comma. </p>") add ("<p>A word of warning. Don't use the email address you use to post to your weblog for email notifications. You'll get into an interesting recursion where your weblog will email a notification that'll be posted to your weblog, and so on... ;-)</p>") add ("<p>Before using this feature make sure you have specified an outgoing SMTP email server using <a href=\"http://127.0.0.1:5335/system/pages/prefs?page=1.2\">Radio's prefs here</a>.</p>") add ("<p><a href=\"mailto:d.a.davies@bham.ac.uk\">Send me an email</a> and tell me if it worked for you. If it didn't please tell me that too!</p>") temp.pta = pta^ add ("<p><b>Email notification</b></p>") if pta^.method == "POST" and pta^.radioResponder.postargs.assetmanager if defined (pta^.radioResponder.postargs.activate) assetManagerData.emailnotificationenabled = pta^.radioResponder.postargs.activate user.radio.callbacks.beforeWeblogPostForm.notify = assetManagerSuite.emailnotification.beforeWeblogPostForm user.radio.callbacks.afterWeblogPostForm.notify = assetManagerSuite.emailnotification.afterWeblogPostForm else assetManagerData.emailnotificationenabled = false try delete (@user.radio.callbacks.afterWeblogPostForm.notify) delete (@user.radio.callbacks.beforeWeblogPostForm.notify) assetManagerData.emailnotificationcategories.homepage = pta^.radioResponder.postargs.homepage assetManagerData.emailnotificationmimetype = pta^.radioResponder.postargs.mimetype if defined (pta^.radioResponder.postargs.defaultnotify) assetManagerData.defaultemailnotificationenabled = pta^.radioResponder.postargs.defaultnotify else assetManagerData.defaultemailnotificationenabled = false if not defined (assetManagerData.emailnotificationenabled) assetManagerData.emailnotificationenabled = false if assetManagerData.emailnotificationenabled checked = "checked " add ("<p><form method=\"POST\"><input type=\"hidden\" name=\"assetmanager\" value=\"true\"><input " +checked + "type=\"checkbox\" name=\"activate\" value=\"true\"> Activate assetManager email notification features</p>") if not defined (assetManagerData.emailnotificationcategories) new (tableType, @assetManagerData.emailnotificationcategories) assetManagerData.emailnotificationcategories.homepage = "" if not defined (assetManagerData.emailnotificationmimetype) assetManagerData.emailnotificationmimetype = "text/html" add ("<table>") add ("<tr><td>Default email address to notify</td><td><input type=\"text\" value=\"" + assetManagerData.emailnotificationcategories.homepage + "\" name=\"homepage\"></td></tr>") case assetManagerData.emailnotificationmimetype "text/plain" add ("<tr><td>Email format</td><td><select name=\"mimetype\"><option value=\"text/html\">HTML<option selected value=\"text/plain\">Plain text</select></td></tr>") "text/html" add ("<tr><td>Email format</td><td><select name=\"mimetype\"><option value=\"text/html\" selected>HTML<option value=\"text/plain\">Plain text</select></td></tr>") add ("</table>") bundle // add default notify if not defined (assetManagerData.defaultemailnotificationenabled) assetManagerData.defaultemailnotificationenabled = false if assetManagerData.defaultemailnotificationenabled defaultnotifychecked = "checked " add ("<p><input type=\"hidden\" name=\"assetmanager\" value=\"true\"><input " + defaultnotifychecked + "type=\"checkbox\" name=\"defaultnotify\" value=\"true\"> Send email notification for every post by default</p>") add ("<p><input type=\"submit\"></form></p>") return (htmlText) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������6�����Geneva���������������������������� ��������������[[1������PLAND������mac ������������local pta = html.getpagetableaddress () temp.pta = pta^ pta^.title = "Subscribe to weblog catagories" if pta^.method == "GET" return (string (assetmanagerwebsite.forms.subscribeform)) else email = pta^.radioresponder.postargs.email return ("Thanks for subscribing " + email + "!") ���������������������������������������������������F����FFFF000000060001001777AA000000000071000000001001710000001-7EFF6FBE18000004800480647200-16D716D710647222FFFF0103720000100000035000000010BF40840647222BE038E0003A647600002000000C400000000�BF, <form name="subscribe" method="post" enctype="application/x-www-form-urlencoded"> <input type="text" name="email" size="24" border="0"><input type="submit" value="Go!" border="0"> </form> 000400000009000000020C10000500000009000000020C10000600000032000000010A210FFFF0A00000 20 0007000000190000000102018000080000009700000001�40,Geneva����������������������������������������������������������40,����������������������������������������������������������������4030 10000900000015000000023E62793E6279000A0000001500000002647222647222000B00000005000000020000C0000001900000001726D7127A739E10000F0000005200000000400 10 �4,77A�4,stem�4,�U{�4,�@@�4,�B0�4,�UD�4,�E{00130000007E00000000DA91F8CE1C1D1E1F7F1B0�44,-��.��������������.��'��"��������������FFFF0FFFF0FFFE000000060001001777AA�[[��� �������������������������������������������������0�)f������������������������������������������������������������F����������X���$���[[�������� ���� ��� ����$ subscribe�����9 subscribeform�������VGeneva���������������������������� ������������2�"i��������������������������� 7�������R��m���Geneva���������������������������� �������������1H1Kj���/��LAND������mac ������������local pta = html.getPageTableAddress () params on buildResponse (code, shortmessage, longmessage) pta^.code = code pta^.responseBody = webserver.util.buildErrorPage (code + " " + string.upper (shortmessage), longmessage) return temp.rsspta = pta^ bundle // get and compile args if pta^.searchArgs == "" return ("It didn't work! This page was not called correctly.") else new (tabletype, @args) webserver.parseArgs (pta^.searchargs, @args) temp.rssargs = args bundle // get RSS results case args.database "mesh" params = string.httpResultSplit (tcp.httpClient (server:"medweb2.bham.ac.uk", port:"80", path:"/filemaker.acgi?-db=mesh&-error=/xml/error.html&-max=99&heading=" + string.urlEncode (args.search) + "&-lay=xml&-format=/xml/meshrss.xml&-find")) "images" params = string.httpResultSplit (tcp.httpClient (server:"medweb2.bham.ac.uk", port:"80", path:"/filemaker.acgi?-db=image%20database&-error=/xml/error.html&-max=99&search=" + string.urlEncode (args.search) + "&-lay=xml&-format=/xml/imagerss.xml&-find")) "mcqs" params = string.httpResultSplit (tcp.httpClient (server:"medweb2.bham.ac.uk", port:"80", path:"/filemaker.acgi?-db=medical&-error=/xml/error.html&-max=99&search=" + string.urlEncode (args.search) + "&-lay=xml&-format=/xml/mcqrss.xml&-find")) temp.xmlresult = params if not defined (scratchpad.rssResources) new (tabletype, @scratchpad.rssResources) else if typeOf (scratchpad.rssResources) != tableType new (tabletype, @scratchpad.rssSearchResults) s = clock.now () op.rssToOutline (params, @scratchpad.rssResources.[s]) Frontier.bringToFront () edit (@scratchpad.rssResources.[s]) bundle // set up response page table pta^.responseHeaders.["Content-Type"] = "text/html" //a sensible default pta^.responseHeaders.location = args.redirect pta^.responseHeaders.URI = args.redirect buildResponse (302, "FOUND", "Found the page.") return (true) ��������������������������������������������������������������������������������������������������������������������������������������$datatabl�������������������$datatabl������������������$datatabl������������������$datatabl�������������������$datatabl������������������$datatabl������������������$datatabl������������������$datatabl������������������$datatabl�����������������������������������������������$datatabl���������������� 7������������������Geneva���������������������������� ��������������cc��� ��'?LAND������mac ������������return ("Hello") ����������������������.����Geneva���������������������������� ��������������)E���(��+nLAND������mac ������������return (assetManagerSuite.webSiteHomePage ()) ������������������H��9���Geneva���������������������������� ��������������/ ������ULAND������mac ������������local pta = html.getpagetableaddress () htmlText checked = "" categories category secret pta^.title = "Mobile weblogging preferences" on add (s) htmlText = htmlText + s + cr add ("<p>Mobile weblogging preferences have moved <a href=\"/assetmanager/mobileblogging/default\">here</a></p>") return (htmlText) �����������������������������������������������������������������������}����������3���Geneva���������������������������� ����� � ������6t�������#LAND������mac ������������local pta = html.getPageTableAddress () argtable = @pta^.radioResponder.postArgs htmlText nq n feedback score = 0 temp.marked = pta^ on add (s) htmltext = htmlText + s + cr bundle // get question list and number of questions questionList = argTable^.question if typeOf (questionList) == listType nq = sizeOf (questionList) else nq = 1 questionList = {questionList} pta^.title = "Your marked questions" for n = 1 to nq adrQuestion = @workspace.qti.questions.[questionList [n]] theResponse = argtable^ [questionList [n]] stem = adrQuestion^.presentation.stem add ("<P>" + n + ". " + stem + "</p>") branch = adrQuestion^.presentation.responses.[theResponse].text thisScore = number (adrQuestion^.presentation.responses.[theResponse].score) try feedback = adrQuestion^.presentation.responses.[theResponse].feedback else feedback = "" score = score + thisScore add ("<blockquote>You said: " + branch + "<br>") add (feedback + " <i>(" + thisScore + " marks)</i></blockquote>") add ("<p>Overall you scored " + score + " marks</p>") return (htmlText) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������}�� =�������&�� � ��Geneva���������������������������� ��������������ѥ�����^9LAND������mac ������������ local pta = html.getpagetableaddress () htmlText checked = "" categories category secret pta^.title = "Mobile blogging to categories" on add (s) htmlText = htmlText + s + cr temp.pta = pta^ add ("<p>The assetManager tool allows you to email to specific weblog categories. To achieve this each catagory has its own secret subject, that is, the subject line of the email sent to you weblog. When an email message is received by your copy of Radio the assetManager checks the secret subject against the list below and posts to the appropriate category. Categories are <a href=\"/system/pages/prefs?page=2.4\">managed here</a>. To only post to your weblog home page use the secret subject you entered in the <a href=\"/system/pages/prefs?page=2.9\">mail to weblog prefs here</a>. At present you can only post to a single category or only to the home page. Secret subjects cannot be combined to post to more than one category simultaneously.</p>") if pta^.method == "POST" and pta^.radioResponder.postargs.assetmanager if defined (pta^.radioResponder.postargs.activate) assetManagerData.mailtoweblogenabled = pta^.radioResponder.postargs.activate weblogData.callbacks.weblogCheckMail.assetmanager = assetManagerSuite.mailtoblog.mailtoblogcallback else assetManagerData.mailtoweblogenabled = false delete (@weblogData.callbacks.weblogCheckMail.assetmanager) categories = pta^.radioResponder.postargs.category if categories != "" if typeOf (categories) == listType for n = 1 to sizeOf (categories) assetManagerData.categories.[categories [n]] = pta^.radioResponder.postargs.[categories [n]] if not defined (assetManagerData.mailtoweblogenabled) assetManagerData.mailtoweblogenabled = false if assetManagerData.mailtoweblogenabled checked = "checked " add ("<p><form method=\"POST\"><input type=\"hidden\" name=\"assetmanager\" value=\"true\"><input " +checked + "type=\"checkbox\" name=\"activate\" value=\"true\"> Activate assetManager mail to weblog features</p>") if not defined (assetManagerData.categories) new (tableType, @assetManagerData.categories) add ("<table>") add ("<tr><td>Weblog Category</td><td>Secret subject to use</td></tr>") add ("<tr><td>Home page only</td><td>" + weblogData.prefs.mailposting.secretSubject + "</td></tr>") if defined (weblogData.categories) for n = 1 to sizeOf (weblogData.categories) category = nameOf (weblogData.categories [n]) if not defined (assetManagerData.categories.[category]) assetManagerData.categories.[category] = "" secret = "" else secret = assetManagerData.categories.[category] add ("<input type=\"hidden\" name=\"category\" value=\"" + category + "\">") add ("<tr><td>" + category + "</td><td><input type=\"text\" value=\"" + secret + "\" name=\"" + category + "\"></td></tr>") add ("</table>") add ("<p><input type=\"submit\"></form></p>") add ("<p><a href=\"/assetmanager/mobileblogging/default\"><< Setting up assetManager mobile blogging<a></p>") return (htmlText) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� =�� !���������� %� ��Geneva���������������������������� ��������������Ѡ Oq���$��6�E_LAND������mac ������������local pta = html.getpagetableaddress () htmlText checked = "" categories category secret pta^.title = "Setting up assetManager mobile blogging" on add (s) htmlText = htmlText + s + cr add ("<p>Before using the assetManager mail-to-weblog features please make sure your mail-to-weblog Radio preferences are set by <a href=\"http://127.0.0.1:5335/system/pages/prefs?page=2.9\">clicking here</a>.</p>") add ("<p><b>What you can do with assetManager mobile blogging</b></p>") add ("<p>I've written a mobile blogging how-to guide on my weblog <a href=\"http://radio.weblogs.com/0001161/stories/2003/02/26/mobileBloggingHowtoGuide.html\">here</a>.</p>") add ("<p>When combined with Radio's built-in ability to receive emails you can use the assetManager tool to make a weblog post from anywhere that you can send an email. If you have an email capable mobile phone you can post to your weblog from anywhere that you can use your phone. What's more, if you have a picture and/or video phone you can include pictures and video clips in your weblog post. Mobile blogging frees you from having to sit at a computer. You can now post to your blog from anywhere.</p>") add ("<p>I have only tested mail-to-blog using my Nokia mobile phone and with Microsoft email clients, specifically Entourage on Mac OS and Outlook 2000 on Windows. Attached pictures and video are only recognised when sent as MIME/base64 encoded attachments i.e. do not send attachments uuencoded or binhexed. In the systems I've tried it is possible to attach more than one file. You can also send HTML formatted email messages however given the variability of email clients unpredictable weblog posts may result. Please feel free to experiment and let me know how you get on.</p>") add ("<p><a href=\"mailto:d.a.davies@bham.ac.uk\">Send me an email</a> and tell me if it worked for you. If it didn't please tell me what email client you were using on which platform.</p>") add ("<p>Customize you mobile blogging experience by setting assetManager preferences...</p>") add ("<blockquote>1. <a href=\"title\">Add a title to your post</a><br>") add ("2. <a href=\"categories\">Mobile blogging to categories</a><br>") add ("3. <a href=\"pictures\">Handling attached pictures</a><br>") add ("4. <a href=\"video\">Handling attached video clips</a></blockquote>") return (htmlText) ����������������������������������������������������������������������������������������������������������������������� !�� ��������� z���Geneva���������������������������� �������������Ѹ���,�HLAND������mac ������������local htmltext pta = html.getpagetableaddress () checked1 checked2 height width align pta^.title = "Handling attached pictures" on add (s) htmlText = htmlText + s + cr bundle // set up assetManager prefs table if not defined (assetManagerData.picturesize) assetManagerData.picturesize = "scale" if not defined (assetManagerData.pictureheight) assetManagerData.pictureheight = 120 if not defined (assetManagerData.picturewidth) assetManagerData.picturewidth = 160 if not defined (assetManagerData.picturealign) assetManagerData.picturealign = "right" if pta^.method == "POST" if defined (pta^.radioResponder.postargs.pictures) // check it's our form that's done the posting! assetManagerData.picturesize = pta^.radioResponder.postargs.size assetManagerData.pictureheight = pta^.radioResponder.postargs.height assetManagerData.picturewidth = pta^.radioResponder.postargs.width assetManagerData.picturealign = pta^.radioResponder.postargs.align bundle // get prefs for display case assetManagerData.picturesize "actual" checked1 = " checked" "scale" checked2 = " checked" height = assetManagerData.pictureheight width = assetManagerData.picturewidth align = assetManagerData.picturealign add ("<p>You can include one or more pictures in your weblog post by sending them as email attachments. By default the assetManager tool extracts any attached pictures and places them in a dated folder within your <a href=\"/images/\">weblog images directory structure</a>. The picture is then inserted into your weblog post and displayed as a thumbnail with a height of 120 pixels and width of 160 pixels. You can customize this default behaviour.</p>") add ("<p><form method=\"POST\"><input type=\"hidden\" name=\"pictures\" value=\"true\"><input type=\"radio\" name=\"size\" value=\"actual\"" + checked1 + ">Display pictures in mobile weblog posts actual size (i.e whatever size they're sent, do not display as a thumbnail)</p>") add ("<p><input type=\"hidden\" name=\"pictures\" value=\"true\"><input type=\"radio\" name=\"size\" value=\"scale\"" + checked2 + ">Display pictures as a thumbnail with height of <input size=\"4\" type=\"text\" value=\"" + height + "\" name=\"height\"> pixels and width of <input size=\"4\" type=\"text\" value=\"" + width + "\" name=\"width\"> pixels regardless of their actual size (i.e scale the pictures)</p>") add ("<p>Align pictures <input size=\"10\" type=\"text\" name=\"align\" value=\"" + align + "\"></p>") add ("<p>NB: A present it is not possible to physically resize attached pictures. Instead the scaling simply changes the display size. Best results are obtained if you post pictures at roughly the size you want them to appear on your weblog although most pictures from camera phones look better if displayed at half or quarter their actual size as it improves their quality. Feel free to experiment to find the best settings for your pictures. A version of assetManager that is able to physically resize your pictures is coming soon!</p>") add ("<p><input type=\"submit\"></form></p>") add ("<p><a href=\"/assetmanager/mobileblogging/default\"><< Setting up assetManager mobile blogging<a></p>") return (htmltext) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ����������<��Z���Geneva���������������������������� ��������������(��� ��$LAND������mac ������������local htmltext pta = html.getpagetableaddress () pta^.title = "Add a title to your post" on add (s) htmlText = htmlText + s + cr add ("<p>Adding a title to your mobile weblog post couldn't be easier. After your secret subject keyword in the subject line of your post add a space then the title as you want it to appear in your post. For example, if your secret subject is 'foo' and you want the title of your post to be 'My grand day out' then set the subject to 'foo My grand day out'. The assetManager will then recognise your secret subject and set the title of your post accordingly.</p>") add ("<p>NB: Some email clients, notably on some mobile phones, encode the text sent in email messages in a way that prevents the assetManager tool from recognising the post title. I'm working on a way around this but for now if you're unlucky enough to have one of these phones you can still submit a mobile weblog post but unfortunately you won't be able to specify a post title.</p>") add ("<p><a href=\"/assetmanager/mobileblogging/default\"><< Setting up assetManager mobile blogging<a></p>") return (htmltext) ��������������������������������������������������������� ����������[���Geneva���������������������������� ��������������Ѹ Qa���A�HLAND������mac ������������local htmltext pta = html.getpagetableaddress () checked1 checked2 height width align pta^.title = "Handling attached video" on add (s) htmlText = htmlText + s + cr if pta^.method == "POST" if defined (pta^.radioResponder.postargs.video) // check it's our form that's done the posting! assetmanagersuite.mailtoblog.qtembedsnippet = pta^.radioResponder.postargs.snippet bundle // get prefs for display case assetManagerData.picturesize "actual" checked1 = " checked" "scale" checked2 = " checked" height = assetManagerData.pictureheight width = assetManagerData.picturewidth align = assetManagerData.picturealign add ("<p>You can include video clips as well as pictures in your weblog post by sending them as email attachments. By default the assetManager tool extracts any attached video files and places them in a dated folder within your <a href=\"/images/\">weblog images directory structure</a>. The video is then embedded into your weblog post. I've only tested this with a Nokia 7650 mobile phone so by default the only video file format supported is 3GP at a size of 128x96 pixels (plus 16 pixels for the QuickTime video controller). I'm keen to support more video formats so please let me know how this works with your phone. If you need software to play 3GP video clips then I can recommend <a href=\"http://www.apple.com/quicktime/download/\" target=\"_blank\">QuickTime.</a></p>") add ("<p>You can customize the default embedding parameters by editing the following HTML snippet. NB: the asterisk in the HTML snippet is my crude way of representing the URL of your upstreamed video clip so don't delete it, it's needed by the processing script! Once I've tried different video formats I'll tidy this mini-template up a bit.</p>") add ("<p><form method=\"POST\"><input type=\"hidden\" name=\"video\" value=\"true\"><textarea name=\"snippet\" rows=\"8\" cols=\"85\">" + assetmanagersuite.mailtoblog.qtembedsnippet + "</textarea>") add ("<p><input type=\"submit\"></form></p>") add ("<p><a href=\"/assetmanager/mobileblogging/default\"><< Setting up assetManager mobile blogging<a></p>") return (htmltext) ������������������������������������������������������������������������������������������������������������������������������������������������������������ ������������B���э L�������� ���� ��� �������+ ����4���@ ����F���R ����X categories�����Ddefault�����pictures�����útitle�����Ѻvideo�������VGeneva���������������������������� ������������2[�E��������������������������t��������<������Geneva���������������������������� ��������������+6+����o@LAND������mac ������������local pta = html.getpagetableaddress () htmlText on add (s) htmltext = htmltext + s + "\r\n" pta^.title = "Picture Gallery" add (assetManagerSuite.galleryForWebsite ()) return (htmlText) �������������������������������������������������������t��������������Geneva���������������������������� �������������K4�����'?LAND������mac ������������ local adr qType qTopic qStem responseList responseListLabel htmlText nq = 0 rn thisResponselabel thisResponse respconditionList feedbackList xml.compile (string (workspace.qti.data2), @adrdata) temp.adrdata = adrdata edit (@temp.adrdata) on getmattext (adrMaterial) local (adr, mattext, texttype) adr = xml.getaddress (adrMaterial, "material") mattext = xml.getaddress (adr, "mattext") try texttype = xml.getAttributeValue (mattext, "texttype") else texttype = "text/plain" case texttype "text/plain" return (xml.getValue (adr, "mattext")) "text/html" return (xml.entityDecode (mattext^.["/cdata"])) on add (s) htmltext = htmlText + s + cr bundle // make questions adrquestestinterop = xml.getaddress (@adrdata, "questestinterop") // get the question table address for n in adrquestestinterop nq++ responseList = {} responseListLabel = {} ident = xml.getAttributeValue (n, "ident") bundle // new table in the item bank adrQuestion = table.uniquename ("", @workspace.qti.questions, 8) new (tableType, adrQuestion) new (tableType, @adrQuestion^.presentation) new (tableType, @adrQuestion^.presentation.responses) bundle // process presentation adr = xml.getaddress (n, "presentation") bundle // stem qStem = getmattext (adr) adrQuestion^.presentation.stem = qStem bundle // responses adr = xml.getaddress (adr, "response_lid") adr = xml.getaddress (adr, "render_choice") adrList = xml.getaddressList (adr, "response_label") for r in adrList // walk through responses getting labels and data thisResponseLabel = xml.getAttributeValue (r, "ident") thisResponse = getmattext (r) bundle // add to item bank new (tableType, @adrQuestion^.presentation.responses.[thisResponseLabel]) adrQuestion^.presentation.responses.[thisResponseLabel].text = thisResponse responseListLabel = responseListLabel + thisResponselabel responseList = responseList + thisResponse bundle // response processing adr = xml.getaddress (n, "resprocessing") respconditionList = xml.getAddressList (adr, "respcondition") for respcond in respconditionList bundle // what's the condition? whichBranch = "" try // varequal whichBranch = xml.getValue (xml.getAddress (respcond, "conditionvar"), "varequal") branchScore = xml.getValue (respcond, "setvar") adrQuestion^.presentation.responses.[whichBranch].score = branchScore try // get the feedback item whichFeedback = xml.getAttributeValue (xml.getAddress (respcond, "displayfeedback"), "linkrefid") feedbackList = xml.getAddressList (n, "itemfeedback") for f in feedbackList if xml.getAttributeValue (f, "ident") == whichFeedback adrQuestion^.presentation.responses.[whichBranch].feedback = getmattext (f) try // not whichBranch = xml.getValue (xml.getAddress (respcond, "conditionvar"), "not") try // unanswered whichBranch = xml.getValue (xml.getAddress (respcond, "conditionvar"), "unanswered") new (tableType, @adrQuestion^.presentation.unanswered) try // get the feedback item whichFeedback = xml.getAttributeValue (xml.getAddress (respcond, "displayfeedback"), "linkrefid") feedbackList = xml.getAddressList (n, "itemfeedback") for f in feedbackList if xml.getAttributeValue (f, "ident") == whichFeedback adrQuestion^.presentation.unanswered.feedback = getmattext (f) bundle // mark up questions add ("<p>" + nq + ". " + qStem + "</p>") add ("<input type=\"hidden\" name=\"question\" value=\"" + nameOf (adrQuestion^) + "\">") rn = 0 add ("<blockquote>") add ("<table>") for r in responseList rn++ buttonText = "<input type=\"radio\" name=\"" + nameOf (adrQuestion^) + "\" value=\"" + responseListLabel [rn] + "\">" add ("<tr><td>" + "</td><td>" + buttonText + "</td><td>" + r + "</td></tr>") add ("</table>") add ("</blockquote>") if htmlText != "" htmlText = "<form method=\"POST\" action=\"http://127.0.0.1:5335/assetmanager/mark\">" + htmlText add ("<p><input type=\"submit\" value=\"Mark answers\"></p>") add ("</form") return (htmltext) webBrowser.displayText (htmlText) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������7ѐ�������� ���� ��� �������* ����4���@ ����H���T ����[���g ����n���z ������� ������� ������� ������� ������� ������� ������ �����$ ���3��? ���C#filters�����z#ftpSite�����z #glossary�����|#images�����|#prefs�����}#tools�����~emailnotification�����6forms�����bgetrss����� hello�����cindex����� mailtoblog�����mark�����mobileblogging�����apicturegallery�����qset�������V Lucida Grande����������������������������������?��@������������������������v������Verdana��������������������������� ��������������s L���.��o@LAND������mac ������������#filters #ftpSite #glossary #images #prefs #tools emailnotification forms getrss hello index mailtoblog mark mobileblogging categories default pictures title video picturegallery set ������]x�_0�������������������]x�_0�������������������]x�_0�������������������]x�_0�������������������]x�_0�������������������]x�_0��������������������]x�_0��������������������]x�_0��������������������]x�_0���������������������]x�_0���������������������]x�_0���������������������]x�_0���������������������]x�_0��������������������]x�_0��������������������]x�` ���������������������]x�` ���������������������]x�` ���������������������]x�` ���������������������]x�` ���������������������]x�_0���������������������]x�_0������������������� ������������55��������������� �����������t���5PL�������� ������� ����.���: ����P���\ ����r���~ ������� ������� ������� ������ �����$ ���<assetManagerData��������XassetManagerInfo��������assetManagerNodeTypes�������zassetManagerResponder�������^assetManagerRpcHandlers�������+assetManagerSoapHandlers�������,assetManagerSuite������jyassetManagerThread������uassetManagerWebsite������assetManagerWindowTypes��������V Lucida Grande���������������������