summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2000-12-10 15:50:11 +0000
committerDries Buytaert <dries@buytaert.net>2000-12-10 15:50:11 +0000
commit5fd94b17655fc3a0154ae5b9ca75271e1922fd15 (patch)
treeac68001617b22ceed544a1a5e87bab400f6f20ee
parent939c92a2a5c93d84459b0c1f12bf1fab65f129e5 (diff)
downloadbrdo-5fd94b17655fc3a0154ae5b9ca75271e1922fd15.tar.gz
brdo-5fd94b17655fc3a0154ae5b9ca75271e1922fd15.tar.bz2
- added 2 new modules!
--> check http://drop.org/module.php?mod=module-list for a list of available modules
-rw-r--r--modules/documentation.module28
-rw-r--r--modules/module-list.module14
2 files changed, 42 insertions, 0 deletions
diff --git a/modules/documentation.module b/modules/documentation.module
new file mode 100644
index 000000000..392530801
--- /dev/null
+++ b/modules/documentation.module
@@ -0,0 +1,28 @@
+<H1>Documentation:<BR>user guide, administrator guide, technical manual</H1>
+<SMALL><I>$Id$</I></SMALL>
+
+ <H3>Blobs</H3>
+
+<P>The site can be almost entirely configured through a web interface by using <I>blobs</I>. Simply put, blobs are small bit of PHP code which will get plugged into the engine or modules powering the site. Blobs are typically used to link modules with the mainstream engine or to customize various aspects of the engine itself.</P>
+<P>If you know how to script in PHP, blobs are pretty simple to create. Don't get your panties in a knot if you are not confident with PHP: simply use the standard blobs (i.e. those available by default) as they are just fine or ask an expert blobber to help you creating custom blobs that fit your need.</P>
+<P>Each blob consist of a key of maximum 255 characters and an associated block of PHP code which can be as long as you want it to be. You can use any piece of PHP code to make up a blob. A blob's code is stored in the database and the engine or a particular module will use the key to find the associated piece of PHP code which will then be dynamically embedded in the engine or the module just-in-time for execution.</P>
+<P>There are however some factors to keep in mind when using and creating blobs: blobs can be extremly useful and flexible, yet be dangerous and insecure if not properly used. If you are not confident with PHP, SQL or even with the site engine for that matter, avoid experimenting with blobs because you can - and you probably will - corrupt your database or even break your site!</P>
+<P>Remember that the code within each blob must be valid PHP code, including things like terminating statements with a semicolon so the parser won't die. Therefore, it is highly recommended to test your blobs seperatly using a simple test script on top of a test database before migrating to your production environment running your real database.</P>
+<P>Note that you can use any global variables, such as configuration parameters within the scope of a blob and keep in mind that variables that have been given values in a blob will retain these values in the engine or module afterwards.</P>
+<P>You may as well use the <CODE>return</CODE> statement to return a value back to the engine.</P>
+<P><U>A basic example:</U></P>
+<P>Given the blob with key <CODE>sumbit_information</CODE>, used in <CODE>submit.php</CODE> to retrieve and display submission guidelines at the top of the story submission page. A simple code block for this blob could look like this:</P>
+<PRE>
+ return "Welcome visitor, ... sumbission guidelines go here ...";
+</PRE>
+<P>If we are however dealing with a registered user, we can customize the message by using:
+<PRE>
+ if ($user) {
+ return "Welcome $user->userid, ... submission guidelines go here ...";
+ }
+ else {
+ return "Welcome visitor, ... sumbission guidelines go here ...";
+ }
+</PRE>
+<P>For more in depth example, we recommand you to check any of the available modules and to go from there.</P>
+<P>As said above, you can virtually use any piece of PHP code in a blob: you can declare and use functions, consult the SQL database, access configuration settings and so on.</P>
diff --git a/modules/module-list.module b/modules/module-list.module
new file mode 100644
index 000000000..6cc3b2aa1
--- /dev/null
+++ b/modules/module-list.module
@@ -0,0 +1,14 @@
+<H1>Module list</H1>
+<SMALL><I>$Id$</I></SMALL>
+
+<P>Installed or available modules:</P>
+ <UL>
+ <?
+ $handle = opendir("modules");
+ while ($file = readdir($handle)) {
+ $name = substr($file, 0, strpos($file, ".module"));
+ if ($name) print "<LI><A HREF=\"module.php?mod=$name\">$name</A></LI>";
+ }
+ closedir($handle);
+ ?>
+ </UL>