Myth2 v2.1 Readme


About

Myth2 is a sort of interactive story in which you traverse down a binary tree of storys,
you are given two options on each node and can choose either. Once you reach the end of a
branch you may add to the story. It's similar to the gamebooks that were a demi-craze
in the 80's except that it can be added to and expanded upon by the reader.
The Admin can easily edit nodes or delete a node (and all nodes below that one).

Myth2 is coded entirely in PHP and uses MySQL for the backend. It was developed on php 4.3.2
and mysql 4.0.12, however it should work fine on lower versions of php4 and mysql3.x and 4.x.
Myth2 is basically a implemention of a binary tree using php/mysql.

It is coded and maintained by solidox. New versions can be found at http://solidox.org/myth2/

Installation/Configuration

Myth2 v2.1 introduces an automatic installer, which will handle the database importing for people
without access to phpmyadmin/etc. To install Myth2 manually follow these steps: If you do not have the ability to import .sql files via phpmyadmin/etc, i have written a minimalist
installer capable of importing the database structure.
To use it, follow the steps above (except for importing), after you've edited myth2.php and changed default admin user/pass
goto http://url/myth2.php?w=login in your browser. enter your admin details, it will then complain with an error. At this point
visit http://url/myth2.php?w=install (or if you're upgrading the database from 2.0, w=upgrade) and click confirm, this should import
the database. This method has not gone through much testing and is a bit clumsy, so don't expect it to work properly

In the myth2.php file there a number of configuration variables, here is a short description of each:
NameDefault ValueDescription
Basic Config
ADMIN_USERadminThe username which will be used to login to the admin interface
ADMIN_PASSdefaultThe password which will be used to login to the admin interface. THIS MUST BE CHANGED
MYTH_TITLEMyth2This value will be placed in the <title> tag and appear in the browser title bar
MYTH_CSSdefault.cssSet this if you wish to use a diffrent stylesheet
MYTH_SHOWCOUNT1Controls whether the number of nodes in a tree is show in the tree list. Set to 0 to turn off
MYTH_SHOWIP0If this is set to 1, when logged in as admin the ip of the poster will appear next to their name in the node
MYTH_USESTATS0When set to 1, Myth2 will log stats of visitors and referer headers from the sites they come from
MYTH_SHOWLOGIN1If you want a little bit of additional security, you can set this to 0 to hide the login link on the main page. This may prevent people from being tempted to try random passwords. when disabled it will be accessable through http://url/myth2.php?w=login
The following are new in v2.1
MYTH_ANONanonymousDefines the default anonymous name
MYTH_ALLOWRATING0Enables rating system of individual nodes
MYTH_ALLOWLIST1Allows people to click a link in a node and be show a page with every node traversed so far
MYTH_LISTMODE3Sets the mode of the list, either 1, 2 or 3
MYTH_PUBLICLATEST0When enabled it will allow non-admins to view all the latest entries in a tree, admin can always view this.
MYTH_DEFLIMIT20How many nodes to show in one page on the latest nodes list
MYTH_USEFILTER1Enables or Disables the filter
Advanced Config
USE_GZIP0Enable this by setting to 1 and pages will be gzip compressed before being sent to the browser, this can speed up the time spent browsing the site and save bandwidth (altho it does take a little more cpu to compress the page). Not all servers support this and not all browsers support it, if your server supports it there is no harm in enabling it.
MYTH_MD5PASS0If you wish some extra security and are worried about people being able to view the php source, you can set this to 1 and use an MD5 encrypted password in the ADMIN_PASS field instead of a plaintext one.
MYTH_NOCOOKIES0By default, Myth2 uses a cookie to save the name of the author of a story, this saves them re-entering it each time they post. Setting this to 1 will disable the cookies, however cookies are always used for admin login if the autologin box is checked
MYTH_EMBEDDED0Set this to 1 if you are going to be using Myth2 via an include() from an existing website, this stops the usual <html>,<head>,etc tags from being sent. If using within an existing site, be sure that no variables conflict

Once you've logged in you can create a new myth with the link.
The stats link (if enabled) will take you to a page where you can view stats.
If you do a lot of deleting/editing of nodes then every once in a while it's a good idea to optimize the tables,
this reduces wasted space on the mysql server.

Filter

The filter is a new feature in v2.1 which allows both simple and complex search and replace operations
on all of the nodes. It has 3 modes to it: normal, ereg and preg. Normal mode (regex set to off) does
a simple find and replace substitution. ereg mode uses posix compatible regular expressions to perform complex
search and replace. preg mode uses perl compatible regular expressions. ereg and preg are very similar, but
have slightly diffrent syntax and apparently preg is faster (although it will make very little diffrence in
this situation), which to use comes down to personal preference.
Examples:
Normal - search: cake replace: c**k
Normal - search: :) replace: <img src="images/smile.png">
preg - search: /\[([^\]]+)\]/ replace: <a href="http://www.everything2.com/index.pl?node=\1">\1</a>
ereg - search: {([^}]+)} replace: <a href="http://dict.die.net/\1/">\1</a>

TFAQ

(theoretically frequently asked questions)
Q: Why is it Myth2?
A: because it is the sequal to myth

Q: What happened to version 1?
A: It was coded, it worked, it was used but it was full of bugs and shoddy coding, Myth2 was a recode from scratch.

Q: Why "Myth2 v2.x" and not simply "Myth v2.x"?
A: Shoosh.

Q: Why does your colors/layout/design/etc suck?
A: I am a coder... not an artist.

Contact

Myth2 is coded and maintained by solidox. If you wish to report a bug, request a feature, make a comment, etc, etc
feel free to contact me via a medium of your choice (preferred method of contact is IRC)
url: http://solidox.org
email: admin (hat) solidox (dawt) org
IRC: irc.cocytusuk.org / #cocytusuk

Changelog

2.1 - Added list of recently added nodes, viewable by either admin-only or public
    - Added word/swear filter with regex (both posix and perl) capability
    - Installer to create/upgrade database
    - Removed 128 char limit on options
    - Display the story so far in a single page
    - Ratings system, to rate individual nodes
    - Count of dead ends in a tree (nodes with 0 nodes below)
    - Couple of extra stylesheets bundled in the tarball
    - Can redefine default anonymous name
    - mythstats.php is now obsolete as it has been integrated into the main file
    - Various other tweaks i can't remember

2.0 - Initial Release

Licence

Myth2 is released under the *bsd license:
/************************************************************************
Myth2 v2.1
Copyright (c) 2003, solidox
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
	notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
	notice, this list of conditions and the following disclaimer in the
	documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote
	products derived from this software without specific prior
	written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
************************************************************************/