[Home]WikiPatches/InterSiteIcons

UseModWiki | WikiPatches | RecentChanges | Preferences

I wrote a small patch to add support for showing small icons exactly before each InterSite link, the image filenames are placed behind the aliasURLs in the intermap file and can be temporarily or permanently disabled by ending the corresponding definition line with a '0'.

In addition, also decided to make all "keys", i.e. the InterSite(InterWiki) keys case-insensitive, making GOOGLE:tombo the same as google:tombo (Option $InterSiteLinksCaseSensitive).

Using the new switch $InterSiteIcon=2 suppresses the InterSiteLink prefix string such as google: , when an InterSiteIcon? image is shown. The InterSite string is shown as alternative text, when an image filename is present for this InterSite but could not be loaded.


 Here is a screenshot taken from one of my Wikis 
 

 left column:                      right column:
 $InterSiteIcons = '1';            $InterSiteIcons = '2'
                                   (InterSite text is suppressed, but shown as alternative image text when the image could not be loaded as with "caselaw" in the above example)


My Intermap file format is compatible with the original file format, but has the following features:

Intermap file formats

Old format: key aliasURL

Examples:

Dictionary http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=
Google http://www.google.com/search?q= 
Cache http://www.google.com/search?q=cache: 
WikiPedia http://www.wikipedia.org/wiki/

New format: [# ] key aliasURL [aliasImagefilename [0|1]]

# Dictionary http://www.dict.org/bin/Dict?Database=*&Form=Dict1&Strategy=*&Query=
Google http://www.google.com/search?q= google-favicon.gif
Cache http://www.google.com/search?q=cache: google-favicon.gif 0
WikiPedia http://www.wikipedia.org/wiki/ wiki-icon.gif 1

 Remarks:

 Line 1: If a '#' is present on a line, the whole entry is ignored.
 Line 2: If an image filename is present, this image is shown before the aliasURL (if $InterSiteIcons >= 0)
 Line 3: If a trailing '0' (zero) is found, the image is not shown even when the filename is present.
         This feature allows the wiki administrator to keep the image filenames in the Intermap file 
         but to disable some icons.
 Line 4: The default is: to show the image, therefore you do not need to type a trailing '1'

 New variables in <tt>config</tt>:

 $InterSiteIcons   = '2';                 # 0: no InterSiteIcons; 1: show InterSiteIcons ; 2: show InterSiteIcons and suppress InterSitePrefix
 $InterSiteIconDir = 'usemod/upload/';    # path to the InterSiteIcons small image files
 $LocalWikiIcon    = 'favicon.gif';       # small image shown before a LocalWiki: IntraSite-Link
 $InterSiteLinksCaseSensitive = '0';      # 0: case-insensitive (default) ; 1: case-sensitive InterSiteLinks

The code for the patch will follow end of April 2004, please be patient - it is ready and stable and it is a really nice patch. TomGries 01.04.2004


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 13, 2007 1:14 pm by JuanmaMP (diff)
Search: