I keep all my WPS URL objects off a main URL folder, I then create HTML pages from this so I can effectively access my URL objects from anywhere via the internet (pages at http://www.labyrinth.net.au/~dbareis/bookmark.htm). Different categories can have their own look and feel!
This code highly customises how the header "FTPLIKE.IH" works. At the moment I am still working on separating the code to a generic header file and my specific configuration of this, for this reasons there will be things in "bookmark.ih" which should not be and visa versa.
This is the code I use for my specific customisations (as at 2 Jan 01, 7:37am):
;----------------------------------------------------------------------------
;--------------------------------[ BOOKMARK.IT ]-----------------------------
;----------------------------------------------------------------------------
;
; *************************************************************************
; WORK IN PROGRESS, I AM GRADUALLY SEPARATING BOOKMARK.IT/.IH so that there
; is a generic component anyone can use and my separate customisations
; (in "BOOKMARK.IT").
; *************************************************************************
;
; This file contains specific customisations to bookmarks for Dennis
; Bareis' site.
;
;----------------------------------------------------------------------------
;--- Include my common header -----------------------------------------------
;#define PAGE_TRANSITION_ENTER Duration=1,Transition=3
#define PAGE_TRANSITION_EXIT Duration=1,Transition=2
#define Title "Dennis' Personal Bookmarks"
#define AddToDescription Dennis' Personal Bookmarks, straight from OS/2 WPS URL Objects
#define COLOR_PAGE_TITLE #003366 ;;Original Dark Blue
;;#define COMPUTER_NO_DESC_KEYWORD_META
#include "computer.ih"
;--- Add counter to this page -----------------------------------------------
#define COUNTER_ID 685720
#define COUNTER_ROOT c1
#include "counter.ih"
;--- Title ------------------------------------------------------------------
<$BackgroundMainWindows>
<$PageTitle TITLE="Dennis' Personal Bookmarks">
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%[ Definitions for use in my "DIRATTR.$$$" files ]%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#evaluate "Eol" "d2c(10)"
#define LookAndFeelForOs2 \
BgImage = graphics/os2warp.jpg<$Eol> -\
BgColor = #E0E0E0
#define LookAndFeelForPpwizard \
BgImage = ppwizard/ppw_bg.jpg<$Eol> -\
BgColor = WHITE
#define LookAndFeelForFlowers \
BgImage = graphics/flowers.jpg<$Eol> -\
BgColor = #F7FFCE
#define LookAndFeelForLinux \
BgImage = graphics/linux_bg.gif<$Eol> -\
BgColor = #FFFFC6
#define LookAndFeelForWindows \
BgImage = graphics/bg_win.jpg<$Eol> -\
BgColor = #E0E0E0<$Eol> -\
DirIcon = <IMG SRC="graphics/win16x12.gif" VALIGN="MIDDLE" WIDTH=16 HEIGHT=12 BORDER=0><$Eol> -\
DotDotIcon = <IMG SRC="graphics/win16x12.gif" VALIGN="MIDDLE" WIDTH=16 HEIGHT=12 BORDER=0>
;--- At end of file listing... ----------------------------------------------
#define FTPLIKE_END_PAGE_ABOVE_FOOTER \
#ifdef ALL_URL_NAME -\
<CENTER> -\
<P>A <A HREF="<$ALL_URL_NAME>">complete listing \
of all URLS</A> is available if you are \
having trouble locating a URL. -\
</CENTER> -\
#endif -\
<$ImgBarbedWire> -\
<CENTER> -\
<H2>Creating These Book Mark Pages</H2> -\
</CENTER> -\
-\
<P>This page was automatically created from Windows \
Internet Explorer URL objects created with IE 5 or \
converted from my OS/2 Netscape WPS URLs (which are \
also supported). \
\
The free tool used was \
<A HREF="ppwizard.htm">PPWIZARD</A> \
(for Windows, Unix & OS/2) using \
<A HREF="ppwizard/bookmarks.htm"> -\
this source code \
</A>. -\
-\
<P>All URLs are checked periodically using the \
<A HREF="checkurl.htm">my free URL validation tool</A> \
(for Windows and OS/2). \
This ensures that very few if any links point to moved \
pages or return 404 errors etc.
;--- Include common support code --------------------------------------------
#define BOOKMARK_DIRECTORY C:\DBAREIS\BOOKMARKS
;#define+ BOOKMARK_DIRECTORY C:\DBAREIS\BOOKMARKS\My Computer
;#define BOOKMARK_OPEN_LINK_IN _BareisSame ;;Creates one new window which is reused by all links
#include "BOOKMARK.IH"
This is the (becoming) generic header code I use (as at 16 Oct 00, 9:02am):
;----------------------------------------------------------------------------
;--------------------------------[ BOOKMARK.IH ]-----------------------------
;----------------------------------------------------------------------------
;
; *************************************************************************
; WORK IN PROGRESS, I AM GRADUALLY SEPARATING BOOKMARK.IT/.IH so that there
; is a generic component anyone can use and my separate customisations
; (in "BOOKMARK.IT").
; *************************************************************************
;
; This header file expands on the basic functionality provided by the
; "FTPLIKE" header to allow you to organise Netscape or Internet Explorer
; URL objects in categories and then generate HTML pages for these.
;
; You can see my bookmarks at:
;
; http://www.labyrinth.net.au/~dbareis/bookmark.htm
;
; Some of the features:
;
; * You can nest categories to any level.
;
; * Categories (tree) can appear in more than one place
; WITHOUT duplicating the URLS.
;
; * Url's can be commented, giving you the ability to use normal
; browser URL (shortcut) creation and add comments to your
; generated pages.
;
;
; Some details:
;
; * The main (top level) URLS are incorporated into the page that
; includes this one, all others are generated from start to finish.
;
;
;
; Improvements I need to make
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~
; * Make user customisable "BOOKMARK.IT" header, removing any of my
; stuff into a new private header.
;
; * Use Java (or JavaScript) Tree Navigation
;
; * As well as ALL URLS listed what about being able to indicate
; categories example "all windows".
;
; * What about index similar to all url list. Probably supply list of
; words (but maybe exceptions) so as to exclude "the" etc.
;
;
; * BUG in ">DIRTEXT" etc, only takes first line?
;
; * Files/Dirs starting with '$$' invisible and don't appear
; in generated pages. #define will allow disable or selection
; of different prefix.
;
; * Have dir attributes, need easy way to assign "file"
; attribs (priority , alias etc). Maybe use "[*BOOKMARK*]" to
; mark off section of file, probablt then go to 1st '['?
;
; * Allow option define of collon URLS ALIAS defined in UTL name:
;
; URL TITLE$$$URL ALIAS
;
; * Once mechanism for giving a URL an alias need new DIR command
; (IncludeUrls) to include common file/url Aliases.
;
; * Too much to write down
;----------------------------------------------------------------------------
;--- Initialization ---------------------------------------------------------
#define OpSys <?OpSys>
#if left('<$OpSys>', 3) = 'WIN'
#define+ OpSys WINDOWS
#endif
#if '<$OpSys>' <> 'WINDOWS' & '<$OpSys>' <> 'OS/2'
#error "Sorry but you will need to modify this file to work on operating systems other than Windows & OS/2! These changes are expected to be relatively minor."
#endif
#if ['<$OpSys>' = 'OS/2']
;--- In OS/2 can get "real name" of file from EA's -------------------
#evaluate "" "call RxFuncAdd 'SysGetEA', 'RexxUtil', 'SysGetEA'"
#endif
#RexxVar AllUrlCount = 0
#define ALL_URL_NAME bookmark_all_urls.htm
;--- Need sorting support for URLS ------------------------------------------
#include "PpwSort.h"
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%[ Override FTPLIKE Header Defaults ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;--- Used as separator ------------------------------------------------------
#define SPACE <IMG SRC="graphics/clear1x1.gif" ALIGN=middle ALT=" " BORDER=0 WIDTH={$HSIZE=^1^} HEIGHT={$VSIZE=^1^}>
;--- Define the "window" that a bookmark URL opens in -----------------------
#ifndef BOOKMARK_OPEN_LINK_IN
;--- Each link opens its own window ------------------------------
#define BOOKMARK_OPEN_LINK_IN _blank
#endif
;--- Save values of this pages info (they get modified below!) --------------
#ifndef VERSION_PUSHPOPM_H
#include "PushPopM.H"
#endif
<$MacroPush Macro='ShortNameHtml'>
<$MacroPush Macro='ShortNameHtmlLowerCase'>
;--- Don't just want filename! We want Title + URL --------------------------
#DefineRexx REXX_PREPARE_LEFT_SIDE
;--- Get the URL, we know a filename -------------------------------------
CloseRc = stream(FtpFile, 'c', 'close');
#if ['<$OpSys>' = 'OS/2']
;--- First line of OS/2 WPS URL file contains the URL ----------------
eUrl = linein(FtpFile);
#endif
#if ['<$OpSys>' = 'WINDOWS']
;--- In WINDOWS Look for "URL=" in column 1 --------------------------
eUrl = '';
do while lines(FtpFile) <> 0
;--- Look for URL line -------------------------------------------
ThisLine = linein(FtpFile);
if left(ThisLine, 4) = "URL=" then
do
;--- Found it! -----------------------------------------------
eUrl = substr(ThisLine, 5); ;;Rest of line is URL
leave; ;;Look no further!
end;
end;
;--- Found the URL within the file? ----------------------------------
if eUrl = '' then
do
;--- Did not find it! --------------------------------------------
eUrl = 'URL not found in "' || FtpFile || '"';
call Warning 'URL_NF', eUrl;
eUrl = 'Error: ' || eUrl;
end;
#endif
CloseRc = stream(FtpFile, 'c', 'close');
;--- Under windows TITLE will end with ".url" ----------------------------
ThinTitle = '{$TITLE}';
#if ['<$OpSys>' = 'WINDOWS']
if translate(right(ThinTitle, 4)) = '.URL' then
ThinTitle = left(ThinTitle, length(ThinTitle)-4);
#endif
;--- Make sure title not too "wide" --------------------------------------
ThinTitle = ReplaceString(ThinTitle, '<BR>', ' '); ;;Not sure why this is here...
ThinTitle = BreakAt(30, ThinTitle, ' -', '<br>');
ThinTitle = ReplaceString(ThinTitle, ' <br>', '<br>');
ThinTitle = ReplaceString(ThinTitle, '<br> ', '<br>');
;--- Fix quote char on some titles ---------------------------------------
ThinTitle = ReplaceString(ThinTitle, '`', "'");
ThinTitle = ReplaceString(ThinTitle, 'EF'x, "'");
;--- Make sure URL not too "wide" ----------------------------------------
ThinUrl = BreakAt(25, eURL);
#DefineRexx
#define FTPLIKE_FILE_LEFT_SIDE_DISPLAY \
#evaluate '' ^<$REXX_PREPARE_LEFT_SIDE TITLE='<??FtpShortD $$SQx2>'>;^ -\
<TR> ;;Start New File row %\
<TD ALIGN=CENTER> ;;Start filename cell %\
<A HREF="<??eURL>" TARGET=<$BOOKMARK_OPEN_LINK_IN>> -\
<??ThinTitle> -\
</A> %\
</TD> ;;End cell \
<TD ALIGN=CENTER> ;;Start filename cell %\
<A HREF="<??eURL>" TARGET=<$BOOKMARK_OPEN_LINK_IN>> -\
<??ThinUrl> -\
</A> -\
</TD> ;;End cell
;--- Right side display (comment) + capture URL -----------------------------
#DefineRexx FTPLIKE_GET_FILE_COMMENT ;;Note comment's are not allowed to contain <ENTER> (don't know how to handle)!
;--- Find comment for URL, we know a filename -------------------
#if ['<$OpSys>' = 'OS/2']
;--- In OS/2 comments are stored in OS/2 Extended Attributes -
if SysGetEA(FtpFile, ".COMMENTS", "FtpComment") <> 0 then
FtpComment = '';
else
FtpComment = substr(FtpComment, 11); ;;Drop EA Type info
FtpComment = space(ReplaceString(FtpComment, '0D0A'x, '<BR>'));
#endif
#if ['<$OpSys>' = 'WINDOWS']
;--- Look for bookmark comment section (freeform text) ------
CommentSection = "[BMCOMMENTS]";
CommentNl = d2c(10);
FoundComment = 'N';
FtpComment = '';
CloseRc = stream(FtpFile, 'c', 'close');
do while lines(FtpFile) <> 0
;--- Get next line (ignore leading/trailing spaces) -----
ThisLine = strip(linein(FtpFile));
if left(ThisLine, 1) = '[' then
do
;--- Found start of Section --------------------------
if FoundComment = 'Y' then
leave; ;;Found end of comment!
ThisLine = translate(ThisLine);
if ThisLine = CommentSection then
FoundComment = 'Y';
end;
else
do
;--- Just a normal line ------------------------------
if FoundComment = 'Y' then
do
if FtpComment == '' then
FtpComment = space(ThisLine);
else
FtpComment = FtpComment || CommentNl || space(ThisLine);
end;
end;
end;
CloseRc = stream(FtpFile, 'c', 'close');
;--- Add "<P>" for paragraphs -------------------------------
FtpComment = ReplaceString(FtpComment, CommentNl || CommentNl, '<P>');
;--- Sort out line wrapping issues --------------------------
FtpComment = ReplaceString(FtpComment, CommentNl, ' ');
#endif
;--- Now see if any high ASCII ----------------------------------
HighPos = verify(FtpComment, xrange('80'x, 'FF'x), 'M');
if HighPos <> 0 then
do
call Warning 'BM_HAC', 'High ASCII found for "' || FtpFile || '"';
FtpComment = strip(left(FtpComment, HighPos-1)) || '<HR><FONT COLOR="RED"><BLINK>Truncated here.</BLINK></FONT>' || " <B>Please don't use ENTER to separate paragraphs!</B>";
end;
;****************************************************************
;***[ Now keep information about this URL (for all URLs page) ***
;****************************************************************
;--- Now compact the title --------------------------------------
Title = ReplaceString(FtpShortD, '<BR>', ' ');
Title = space(Title);
;--- Under Windows title will end with ".url" -------------------
#if ['<$OpSys>' = 'WINDOWS']
if translate(right(Title, 4)) = '.URL' then
Title = left(Title, length(Title)-4);
#endif
;--- Increase count and save info in array ----------------------
AllUrlCount = AllUrlCount + 1;
AllUrl.AllUrlCount.!Url = eURL;
AllUrl.AllUrlCount.!Title = Title;
AllUrl.AllUrlCount.!Comment = FtpComment;
AllUrl.AllUrlCount.!Category= '<$FTPLIKE_DISPLAY_DIR_TITLETAG $$SQx2>';
AllUrl.AllUrlCount.!Html = ToLowerCase(_filespec('name', '<?OutputFile>'));
#DefineRexx
#DefineRexx 'Rexx2AmPm'
TimeAmPmFmt = GetAmPmTimeFromHhMmSs('{$TIME}');
#DefineRexx
#define FTPLIKE_SHOW_FILE_TIME \
#evaluate ^^ ^<$Rexx2AmPm TIME="<??FtpHour>:<??FtpMinute>:<??FtpSecond>">^ -\
<??FtpDay> <??FtpMon> <??FtpYear> \
<??TimeAmPmFmt>
#define FTPLIKE_ADD_FILE_SIZE_AFTER_TIME ;;Don't want file size!
;--- Other stuff ------------------------------------------------------------
#define FTPLIKE_NO_HEADER_FOOTER_ON_1ST_PAGE
#define FTPLIKE_FOLLOW_SUBDIRECTORIES
#define FTPLIKE_USE_LONG_FILENAMES 100
#define FTPLIKE_BODY_BG_IMG graphics/bground.jpg
#define FTPLIKE_BODY_BG_COLOR #CCFFFF
#define FTPLIKE_BODY_LINK_COLOR #3333FF
#define FTPLIKE_BODY_VLINK_COLOR green
#define FTPLIKE_BODY_ATTR_OTHER LEFTMARGIN=5 TOPMARGIN=5 MARGINWIDTH=5 MARGINHEIGHT=5
#define FTPLIKE_DIRECTORY <$BOOKMARK_DIRECTORY>
#define FTPLIKE_DIRECTORY_WEB
#define FTPLIKE_NEWHTML_PREFIX bookmark_
#define FTPLIKE_HEADER <$PageTitle TITLE="{$Title}">
#define FTPLIKE_FOOTER \
#evaluate+ ShortNameHtml "_filespec('name', '<?OutputFile>')" -\
#evaluate+ ShortNameHtmlLowerCase "translate('<$ShortNameHtml>', 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" -\
<$EndHtmlWithStandardFooter>
#define FTPLIKE_TEXT_FILE url
#define FTPLIKE_TEXT_FILES urls
#define FTPLIKE_TEXT_DIR category
#define FTPLIKE_TEXT_DIRS categories
#define FTPLIKE_MINI_DIR_IMG_TAG <IMG SRC="graphics/fldrcls.gif" ALIGN="MIDDLE" ALT="*" TITLE="" BORDER=0 WIDTH=14 HEIGHT=11 VSPACE=3>
#define FTPLIKE_DONT_USE_C2X ;;Have longish dirs/names
#define FTPLIKE_HEAD_STYLE_TAGS <$CssStyle>
#define FTPLIKE_EXTRA_HEAD_TAGS \
<$FULL_PICS_RATING> %\
<$ENGLISH_CHARSET><?NewLine>
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%[ Include FTPLIKE Header ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#include "FTPLIKE.IH"
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%[ Add Footer to "ROOT" Page ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<$MacroPop Macro='ShortNameHtmlLowerCase'>
<$MacroPop Macro='ShortNameHtml'>
<$EndHtmlWithStandardFooter>
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%[ Produce ALL URLS List Page ]%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef ALL_URL_NAME
#output "<$ALL_URL_NAME>"
;--- Output Header stuff ---------------------------------------------
#define+ FTPLIKE_DISPLAY_DIR_TITLETAG ALL <??AllUrlCount> LINKS
#define+ FTPLIKE_DISPLAY_DIR_CATEGORY_LT <$FTPLIKE_DISPLAY_DIR_TITLETAG>
<$FTPLIKE_START_HTML_PAGE>
;--- Generate BODY ---------------------------------------------------
<?NewLine>
#if [AllUrlCount = 0]
<P>No URLs at all!
#elseif
;--- Generate body -----------------------------------------------
#DefineRexx ""
;--- Sort the array by Title -------------------------
<$GenRexx2Sort \
COUNT=^AllUrlCount^ \
GREATER=^SrtGreater = AllUrl.SrtIndex1.!Title > AllUrl.SrtIndex2.!Title^ \
SWAP=^ \
SrtTemp = AllUrl.SrtIndex1.!Title; \
AllUrl.SrtIndex1.!Title = AllUrl.SrtIndex2.!Title; \
AllUrl.SrtIndex2.!Title = SrtTemp; \
SrtTemp = AllUrl.SrtIndex1.!Url; \
AllUrl.SrtIndex1.!Url = AllUrl.SrtIndex2.!Url; \
AllUrl.SrtIndex2.!Url = SrtTemp; \
SrtTemp = AllUrl.SrtIndex1.!Comment; \
AllUrl.SrtIndex1.!Comment = AllUrl.SrtIndex2.!Comment; \
AllUrl.SrtIndex2.!Comment = SrtTemp; \
SrtTemp = AllUrl.SrtIndex1.!Category; \
AllUrl.SrtIndex1.!Category = AllUrl.SrtIndex2.!Category; \
AllUrl.SrtIndex2.!Category = SrtTemp; \
SrtTemp = AllUrl.SrtIndex1.!Html; \
AllUrl.SrtIndex1.!Html = AllUrl.SrtIndex2.!Html; \
AllUrl.SrtIndex2.!Html = SrtTemp; \
^ \
>
;--- Display Each item -------------------------------
AllOutput = '';
Index = 1;
do while Index <= AllUrlCount
;--- Get main information ------------------------
StartName = AllUrl.Index.!Title;
StartUrl = AllUrl.Index.!Url;
StartComment = AllUrl.Index.!Comment;
;--- Output Name & URL ---------------------------
UrlLink = '<A HREF="' || StartUrl || '" TARGET=<$BOOKMARK_OPEN_LINK_IN>>' || StartUrl || '</A>';
AllOutput = AllOutput || '<P><?NewLine>';
AllOutput = AllOutput || '<TABLE BORDER=0 WIDTH="100%" CELLPADDING=1 cellspacing=0><?NewLine>';
AllOutput = AllOutput || ' <TR><TD BGCOLOR=SILVER>' || StartName || '</TD></TR><?NewLine>';
AllOutput = AllOutput || ' <TR><TD BGCOLOR="#FFFF9C">' || UrlLink || '</TD></TR><?NewLine>';
;--- Add category information to comments --------
Comment = StartComment;
do Index = Index to AllUrlCount
;--- Only category differs? ------------------
if StartName <> AllUrl.Index.!Title | StartUrl <> AllUrl.Index.!Url | StartComment <> AllUrl.Index.!Comment then
leave;
;--- Add category ----------------------------
MoreLikeThis = '<A HREF="' || AllUrl.Index.!Html || '"><SMALL>Category: ' || AllUrl.Index.!Category || '</SMALL></A>';
if Comment = '' then
Comment = MoreLikeThis;
else
Comment = Comment || '<BR>' || MoreLikeThis;
end;
;--- Output comments and category information ----
AllOutput = AllOutput || ' <TR><TD BGCOLOR=WHITE>';
AllOutput = AllOutput || Comment;
AllOutput = AllOutput || '</TD></TR><?NewLine>';
;--- End the entries table etc -------------------
AllOutput = AllOutput || '</TABLE><?NewLine><?NewLine>';
;--- How many items did we just handle? ----------
end;
#DefineRexx
<??AllOutput>
#endif
;--- Thats All for this file ---------------------------------------------
<$FTPLIKE_FOOTER>
#output
#endif