ewiki code fragments/ and tools/ ================================ Unlike the plugins/ the code snippets and asorted data files in fragments/ can be included() directly into yoursite.php and are sometimes also unspecific to ewiki. And the init-pages/ for example are required only once and can be removed after initialization. The tools/ is a separate bundle of administration tools for the ewiki database. They are separate from the main Wiki (even comes with a different 'config.php') to enhance safety and reliability. 1 fragments/ 1.1 strip_wonderful_slashes.php 1.2 strike_register_globals 1.3 404finder.php 1.4 htaccess 1.5 binary.php 1.6 force_lang_de.php 1.7 fragments/funcs/* 1.8 fragments/css/* 1.9 fragments/blocks/* 1.a fragments/patches/* 1.b fragments/php-patches/* 2 Additional tools/ 2.1 tools/t_flags 2.2 tools/t_backup 2.3 tools/t_restore 2.4 tools/t_remove 2.5 tools/t_holes 2.6 tools/t_textinsert 2.7 tools/t_transfer 2.8 tools/t_revert 3 commandline tools/ 3.0 tools/setup 3.1 tools/ewikictl 3.2 tools/wiki2html 3.3 tools/mkhuge 3.4 tools/mkpluginmap 3.5 tools/mkpageplugin 3.6 tools/mkxpi 3.7 tools/php5fix 4 examples/ 4.1 examples/homepage.php 5 Pages in init-pages/ -------------------------------------------------------------------- 7 -- fragments/ ŻŻŻŻŻŻŻŻŻŻ This directory holds some files to integrate ewiki.php within some other web projects (for example PhpNuke) or some helper and extension code, but even data files, code patches. Most stuff is grouped into subdirs: blocks/ plugin extractions to get included() somewhere into yoursite (onto left or right side, like in one of those portal scripts) head/ also output html snippets, for inclusion into the html area of pages css/ for sample .css files and per-page .css definitions (for use with 'fragments/css.php') funcs/ code snippets of varying usefulness parent-cms/ samples on how to integrate ewiki into CMS or portal scripts patches/ code/feature tweaks php-patches/ PHP interpreter bugfixes ./ assorted stuff, described below: strip_wonderful_slashes.php ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ If you have a PHP 4.1 or a provider using the annoying factory-default settings of such a version, you may find this tiny script helpful. It removes the just-for-security-reasons-added-backslashes from the $_REQUEST variables. I wasn't very interested in adding hundreds of stripslashes() calls inside ewiki.php, so this is the workaround for __your__ providers broken php.ini It does not hurt a well configured PHP interpreter setup. Newer ewiki versions come with a "plugins/lib/fix.php", which does basically the same, but also incorporates: strike_register_globals ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Tries to secure the $GLOBALS environment for PHP setups with the register_globals still turned on (which is a bad thing!). 404finder.php ŻŻŻŻŻŻŻŻŻŻŻŻŻ Simple example on how to use "ErrorDocumet 404" rediriction to activate the ewiki page search function automatically, which is the poor mans mod_rewrite. htaccess ŻŻŻŻŻŻŻŻ To make a Wiki installation look more profession you should try to use your Webservers mod_rewrite module to get nicer looking URLs. This file is an example to be installed as ".htaccess" (Web server per-directory configuration file), which allows to call your ewiki wrapper using URLs like: http://www.example.de/wiki/SomePage http://www.example.de/wiki/edit/OneOfThePages (For this example, you needed to set EWIKI_SCRIPT to "/wiki/"). This example '.htaccess' script shows how to instruct mod_rewrite to catch above URLs and to transform them into ".../index.php?id=Page" again before calling the script. +++ Shows how to use mod_rewrite with ewiki. * old style: http://www.example.com/wiki.php?page=WikiPage * PATH_INFO: http://www.example.com/WikiPage Remember to enable EWIKI_USE_PATH_INFO inside ewiki.php - this was disabled once, because of the many broken Apache implementations (they seem to support that broken CGI/1.1 specification, which was for good reasons and luckily never blessed to become an official RFC). binary.php ŻŻŻŻŻŻŻŻŻŻ If yoursite.php (ewiki wrapper) is not designed carefully enough (=not binary safe, because or text is written before the ewiki.php core script got included) or EWIKI_SCRIPT_BINARY cannot be set correctly, you may want to use this wrapper script to allow for uploading and retrieval of binary content (images) via ewiki. Copy it to where the main ewiki.php script is, and set the EWIKI_SCRIPT_BINARY constant to the correct absolute position (possibly including http://server.name/) of "binary.php". (this constant must be set on top of ewiki.php) You must set the database access params in here, too. It may also be useful if you'd like to divide the database into its two parts again - text content and binary content. You could even let it save binary content in a flat file database, while WikiPages remain in a RDBMS. force_lang_de.php ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Sample pre-config script for "de_DE" lang to preset the language appearance of ewiki. If you just are too lazy to set up your browser correctly, then this line usually fixes your language setting problem: $_SERVER["HTTP_ACCEPT_LANGUAGE"] = "de"; (must be written before ewiki.php gets included) fragments/funcs/* ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ The funcs/ subdirectory contains code snippets, that provide additional interface functions. fragments/funcs/auth.php ------------------------ Include this script wherever you need authentication. It uses the HTTP Basic Authentication scheme, but the passwords are inside the script in the $passwords array (so no need for .htpasswd setup). Note that this script needs to be called before any body output is made (else it would be too late for http header() output). fragments/funcs/wiki_format.inc ------------------------------- This php include() file contains just the reduced wiki_format() function, the code to generate internal WikiLinks and the binary data stuff has been removed. It is best suited to allow rendering of WikiSource with other php projects. The script was contributed by Frank Luithle. fragments/css/* ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Please understand the *.css as examples that illustrate which style classes are defined inside ewiki.php and its companion plugins. Remember, you could insert those files with PHPs` include(), too - if desired (and if a