[Home]EdGray

UseModWiki | RecentChanges | Preferences

A Wiki newbie as of July 2001. I've quickly fallen in love with UseMod. I've downloaded version .92 and installed it on a Windows 2000 server running Microsoft's Internet Information Server with the latest version of ActivePerl installed. I work at [Sony Electronics], in the computer support division. We are using UseMod on our intranet to assist us in software development and management.

I like the fact that UseMod is contained in a single file and that he config options are well documented and easy. And while UseMod has numerous features I enjoy the fact that I can easily extend and customize it.

I've found that the UserGotoBar is a great way to easily extend tyhe functionilty of the wiki. I have added links to a file manager, calander and to [[CVS]]. Also, the script itself is easy to edit and update. I've added the various patches to include support for easy table creation and font color formatting. I've even included a sub-procedure for a qoute of the day to appear in the footer and incorporated a spellchecker from http://www.spellchecker.net which works very well with UseMod on the edit page.


Here is how I've customized the UserGotoBar with other perl utilities, graphical icons and the output from a sub procedure that returns the current date and time (Clock):

$UserGotoBar = "<img src=smspace.gif><a href='wiki.pl?action=index'><img src=icons/index.gif alt=index border=0></a><img src=smspace.gif><a href='db/database.pl'><img src=icons/fileman.gif alt=FileManager border=0></a><img src=smspace.gif><a href='calendar/calendar.html'><img src=icons/calendar.gif alt=Calendar border=0></a><img src=smspace.gif><a href='http://xxx.xxx.xxx.xxx/cgi-bin/cvsweb.cgi/?only_with_tag=MAIN#dirlist'><img src=icons/cvs.gif alt=CVS border=0></a><img src=smspace.gif><a href='wiki.pl?System'><img src=icons/sysadmin.gif alt=SysAdmin border=0></a><img src=smspace.gif><a href='wiki.pl?Help'><img src=icons/help.gif alt=Help border=0></a><img src=smspace.gif><br><font size=-1 face=arial><b>Current Time:</b> " . &Clock() . "</font>" ;  # HTML added to end of goto bar


Here is the code for the quote of the day sub procedure:

Remember to delcare the variables and arrays or you'll get errors. This could be done within the sub procedure but I included them with the other variables at the top of the script.

The entry for the footer option: 

$FooterNote  = "<hr><img src=icons/sound.gif alt='Quote of the day' border=0> <i> " . &QTD() . "</i>";         # HTML for bottom of every page

sub QTD {
# Quote of the day from Matt's CGI archive
# http://www.worldwidemart.com/scripts/rand_text.shtml

# This is the file in which all of your random text phrases are stored.      #
$random_file = "/esupport/wiki/quotes/random.txt";

# The delimiter specifies how each phrase is distinguished from another.  For#
# instance, the common fortune file (a Unix program) is delimited by a new   #
# line followed by two % signs on the next line and then a new line.  This is#
# a pretty good format and you can read more about it in the README file.    #
$delimiter = "\n";

# Open the file containing phrases and read it in.
open(FILE,"$random_file") ;
@FILE = <FILE>;
close(FILE);

# Join these lines from the file into one large string.
$phrases = join('',@FILE);

# Now split the large string according to the $delimiter.
@phrases = split(/$delimiter/,$phrases);

# Invoke srand; with a seed of the time and pid.  If you are on a machine
# which doesn't put the pid into $$ (ie. Macintosh, Win NT, etc...), change
# this line to:  srand(time ^ 22/7);
srand(time ^ 22/7);

# Now pluck our random phrase out of the @phrases array!  But wait!  This
# only returns a number.
$phrase = rand(@phrases);

# Change this number into the text we want to return and print it!
$qtext = $phrases[$phrase];
return $qtext;

# All Done!
}


UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 27, 2007 1:44 am by MarkusLude (diff)
Search: