Bug reports should be reported in WikiBugs and formal patches announced/published in WikiPatches.
1. What is the format of the data files? Can it be easily understood?
For complete documentation, see DataBase.
Under the data directory are files (page/A/Alkali_model.db, for example).
These files are mostly simple text files. You can cat them to your terminal. The files are delimited by the superscript 3 character, mostly.
The fields in the file are... The first line represents??? There is some diff looking stuff in there???
$FS = "\xb3"; # The FS character is a superscript "3" $FS1 = $FS . "1"; # The FS values are used to separate fields $FS2 = $FS . "2"; # in stored hashtables and other data structures. $FS3 = $FS . "3"; # The FS character is not allowed in user data. # read full contents of .db file into $dbfile %Page = split(/$FS1/, $dbfile, -1); %Section = split(/$FS2/, $Page{'text_default'}, -1); %Text = split(/$FS3/, $Section{'data'}, -1); $pagetext = $Text{'text'}; # text of the page
2. Let's suppose someone with an increasingly high-traffic wiki (WikiPedia, for example) wanted to convert UseModWiki to FastCGI or mod_perl. What would be required?
3. Where can I get a basic explanation of what such-and-such a function does?
Try Functions. If you know what a function does, and it doesn't say so over there, please fill it in. There are a lot of functions, but if 10 people do 2-3 a day, we will be done in a few years. *wink*
4. Is there a list of the CGI actions available in the script anywhere (ie pagelock, index and list features, etc)?
See the comprehensive Actions and AdminFeatures, or the more user-friendly System for lists.
See also the subroutines DoBrowseRequest and DoOtherRequest.
5. What thoughts are there on the distribution of the InterWiki tags used in intermap? -- ChrisFedde
6. Have you anything that describes the basic flow of the wiki.cgi program? -- ChrisFedde
7. PolishTranslation is ready. I only wish I need't have resorted to an ugly hack to translate $RCName. --kpj
8. What are the diffs between major diffs, minor diffs and author diffs? (Pardon the pun.) :-) -- CAL
9. Does anyone know if a patch for creating an edit button on the top of the page and perhaps even change the font of the "Edit" link to a larger font?
I'm thinking that this might increase the chance that people will contribute by editing pages. --MatthewSimpson
10. What is the backup/restore process for a UseModWiki? Can a UseModWiki be safely and easily moved to a new location on the webserver or to a new server? Can individual pages be imported and exported? -- DavidMasterson
$DataDir
directory. Moving the wiki is as simple as changing the $DataDir
configuration variable. (The wiki data files (except the config file if it is used) do not contain any path information.) --CliffordAdams
11. As a CGI script, should UseModWiki be doing more to set ownerships and permissions of files? Perhaps it should always set the umask to 0? -- DavidMasterson
#!/usr/bin/perl $| = 1; print "Content-type: text/html\n\n"; print "<html><pre>\n"; print "Output:\n"; print `tar -cvzf /some/private/dir/mbback.tgz /home/usemod/meatball`; print "\n...done.\n</pre></html>\n";
$DataDir
wind up being owned by "nobody" with a permission that does not allow me to clean them out if (or when) I decide to remove the Wiki. I chose to set the umask to 0 and chmod "g+s" the $DataDir
. -- DavidMasterson
$DataDir
to "/home/david/wikidir/mywiki" (which will be autocreated by the script). --CliffordAdams
$DataDir
to ensure it's my group that things are created with. -- DavidMasterson
#! /usr/bin/perl -Tw print "Content-type: text/html\n\n"; print "<html><head><title>foo</title></head><body>\n"; print "I'm foo!\n"; print "</body></html>\n"; @files = qw( /home/USERNAME/wiki/MyWiki/intermap /home/USERNAME/wiki/MyWiki/style.css ); for $f ( @files ) { open( FOO, "> $f" ); print FOO "\n"; close FOO; chmod( 0664, $f ); } __END__
Replying to the problem posed by DavidMasterson: I did an install of UseModWiki 1.0 in a userspace (/home/user/public_html for purposes of discussion) on a Red Hat Linux server. I was able to keep the wiki's dataspace set drwxrwxr-x, and the file-ownership set to user, by setting the group assignment to nobody (chgrp -R nobody *). That worked, when setting the wiki's subtree world-writable didn't. This being a Red Hat machine, the Apache http server owns user nobody, group nobody. If you're running on some other distributions, they all seem to have different methods, so you'll have to find out what group the httpd demon belongs to there (on MEPIS 3.3.1, apache2 runs as user www-data, for instance). --CrB3 (C. R. Bryan III)
Anyone interested in a modification to the usemod source code that adds an admin bar and an actions bar similar to the navigation bar in the current version (plus options to show or not show in the preferences)? I have written the code and have a working version running at http://www.razar.f2s.com/cgi-bin/newwiki.pl ( the freedom 2 surf server is very slow, expect delays ). -link seems broken, just fyi. -KlocWerk
The changes aren't major, but it would make using the admin functions a lot easier to use. I have not done any programming in perl, but have tried to copy the style of the current code. If someone would be willing to take a look at the code and check I'd be happy to supply it.
Hopefully something like this will be incorporated by CliffordAdams into the main code. I am also currently doing a modification of the code so that the login takes your username not an ID. If anyone has done this allready I would appreciate the code so I dont have to do the work myself ;). If you are interested send me something at ghast@zombieworld.com --Razar
Nice idea, I think I will do something like this, though you realise that most people will just create a page for themselves and place all the usefull links they want on that? The problem is that they are unlikely to find out how to use the more obscure actions that the cgi allows. Btw it does not really complicate the code to add the extra bars, since most of the functionallity is allready in the code. Its maybe 50 lines I think. My motivation was actually just to make the admin page lock command easier to use. Its much easier as admin to go to a page and either lock or unlock it based on a link than to type in the various options in the address bar. Also the way I did the Wiki Lock makes it immediately obvious when you are logged in as admin if the wiki is locked or not. I added the normal actions just for completeness. --Razar
(*) The login feature is not worth the user confusion it causes I disagree, tho I think it should be re-documented. It is very useful for a restricted group of people (including where several share one machine, and where one uses several machines). It is a pain having to set several options each time, one number and one password does all my diff settings, length of edit window, and username. --RiVer
Though I can possibly dig this out of the wiki.pl code (and will, if I have to)....
We are using trans.pl at http://unumondo.com/cgi-bin/wiki.pl -- JerryMuelver
<i>It would be good if the maintenance routine had an option to clean up profiles that haven't been accessed for a specified period. I too have the problem that I cannot delete any files in the database folder because they are owned by the system's "CGI-user"... - Geoffrey
I recently learned about [wt2db], a perl module that converts WikiText files into [Docbook] XML. WikiText seems to be UseModWiki based and is used at the [Linux Documentation Project].
What I'm looking for is whatever patch to the UseModWiki is necessary in order for it to display in a browser the extensions that make up WikiText (e.g., id in sections, QandASets,<programlisting> tags...).
Got now an answer from David Merrill, the author of wt2db, saying that unfortunately:
Maybe we can come up with something along those lines... -DanielHernandez
ExtractTexinfo produces a texinfo file, and then you can run `makeinfo --docbook yourwiki.texi'. -- AlexSchroeder
I would like to have the Search form use the "get" form method so that my web stats program can see the queries and produce a search word report. But, I would like to keep using the "post" form method on the edit page, because "get" seems to be limited to a certain number of characters. Any suggestions before I dive into the code? -- RogerPilkey
Just change the script so it emits method="get" instead of method="post". Simple as that. -- SunirShah
Thanks, Sunir. I modified sub GetFormStart to take a parameter, then I made the GetFormStart call in sub DoEdit to be Post, and left the other GetFormStart calls as Get. Seems to work. RogerPilkey
Q: I want to be able to make links by just putting an underscore between words. Are there any side effects to altering $LpA to be:
$LpA = "(?:(?:$LpA)|(?:${AnyLetter}+_$AnyLetter+))";
It's around line 190-something. I set up a test wiki to play with it, and it seems to work ok. It recognizes regular WikiWords as well as stuff_like_this. I haven't examined all 4000+ lines of code to check for side-effects, though. Will I break anything with this alteration? --DavidWall
Say I am browsing a page, that I want to bookmark to come back to at a later date, if I had an action=BookMark?&id=MarkMe? that would automatically create an entry in my UserName? Page such as, say,
[[MarkMe]] Date & Time of BookmarkingI wonder if someone could offer any insight here. - Thanks Ajiva_Rts
Q: I want to add pictures to a page. They are currently on my C: hard drive.
The pictures must be available for download somewhere. I assume that the directory C:\MyPictures? is not accessible from the web. Therefore, you must upload the pictures to a web server, first. Then you need to find out what URL will lead to these pictures, and once you have that, you can just put the URL on your wiki page and the picture should be inlined, there.
Important: The wiki does not allow you to upload pictures, unless you patch it (see WikiPatches).
I'd like to ask some questions about the LinkDatabase? feature provided by MeatBall:LinkDatabase. Is it available by default or has it to be patched? How is it implemented? (I studied the code some minutes, but couldn't find out. Maybe you can point me to it! :-) - I'd like to have a wiki where all words are checked for links without having special patterns except for escape characters. I'm a ZWiki user in general, but i remembered the LinkDatabase? feature here which might be necessary for such a modification, i guess. - What do you think? Any idea, links etc. are appreciated. - FlorianKonnertz, 03-02
Take a look at MeatBall:GaGa to link all words (based on Moin Moin, I think). For the link data on the Meatball page: This is built in via the link action. -- AlexSchroeder
so as not to lose the internal/external flow...
Thanks
A: I found the patch... WikiPatches/OffsiteNewWindow
Thanks for the great Wiki and I love the Latex ability....
A: It is possible by making a small change to the code, but not through the configuration. In the GetHeader subroutine there is a line:
$header = &ScriptLink($HomePage, "<$logoImage>");Change this to read something like:
$header = '<a href="http://www.othersite.com/">' . "<$logoImage>" . '</a>';...replacing the "othersite" URL with the one you want to use. This should be the only change necessary. (I haven't tested this change.) --CliffordAdams
Thanks for the prompt response and its comprehensible manner. It works as stated. - StephenHay
A: UseModWiki sites are usable by Google and some other search engines. It can help to add a line to robots.txt denying access to URLs like:
http://www.usemod.com/cgi-bin/wiki.pl?action=
...so that search engines don't try to edit pages or view old revisions. I have considered writing an export-to-HTML function (which would make this easy), but I haven't had time to implement it. --CliffordAdams
A1: You could do that. A few people have caused problems on usemod.com in the past, creating hours of work for the volunteers who cleaned up the mess. I have blocked some IPs and domains which frequently cause problems. A few pages (like the home page and RecentChanges) are edit-locked. In the worst case, I do make frequent backups of the site. See WikiErase for more discussion. --CliffordAdams
A2: UseModWiki sites that do not want to allow open editing for everyone can use editor and/or admin passwords to restrict editing. See AdminFeatures for more information. --CliffordAdams
Q: I have modified my wiki to run locally on my computer and I use it as a database essentially, thanks to yours truly CA. Anyways, I can input images from external http sources, but cannot embed local files using local addresses, I think my problem is an address error, anyone with a mac osX have a suggestion?
A: How to modify to RunWikiLocallyOnOSX? --MichaelHerman
Q. Why is the parameter for requesting a page sometimes 'id' (for editing) and sometimes 'title' (for previewing)?
A: That's a good question, and I don't know why offhand. I might have chosen "title" for form submission (saving and previewing) in order to avoid possible confusion with user-id numbers, but that's just a guess. (It's also conceivable that "title" is one of the few surviving bits of the original AtisWiki code. I estimate that about 50-100 lines of AtisWiki are present in UseModWiki 1.0.) Right now I don't really want to change the working code without good reason, but thanks for bringing this up. --CliffordAdams
A1: No. --CliffordAdams
A2: No, but I'm willing to consider specific cases where non-compliance is a problem. The new $ParseParas? setting in 1.0 attempts to bring paragraph handling closer to compliance (when set to 1). I vaguely recall there were other issues that made 4.01 compliance difficult with the current code. --CliffordAdams
A3: Yes ;-) I try to make the script compliant to at least HTML 4.01 transitional. Expect this for 1.1 --MarkusLude
A: I intended UseModWiki to work with at least 10,000 pages. This site has over 1500 pages, and the [Meatball wiki] has over 2700 pages. I have heard of UseModWiki sites with over 10,000 pages that had adequate performance. One other data point: the Wikipedia project used UseModWiki during its initial growth phase, and it handled more than one MeatBall:SlashdotEffect event fairly well.
There are a few areas where performance can suffer with larger numbers of files. The first one is searching--the wiki will search all the page files for every search. The second problem that can occur is a slowdown due to having hundreds or thousands of files in a single directory. The wiki divides pages/files based on their first letter which helps somewhat, but a large number of files will slow down all file-accessing operations. This second problem used to be a major concern with old filesystem implementations, but modern filesystems will handle several thousand files per directory without problems.
If scaling is a major concern, you may want to look at [MediaWiki], which is the software used by the Wikipedia projects. --CliffordAdams
Q: I'm looking for an easy way to distinguish between links to page requests and links to action requests. Any hints? --MarkusLude
A: For most purposes (like excluding robots) you can consider all URLs of the form "...wiki.pl?action=" to be action requests. There is a "browse" action, but that is only typically used by the difference links and links to old revisions (which you usually want to exclude anyway). --CliffordAdams
Q: Right now UseMod uses rss very limited: a link to the page and only the Summary (without any formating) as content. Could this be changed? I would like to see it contain (optional) the full page (the reversion referred too). Would this be posible? -- GideonKlok?
A: It would be possible, but it would not be trivial. I do not intend to add such a feature, but I would be willing to give a little help if someone else wants to add it. (One would have to copy some code from the BrowsePage subroutine to GetRssRcLine.) --CliffordAdams
Q. How can I get rid of the question marks that show up next to words I type that should not turn into links? i.e. MySQL? --Erik Weibust
You can surround the text with "nowiki" tags which prevent any wiki rules from applying to the text. For example <nowiki>MySQL</nowiki> appears as MySQL. You might find it easier to create a MySQL? page if you mention it often. --CliffordAdams
Q: has anyone modified UseMod such that true authentication works? Because I don't mind when people just edit the pages, as long as they at least are registered and have to log in. -- P Ramakers
Q: as an alternate method of creating new pages is there a way of having sth like a [New] tag in UseModWiki like in [CocoaDev] or else a way of getting a form working with the wiki.pl using raw html like in the following: --TobiasSchwinn
<html> <form method="POST" action="wiki.pl"> <p>Page Title: <input type="text" name="title"> <p><input type="submit" name="Save" value="Save"> </form> </html>
A: i found a way of doing this in raw html. just paste the following into ur wiki page:
<html> <form method="POST" action="wiki.pl"> <input type="hidden" name="action" value="edit" /> <p>Page Title: <input type="text" name="id" /> <input type="submit" name="Save" value="Create" /> </form> </html>
Q: Is there a simple way of creating a breadcrumb across the top of the page to keep track of the pages you've visited? -- P Breen A: Can this script help you? http://www.fifegeek.com/webdesign/perl/perlcrumbs.shtml
Q: Changing the encoding of QUERY_STRING env.variable before "new CGI;" called.. is it ok?
There are some situation that browser's request includes multi-byte string. For example: (I'm living in South Korea)
I wanted my wiki support both encoding and I am trying to modify wiki.pl
At first, I tried to check the value which I got from GetParam() like this:
$id = &GetParam('id'); $id = &guess_and_convert($id); # "guess_and_convert" subroutine guesses the encoding of parameter # using Encode::Guess module. If not UTF-8, it converts the parameter # to UTF-8 encoded string and return it.
However, there are so many "GetParam()"s in wiki.pl and I found that it's almost impossible, or so inconvenient to check whenever the parameters are fetched.
Second, I tried to "check and convert" $ENV{QUERY_STRING} value before a CGI object is created:
# convert QUERY_STRING to UTF-8 here $ENV{QUERY_STRING} = check_and_convert($ENV{QUERY_STRING}); # then create CGI object $q = new CGI; # I can get name=XXX and XXX is encoded in UTF-8 $name $q->param("name")
In this case, I think, I don't need to check each parameter in any other following codes... All the values are now UTF-8 encoded.
As far as I had tested, it looked successful. But I'm not sure that such approach is good(?) and safe, because I'm trying to change an environment variable.
In addition, I've already applied WikiPatches/SlashLinks to my wiki, and I found that DoCacheBrowse uses "$ENV{QUERY_STRING}" before "new CGI;" is called in InitRequest.
Therefore, my final code is:
sub DoWikiRequest { ... ### for SlashLinks. I moved these 4 lines from InitRequest to here if ($SlashLinks && (length($ENV{'PATH_INFO'}) > 1)) { $ENV{'QUERY_STRING'} .= '&' if ($ENV{'QUERY_STRING'}); $ENV{'QUERY_STRING'} .= substr($ENV{'PATH_INFO'}, 1); } ### here, I change (if needed) $ENV{'QUERY_STRING'} into the UTF-8 encoded string $ENV{'QUERY_STRING'} = guess_and_convert($ENV{'QUERY_STRING'}); ### original code &InitLinkPatterns(); if (!&DoCacheBrowse()) { eval $BrowseCode; &InitRequest() or return; if (!&DoBrowseRequest()) { eval $OtherCode; &DoOtherRequest(); } } }
What do you think about my approach? Am I missing something or making a mistake? Any advices would be appreciated. I'm sorry I'm not good at English. -- GyPark
Q: To implement a macro feature, I need to open and read from a second page while rendering the current page. OpenPage
sticks page contents into a global variable, so calling OpenPage
while rendering a page will clobber the current page. Must I write a second, non-clobbering open page function? [subquestion: why in the world does wiki.pl use global variables in the first place? They're deprecated for exactly this reason!] -- Mark
WikiBugs/MonthsInEnglish is not fixed in 1.0.4 but it appears as "Fixed (mostly from 0.92)" in WikiBugs; as finally that is an overload even in recentchanges, then its state is really "Not Resolved" or "won't be fixed"? (best the second one?). Thanks.--JuanmaMP
sub DoRandom { my ($id, @pageList); @pageList = &AllPagesList(); # Optimize? $id = $pageList[int(rand($#pageList + 1))]; - &ReBrowsePage($id, "", 0); + &BrowsePage($id); }