Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.images.imageUrl
on imageUrl (imgpath, flFileUrl=false) {
<<Changes:
<<7/26/01; 3:07:42 PM by JES
<<Added a leading slash character to the non-file URL, so images will work on sub-pages when accessing the site remotely.
if imgpath beginswith "/" {
imgpath = string.delete (imgpath, 1, 1)};
local (f = user.radio.prefs.wwwfolder + string.replaceall (imgpath, "/", file.getpathchar ()));
local (url);
if flFileUrl {
url = html.getfileurl (f)}
<<url = file.fileToUrl (f)
else {
url = "/" + imgpath};
url = radio.images.imageFlowBottleneck (f, url);
return (url)};
bundle { //test code
local (pagetable);
new (tabletype, @pagetable);
new (tabletype, @pagetable.radioresponder);
html.setpagetableaddress (@pagetable);
webbrowser.displaytext (imageUrl ("system/images/icons/brain.gif", true))}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.