Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 830 → Rev 831

/trunk/client/phorum/bibliotheque/phorum/docs/SVN-RULES
New file
0,0 → 1,101
Phorum SVN Rules
================
 
This is the first file you should be reading after you get your SVN account.
We'll assume you're basically familiar with SVN, but feel free to post
your questions in the development forum at phorum.org.
 
For information on Phorum's SVN repository, please visit our website:
http://phorum.org/cgi-bin/trac.cgi/wiki/SVNPage
 
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
some basic rules with regards to SVN usage will:
 
a. Make everybody happier, especially those responsible for maintaining
the SVN itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
 
 
Having said that, here are the organizational rules:
 
1. Respect other people working on the project.
 
2. Discuss any significant changes on the list or forum before committing.
 
3. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
 
4. If you don't know how to do something, ask first!
 
5. Test your changes before committing them. We mean it. Really.
 
6. Brian and/or Thomas have the final say.
 
The next few rules are more of a technical nature.
 
1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
messages every day. Woe be to those who attempt to mess with it.
 
2. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
 
3. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
 
4. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
 
 
The format of the commit messages is pretty simple.
 
If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. Everything else goes into the ChangeLog.
 
It is important to note that if your comment logline spans multiple
lines, you have to put # at the beginning of _every_ such line.
 
Another special prefix is MFB. If you are commiting something to a branch
and to trunk, plese put MFB on the front of the trunk commit. This will
keep the log line from showing up twice in the changelog.
 
Example. Say you modified two files, functions.php and mysql.php.
In functions.php you added a new formatting-function and in mysql.php you
fixed a bug in a query. Don't commit both of these at once. Commit them
separately and try to make sure your commit messages look something like
the following.
 
For functions.php:
 
Added new formatting-function that will print everything bold if the user is
not wanted
 
For mysql.php:
Fixed query which messed up the read-page.
# Man, that query was in there since the stone-age!
 
The # lines will be omitted from the ChangeLog.
 
If you fix some bugs, you should note the ticket ID numbers in your
commit message. Ticket ID should be prefixed by "#" for easier access to
tickets when developers are browsing Trac.
 
Example:
 
Fixed attachments-problem when logged in. Ticket #14016
 
To receive daily updates of commits, ask one of the devs to add you to
the list.
 
Happy hacking,
 
The Phorum Dev Team
 
 
* large parts of this file were copied from the PHP Dev Team's
* CVS-RULES file. Thanks guys.
 
/trunk/client/phorum/bibliotheque/phorum/docs/performance.txt
New file
0,0 → 1,202
Phorum 5 performance notes
==========================
 
Several of Phorum's options have a tradeoff effect: enabling more
features can slow Phorum down. This document describes which options
these are and tries to explain the performance cost of each one.
 
Which options you should turn off to improve performance depends
on the way you use your Phorum installation.
 
Table of contents:
 
1. Global Settings
1.1 DNS Lookups
1.2 Count New Private Messages
1.3 Enable Moderator Notifications
1.4 Track User Usage
2. Forum Settings
2.1 Email Messages to Moderators
2.2 Allow Email Notification
2.3 Count Views
2.4 Show New Count in Forum List
2.5 Ban List
2.6 Censor List
2.7 Move Threads on Reply
2.8 Check for duplicates
 
 
1. Global Settings
-------------------------------------------------------------------------------
 
 
1.1 DNS Lookups
---------------
 
DNS lookups cause Phorum to display DNS entries (hostnames) instead
of IP addresses on posts. It also will enable checking if mail
addresses point to valid domains.
 
On a forum with a lot of posts, enabling this will result in a
significant number of queries to your DNS server. Phorum's performance
will slow down while a query is running, as it will wait for the result
of the query.
 
If your DNS server is slow, this may give the impression to your users
that posting a message is very slow. If that is the case, you should
turn DNS lookups off. If you have access to a fast DNS server or only
have a few regular posters, you should be able to leave it on.
 
 
1.2 Count New Private Messages
------------------------------
 
If enabled, this option will alert users when they have new private
messages. On every page a logged in user visits, Phorum will check
to see if they have new private messages.
 
If you have a large number of active users at one time with a large
number of private messages, this query can start to slow down your
database. Turning it off may help performance, but will also remove
the notification users get when they receive a new private message.
You can also enable userdata caching under "Cache Settings" to
improve performance.
 
 
1.3 Enable Moderator Notifications
----------------------------------
 
Similar to the Count New Private Messages option, this option will
alert users who are also moderators when they have a new item that
requires their attention.
 
The performance hit of this feature is basically nothing for users
without moderator permissions, as Phorum will never perform the checks.
Moderators will suffer a small performance hit, depending on what type
of moderator they are.
 
Administrators will suffer a larger performance hit, as they are
effectively moderators of every type, so all of the checks will be
performed.
 
 
1.4 Track User Usage
--------------------
 
This option controls how often Phorum will record when a user was last
active. Setting this to be more frequent results in more accurate last
activity data, but also causes more database writes.
 
The "Constantly" setting will record the users activity on every page
hit by any logged in user, resulting in a dramatic increase in the number
of database writes. In most databases, a write is much slower then a
read, so this can dramatically reduce performance. This setting is not
recommended, except for installations with very few users, or very
powerful hardware.
 
If you are using a module that actively requires this data (such as the
Online Users module), the setting "Once per 5 minutes" is the best
setting, as the data will be too out of date if you update the data
less frequently.
 
If you are not using such a module, "Once per day" or "Once per hour" are
highly recommended over the other options. "Never" disables this function
entirely, and is recommended if you simply don't care to know if a user
is active or not.
 
Note: the option "Cache User Data" should be disabled if you have this
feature set to "Once per 5 minutes" or "Constantly", as the caching
will not be of much use.
 
 
2. Forum Settings
-------------------------------------------------------------------------------
 
 
2.1 Email Messages to Moderators
--------------------------------
 
If enabled, every post in the forum will be emailed to the forum's
moderators. Administrators are automatically moderators in every forum,
and will also get the emails.
 
This option should not directly affect Phorum's performance, but when
a post is made, it will cause some emails to be created. If you have a
large number of moderators and a lot of posts being made by users, this
can generate a significant amount of email traffic.
 
The traffic should only be a problem on very large forums or if you have
a slow mail server. In other cases, it should not cause significant
performance issues.
 
 
2.2 Allow Email Notification
----------------------------
 
This option has similar issues to the Email Messages to Moderators
setting, except the recipients of the emails are users who have
selected the option to have replies in a followed thread emailed to
them.
 
If a large number of users is using this feature in a busy thread, it
can affect performance. If only few users are using this feature, it
will not cause significant performance issues.
 
 
2.3 Count Views
---------------
If enabled, this feature records the number of views each post gets.
For every post read, the counter will be incremented in the database.
On a busy forum, this will result in a tremendous number of database
writes, dramatically slowing down performance.
 
Enabling this feature is not recommended for high traffic forums,
unless you have very powerful hardware.
 
 
2.4 Show New Count in Forum List
--------------------------------
 
If enabled, the count of new messages for each forum will appear in
index.php. While quite handy, this has to run several queries per
listed forum. If there are many forums on the index.php page, there
could be a significant performance hit.
 
2.5 Ban List
------------
 
The ban list is a list of words that are banned when posting a message.
There is a small performance penalty for searching for the banned words,
but only when posting.
 
 
2.6 Censor List
---------------
 
The censor list is a list of filtered words, that is checked on every
post read. Because it is checked far more often than the ban list, a
large censor list will affect performance much more.
 
 
2.7 Move Threads on Reply
-------------------------
 
"Move Threads on Reply" means that a thread which gets a new reply causes
the topic to be moved to the top of the forum, hence the topics are
sorted by their last reply and not by their first post in the message
list.
 
In Flat-mode there is no performance hit. In Threaded-mode it causes
a large overhead because of the complexity of the sorting and the
counting of posts on a page.
 
 
2.8 Check for duplicates
------------------------
"Check for duplicates" runs one additional query while posting to check
if that post has been made before. That query should be fast and just
a small overhead.
 
/trunk/client/phorum/bibliotheque/phorum/docs/license.txt
New file
0,0 → 1,66
/* ====================================================================
* The Phorum License 2.0.
*
* Copyright (c) 2001 The Phorum Development Team. 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 end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Phorum Development Team (http://phorum.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Phorum" and "Phorum Development Team" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact core@phorum.org.
*
* 5. Products derived from this software may not be called "Phorum",
* nor may "Phorum" appear in their name, without prior written
* permission of the Phorum Development Team.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 PHORUM DEVELOPMENT TEAM OR
* ITS CONTRIBUTORS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Phorum Development Team. For more
* information on Phorum , please see
* <http://phorum.org/>.
*
* This license is based on The Apache Software License Version 1.1.
* Only the names, email addresses and urls were changed.
* Permission was granted from The Apache Software Foundation to use
* their license.
*
* The original version of the license is copyright (c) 2000 The Apache
* Software Foundation. All rights reserved.
*
* For more information on the Apache Software Foundation, please
* see <http://www.apache.org/>.
*
*/
 
/trunk/client/phorum/bibliotheque/phorum/docs/blog_howto.txt
New file
0,0 → 1,63
Phorum Blog How-To
==================
 
This document describes how to create a forum which can be used as a blog.
 
 
1. Create the Blog Forum
------------------------
 
1. When creating the forum, you should set `Visible` to `No`. This
will keep it out of the normal forum list;
 
2. The template will use the forum's name as the title of the page;
 
3. Set the forum to allow only reading by anyone.
 
 
2. Create a write group
-----------------------
 
1. Go to `Edit Groups`;
 
2. Add a group by creating a new group. e.g. Blog Writers;
 
3. Click on the group name to edit it;
 
4. Add the blog forum to the group and grant `Read`, `Reply`,
`Create New Topics`, `Edit Their Posts`;
 
5. You can create additional groups for moderation of comments, etc.
 
 
3. Make a cool script (optional)
--------------------------------
 
Somehow, you have to point people at the blog. You could make a redirect
using any number of things to redirect your readers to the appropriate URL
(list.php?1, where 1 is the forum id of the blog forum). However, I like
the following method. Let's asume you want the blog to be a page called
blog.php. Then create blog.php like this:
 
<?php
 
chdir("/full/path/to/phorum");
 
// Below, "1" is the forum_id for the blog forum
$PHORUM_CUSTOM_QUERY_STRING="1";
 
include_once "./list.php";
 
?>
 
If you wanted your front page to be the blog, just create index.php and
put this in it.
 
 
TODO
----
 
At the time of writing, there are still several parts of the default
template that are not yet converted to the blog template. Control Center
for example.
 
/trunk/client/phorum/bibliotheque/phorum/docs/creating_mail_messages.txt
New file
0,0 → 1,99
Customizing your Phorum mail messages
=====================================
 
This document describes the way you can customize the mail messages
that are sent out by Phorum.
 
Table of contents:
 
1. General information
2. User-notifications about new messages in followed threads
3. Moderator-notifications about new messages
4. User-notifications about new private messages
 
 
1. General information
-------------------------------------------------------------------------------
 
All messages and subjects for the mail messages are defined as language
strings in the language-files. So to customize mail messages, you can
change the definition of these strings.
 
For some mail messages, you can use a couple of special tags in the
message and mailsubject, which are automatically replaced by relevant
data.
 
Below you'll find a list of the language strings that you can update for
each type of mail message and the special tags that you can use in them.
 
 
2. User-notifications about new messages in followed threads
-------------------------------------------------------------------------------
 
Related language strings:
 
- NewReplySubject
- NewReplyMessage
 
Replacement tags:
 
- %forumname% The name of the current forum.
- %author% The name of the author of the message.
- %subject% The subject of the message.
- %full_body% The full body of the message including all HTML/BBCode
tags, use with care!
- %plain_body% The body of the message which is stripped from all
HTML/BBCode tags.
- %read_url% The url where this message can be read.
- %remove_url% The url to unsubscribe from the followed thread.
- %noemail_url% The url to set the subscription to "no email", so
the thread is only followed from the user's profile.
- %followed_threads_url% The url to the controlcenter-page where the
user can look at all the followed threads.
 
 
3. Moderator-notifications about new messages
-------------------------------------------------------------------------------
 
Related language strings for messages that need to be moderated:
 
- NewModeratedSubject
- NewModeratedMessage
 
Related language strings for messages that do not need to be moderated:
 
- NewUnModeratedMessage
 
Replacement tags:
 
- %forumname% The name of the current forum.
- %author% The name of the author of the message.
- %subject% The subject of the message.
- %full_body% The full body of the message including all HTML/BBCode
tags, use with care!
- %plain_body% The body of the message which is stripped from all
HTML/BBCode tags.
- %read_url% The url where this message can be read.
- %approve_url% The url where this message can be approve (if it's a
moderated forum and messages need approval)
 
 
4. User-notifications about new private messages
-------------------------------------------------------------------------------
 
Related language strings:
 
- PMNotifySubject
- PMNotifyMessage
 
Replacement tags:
 
- %author% The name of the author of the message.
- %subject% The subject of the message.
- %full_body% The full body of the message including all HTML/BBCode
tags, use with care!
- %plain_body% The body of the message which is stripped from all
HTML/BBCode tags.
- %read_url% The url where this message can be read.
 
 
/trunk/client/phorum/bibliotheque/phorum/docs/CODING-STANDARDS
New file
0,0 → 1,31
Phorum 5 Coding Standards
=========================
 
For the most part, Phorum 5 uses the standards set forth in the PEAR Coding
Standards located at http://pear.php.net/manual/en/standards.php. We do
however differ slightly in a few of ways.
 
1. Header Comment - please use the header comment found in the other Phorum
files.
 
2. Function Naming - PEAR uses the "studly caps" naming. We like to name
functions in all lower case with _. So for example: phorum_get_users().
Don't worry about long names. It is better to have a function named
well.
 
3. Variable Names - PEAR really does not address this as the code you are
writing belongs to your package. However, in Phorum, the code you write
belongs to us all. Please make variable names useful and clear. Avoid
single character variables and things like $temp.
 
Now, in looking at the code, you will see that this is not being followed to
the letter. Sometimes, editors don't cooperate and you get tabs, other
times you just forget and don't do it right. Just don't be upset if you see
an SVN commit that just says "formatting" on your code. Some editors have
auto-format features and will be used to clean up formatting.
 
Even if you are not going to write a module, you may want to read the
creating_mods.txt file. It covers some general concepts that exist in
Phorum that may help you understand more of the Phorum code.
 
Additionally, if you will be using SVN please read the SVN-RULES file.
/trunk/client/phorum/bibliotheque/phorum/docs/install.txt
New file
0,0 → 1,298
Phorum 5 Installation instructions
==================================
 
Contents:
 
1. Requirements
2. Quickstart guide
3. Detailed installation instructions
3.1 Download Phorum
3.2 Unpack the downloaded archive
3.3 Place the Phorum files in your website's document root
3.4 Create a database and a database user
3.5 Configure the database access
3.6 Run the web based installer
3.7 Things to do after installing Phorum
4. Additional issues
4.1 Additional issues for UNIX (Linux, BSD, Solaris, etc.)
4.1.2 Cache directory
4.2 Additional issues for Windows
4.2.1 Cache directory
4.2.2 Problems sending mail to end-users
4.2.3 Date formatting
5. Support
 
 
1. Requirements
-------------------------------------------------------------------------------
 
 
Requirements for running Phorum are:
 
* A webserver;
* PHP, version 4 or above;
* A MySQL server, version 4 or above.
 
If you do not run your own website, but have hosted your website with
a hosting provider, then please ask your hosting provider if your
account meets these requirements.
 
 
2. Quickstart guide:
-------------------------------------------------------------------------------
 
 
This is the quickstart guide for installing Phorum, aimed at people that
are used to working with websites, PHP and databases. If you are having
problems following this guide, then please read chapter 3 instead.
 
1. Unpack Phorum into a directory below your website's document root;
2. Create a database and a full-access database user for that database;
3. Edit include/db/config.php.sample, save it as include/db/config.php;
4. Open {phorum url}/admin.php in your web browser and finish the install.
 
 
3. Detailed installation instructions
-------------------------------------------------------------------------------
 
 
3.1 Download Phorum
-------------------
 
If you haven't already done so, download the latest Phorum distribution
from http://phorum.org/downloads.php
 
3.2 Unpack the downloaded archive
---------------------------------
From Windows:
If you have downloaded the .zip file, you can extract the
files from that archive directly using Windows XP's zipfile support.
If you downloaded the .tar.gz file, you will have to download an
appropriate tool for unpacking, e.g. WinZip (http://www.winzip.com/).
From UNIX:
If you have access to a UNIX shell, you can unpack the .tar.gz
archive using the following command:
shell> tar xvzf phorum-x.y.z.tar.gz
Or if the tar program on your system does not support the -z flag:
shell> gunzip phorum-x-y-z.tar.gz
shell> tar xvf phorum-x.y.z.tar
 
 
3.3 Place the Phorum files in your website's document root
----------------------------------------------------------
 
The document root for a website is the directory in which your site's
web pages are stored. If your website's URL is "http://www.example.com"
and you place the Phorum files in a directory called "forum" inside
your document root, your Phorum installation will be available at the
URL "http://www.example.com/forum". From now on, we will name this
URL simply {phorum url}. So if you see {phorum url}/admin.php, using the
example we mean http://www.example.com/forum/admin.php
If the webserver is running on the same system as where you have
unpacked the downloaded archive, you can move the unpacked files
to your website's document root.
If the webserver is running on another system, you will have to upload
the files to your website's document root. In most cases, you will use
FTP for this, but some hosting providers require SCP (secure copy,
which is more secure than FTP). If you do not know how or where to
upload the Phorum files, please contact your hosting provider.
Security note:
(simply ignore this if it does not make sense to you)
There are software packages that require you to make files writable
for the webserver (using the infamous "chmod 777"). DO NOT DO THIS
FOR ANY OF THE PHORUM FILES. The webserver only needs read access on
the disctribution files, because all dynamic data is stored in the
database. If you run into problems running Phorum, it will never be
because you "forgot" to do "chmod 777" on any the Phorum files.
 
 
3.4 Create a database and a database user
-----------------------------------------
 
Phorum stores all its data in a database. So you now need to create
a database. Officially, only the MySQL database server is supported
by Phorum, so we recommend to use MySQL whenever possible.
If you have hosted your site with a hosting provider, then ask
your hosting provider to setup the database and a full access
database user for you.
If you run your own database server, then you will have to create
the database and the user yourself. If you are using a control
panel, like phpmyadmin, then use that control panel to create
them. Else, you can use the mysql prompt to create the database
by issuing commands like:
mysql> CREATE DATABASE phorum;
mysql> GRANT ALL ON phorum.* TO user@localhost IDENTIFIED BY password;
Of course, for security reasons you would use your own user and
password instead.
If you are unsure how to create a database and a database user,
please refer to your system documentation.
 
 
3.5 Configure the database access
---------------------------------
 
After setting up the database, you'll have to tell Phorum how the
database can be accessed. This configuration is put in the file
include/db/config.php inside your Phorum directory. This file is
not in the distribution. Only a differently named sample file is
included.
First, copy or rename the file "include/db/config.php.sample" to
"include/db/config.php". Now edit the config.php file to match the
access settings for the database that was created in step 4.
If you run your website on a remote server, then either edit
the config.php file directly on that server (e.g. through a
UNIX prompt) or upload the file to the correct location after
editing it locally.
 
 
3.6 Run the web based installer
-------------------------------
 
Now all is in place to run Phorum's installer script.
Open {phorum url}/admin.php using your web browser. This is the admin
interface, which will automatically detect that a fresh install has
to be performed.
 
Follow the instructions on screen to finish the Phorum installation.
 
 
3.7 Things to do after installing Phorum
----------------------------------------
 
Now the installation is complete, test if the forum is working
correctly by opening {phorum url} in your web browser. If you run
into problems, please go to {forum url}/admin.php and click on
"System Sanity Checks" in the menu. This page will perform a couple
of system checks to rule out some basic problems. If problems are
found, please follow the instructions from the sanity checks page
to solve them.
Login into the admin interface at {phorum url}/admin.php and check
out what settings can be done to customize Phorum to your likings.
Customize the looks of Phorum to your needs by creating a custom
template. Instructions can be found in docs/creating_templates.txt.
Read the additional issues for your system (below), docs/faq.txt
and any other files in the docs dir that may help you.
 
 
4. Additional issues
-------------------------------------------------------------------------------
 
 
4.1 Additional issues for UNIX (Linux, BSD, Solaris, etc.)
----------------------------------------------------------
 
4.1.2 Cache directory
---------------------
 
In step 5 above (Edit Settings) There is an entry called Cache
Directory. the installer should set that to /tmp if you appear to
be running a *nix system. This will keep compiled PHP versions of
your templates in /tmp. You can change the cache dir if you do not
want to have your files sitting in /tmp on the server or if you see
error messages like:
 
Warning:
fopen(/tmp/tpl-default-header-a72fb9dd20915e5953aa9b07d3eb3871.php):
failed to open stream: Permission denied in
/path/to/phorum/include/templates.php on line 184
 
If you change the the Cache Directory, the best bet is to set it
to ./cache and make that dir (that is already there in the Phorum dir)
writable by the web server. Most likely this means making it world
writeable (chmod 777). If you do not have access to the shell prompt
of the server and are using only FTP to access the server, please see
your FTP clients help on setting the permissions for a directory.
 
 
4.2 Additional issues for Windows
---------------------------------
 
 
4.2.1 Cache directory
---------------------
 
In step 5 above (Edit Settings) There is an entry called Cache
Directory. The installer should set that to C:\Windows\Temp, if it
can detect you are using Windows. This should work for most modern
Windows versions. If it does not, you will see error messages like:
 
Warning:
fopen(c:\windows\temp\tpl-default-header-a72fb9dd209153aa9b07d3eb3871.php):
failed to open stream: Permission denied in
c:\path\to\phorum\include\templates.php on line 184
 
You will need to change the Cache Directory. The Phorum team is not
very familiar with Windows as a web server platform. We can only tell
you that it will need to be something that the web server can write to.
Changing the Cache Directory to ./cache has worked for some.
 
 
4.2.2 Problems sending mail to end-users
----------------------------------------
 
PHP has to be configured correctly on Windows systems to be able to
send out mail. If this is not done, you might get errors and mail
will not arrive. What you need to do is edit the file "php.ini" (this
file holds the configuration for PHP). Find the sections that is called
"[mail function]". In this section, set the parameter "SMTP" to the
hostname or IP-address of the your SMTP server. If you do not know your
SMTP server, please ask your internet access provider. After this,
PHP will know what mailserver to use for sending out mail messages.
 
If you have no access to the php.ini file and the system administrator
is not willing to update it for you, you will have to install the
SMTP module for Phorum. You can download this module from the module page:
http://phorum.org/cgi-bin/trac.cgi/wiki/ListOfModules
In the settings for this module, you can specify the SMTP server to use
for sending mail. When using this module, you will completely bypass PHP's
builtin mail system.
 
 
4.2.3 Date formatting
---------------------
 
Windows does not support the date formatting function strftime() fully.
If your dates are not showing correctly, you have to edit your language
file ({phorum dir}/include/lang/<yourlanguage>.php) and change the
definitions for $PHORUM['long_date'] and $PHORUM['short_date'] in there
to something that will work for your system. We suggest using the
following definitions:
 
$PHORUM['long_date']="%B %d, %Y %I:%M%p";
$PHORUM['short_date']="%m/%d/%Y %I:%M%p";
 
Go to http://www.php.net/strftime for information on all available
formatting options as well as the formats that Windows does not support.
 
 
5. Support
-------------------------------------------------------------------------------
 
If you have questions about installing Phorum, please visit the website
http://phorum.org/ and ask the development team for help in the
Support forum. Also read the file docs/faq.txt for answers to the most
common questions.
 
 
 
/trunk/client/phorum/bibliotheque/phorum/docs/faq.txt
New file
0,0 → 1,160
Phorum 5 FAQ
============
 
Table of contents:
 
1. Why did you switch from number of replies to number of posts in the list?
2. Does Phorum have avatars or user rankings like (insert UBB clone)?
3. How do I install a module?
4. Why don't non-registered users have new indicators or any options?
5. Why doesn't the default template use {insert latest greatest W3C concept}?
6. You should do (insert your idea here) in the default template.
7. Can I install Phorum once and deploy it on multiple domains?
8. I need to embed Phorum in my page/application.
9. Why do you not use the 'global' keyword in your functions?
10. What are Sticky and Announcement posts?
 
 
1. Why did you switch from number of replies to number of posts in the list?
-------------------------------------------------------------------------------
In short, the people writing the code liked it better. You can modify
your template by putting this line inside your list.tpl file.
<?php $PHORUM['TMP']['ROWS']['thread_count']--; ?>
Just put that right after the line that says:
{LOOP ROWS}
 
2. Does Phorum have avatars or user rankings like (insert UBB clone)?
-------------------------------------------------------------------------------
 
Not by default. There are modules available to add this functionality.
 
 
3. How do I install a module?
-------------------------------------------------------------------------------
 
That depends on your environment and how the module is packaged.
The basic requirement is that the module be inside a directory
which is inside /mods (in the phorum directory). So you could have
something like /phorum5/mods/mymod
 
Most mods come packaged in some form. For a .tar.gz file, in a Unix
(Linux, etc) environment, you can simply download the file into your
/phorum5/mods directory, and then use this command:
 
tar -zxf downloaded_module.tar.gz
 
In Windows, you can extract them using a program like Winzip. Make
sure that the folders are also extracted (this is an optional feature
in Winzip that should be on).
 
You can also extract the file on your home computer and upoad them to the
server using FTP. In that case you should just upload the entire module
directory into /phorum5/mods
 
 
4. Why don't non-registered users have new indicators or any options?
-------------------------------------------------------------------------------
 
Because of many cookie problems that plagued Phorum 3, we have decided
to store all user settings in the database for Phorum 5. The down side
of this is that users must be registered to use these features. The up
side is that the new indicator really works like it should in Phorum 5.
 
 
5. Why doesn't the default template use {insert latest greatest W3C concept}?
-------------------------------------------------------------------------------
 
While we do try and use standards, things like XHTML and CSS are not
always compatible with old browsers. Phorum strives to work with
browsers that are commonly used. We do not ignore new things. However,
we try and be aware of the affect of things we do on all user's machines.
Phorum will remain usable and decent on as many different platforms and
browsers as we can make it out of the box.
 
You might want to check the other templates available and see if there
is a more futurisitic one there. If not, perhaps you would like to
contribute one for everyone.
 
 
6. You should do (insert your idea here) in the default template.
-------------------------------------------------------------------------------
 
The only answer we will give you on this is that you can make your own
template. We have a reason for everything we do. Does this mean we are
not open to suggestion? No. It means there is a chance your suggestion
has been made already and if we did not do it, there is a good reason.
 
Second, if your idea has anything to do with the size of the HTML or
bandwidth, don't even post unless you are using output compression.
Output compression will decrease your bandwidth by leaps and bounds.
Search the net for mod_gzip or look at the PHP manual for
zlib.output_compression. If you don't have that level of access to your
server, you can use ob_start with obgzhandler to do the job. Look in the
PHP manual for the ob_start docs.
 
Some suggestions we have turned down include:
 
Why don't you have the CSS external - browsers do a bad job of caching
CSS and compression utilities like zlib.output_compression can compress
the CSS if it is in the PHP output itself.
 
Your CSS names are way too long. You could use short abreviations like
PLTR - What the crap does PLTR mean? You will see it in the code and
have no idea what part of the output that is referencing. Yes, we could
put comments in the CSS with a long name, but that would not make the
HTML clear. Also, output compression will remove the multiple instances
of the class name. Perhaps most importantly, by having 'Phorum' in all
our class names, we won't step on another applications classes.
 
 
7. Can I install Phorum once and deploy it on multiple domains?
-------------------------------------------------------------------------------
 
Yes! Once you install the Phorum code somewhere, you can copy the
contents of the portable directory to another location. Edit
phorum_settings.php in the new location and point your browser to that
copy of phorum_admin.php. You will be taken through the install process.
Be sure to choose unique values for table_prefix or choose different
database names for each installation of the portable code. A wrapped
forum is a little slower because of the function overhead.
 
 
8. I need to embed Phorum in my page/application.
-------------------------------------------------------------------------------
 
Well, using the portable code mentioned above, one can safely run Phorum
inside other applications. This is because the portable code runs Phorum
inside a function, protecting the namespace of your variables and
Phorum's variables. Depending on your particular application, you may
need to edit the function phorum_custom_get_url in include/wrapper.php to
have the urls of your site be created by Phorum correctly. Also, you
will need to create a var called $PHORUM_CUSTOM_QUERY_STRING for Phorum
to parse instead of the server's query string. It will need to be
formatted in the same way that the standard phorum_get_url would do it.
 
 
9. Why do you not use the 'global' keyword in your functions?
-------------------------------------------------------------------------------
 
Declaring something as global in PHP is the same as making a reference
to the $GLOBALS array. References are not as fast as making a value copy
according to the PHP developers. It is only used in common.php to create
the global existence of the $PHORUM variable.
 
See: <http://marc.theaimsgroup.com/?l=php-dev&m=100955714924477&w=2>
 
This applys to PHP4 only. We may reconsider once PHP5 is widespread.
 
 
10. What are Sticky and Announcement posts?
-------------------------------------------------------------------------------
 
Sticky posts stay at the top of the forum they are posted in and do not
get bumped down as new topics are posted.
 
Announcement posts appear at the top of all forums in the system.
 
/trunk/client/phorum/bibliotheque/phorum/docs/upgrade.txt
New file
0,0 → 1,131
Preliminary Upgrade-Instructions
================================
 
This document describes the Phorum upgrading process. Please keep in mind,
that these instructions are neither complete, nor final. If you find
problems in upgrading which are not described here or if you have
useful additions, please let us know.
 
Table of contents:
 
1. Upgrading from a Phorum5 version to another Phorum5 version
1.1 Upgrading the database
1.1.1 Preparations
1.1.2 From a webbrowser
1.1.3 From a system console
1.2 Upgrading templates and hacks
2. Upgrading from Phorum 3.4.x to Phorum5
 
 
1. Upgrading from a Phorum5 version to another Phorum5 version
-------------------------------------------------------------------------------
 
 
1.1 Upgrading the database
--------------------------
 
 
1.1.1 Preparations
-----------------------
 
The upgrading process will preserve all of your active settings and
modules, but will overwrite hacks and any changes made to the default
template (in the directory {phorum dir}/templates/default). Other
templates will be kept intact.
 
Here are the steps for upgrading:
 
- Backup your existing Phorum5 installation.
Before doing an upgrade, it is always wise to make a good backup
of your running system. Make a backup your Phorum install directory
and the database in which your Phorum tables are stored;
 
- Download a newer Phorum5 package;
- Extract the files and put them on top of the current installation;
- Keep the database settings from {phorum dir}/include/db/config.php
the same;
 
Now you can choose whether you want to upgrade from a webbrowser or
from a console.
 
 
1.1.2 From a webbrowser
-----------------------
Open your forum using your webbrowser. In case a database upgrade
is needed, you will be prompted to go to the admin page. In that case
open the {phorum url}/admin.php page, which will guide you through
the upgrade.
 
 
1.1.3 From a system console
---------------------------
 
In the scripts directory of your Phorum installation, you will find
the script "console_upgrade.php". Go to the scripts directory and
execute the script from there. On most systems, you can do this using
the following command:
 
# php console_upgrade.php
 
If you want to run this script from a different locations, then edit
the script and update the $PHORUM_DIRECTORY variable to match the
location of your Phorum installation.
 
 
1.2 Upgrading templates and hacks
---------------------------------
For minor upgrades, the Phorum team has the policy that templates
should not change. For example, if you are upgrading version 5.1.1
to 5.1.2, you can simply keep the old templates.
 
Template functionality might change between major Phorum releases.
For example, templates that were made for Phorum 5.0.x are not
compatible with the templates for Phorum 5.1.x. So to upgrade these,
you'll have to build new templates, based on the new default template
that is included in the distribution. Simply copying the old template
will most probably result in errors and missing functionality.
If you are doing a minor upgrade and you have to preserve changes that
were made to the default template (which is not the recommended way
of customizing Phorum, see creating_templates.txt), you can follow one
of the following options:
- Extract the new Phorum distribution to its own directory and reapply
your changes before putting it over the existing installation;
- Create a backup of your existing installation. Install the new
distribution on top of the old one and reapply the changes to
the new version while it is "live".
 
2. Upgrading from Phorum 3.4.x to Phorum5
-------------------------------------------------------------------------------
 
- Download and unpack the Phorum5 package;
- Follow the installation instructions in docs/install.txt. Install
Phorum5 is a new directory.
- Convert the old forum data:
In the scripts directory of your Phorum5 distribution, you will find
a script named phorum3to5convert.php. Instructions for using this
script can be found at the top of this script itself. The script will
convert your old forum to Phorum5. Everything, but permission levels,
is converted.
- Update the posted message counters for the users:
In the scripts directory, you will also find a script named
"update_postcount.php". This script can be used to update the number
of posts for users to the right value. So if you want correct numbers
to show up in the user profiles, just run this script once AFTER the
conversion has been completed. To run it, you will have to copy it
over to the main Phorum5 directory. After that you can either run
it from the command line or by opening it from your webbrowser. See
also the instructions in the script itself.
 
/trunk/client/phorum/bibliotheque/phorum/docs/creating_templates.txt
New file
0,0 → 1,58
Creating your own Phorum template
=================================
 
This documents describes how to create your own template for
Phorum. The document is not conclusive, but there should be
enough information in here to get you started.
 
 
Here are the steps that you have to take to create your own template:
 
1) Take the default template directory from {phorum dir}/templates/default
and copy it over to another directory, for example
{phorum dir}/templates/mytemplate.
 
2) Edit {phorum dir}/templates/mytemplate/info.php. In this file you
have to edit at least the $name variable, e.g. to
$name = "My very own template";
 
You can hide the template from the user's template selection box
by setting $template_hide = 1. If you do this, you can only
select this template through the admin interface (this makes
most sense if you set the display-settings to fixed through
the admin interface).
 
3) Open Phorum's admin page {phorum url}/admin.php and go to
"General Settings". There you'll find the option "Default Template".
Set that option to your own template. You can also set a specific
template for each single forum in the forum's settings.
 
 
That's it. You are now using your own template. From here on you can start
tweaking the template files in your {phorum dir}/templates/mytemplate
directory. For most installations, the following template files will be
most interesting:
 
- header.tpl The header which will be added before each page;
- footer.tpl The footer which will be added after each page;
- settings.tpl Here you can change colors and fonts;
- css.tpl This file holds all CSS definitions for Phorum.
 
For more extended information on changing template files, please
visit our Wiki documentation site:
 
http://phorum.org/cgi-bin/trac.cgi/wiki/TemplatesDocs
 
 
 
TODO this should probably go to the wiki, becuase it's quite specific
for a getting started HOWTO...
 
Additional variables in settings.tpl:
{define bodies_in_list 1}
set this to 1 to have the message-bodies loaded in the list if your
template needs them.
 
{define all_bodies_in_threaded_read 0}
set this to 1 to have all the message-bodies also loaded in
threaded-read-view if your template needs them
/trunk/client/phorum/bibliotheque/phorum/docs/creating_custom_userfields.txt
New file
0,0 → 1,138
Creating custom fields for user profiles
========================================
 
*** THIS DOCUMENT IS UNDER DEVELOPMENT, SO IT'S NOT YET COMPLETE ***
 
This documents describes how you can create your own custom fields
within the profiles of Phorum users.
 
 
Table of contents:
 
1. Introduction
2. Creating the custom field
3. Using the custom field
3.1 From the registration process
3.2 From the user's control center
3.3 From a module
 
 
1. Introduction
-------------------------------------------------------------------------------
 
Phorum users all have their own profile. In this profile, data about
the user is stored. By default, Phorum stores for example the
username, email address and signature in the user profile. Also
user settings like the privacy options are stored in there.
 
You might want to add additional fields to the user profile. Example
applications for this are adding extra information that will be
displayed in user profile screens or storing data and settings for
your mods (see also docs/creating_mods.txt, section 2.5).
 
Phorum has an easy, built-in system to extend the profile fields,
without requiring you to change the structure of the database. So there's
no need to actually add columns to the table in which Phorum users are
stored in the database.
 
This document will explain how to use the custom profile field system.
 
 
2. Creating the custom field
-------------------------------------------------------------------------------
 
 
Go to the admin for your Phorum installation ({phorum url}/admin.php).
There you go to "Custom Profiles" under "Users/Groups". In this screen
you can create, update and delete custom user profile fields.
 
To add a field, you will have to enter the following data:
 
* Field Name
 
This is the name that you are going to use for your custom field.
It is not the display name for your field, but the internal name,
which is used to reference the field from your code and HTML form
elements. You are only allowed to use letters, numbers and
underscores (_) for this. So if you want to store the users's shoe
size, you could for example use the field name "shoe_size".
 
Remark:
If you are creating a field for a mod, we recommend you to prefix
the field name with mod_<module name>, to prevent collisions with
Phorum and other mods. So if you add the shoe_size for a module
named "foo", you would name the field "mod_foo_shoe_size".
(see also creating_mods.txt, section 3.7.4).
 
* Field Length
 
This determines the length of the data that can be stored in the
database for the custom field. Data which is longer than this
value will be automatically truncated to the configured length
before being stored in the database.
 
* Disable HTML
 
If this checkbox is enabled, all characters that have a special
meaning in HTML will be automatically escaped when the field is
retrieved from the database. This checkbox should always be
checked in case you are directly displaying the field data,
without doing any data processing yourself. If you do not follow
this rule, it might result in a XSS security problem (see also
creating_mods.txt, section 3.6).
 
If this checkbox is disabled, you will get the data exactly
as it is stored in the database. If you want to display the
data, you should take care of properly escaping HTML code
yourself.
 
 
3. Using the custom field
-------------------------------------------------------------------------------
 
 
3.1 From the registration process
---------------------------------
 
If you want to let the user fill in the data for your custom
field during registration, you will have to add an input field to
the registration template file, which can be found in
templates/default/register.tpl (or of course in your own template
directory if you are using a custom template).
All you have to do is create a standard HTML input field and give it
the name of your custom field. Phorum will automatically take care
of storing the field's data in the database.
In the template you can make use of {REGISTER->fieldname} to get
the value of the field "fieldname". This can be used to let your
field remember its value during requests.
 
Example:
To add the shoe_size field to the registration page, you could
add the following code to the register.tpl at an appropriate place:
 
<input type="text" name="shoe_size" value="{REGISTER->shoe_size}"/>
 
 
3.2 From the user's control center
----------------------------------
 
If you want to give the user an option to change the value of your
custom field from the control center, you will have to put an input
field to the user settings template file, which can be found in
templates/default/cc_usersettings.tpl.
 
 
3.3 From a module
-----------------
 
 
======================================================================
Bits and pieces:
 
You can use all HTML field types, but we
recommend not to use checkboxes, because you will have to write
special code to handle them. Instead you could use a <select>
list with two options ("on" and "off").
 
/trunk/client/phorum/bibliotheque/phorum/docs/permissions.txt
New file
0,0 → 1,91
Permissions in Phorum 5
=======================
 
This document describes the way the permission system of Phorum works.
It is targeted at developers that need inside information on the
API calls that are related to permission handling.
 
Table of contents:
 
1. Checking user permissions
2. Modifying user permissions
3. Some final notes
 
 
1. Checking user permissions
-------------------------------------------------------------------------------
 
First and foremost, your code should use the function called
phorum_user_access_allowed() to check for a given user permission
in the current forum. However, if you find yourself needing to check
the permisssion directly, here is some information.
Permissions are stored using a bitmask. To check for a certain permission,
simply use the bitwise AND (&) operator to match the permission against the
user's permissions.
For example, if we want to check if a user has permission to read
a particular forum, we would use the following if statement:
if($PHORUM["user"]["permissions"] & PHORUM_USER_ALLOW_READ){
// the user can read this forum
} else {
// the user can NOT read this forum
}
 
 
2. Modifying user permissions
-------------------------------------------------------------------------------
 
If you need to modify the permissions, use the bitwise OR (|) to add
a permission or the bitwise XOR (^) to remove a permission. After you
make the change, save the user. Here is some example code:
// add new topic permissions
$PHORUM["user"]["permissions"] =
$PHORUM["user"]["permissions"] | PHORUM_USER_ALLOW_NEW_TOPIC;
phorum_user_save($PHORUM["user"]);
// remove new topic permissions
$PHORUM["user"]["permissions"] =
$PHORUM["user"]["permissions"] ^ PHORUM_USER_ALLOW_NEW_TOPIC;
phorum_user_save($PHORUM["user"]);
 
3. Some final notes
-------------------------------------------------------------------------------
 
That should be all you need to know about the Phorum permission system.
Here is some stuff that helped explain this to the other developers:
> select (256 | 16);
> That OR's the two numbers together.
> you get 272
> then:
> select 16 & 272;
> That returns 16.
> So, in our data, the 272 represents what is in the database.
> The 16 would be one of the permission constancts
> Our constants would look like this:
> define("PHORUM_USER_ALLOW_READ", 1);
> define("PHORUM_USER_ALLOW_REPLY", 2);
> define("PHORUM_USER_ALLOW_EDIT", 4);
> define("PHORUM_USER_ALLOW_NEW_TOPIC", 8);
> define("PHORUM_USER_ALLOW_UPLOAD", 16);
> define("PHORUM_USER_ALLOW_ATTACH", 32);
> define("PHORUM_USER_ALLOW_MODERATE_MESSAGES", 64);
> define("PHORUM_USER_ALLOW_MODERATE_USERS", 128);
> define("PHORUM_USER_ALLOW_FORUM_PROPERTIES", 256);
> To give someone read and reply, we would set their perm to 1 | 2
> Then, to check it, we would $user_perm_value & $perm == $perm
> or in sql
> where permission & $perm = $perm
Another example to show that the = $perm can be left out:
> select 1 | 2
> read, reply
> = 3
> select 3 & 16
> =0
/trunk/client/phorum/bibliotheque/phorum/docs/NEWS
New file
0,0 → 1,1668
 
Phorum 5 Changelog
--------------------------------------------------------------------------------
2006-03-20 19:23 brian
* releasing Phorum 5.1.0
 
2006-03-10 22:40 brian
* keep version as 5.1-dev and change it in tags
 
2006-03-10 21:41 mmakaay
* Fixed #289: duplicate page header shown on read page with the
forum in r/o mode
 
2006-03-10 12:17 mmakaay
* Fix for #288: editing puts back mail address of registered users
into the post
 
2006-03-07 09:19 ts77
* made two different variables for signature in control panel. one
for formatted one and one for the htmlescaped one. fixing #254
 
2006-03-06 22:51 ts77
* "fixing new pm-flag with user-caching enabled, fixing #281"
 
2006-02-21 12:49 dvl
* Change from INSERT SET to INSERT VALUES
 
2006-02-16 12:34 mmakaay
* Fix for updating posts with single quotes in subj/body (resulted
in SQL error)
 
2006-02-13 20:51 mmakaay
* Fix for #267: sending a PM with a subject only containing spaces
is now rejected
 
2006-02-12 18:19 ts77
* fixed search-escaping and missing search-table inserts (#261)
 
2006-02-12 18:12 ts77
* "fixed author search (#262)"
 
2006-02-08 16:32 mmakaay
* Made the notification message for PM faster, by using
phorum_db_pm_checknew(). Beware that this change inflicts a
template change. Instead of the variable {PRIVATE_MESSAGES->new},
the variable {NEW_PRIVATE_MESSAGES} has to be used. Before,
{PRIVATE_MESSAGES->new} contained the number of new messages,
while now {NEW_PRIVATE_MESSAGES} contains a value that indicated
whether there are new messages or not.
 
2006-02-08 16:29 mmakaay
* Added function phorum_db_pm_checknew for quick checking for new
PMs to db layers
 
2006-02-08 16:05 mmakaay
* Some optimization in the private message formatting code for more
speed.
 
2006-02-08 11:29 mmakaay
* Bugfix: When using reply in read page, moderators could not view
the message
 
2006-02-07 17:07 mmakaay
* Possible fix for templates.php timing out on Windows systems
 
2006-02-05 17:30 ts77
* added script for rebuilding the search-table
 
2006-02-05 16:41 ts77
* fixed double escaped search-data
 
2006-02-04 16:12 mmakaay
* Fix for searching for quoted phrases
 
2006-02-04 15:19 ts77
* removed "stale </a>" from #252
 
2006-02-03 13:48 ts77
* "build the urls in search-page in any case - fix for #251"
 
2006-02-03 13:14 mmakaay
* Fixed bug: admin could not relogin with cookies disabled in
Phorum's settings
 
2006-01-28 22:02 ts77
* "first version of console-upgrade script. not yet tested"
 
2006-01-28 16:37 ts77
* "added missing POST_VARS, fix for #249"
 
2006-01-24 19:54 ts77
* "disabled tight_security by default on new installs"
 
2006-01-24 03:04 brian
* Fix for bug #234. Forum permissions not removed when changing from
default forum options to custom
 
2006-01-22 21:11 mmakaay
* The query for discovering mutual buddies was incorrect (bug #230,
thanks regdos)
 
2006-01-21 18:20 ts77
* fixing default settings overwriting all forums (bug #233)
 
2006-01-21 17:49 ts77
* really showing newflags in both flat and threaded read (fixing
#235)
 
2006-01-20 11:22 mmakaay
* Fix for #231: Undefined constant used (credits to joys)
 
2006-01-20 00:32 mmakaay
* Fix: reply on read page + tighter security gave problems on
session timeout
 
2006-01-18 14:34 mmakaay
* Fixed failing combination of tighter security + URI authentication
(no cookies)
 
2006-01-17 23:01 mmakaay
* Fix for #229: The list of buddies is now sorted by username
(thanks regdos)
 
2006-01-16 23:31 mmakaay
* Bugfix: The administrator could not edit replies to announcements
 
2006-01-16 23:13 ts77
* "fixing index-links + #220"
 
2006-01-16 18:09 brian
* Profiles for users that are deactivated show an error message now.
 
2006-01-16 16:46 mmakaay
* Fix for #219: No charset sent using Content-Type header for admin
interface
 
2006-01-16 15:27 mmakaay
* Final fix for [216] and [217]
 
2006-01-15 18:59 ts77
* fix for not being able to empty the permissions
 
2006-01-15 16:49 ts77
* "focus to search-form only on first entry and no results (#218)"
 
2006-01-15 13:21 ts77
* another fix for reply on separate page, quotes and so on (#216)
 
2006-01-12 23:48 dvl
* Conversion of final MySQL elements. Search now works
 
2006-01-12 22:05 brian
* RSS feeds are now cached for better performance
 
2006-01-11 16:18 brian
* Added post count to user profiles
 
2006-01-10 21:33 ts77
* "fixed a couple of problems with install-settings, now really
fixing #210"
 
2006-01-10 21:18 ts77
* "revert previous change, my bad"
 
2006-01-10 21:08 ts77
* "adding default forum settings on install (fix for #210) "
 
2006-01-06 22:49 dvl
* Because PostgreSQL doesn't have the same limits as MySQL, just
return NULL from phorum_db_maxpacketsize()
 
2006-01-06 22:39 dvl
* Add a work-in-progress for the PostgreSQL port. Search does not
work.
 
2006-01-06 21:42 ts77
* "fixing another item of #203"
 
2006-01-06 10:29 ts77
* "fixed #203"
 
2006-01-04 20:49 mmakaay
* Extended search options for admin user control. Thanks spoier!
 
2005-12-18 20:45 brian
* checked that users are fully logged in if that option is selected
in the admin
 
2005-12-16 23:11 ts77
* added a switch for using RSS and a link to the header for it
 
2005-12-16 21:02 ts77
* streamlined index/messagelist/post-url creation should fix #199
 
2005-12-10 19:36 ts77
* made the target of the sql-error-messages configurable
 
2005-12-10 18:41 ts77
* some better formatting in banlist and badwords, marking duplicate
entries in banlists (patch from golem.de)
 
2005-12-10 18:13 ts77
* remove the unnecessary message-bodies in threaded-read-view for
performance increases in large threads (recommended by golem.de),
added an option to still load them if a template needs this
 
2005-12-10 17:40 brian
* changes to blog template for phorum 5.1
 
2005-12-05 19:40 ts77
* added banlist-checks for spam-words in subject and body (provided
by golem.de)
 
2005-12-04 14:05 ts77
* added options for moderators to avoid getting moderation-emails,
implementing #196
 
2005-12-04 13:14 ts77
* "adding checks for duplicate custom profile-fields and reserved
names, fixing #160 , list of reserved names might need some
extension"
 
2005-11-27 21:48 ts77
* added navigation and more visible message to report-form (fixing
#185)
 
2005-11-23 15:23 brian
* commiting module to allow for attachments to be stored on the
filesystem
 
2005-11-22 23:03 ts77
* setting up more data in list.php if the bodies are retrieved too,
like maurice suggested, fixing #169
 
2005-11-22 22:25 ts77
* moved default settings from dblayer to install-script calling the
db-dependant functions, should fix #172
 
2005-11-22 10:45 ts77
* "fixed #189"
 
2005-11-21 13:12 mmakaay
* Fix for bug #188: new flags not shown for sticky and announce in
threaded list
 
2005-11-20 23:42 ts77
* "added first experimental mysqli-layer"
 
2005-11-08 21:47 ts77
* "fixed removing newlines in table-definitions (kudos to brian)"
 
2005-11-03 20:53 mmakaay
* Added upgrade notification iframe banner to the admin interface
header
 
2005-11-02 21:40 ts77
* fixed bug #175
 
2005-10-29 01:08 mmakaay
* Added 'Check for new version' to the admin interface
 
2005-10-25 13:51 mmakaay
* Lots of improvements for the bundled smiley mod. # * Often the
hard-coded smiley path "./smileys" was used instead # of the
configurable prefix. # * Fixed showing a smiley preview image. # *
Preview image is now also shown directly when starting to edit a
smiley. # * Implemented a separate mods/smileys/defaults.php file,
for easy # default config value maintenance and initial
configuration setup. # * In the $PHORUM["mod_smileys"] array,
smileys are not stored at the same # level as the other settings
anymore. # * The smiley prefix path is better checked for
problems. # * The smiley prefix path is forced to always have an
ending "/" character. # * Only files with a real image extension
are used in the smiley drop down. # * If configured smileys have
an unavailable image, the "Smiley image" # column in the overview
will say "UNAVAILABLE" and a clear warning message # is shown to
the administrator, telling him to fix the problem(s). # * The
smiley body & subject replacement arrays are cached in the
database. # * The message "no smileys configured" was never shown.
# * Inputs for smiley and alt tag are made smaller (50 was too
much IMO). # * Smiley images are put in the CSS class
"phorum-smiley", so users can # style the image if they want to. #
* Installation of a default list of smileys is taken out of #
include/db/mysql.php. This is now fully handled by the module
itself. # * Description for "thumbs up smiley" changed to "the
finger smiley". # * Smileys are now stored inside the module
directory itself. # * The configuration for the old smileys mod is
automatically converted.
 
2005-10-17 16:35 ts77
* fixing #164, removed debug-output and check for forum inheriting
default settings
 
2005-10-17 16:12 ts77
* "fixed [156], table structure needed to be changed"
 
2005-10-15 02:19 mmakaay
* Added phorum_check_bans() for easy checking and fixed
phorum_check_ban_lists().
 
2005-10-11 06:23 mmakaay
* Only show (Buddy) after username in profile in case PM is enabled
 
2005-10-10 13:59 mmakaay
* New template feature: {HOOK hook_name arg1 arg2 .. argn} # Hooks
can now also be called in templates. This is solely for # being
able to let modules writers extend the forms that Phorum uses. #
If one hook argument is used, the hook code will translate to: #
phorum_hook(hook_name, arg1) # If multiple hook arguments are
used, it will translate to: # phorum_hook(hook_name, array(arg1,
arg2, .., argn)) # The hook may also be called without using
arguments.
 
2005-10-08 05:01 brian
* Added new hooks to make alternate attachment storage possible
 
2005-10-06 23:21 mmakaay
* Activated the new editor code in the Phorum core. # This revision
does not contain cleanup of the old code. # That will be done in a
separate revision.
 
2005-10-06 15:52 ts77
* "fixed ticket #138 , typo in database-create-scripts."
 
2005-10-06 14:11 mmakaay
* New feature for the PM interface: multiple recipients in one
message
 
2005-10-06 13:54 mmakaay
* Added feature to header.tpl, which can be used to set the focus to
a page element. The element's id can be specified using
{FOCUS_TO_ID}.
 
2005-10-06 05:00 brian
* simplified the help pop up by ridding us of the iframe and the
extra js code in include.
 
2005-10-05 15:20 brian
* added user's status to the user admin.
 
2005-10-04 06:28 brian
* New security feature! Users must confirm their login before
posting or making changes to their account if they have been away
from the site.
 
2005-10-04 05:02 brian
* Added default forum settings. A forum can now inherit its settings
from another forum, or the defaults.
 
2005-10-04 02:21 brian
* Private Messages are now separate from the Control Center.
 
2005-10-04 01:49 brian
* ASSIGN now supports ints
 
2005-10-03 01:31 mmakaay
* Implemented a buddy system for private messaging.
 
2005-10-01 22:24 mmakaay
* Added a new option "System Sanity Checks" to the admin panel. This
can be used to run a number of checks on the system to see if it
is configured correctly for using Phorum. # Implementation: # #
All checks are stored as single PHP files in the directory #
include/admin/sanity_checks/ # Each file you create there must at
least have the following: # # * A variable $check_description
which is set to the description # string that is showed in the
sanity checks result screen. # * A function named
phorum_check_<file basename> which does the # actual checking.
This function has to return two parameters. # The first one is one
of the constants PHORUM_SANITY_OK, # PHORUM_SANITY_WARN or
PHORUM_SANITY_CRIT. The second one # is a description of a problem
that was found or NULL in # case no problem was found. # # The
sanity checking frontend will then take care of the rest. # #
Already implemented checks are checks for: # - database connection
(Config available and can we connect?) # - cache directory (Can we
find and write there? And does caching work?) # - file uploading
(Checking PHP/MySQL max upload size against settings)
 
2005-09-28 10:51 mmakaay
* Fixed #123: when deleting a thread, also delete move notification
 
2005-09-28 09:32 mmakaay
* Fixed #115
 
2005-09-28 00:40 mmakaay
* Rewrote the module creation documentation and updated the list of
hooks
 
2005-09-24 11:43 mmakaay
* Cleaned up and updated the Phorum5 docs directory.
 
2005-09-22 14:15 mmakaay
* Added e-mail notifications for new private messages. The user can
turn these notification on or off in the control panel (forum
settings). # The users table now has a field "pm_email_notify" to
store the setting in.
 
2005-09-22 00:11 mmakaay
* Implemented folder support for private messaging.
 
2005-09-20 23:30 brian
* Made fonts look better on Linux
 
2005-09-20 23:30 brian
* Changed to use new template abilities
 
2005-09-20 23:29 brian
* Added Mark Read and RSS links to index page.
 
2005-09-20 23:00 brian
* Stickies and announcements not longer mess up threaded view.
 
2005-09-20 22:59 brian
* Stickies and announcements not longer mess up threaded view.
 
2005-09-17 17:26 ts77
* added maurice's new method of including/inlining templates so that
just one large template is processed on output (see #90 for
details)
 
2005-09-16 13:39 mmakaay
* Implemented a whole new backend for the PM system. This backend is
a preparation for a more sophisticated PM system which supports
things like user folders, buddy lists, multiple recipients and a
trash bin. # # Notes: # # Because the way messages are stored has
changed, the old PM calls # from mysql.php have been deprecated.
When calling these functions, # an error message will be shown.
This will only be done in case # non-Phorum scripts call the old
functions. Phorum uses the new API. # # In the database migration
script, dropping the old private messages # table is not yet
included, so in case of problems a rollback is # possible without
loosing the old private messages. This will be # incorporated as
soon as the new code has proven to be stable. # # New database
structure: # # {prefix}_pm_messages: holds the message data for a
PM # {prefix}_pm_folders: holds the custom folders for the users #
{prefix}_pm_xref: links users, messages and folders together # #
The inbox and outbox for the users are built-in special folders, #
so there will not be in {prefix}_pm_folders.
 
2005-09-13 11:15 mmakaay
* Added configuration option for setting max nr. of messages in the
PM storage of a user
 
2005-09-12 23:01 mmakaay
* Fix for #111 Added checks for banned users to PM posting
 
2005-09-12 21:37 mmakaay
* Added an experimental tool for helping language maintainers
 
2005-09-08 14:53 mmakaay
* Fixed "Only variables can be passed by reference" error caused by
PHP 5.0.5 In PHP 5.0.5 constructions like
array_shift(some_function()) are no longer accepted.
 
2005-09-06 19:32 mmakaay
* Use phorum_filesize() for formatting filesizes
 
2005-09-06 18:50 mmakaay
* Subject needed to be formatted before it was displayed.
 
2005-09-06 14:47 mmakaay
* Fixed copyright notice formatting.
 
2005-08-31 21:38 mmakaay
* Database upgrade script for [209]
 
2005-08-31 11:17 mmakaay
* Fixed some more line-ending properties
 
2005-08-29 00:17 mmakaay
* Disabled cumulative attachment size check in case no config value
is set
 
2005-08-28 23:52 mmakaay
* Added max cumulative size to attachment settings and some fixes: *
max cumulative size is used to be able to set a maximum total size
for all attachments together. So now you can allow for example 10
attachments of each 1 Mb max, but limit the total attachment size
to 2 Mb. So the user can upload for example either 10 photo's or 1
MP3 file, but not 10 MP3 files. * uploading one or more
attachments always replaced the complete list of attachments,
instead of adding attachments to it; * Added some more explanation
for the attachment admin parameters, to make clear what an empty
or zero value means to Phorum; * The list of allowed file types is
not shown anymore in the template case no list is set in the admin
interface (so you won't get "You are allowed to attach files of
the following type:" without any options behind it on screen);
 
2005-08-28 18:49 mmakaay
* Updates from #106
 
2005-08-28 14:52 mmakaay
* Implemented formatting of filesizes.
 
2005-08-28 14:45 mmakaay
* Added phorum_filesize() for formatting bytes to better readable
file sizes.
 
2005-08-26 22:19 mmakaay
* Mysql upgrade script for #97
 
2005-08-26 22:00 ts77
* fixes for #97
 
2005-08-26 21:48 mmakaay
* Fixed $thread_is_announcement assignment to make
ThreadAnnouncement work
 
2005-08-26 19:29 ts77
* "fix for bug #103"
 
2005-08-26 19:27 ts77
* "fix for bug #102"
 
2005-08-26 19:24 ts77
* "fix for bug #105"
 
2005-08-26 19:22 ts77
* fixes bug #101
 
2005-08-23 18:21 ts77
* fixing ticket #100, thx to maurice
 
2005-08-22 20:11 ts77
* "fixed problem in newflags with vroots"
 
2005-08-21 18:57 ts77
* included patch for #89
 
2005-08-18 17:23 brian
* Fixed issues with upgrading and made sure no on could run the
install or upgrade on a running Phorum.
 
2005-08-12 21:08 ts77
* "changed merge thread to reinsert messages (#60)"
 
2005-08-11 16:38 ts77
* added option to generate your own custom urls with phorum_get_url
 
2005-08-11 16:10 ts77
* "fixed #86"
 
2005-08-11 16:07 ts77
* "fixed #85"
 
2005-08-11 16:03 ts77
* "fixed #87"
 
2005-08-11 03:04 brian
* Added a new module called markdown that uses the new simple,
single file module method. Markdown is a text decoration syntax
used in several open source blogging applications.
 
2005-08-11 02:59 brian
* Added support for new template options. These include adding NOT
to an if and comparing two template vars with an if. Plus some bug
fixes.
 
2005-08-10 20:53 ts77
* fixed #79
 
2005-08-10 20:34 ts77
* "fixing #72"
 
2005-08-10 20:24 ts77
* "fixing #68 and #80"
 
2005-08-10 10:43 ts77
* "fixed ticket #81 ... thx"
 
2005-08-09 18:28 ts77
* changed post_form-hook to be without arguments
 
2005-08-09 16:02 ts77
* "fixed #76"
 
2005-08-08 18:25 ts77
* made move-thread much more robust, also less permissions needed to
move a thread *to* a forum
 
2005-08-07 15:40 ts77
* "fixed enhancement-request #67"
 
2005-08-07 15:30 ts77
* "fixed bug #64"
 
2005-08-05 18:54 ts77
* "added strike-through to bbcode"
 
2005-08-05 10:50 ts77
* fixed replyable attachments in non-threaded list
 
2005-08-05 01:04 brian
* Adding rss.php to the distro officially
 
2005-08-05 01:02 brian
* Added blog template to distro
 
2005-08-01 19:52 ts77
* formatting the signature on the controlcenter-startpage too
 
2005-07-27 18:36 brian
* we need to htmlspecialchars the body previews.
 
2005-07-26 16:14 ts77
* "changed meta-field in messages-table mediumtext, there were
problems with long threads before"
 
2005-07-24 21:42 ts77
* show index-url only if the forum is not hidden
 
2005-07-24 21:12 ts77
* fixed paging of read-pages for moderators if unapproved posts are
there
 
2005-07-19 17:28 ts77
* setting charset and encoding for outgoing mails (thx to Stephan
Schulz)
 
2005-07-19 17:20 ts77
* fixed tz_offset with default-setting going wrong
 
2005-07-19 10:51 ts77
* made bad-words check work on subject and author too
 
2005-07-18 17:21 ts77
* fixed setting-inheritance
 
2005-07-18 17:19 ts77
* fixed forum-index link in case of new folder view
 
2005-07-16 18:52 ts77
* fixed permissions not being saved in the admin
 
2005-07-12 08:00 ts77
* show "move thread" only if the moderator moderates more than one
forum
 
2005-07-11 21:48 ts77
* option for ignoring administrators in moderator-emails
 
2005-07-06 21:11 ts77
* added banlist by userid and blocked blocked users from editing
their posts
 
2005-07-06 16:27 brian
* Added a note to inform new admins that they will see the IP
address even when hidden from other users.
 
2005-07-05 21:34 ts77
* added merge/split thread feature
 
2005-06-27 17:14 ts77
* added link for going to the first new message in a thread (flat
view only)
 
2005-06-24 16:13 ts77
* added inherited forum-settings (done as paid work by sandersor.de)
 
2005-06-20 19:15 brian
* Rework of attachment workflow. Users can now edit and preview
posts before commiting them to the forum list.
 
2005-06-20 17:48 brian
* The admin now uses the charset from the default language file
 
2005-06-20 17:35 brian
* Reverse threading hack implemented as a feature
 
2005-06-20 17:35 brian
* Reverse threading hack implemented as a feature
 
2005-06-20 17:01 brian
* Using charset in htmlentities now ticket #25
 
2005-06-19 01:02 brian
* You can now choose between the classic forum/folder display and
the new flat forum display
 
2005-06-16 03:55 brian
* Added new ability to toggle the status of the forum. Normal, Read
Only, Admin Only and Disabled. Also, Phorum will display a message
when the database is down and optionally redirect to a URL you set
up in the DB config file.
 
2005-06-16 02:17 brian
* few rewrites for SVN and how the change log works now.
 
2005-06-16 02:09 brian
* doc update for quote hook and some fixes
 
2005-06-16 01:52 brian
* Reply form on a separate page and quote hook are now done.
 
2005-06-15 21:56 brian
* replies by moderators were being marked as closed. also, should
have been checking $parent status and not $parent closed.
 
2005-06-09 08:41 ts77
* sending user-localized mail-notifications (#42)
 
2005-06-08 19:17 ts77
* enhanced announcements with the option to allow replies
 
2005-05-25 21:55 ts77
* added another hook "check_post"
 
2005-05-18 20:48 ts77
* preview for message-edits by users
 
2005-03-28 23:15 ts77
* first implementation of message-caching for read-page
 
2005-03-19 13:53 ts77
* added session-id for uri-authentication to make it a bit safer
(i.e. if such a url is posted somewhere)
 
2005-03-17 23:26 ts77
* don't allow making a message to an announcement if it has replies
 
2005-03-17 22:48 ts77
* make announcements have a better reason that you can not reply to
them (fixes bug #4)
 
2005-03-17 17:41 ts77
* Initial Import of HEAD and 5.0.15
 
 
---------------------------------------------------------------------------------
attached is the previous Changelog up to March, 10th 2005
(before we were running subversion)
---------------------------------------------------------------------------------
Phorum 5 Changelog
---------------------------------------------------------------------------
 
Release: phorum.5.0.15
-----------------------
 
* Better handle invalid input for page value in url. - brian
(03/10/2005)
 
* Better handle invalid input for user_id in url. - brian
(03/10/2005)
 
* Redirect URL needs to encode the url parts - brian (03/10/2005)
 
* make checkdnsrr-calls only if function exists - ts77 (03/09/2005)
 
* fixed bug in email-panel of cc - ts77 (03/09/2005)
 
* added mark-thread-read (patch from Panu, thx!) - ts77 (03/05/2005)
 
* First commit of mysql full text search - brian (03/01/2005)
 
* You can reply via PM - brian (03/01/2005)
 
* Subscriptions now changed when threads are moved. - brian
(02/28/2005)
 
* Fixed a possible XSS issue - brian (02/22/2005)
 
* Forum id carried in group parts of CC now. - brian (02/22/2005)
 
Release: phorum.5.0.14a
------------------------
 
* clearing special-characters from attachment-name (thanks to Jon
Oberheide) - ts77 (02/21/2005)
 
* Removed Upload files permission option. Never used. - brian
(02/21/2005)
 
Release: phorum.5.0.14
-----------------------
 
* fixed wrong fallback to default-template if user-template is set as
empty - ts77 (02/16/2005)
 
* fixed problem if account is denied before the user has verified the
account by mail - ts77 (02/16/2005)
 
* checking new user-email also against existing emails - ts77
(02/16/2005)
 
* Renamed settings variables to comply with Phorum standards - sheik
(02/08/2005)
 
* disallowing time-zone-selection works now too if a user already
selected a timezone. - ts77 (02/05/2005)
 
* implemented user-caching with the new cache-layer - ts77
(02/05/2005)
 
* Removed call to timing functions - sheik (02/05/2005)
 
* Added code for "open links in new window" and "anti-spam tag on
links" - sheik (02/05/2005)
 
* Settings file created to make new "open links in new window" and
"anti-spam tag on links" options optional - sheik (02/05/2005)
 
* added simple file-caching api - ts77 (12/23/2004)
 
* fixed permission-display in admin - ts77 (12/14/2004)
 
* MFH: ip-masking in preview too - ts77 (11/28/2004)
 
* added stripped body and full body to email-variables, documented
email-variables - ts77 (11/28/2004)
 
* added closed-flag to list-page - ts77 (11/28/2004)
 
* moved custom profile-fields into their own table and made options
for limiting them in size and htmlencoding them - ts77 (11/26/2004)
 
* new upgrade-system: only one upgrade-file at a time, new numbering
- ts77 (11/25/2004)
 
* moved format_functions.php out of the condition - ts77
(11/23/2004)
 
* changed threaded-list/-read to use padding for indenting and
wrapping long subjects - ts77 (11/23/2004)
 
* fixed message after editing - ts77 (11/22/2004)
 
* Changed email regex to be more compatible with modern domain names.
- brian (11/22/2004)
 
* new hooks cc_user_save, before_register - changed hook
after_register - ts77 (11/16/2004)
 
* report a post split out from read.php, allows user to explain the
report - tridus (11/16/2004)
 
* added "search"-hook - ts77 (11/16/2004)
 
* fixed saving passwords (disallowed empty ones) - ts77 (11/16/2004)
 
* fixed converting pure email-addresses if no bbcode was found - ts77
(11/16/2004)
 
* showing forum-list-link only if needed - ts77 (11/15/2004)
 
* giving just a message if no forums are visible in a folder - ts77
(11/12/2004)
 
* changed default for new folders to be visible - ts77 (11/12/2004)
 
Release: phorum.5.0.13a
------------------------
 
* reverted more of the entity changes - ts77 (11/11/2004)
 
Release: phorum.5.0.13
-----------------------
 
* Added a lot of code to check for invalid input - brian
(11/10/2004)
 
* Requests for passwords for users that have not verified will not be
sent a new verification email - brian (11/09/2004)
 
* some more precautions for html-entities - ts77 (11/08/2004)
 
* logout works with empty REFERER now too - ts77 (11/08/2004)
 
* fixed wrong message counts in threaded list - ts77 (11/03/2004)
 
* fixed backurl in controlcenter while being in a forum-folder - ts77
(11/02/2004)
 
* removed requirement to specify a description for forum/folder in
the admin - ts77 (11/02/2004)
 
* fixed user_template and user_language to allow the "default"-value
- ts77 (11/01/2004)
 
* fixed bug #531, msgs with attachments didn't get the right status
in moderated forums - ts77 (10/29/2004)
 
* Escape the HTML in name and description when editing - brian
(10/28/2004)
 
Release: phorum.5.0.12
-----------------------
 
* XSS really gone now - ts77 (10/27/2004)
 
* added profile hook to controlcenter-summary too - ts77
(10/27/2004)
 
* better defaults for page if not set - ts77 (10/26/2004)
 
* fixed sql-injection issue - ts77 (10/25/2004)
 
* fixed sql-injection issue - ts77 (10/24/2004)
 
* fixed showing pm-inbox after deleting in the pm-sentbox - ts77
(10/24/2004)
 
* fixed wrong message-index if not logged in - ts77 (10/24/2004)
 
* posts in closed threads can't be edited - tridus (10/22/2004)
 
* Fixed session timeout to allow session cookies by using 0 days -
brian (10/22/2004)
 
* Updated bbcode module to have classes in some of the markup - brian
(10/22/2004)
 
* fixed bug #526/#528 - ts77 (10/21/2004)
 
* fixed move-notification in threaded view - ts77 (10/21/2004)
 
* fixed "message not found" for threaded-read - ts77 (10/21/2004)
 
* added (optional) move-notification - ts77 (10/19/2004)
 
Release: phorum.5.0.11
-----------------------
 
* bug fix release (10/15/2004)
 
* added attachment-conversion (thanks to Clemens Weiss), checking for
existing group and user tables now - ts77 (10/14/2004)
 
* added script for updating the post-counts of users after conversion
- ts77 (10/13/2004)
 
* file update_postcount.php was initially added on branch phorum_5_0.
- ts77 (10/13/2004)
 
* fixed hidden messages showing in threaded-list - ts77 (10/11/2004)
 
* censor-filter now works per-forum too - ts77 (10/09/2004)
 
* file creating_templates.txt was initially added on branch
phorum_5_0. - ts77 (10/09/2004)
 
* bodies only loaded on request now in the message-list - ts77
(10/09/2004)
 
* deleting subscriptions on deleting a message too - ts77
(10/09/2004)
 
* Better detection of js in HTML mod - brian (10/08/2004)
 
* Reworked key for getting post count for better performance - brian
(10/08/2004)
 
* Reworked key for getting post count for better performance - brian
(10/07/2004)
 
* Email validity check now allows for capital letters in the email's
domain - brian (10/04/2004)
 
* Both datestamp and last_post_time are now formatted in threaded and
non-threaded mode. - brian (09/30/2004)
 
* Improved performance of getting unapproved list for moderators -
brian (09/30/2004)
 
* Setting tz to default now works properly - brian (09/29/2004)
 
* Closed posts could be brute force replied to. - brian (09/28/2004)
 
* Fixed warning when adding/editing forums. - brian (09/27/2004)
 
* The HTML_TITLE is not set correctly on pages of a read page. -
brian (09/25/2004)
 
* fixed newflags for moved threads - ts77 (09/22/2004)
 
* fixed ip-display in preview - ts77 (09/20/2004)
 
* Registration emails will now work better for AOL users - brian
(09/15/2004)
 
* Fixed possible XSS issue with the linked author - brian
(09/15/2004)
 
* fixed url in redirect after adding/editing a forum - ts77
(09/14/2004)
 
* Bare urls with capital letters in them were not getting converted
properly. - brian (09/14/2004)
 
* Fixed the email and url tags in BBCode - brian (09/14/2004)
 
Release: phorum.5.0.10
-----------------------
 
* BBCode module only works for properly formatted codes now. Urls are
shortened for better display. - brian (09/13/2004)
 
* Fixed potential XSS in last post author name - brian (09/10/2004)
 
* correctly removing session-info from all notification-urls - ts77
(09/10/2004)
 
* Session timeout can be 0 now. - brian (09/10/2004)
 
* Added module localization support - tridus (09/09/2004)
 
* added forum_last_active column for forum where the user was last
active. - ts77 (09/07/2004)
 
* Email verification is no more inline with RFC 2822 - brian
(09/07/2004)
 
* We now give better messages upon new installations. - brian
(09/06/2004)
 
* new message-notifications for moderators work correctly now - ts77
(09/06/2004)
 
* Fixed bug where sticky posts edited by non-moderators stay sticky -
brian (09/06/2004)
 
* Changes in admin to forums send you back to that forums parent
instead of the top. - brian (09/06/2004)
 
* anchors for read-links now have a msg-<number> name - ts77
(09/05/2004)
 
* fixed that user-timezone set to default is really ignored for
tz-conversion then - ts77 (09/05/2004)
 
* conversion-script now handles permissions and groups /
group-members too - ts77 (09/03/2004)
 
* fixed threaded-view paging. threads could be hidden between page 1
and 2. - ts77 (09/02/2004)
 
Release: phorum.5.0.9
----------------------
 
* bug fix release (09/01/2004)
 
* new hook \"moderation\" i.e. for logging moderator actions - ts77
(08/31/2004)
 
* fixed missing links and vars for mails about attachments - ts77
(08/31/2004)
 
* storing forum-offsets in the settings now on conversion - ts77
(08/31/2004)
 
* installer now checks if cache is writable on a new install - tridus
(08/31/2004)
 
* fixed \"mark all messages read\" in empty forums - ts77
(08/28/2004)
 
Release: phorum.5.0.8.RC
-------------------------
 
* bumped release version - brian (08/20/2004)
 
* newflags are now moved while moving a message - ts77 (08/20/2004)
 
* Added a hook to the index.php page - brian (08/19/2004)
 
* Added new message count to forum index - brian (08/19/2004)
 
* pm-preview now formatted too - ts77 (08/19/2004)
 
* Created a function for module writers that will fetch the last x
messages with several options - brian (08/19/2004)
 
* Attachments can now be deleted by users and moderators - brian
(08/18/2004)
 
* New Smilies - brian (08/17/2004)
 
* added script.php, external and scheduled hooks to run things from
command line - tridus (08/12/2004)
 
* moderator notifications are now different for messages needing
approval and not needing approval - ts77 (08/11/2004)
 
* Moved closed status to its own field for better logic and
performance - brian (08/09/2004)
 
* enhancements for smiley-module (thanks to Cameron Brunner) - ts77
(08/08/2004)
 
* *** empty log message *** - ts77 (08/07/2004)
 
* Improved memory usage of the 3to5 upgrade script. - brian
(08/04/2004)
 
* rewrote newflag/readflag storage to be more flexible - ts77
(08/03/2004)
 
* added email-verification on email-change - ts77 (08/03/2004)
 
* fixed saving permissions, missing break in display_fixed - ts77
(07/29/2004)
 
Release: phorum.5.0.7a.beta
----------------------------
 
* removed debugging output - security issue - ts77 (07/28/2004)
 
* fixed broken p3-to-p5-conv - ts77 (07/28/2004)
 
Release: phorum.5.0.7.beta
---------------------------
 
* bug fix release (07/26/2004)
 
* Improved private messaging. Added formatting, security - brian
(07/23/2004)
 
* fix table name typo - brian (07/23/2004)
 
* Added support to look at banned names and emails to the register
page - brian (07/22/2004)
 
* tweaked new installation settings, added smiley defaults - tridus
(07/22/2004)
 
* changed config.php to config.php.sample - tridus (07/22/2004)
 
* Improved followed (bookmarks/subscriptions) threads - brian
(07/19/2004)
 
* allowed for hidden languages/templates - ts77 (07/19/2004)
 
* added fixed display-settings - ts77 (07/19/2004)
 
* Added hooks to all moderation functions - brian (07/18/2004)
 
* Improved followed (bookmarks/subscriptions) threads - brian
(07/18/2004)
 
* Improved the email sent when a post is reported. - brian
(07/17/2004)
 
* added thread-bookmarking (thanks to Arthur Louie) - ts77
(07/17/2004)
 
* added convertViewCount.php to scripts directory - converts
viewcounts to new format - tridus (07/17/2004)
 
* Improved help text with regards to permissions - brian
(07/17/2004)
 
* Added check of read permissions to attachments. - brian
(07/16/2004)
 
* Added tighter security to seaches - brian (07/16/2004)
 
* added float-to-top for threaded mode AND an additional setting for
number of threads on the list-page on threaded-mode, paged list for
threaded - ts77 (07/15/2004)
 
* added user_list hook - tridus (07/15/2004)
 
* added ability for users to join groups in CC, admin can disallow on
a per-group basis - tridus (07/11/2004)
 
* groupmod improvements - can filter the list of users, group list
shows how many unapproved - tridus (07/11/2004)
 
* added index for unapproved messages-queries - ts77 (07/10/2004)
 
* *** empty log message *** - ts77 (07/10/2004)
 
* added read-url to subscriptions-page - ts77 (07/10/2004)
 
* added option to show smileys in subject too - ts77 (07/10/2004)
 
* added users data as USERINFO to the template-vars - ts77
(07/09/2004)
 
* fixed checking for correct user if reading a PM - ts77
(07/08/2004)
 
* Optimized queries for flat list view. Should help with speed issues
some have seen. - brian (07/07/2004)
 
* added fallback to default-language if nonexistent language selected
- ts77 (07/04/2004)
 
* allowed macro-expansion in mail-subject too - ts77 (07/03/2004)
 
* added SearchTips to the search-page - ts77 (07/03/2004)
 
* added missing signature to post-preview - ts77 (07/01/2004)
 
* added a notification box to alert users of things that need their
attention - tridus (06/21/2004)
 
* initial group moderation interface, can list group members in cc
(assign mods in admin) - tridus (06/19/2004)
 
* group moderation is fully functional - tridus (06/19/2004)
 
* added optional dropdown list of users when sending a new private
message - tridus (06/19/2004)
 
* added error-checking for too large message-bodies - ts77
(06/18/2004)
 
* added DST-setting, started email-change verification (not finished
yet) - ts77 (06/14/2004)
 
* added confirmation before a post is reported - tridus (06/10/2004)
 
* fixed banlist-checking (was wrong order of arguments) - ts77
(06/01/2004)
 
* fixed setting a wrong password in the user-admin if no password is
set. - ts77 (05/30/2004)
 
* merged viewcount-mod into the main-code, allows per-forum setting
now - ts77 (05/29/2004)
 
Release: phorum.5.0.6.beta
---------------------------
 
* File Uploads in CC now global option. Fixes bugs with this system -
brian (05/25/2004)
 
* report a post now works - tridus (05/24/2004)
 
* approving a whole thread is now implemented - ts77 (05/22/2004)
 
* removed page-links from list if the read-view is set to threaded -
ts77 (05/20/2004)
 
* fixed missing sticky/announcement in preview - ts77 (05/20/2004)
 
* tightened checks for valid values in search-links - ts77
(05/20/2004)
 
* fixed missing message-id and -thread in notification messages for
attachments - ts77 (05/20/2004)
 
* really abort an message-edit if an error occured - ts77
(05/20/2004)
 
* *** empty log message *** - ts77 (05/18/2004)
 
* Added an after_register hook - brian (05/15/2004)
 
* User searches in admin now list all users when page first accessed
- brian (05/15/2004)
 
* improved ban-list checking (does user/email check for registered
now too) - ts77 (05/14/2004)
 
* overwriting temporary password too on password-change - ts77
(05/08/2004)
 
* unapproved messages are now marked while reading them - ts77
(05/07/2004)
 
* author-name is changed now on deleting a user (can be disabled with
a constant in include/constants.php) - ts77 (05/07/2004)
 
* hidden/unapproved messages are now ignored in thread-info like
count and new - ts77 (05/07/2004)
 
* Title tag now contains some dyanmic information - brian
(05/02/2004)
 
* Adding a global HTML title and support for additional tags in the
head of the page. - brian (05/02/2004)
 
* Added new constant for string separator for things like the title
tag - brian (05/02/2004)
 
* added user-delete to the admin - ts77 (05/02/2004)
 
* added an admin option for deleting old messages/threads - ts77
(05/01/2004)
 
* Portable code should work now - brian (04/30/2004)
 
* enabled IIS-hack - checking for SERVER_SOFTWARE-string - ts77
(04/30/2004)
 
* many improvements to the templates, better configurability,
alternating colors and stuff - ts77 (04/30/2004)
 
* Added support for meta tags in language files - brian (04/23/2004)
 
* Added a link to phorum.org in the template footer - brian
(04/20/2004)
 
* fixed signature-flag in user-edit of messages - ts77 (04/18/2004)
 
* fixed view of usernames with html-characters, html-encoded now -
ts77 (04/18/2004)
 
* *** empty log message *** - ts77 (04/18/2004)
 
* forum-list link goes now back to the parent-folder, not the
root-folder - ts77 (04/10/2004)
 
* email-addresses of anonymous users are now shown in the list too -
ts77 (04/10/2004)
 
* fixed hide_email not saved - ts77 (04/08/2004)
 
* fixed hidden messages shown in list - ts77 (04/07/2004)
 
* Fixed portable code. - brian (04/02/2004)
 
* You can no longer edit settings for a module that is turned off. -
brian (04/02/2004)
 
* Searches are now url encoded so that url characters do not break
searching. - brian (04/01/2004)
 
* User registering from a forum are now treated properly. - brian
(03/29/2004)
 
Release: phorum.5.0.5.beta
---------------------------
 
* bug fix release (03/23/2004)
 
Release: phorum.5.0.4a.beta
----------------------------
 
* bug fix release (03/22/2004)
 
Release: phorum.5.0.4.beta
---------------------------
 
* implemented dates formatted by locale - ts77 (03/21/2004)
 
* Added the date a user is registered and the ability to track when a
user last used Phorum. - brian (03/17/2004)
 
* Added ability to detect if cookies are off on the browser. - brian
(03/17/2004)
 
* Users can only search forums they are allowed to read now. - brian
(03/17/2004)
 
* added link to private messages to the default template, with number
of new messages - tridus (03/12/2004)
 
* Added user_info hook so module writers could alter user sigs in
read.php - brian (03/05/2004)
 
* fixed bug #489, selecting the max-id from wrong database - ts77
(03/05/2004)
 
* added send_mail-hook for plugging into the sending of messages -
ts77 (03/04/2004)
 
* fixed saving user-data in the cc - ts77 (03/04/2004)
 
Release: phorum.5.0.3.beta
---------------------------
 
* fixed bug #478 - ts77 (03/03/2004)
 
* added an idea, group moderators - ts77 (03/03/2004)
 
* added user-selectable template - ts77 (03/02/2004)
 
* Registration Moderation Added - brian (03/01/2004)
 
* added user-selectable language - ts77 (02/25/2004)
 
* First commit of attachments. - brian (02/13/2004)
 
* added mixed view by checking threaded/non-threaded separately in
list and read - ts77 (01/24/2004)
 
* If there is only one forum, index.php now redirects to it. - brian
(12/09/2003)
 
* honor admin-setting of allowed tz-selection or not - ts77
(12/09/2003)
 
* This is a test of the new cvs update log script. - brian
(11/26/2003)
 
* fixed replies to sticky posts - brian (11/02/2003)
 
Release: phorum.5.0.2.alpha
----------------------------
 
* bug fix release (10/30/2003)
 
* stickies did not show up if there were no other messages. - brian
(10/29/2003)
 
* added user-selectable timezone - ts77 (10/04/2003)
 
* implemented banlists per forum and put banlists in a table - ts77
(09/27/2003)
 
* Moderators can now view all users emails. - brian (09/19/2003)
 
* Added a user file storage area to CC - brian (09/18/2003)
 
* Added a user file storage area to CC - brian (09/17/2003)
 
* Add email confirmation of new registrations. - brian (08/01/2003)
 
* added option to show signature in a post or not added default
settings for email-notify and add-signature to controlcenter ->
boardsettings - ts77 (07/25/2003)
 
* Added bad word filter. - brian (07/24/2003)
 
* added duplicate-post check - ts77 (07/19/2003)
 
* ControlCenter (mostly) finished - ts77 (07/12/2003)
 
* moved prepost-moderation from its own page to the control-center -
ts77 (06/15/2003)
 
* Added list of message-subscriptions to the control-center - ts77
(06/15/2003)
 
* activated display-order in the admin - ts77 (06/15/2003)
 
* added control-center - ts77 (06/10/2003)
 
* Moderator's ips are no longer shown. - brian (06/10/2003)
 
Release: phorum.5.0.1.alpha
----------------------------
 
* bug fix release (06/08/2003)
 
* $PHORUM['DATA']-array and this entry is used as template-name then.
- ts77 (05/31/2003)
 
* Added preview - brian (05/30/2003)
 
* Added "last post" feature in list.php to jump to last post in
thread - brian (05/25/2003)
 
* Fixed lost password so that it now sends a temp password like
Phorum 3 does. - brian (05/25/2003)
 
* Public users can no longer post using registered names. - brian
(05/25/2003)
 
* Added showing of IP to read page. - brian (05/23/2003)
 
* Added quoting on reply. Does not use javascript. - brian
(05/23/2003)
 
Release: phorum.5.0.0.alpha
----------------------------
 
* fixed missing localizations of GoTo - ts77 (04/22/2003)
 
* Changed language file. All keys to array have no spaces now. -
brian (04/09/2003)
 
* Rewrote large portions of the template engine. - brian
(04/09/2003)
 
* added .htaccess-files in important directories to increase security
- ts77 (04/05/2003)
 
* added a first version of a conversion script from phorum3.4 to
phorum5 - ts77 (04/04/2003)
 
* Added HTML module to allow safe HTML in messages. - brian
(04/04/2003)
 
* Added/fixed paging on the list page. - brian (04/03/2003)
 
* fix for update_forum_stats if no posts in forum. - ts77
(03/09/2003)
 
* added display of number of edits and last edit to read-view added
switch for allowing edit of posts to the admin - ts77 (02/24/2003)
 
* added pre-post moderation - ts77 (02/23/2003)
 
* added viewcount-mod, new hook "readthreads" - ts77 (02/21/2003)
 
* Added a post hook. - brian (02/13/2003)
 
* Added a meta field to the message table to store extra info. Useful
for mods to use. - brian (02/13/2003)
 
* fixed new-flags while using paging - ts77 (02/12/2003)
 
* Added paging to the read page including page links on list.php -
brian (02/04/2003)
 
* Fixed more potential cross sight scripting issues with form input.
- brian (01/30/2003)
 
* Fixed a cross sight scripting issue when echoing sql errors. -
brian (01/30/2003)
 
* User/Group permissions fully done. - brian (01/23/2003)
 
* Added Time Zone offset. - brian (01/23/2003)
 
* Added group admin - brian (01/23/2003)
 
* Added sigs to the read page - brian (01/20/2003)
 
* implemented user-edits of posts. - ts77 (01/19/2003)
 
* implemented first try of a new upgrade-system - ts77 (01/18/2003)
 
* added edit-post parts - ts77 (01/18/2003)
 
* Added new item about our CSS/XHTML stance. - brian (01/16/2003)
 
* added option to add moderated forums to a user through the
user-admin. - ts77 (01/13/2003)
 
* threaded or flat is now a user option. - brian (01/12/2003)
 
* added close/reopen thread - ts77 (01/12/2003)
 
* fixed sticky and announcement posting - brian (01/12/2003)
 
* Added announcement support - brian (01/12/2003)
 
* Added color and size tags to bbcode. - brian (01/12/2003)
 
* fixed sticky and announcement posting / added nav to post form -
brian (01/12/2003)
 
* laid groundwork for popup help in admin - brian (01/11/2003)
 
* some more template-code, "if" allows now loopvars and array-vars
too - ts77 (01/11/2003)
 
* added move-thread functionality - ts77 (01/11/2003)
 
* enabled list-moderation - ts77 (01/11/2003)
 
* added code to show menu descriptions in status bar - brian
(01/11/2003)
 
* changed user functions to all be named phorum_user_* - brian
(01/10/2003)
 
* added a wrapper to allow multiple Phorum's from one source base -
brian (01/10/2003)
 
* added first moderation-parts (delete message and delete message
with answers) - ts77 (01/10/2003)
 
* fixed lost password error. - brian (01/10/2003)
 
* improved installer - brian (01/10/2003)
 
* fixed link after register - brian (01/08/2003)
 
* Added user admin module. - brian (01/07/2003)
 
* email banning was not working - brian (01/06/2003)
 
* Modified code to include header and footer templates instead of the
templates having to do it. - brian (12/19/2002)
 
* added mark-all-read-functionality - ts77 (11/23/2002)
 
* Improved error handling of table creation - brian (11/19/2002)
 
* added newflag-support, uses a new table and only works if a user is
logged in - ts77 (11/09/2002)
 
* bbcode handles the url translation of all kinds. - brian
(11/06/2002)
 
* Changed the read hook to run before the body is formatted. mods
must use special methods to insert tags. - brian (10/30/2002)
 
* heh, allow_html was reversed. - brian (10/25/2002)
 
* fixed lack of ] - brian (10/21/2002)
 
* search was skipping the first result. - brian (10/16/2002)
 
* search template - brian (10/16/2002)
 
* fixing modifystamp and thread_count. - brian (10/12/2002)
 
* made index.php get actual data for posts and last post. - brian
(10/11/2002)
 
* removed finish template. - brian (10/07/2002)
 
* $extra not implemented in all places. - brian (10/07/2002)
 
* check for smiley dir before trying to read from it. - brian
(10/07/2002)
 
* adding mod settings admin. - brian (10/06/2002)
 
* some smiley-examples - ts77 (10/06/2002)
 
* updating error codes, got modules working, added bb code mod, added
dns lookup option and email validation. - brian (10/06/2002)
 
* add replace mod and mod creation doc. - brian (10/06/2002)
 
* added function for admin-form, corrected hooks-code, added
smiley-plugin - ts77 (10/06/2002)
 
* adding mod admin code and email validation code. - brian
(10/06/2002)
 
* fixed some install errors. - brian (10/06/2002)
 
* actually adding bbcode module now. - brian (10/06/2002)
 
* fixes for "headers sent" ... just some newlines removed - ts77
(10/06/2002)
 
* more template stuff. more admin stuff. folders working. - brian
(08/29/2002)
 
* updated more of the template. - brian (08/28/2002)
 
* tweaking install process. - brian (08/28/2002)
 
* got search working. - brian (08/27/2002)
 
* added ban list to admin. More work on default template. Started
phorum.php wrapper script. - brian (08/24/2002)
 
* first shot at a template. added some stubs for needed features. -
brian (08/23/2002)
 
* got the install wizard working. started on search - brian
(08/21/2002)
 
* small fix to the caching. - ts77 (08/21/2002)
 
* convert message tables into one table. rename all database
functions to phorum_db_?? - brian (08/18/2002)
 
* admin login was not working. - brian (08/10/2002)
 
* got the admin working, got the index.php working. redesigned the
tables, added and install.txt - brian (08/09/2002)
 
* lots of changes. Remember this is still pre alpha. - brian
(08/08/2002)
 
* fixed read url in flat mode. - brian (07/25/2002)
 
* no longer passing refs from the db functions, just arrays. - brian
(07/12/2002)
 
* lots of fixes. - brian (06/13/2002)
 
/trunk/client/phorum/bibliotheque/phorum/docs/creating_mods.txt
New file
0,0 → 1,1869
Creating Modules for Phorum5
============================
 
This document describes the Phorum5 module system. It is targeted at
developers who want to do customization and extend the functionality
of Phorum5. Modules are the preferred way to archieve this in
Phorum5.
 
For much of this document, we will be talking about an example module
"foo". Of course you will not name your module "foo", but something much
more appropriate. If you're not familiar with the terms "foo" and "bar",
you can visit http://en.wikipedia.org/wiki/Metasyntactic_variable
 
Be sure to read at least the **CAUTIONS AND SECURITY ISSUES** section,
before making your own modules.
 
 
Table of contents:
 
1. Introduction
1.1 Modules
1.2 Hacks
1.3 Hooks
2. Creating your own modules
2.1 What modules are built of
2.1.1 Hook functions
2.1.2 Module information
2.1.3 Other "stuff"
2.2 Module structure
2.2.1 Single file modules
2.2.2 Multiple file modules
2.3 Supporting multiple languages
2.4 Storing message data
2.4.1 From hooks that are run before saving a message to the database
2.4.2 From other hooks
2.5 Storing user data
2.6 Creating custom URLs
2.7 Implementing settings for your module
2.8 Changing the template
2.9 Example modules
3. **CAUTIONS AND SECURITY ISSUES**
3.1 Make modules, not hacks
3.2 Reload your module if you change the module information
3.3 How to access the $PHORUM array from your hook functions
3.4 How to access additional files in your multi file module
3.5 Secure your PHP files agains hackers
3.6 Secure your pages from XSS
3.7 Prevent namespace collisions
3.7.1 (Hook) functions
3.7.2 Data stored in $PHORUM
3.7.3 Language strings stored in $PHORUM
3.7.4 Data stored in messages, users and settings
4. Overview of available Phorum hooks
4.1 Code hooks
4.2 Template hooks
5. Support
 
 
1. Introduction
-------------------------------------------------------------------------------
 
 
1.1 Modules
-----------
 
Modules are self contained pieces of software, that can be added to
Phorum to change or extend its functionality. Modules can do this
without having to change anything in the standard Phorum distribution
files or database structure. So installing a module means: drop in
the code, go to the admin "Modules" page, enable the module and it
works.
 
 
1.2 Hacks
---------
 
The moment it is neccessary to make changes to the standard Phorum
distribution files or database structure to implement some kind of
functionality, we're talking about a hack (even if the changes
that have to be made are accompanied by a drop in module).
 
Although there is nothing wrong with writing hacks, the Phorum team
wants to urge you to try if you can write a module before resorting
to a hack. Modules are the preferred way of modifying Phorum
functionality, because that will make both upgrading your distribution
and having your modification adopted by others easier.
 
 
1.3 Hooks
---------
 
Phorum uses hooks to run its modules. Hooks are points in the
application where Phorum stops and runs its data through the modules
that are configured to handle the hook. The modules can act upon and
change this data.
 
The following image visualizes what happens when Phorum reaches
a hook point in the application, for which two modules ("foo" and
"bar") have been configured.
 
 
Phorum
Application
(1) (1) Phorum is running.
| (2) Phorum reaches the
| hook named "some_hook".
v Phorum (3) Phorum sends data to
some_hook >----- data ------+ the module system.
(2) (3) | (4) The module "foo" is run.
v (5) The module "bar" is run.
(4) module "foo" (6) The Phorum data (which
| might be modified by the
v modules) is sent back
(5) module "bar" to Phorum.
| (7) Phorum continues running
Phorum Modified | with the modified data.
Application <---- data ------+
(7) (6)
|
|
v
 
 
2. Creating your own modules
-------------------------------------------------------------------------------
 
 
2.1 What modules are built of
-----------------------------
 
 
2.1.1 Hook functions
--------------------
 
A module contains one or more PHP functions that act as hook
functions. Hook functions will receive some data in a variable
from Phorum and have to return the (possibly modified) data, which
will then go either back to Phorum or to the input of another module
which also handles the same hook (see 1.3). So the most basic (and
useless :-) hook function you could write would look somewhat like this
(see 3.7 for an explanation of the naming of the function):
 
function phorum_mod_foo_some_hook ($data) {
return $data;
}
 
The exact nature of the data that is sent to the hook functions
depends solely on the hook that is run. In chapter 4 of this document
you will find a description of all supported hooks, including a
specification of the type of data that is sent.
 
 
2.1.2 Module information
------------------------
 
For each hook that you want to handle in your module, you will have
to point the module system to the function in your module that will
handle the hook. Together with some other information, used for
describing the module, this is stored in the module information.
The module information acts as the glue between Phorum and your
module.
 
Module information is formatted using lines of plain text. Each line
contains a bit of information about the module. The general format
of the lines in the module information is:
 
<type>: <data>
 
Here is a list of the types that can be used:
 
+--------+-----------------------------------------------------------+
| <type> | <data> |
+--------+-----------------------------------------------------------+
| title | This is the title for the module that is displayed in the |
| | "Modules" page of the admin interface. |
+--------+-----------------------------------------------------------+
| desc | This is the description that is displayed along with the |
| | title in the admin interface, to give a little more |
| | information about the module. Using HTML in the <data> |
| | part is allowed. |
+--------+-----------------------------------------------------------+
| hook | This describes which hook functions are called for which |
| | Phorum hooks. The data consists of two fields, separated |
| | by a pipe "|" symbol. The first field contains the name |
| | of the hook that this module is hooking into. The second |
| | field contains the name of the hook function that will be |
| | called for the hook. |
+--------+-----------------------------------------------------------+
 
It is allowed to use multiple hook lines in your module information,
so your module can hook into multiple hooks. When doing this, it
is also allowed to use the same hook function for handling different
hooks in your module (asuming the hooks are compatible).
 
Here's an example of what the module information for our example
module "foo" might look like:
 
title: Foo example module
desc: This is the Foo module for Phorum. Nothing exciting...
hook: some_hook|phorum_mod_foo_some_hook
hook: some_other_hook|phorum_mod_foo_some_other_hook
hook: yet_another_hook|phorum_mod_foo_some_other_hook
 
So what this module info for example does, is telling Phorum that
when it gets to "some_other_hook", it will have to call the function
phorum_mod_foo_some_other_hook() in your module. It also tells
that for "yet_another_hook" the same function has to be called.
 
 
2.1.3 Other "stuff"
-------------------
 
Hook functions and the module information are all the parts needed
for creating a working module. However, your module might need
extra stuff like template, language and image files. You can
store these files along with your module when using the multiple
file module structure (see 2.2.2 below).
 
If you do not need to store any other stuff with your module, you
can also choose to use the single file (see 2.2.1 below) module
structure.
 
 
2.2 Module structure
--------------------
 
 
2.2.1 Single file modules
-------------------------
 
Single file modules are useful in case case no additional files have
to be distributed with your module. Because the module consist of
only one single file, it is very easy to distribute. Beware that the
moment you want to support for example a settings screen, multiple
languages or custom images, you will have to switch to the multiple
file module structure.
 
Single file modules consist of one single PHP file, which contains
both the module information and the hook functions. For storing the
module informaton, a special PHP comment is used. This comment must
look like the following:
 
/* phorum module info
<module information lines go here>
*/
 
Using the example module info from 2.1.2, the complete single
file module would look like this (see 3.5 why we use the
check on PHORUM at the start of this file):
 
<?php
 
if(!defined("PHORUM")) return;
 
/* phorum module info
title: Foo example module
desc: This is the Foo module for Phorum. Nothing exciting...
hook: some_hook|phorum_mod_foo_some_hook
hook: some_other_hook|phorum_mod_foo_some_other_hook
hook: yet_another_hook|phorum_mod_foo_some_other_hook
*/
 
function phorum_mod_foo_some_hook ($data) {
// Do stuff for "some_hook".
return $data;
}
 
function phorum_mod_foo_some_other_hook ($data) {
// Do stuff for "some_other_hook" and "yet_another_hook".
return $data;
}
 
?>
 
Installation of a single file module is done by putting the PHP
file (e.g. foo.php) directly in the directory {phorum dir}/mods/
and activating the module from the "Modules" screen in your
admin interface.
 
 
2.2.2 Multiple file modules
---------------------------
 
Multiple file modules are useful in case you need additional files
to be stored with your module, for example a settings screen,
language files or custom images.
 
Multiple file modules are stored in their own subdirectory below
the directory {phorum dir}/mods/. So if you have a module named
"foo", you will have to create a directory {phorum dir}/mods/foo/ for
storing all module files.
 
Inside this subdirectory, you will have to create a least two files.
The first is a file called "info.txt". This file contains the
module information for your module (see 2.1.2). The second file
is the PHP file which contains the hook functions for your module.
The basename of this file should be the same as the name of the
module subdirectory. So for our example module "foo", you will have
to create a file named "foo.php".
 
Using the example module info from 2.1.2, the complete multiple
file module would look like this (see 3.5 why we use the
check on PHORUM at the start of the PHP file):
 
info.txt:
 
title: Foo example module
desc: This is the Foo module for Phorum. Nothing exciting...
hook: some_hook|phorum_mod_foo_some_hook
hook: some_other_hook|phorum_mod_foo_some_other_hook
hook: yet_another_hook|phorum_mod_foo_some_other_hook
 
foo.php:
 
<?php
 
if(!defined("PHORUM")) return;
 
function phorum_mod_foo_some_hook ($data) {
// Do stuff for "some_hook".
return $data;
}
 
function phorum_mod_foo_some_other_hook ($data) {
// Do stuff for "some_other_hook" and "yet_another_hook".
return $data;
}
 
?>
 
So far, the module has exactly same functionality as the single
file module from 2.2.1. From here on, the functionality can be
extended. Some of the possibilities are:
 
- Using custom files for your module (images, classes, libs, etc.);
- Letting your module support multiple languages;
- Creating a settings screen for your module;
 
 
2.3 Supporting multiple languages
---------------------------------
 
(this feature is only available for the multiple file module structure)
 
If your module includes text that will be displayed to end users,
you should strongly consider making it support multiple languages.
This will allow Phorum installations using another language to display
output of your module in the same language, instead of the language
you have written the module in.
 
For supporting multiple languages, the first thing to do is add the
following to your module information file (info.txt):
 
hook: lang|
 
There is no hook function configured here, because the "lang" hook
is only used as a marker for Phorum. This only tells Phorum that your
module supports multiple languages.
 
Next, you must provide at least one language file with your module.
Language files are stored in a subdirectory name "lang" inside your
module directory. So in our sample module, the full directory would be
{phorum dir}/foo/lang/. The language files must be named identical
to the main language files that Phorum uses. So, to include both
English and French, your module would have the following file
structure below the Phorum's mods directory:
 
foo/info.txt
foo/foo.php
foo/lang/english.php
foo/lang/french.php
 
The structure of your language files will be almost identical to that
of the main Phorum language files. However, for your own language files
it is advisable to add an extra level in the language variables, to
avoid conflicts with other modules or Phorum itself. Here is an
example of how you would do that:
 
<?php
$PHORUM["DATA"]["LANG"]["mod_foo"]["Hello"] = "Hello!";
?>
 
Here, the extra inserted level is ["mod_foo"]. You can add as many
lines as you need for your module. To access the above language string,
from your module code you would use:
 
$PHORUM["DATA"]["LANG"]["mod_foo"]["Hello"]
 
From a template file, you would use:
 
{LANG->mod_foo->Hello}
 
In case a Phorum installation is using a language that your module
does not support, Phorum will automatically attempt to fallback to
English. So it is highly recommend that you include an english.php
language file in all your modules. If both the current language and
english.php are not found, Phorum will be unable to load a language
for your module and will display empty space instead of language
strings.
 
Try to reuse strings that are already in the main Phorum language
files itself. Only create custom strings when there is no alternative
available. Having more text to translate is more work for everybody,
especially the Phorum translators.
 
 
2.4 Storing message data
------------------------
 
If your module needs to store data along with a Phorum message,
you can make use of the meta information array that is attached
to each message ($message["meta"]). This array is a regular PHP
array, which is stored in the database as serialized data
(see http://www.php.net/serialize). Because Phorum and other modules
make use of this meta data as well, you should not squash it,
neither access the meta data in the database directly. Instead
use the methods described in this section.
 
Remark: because the meta data is stored as serialized data in the
database, it is not possible to include data you store in there
in SQL queries.
 
When storing information in the meta data from a hook function, you
can encounter two different situations, which both need a different
way of handling.
 
 
2.4.1 From hooks that are run before saving a message to the database
---------------------------------------------------------------------
 
There are some hooks that send a full message structure to the
hook functions, so these can change the message data before storing
the message in the database. Examples are the hooks "pre_post"
and "pre_edit". In this case you can simply update the meta
information directly. Here's an example of how this would look
in your hook function:
 
function phorum_mod_foo_pre_post ($message) {
$message["meta"]["mod_foo"]["foodata"] = "Some data";
$message["meta"]["mod_foo"]["bardata"] = "Some more data";
return $message;
}
 
Phorum will take care of storing the updated meta data in the database.
 
 
2.4.2 From other hooks
----------------------
 
For other hooks, the proper way to store information in the meta
data is to retrieve the current meta data using phorum_db_get_message(),
copy the meta data to a new message structure, make changes as needed
and use phorum_db_update_message() to update the message in the
database. Here is an example of how this could look in your hook
function:
 
function phorum_mod_foo_some_hook ($data) {
 
// Somehow you get the id for the message. Here we asume
// that it is stored in the $data parameter.
$message_id = $data["message_id"];
 
// Retrieve the current message data.
$message = phorum_db_get_message ($message_id);
 
// Create updated meta data.
$new_message = array("meta" => $message["meta"]);
$new_message["meta"]["mod_foo"]["foodata"] = "Some data";
$new_message["meta"]["mod_foo"]["bardata"] = "Some more data";
 
// Store the updated data in the database.
phorum_db_update_message($message_id, $new_message);
 
return $data;
}
 
Changing meta data for a message this way will ensure that the
existing meta data is kept intact.
 
 
2.5 Storing user data
---------------------
 
If your module needs to store data along with a Phorum user,
you can make use of custom profile fields. In the admin interface,
under "Custom Profiles", you can add your own profile fields
(see also docs/creating_custom_userfields.txt).
 
The custom profile fields will be accessible from within the user
data. E.g. if you have created a custom profile field named "foobar",
the value of that field will be stored in $user["foobar"].
 
When using a custom profile field for storing module information,
you can use a separate field for each piece of data you want to
store. But instead, you can also create a single field for storing
a complete array of information. Phorum will automatically take care
of storing this information (serialized) in the database. You only
should make sure that the custom profile field is large enough to
store all the data. When your module needs to store multiple fields,
this is the preferred way.
 
For storing data in the custom profile field, you can make use of the
phorum_user_save() function. Below are two pieces of code which show
how our example module might store data for a user (asuming $user_id
is the id of the user that must be changed).
 
When using multiple fields "mod_foo_foodata" and "mod_foo_bardata":
 
$user = phorum_user_get($user_id);
$user["mod_foo_foodata"] = "Some user data";
$user["mod_foo_bardata"] = "Some more user data";
phorum_user_save($user);
 
When using a single custom field "mod_foo" for this module:
 
$user = phorum_user_get($user_id);
$user["mod_foo"] = array (
"foodata" => "Some user data",
"bardata" => "Some more user data"
);
phorum_user_save($user);
 
 
2.6 Creating custom URLs
-------------------------
 
Phorum uses the function phorum_get_url() to consistenly build URLs
that point to parts of Phorum. It is recommended that you use this
function as well when creating links yourself, so special features
and future changes will automatically be incorporated in the links
you use.
 
Here's an example of building an URL, which will open the profile
for the user with user_id = 17:
 
$url = phorum_get_url(PHORUM_PROFILE_URL, 17);
 
The argument list that this function takes, depends on the first
argument which tells Phorum what kind of URL has to be built.
So when building other URLs, other arguments will probably
be used.
 
If you need to build a custom URL to link to your own module, you
can use phorum_get_url() as well. The way to go is simple. You
need to use PHORUM_CUSTOM_URL as the first argument and add all
URL building parameters to it.
 
The first parameter needs to be the filename of the file to link
to, without the (.php) extension. The second parameter needs to
be 0 or 1. If it is 1, the current forum_id is added to the URL.
All other parameters are added comma separated to the URL.
 
Here's an example of building a custom URL which links to the
file "myfile.php". The URL has to have the forum_id in it and
needs to contain the additional parameter "foo=bar":
 
$url = phorum_get_url(PHORUM_CUSTOM_URL, "myfile", 1, "foo=bar");
 
 
2.7 Implementing settings for your module
-----------------------------------------
 
(this feature is only available for the multiple file module structure)
 
Some modules that you write might need to store settings for later
use. For those, you can create a settings page which will be used
from within the admin interface.
 
The settings page must be put in your modules's directory by the
name of "settings.php". So for our example module "foo" the file
would go in {phorum dir}/mods/foo/settings.php. In the admin
interface under the option "Modules", a link to the settings.php
page will automatically be added if the settings.php file is
available for your module.
 
Although you can do anything you want from your settings.php script,
it is recommended that you use the tools that are handed to you
by Phorum for building pages and storing settings.
 
One of those tools is a PHP object "PhorumInputForm" which
can be used to create standard input forms and table displays in
the admin interface. The best example here is to look at one of the
modules that come with Phorum like "bbcode" or "replace".
 
Another tool is the function phorum_db_update_settings() which can
be used for storing settings in the database. To store settings using
this function you do something like the following:
 
$foo_settings["foodata"] = "Some setting data";
$foo_settings["bardata"] = "Some more setting data";
phorum_db_update_settings(array("mod_foo" => $foo_settings));
 
$foo_settings can be anything you like: an array, object, string, etc.
The first request after you have stored your settings, the setting
data for this example will be available in $PHORUM["mod_foo"].
 
To ensure that your settings file is only loaded from the admin
interface, place this line at the top of your settings.php file
(see also 3.5):
 
if(!defined("PHORUM_ADMIN")) return;
 
 
2.8 Changing the templates using template hooks
-----------------------------------------------
 
 
2.8.1 When to use a template hook
---------------------------------
 
Changing the templates should be avoided as much as possible when
writing a module. This will basically turn your mod into a hack,
because files have to be edited for it. Inexperienced users might
find it hard to install your module if they have to modify files
to get it to work.
 
If you cannot avoid changing the template, then consider to use
template hooks for this. You can use these if your template change
involves adding extra code to a template. The advantage is that
there's only little code that has to be added to the templates,
which makes things less confusing to users that want to install the
module.
 
 
2.8.2 How to use a template hook
--------------------------------
 
To create a template hook, you do the following:
 
* Add "{HOOK tpl_some_hook}" to the template at an appropriate spot;
 
* Put "hook: tpl_some_hook|phorum_mod_foo_tpl_some_hook" in your
module info;
 
* Create the hook function phorum_mod_foo_tpl_some_hook() that
prints out the code that has to be placed at the position of
the "{HOOK tpl_some_hook}" code the the template.
 
If you want to pass on the data from template variables to
the hook function, you can simply add the variables to the hook
definition in the template. Example:
 
{HOOK tpl_some_hook DATA1 DATA2}
 
The hook function will get the contents of these variables passed in
a single array. This can for example be useful if your template hook
needs access to loop data. Example:
 
{LOOP MESSAGES}
...
{HOOK tpl_some_hook MESSAGES}
...
{/LOOP MESSAGES}
 
 
2.8.3 Preventing collisions in hook names
-----------------------------------------
 
You can use any name for "tpl_some_hook", but beware that your
name does not collide with an already existing hook name.
 
The easiest way to do this is use the techniques from section 3.7.
As a rule of thumb, you can use the following format:
 
tpl_mod_<modulename>_<identifier>
 
Example: If a buttonbar is added in one of the templates for a module
named "foo", the name for the hook could be "tpl_mod_foo_buttonbar".
 
 
2.9 Example modules
-------------------
 
The best way of learning how to write modules is probably looking
at existing module code. In your Phorum distribution's docs directory,
you will find the directory example_mods. This directory contains a
couple of example modules, demonstrating the features described in this
document. The modules have no real functional purpose, but they might
be easier to read than the real Phorum modules.
 
 
3. **CAUTIONS AND SECURITY ISSUES**
-------------------------------------------------------------------------------
 
 
3.1 Make modules, not hacks
---------------------------
 
Making modules that require database changes are discouraged and may
not be accepted as an approved module. We want modules to be as
transparent as possible for upgrades. Please attempt to store your
data in the proper place. See chapter 2 for more information on that.
 
 
3.2 Reload your module if you change the module information
-----------------------------------------------------------
 
If you are changing the module info for a module that is already
activated in your Phorum installation, you must deactivate and
reactivate it to have Phorum reload the changed information. For
performance reasons the module information is only read when the
module is activated.
 
If you have added a new hook function to your module and it seems
not to be run, it probably is because you did not do this.
 
 
3.3 How to access the $PHORUM array from your hook functions
------------------------------------------------------------
 
The $PHORUM array is in the global scope. From inside a function,
you can not directly access this array. So you will have to import
the $PHORUM array into your function scope. The Phorum team
recommends the following method for doing this (check out the
faq.txt to see why we do not use the "global" keyword):
 
function phorum_mod_foo_some_hook ($data) {
$PHORUM = $GLOBALS["PHORUM"];
 
// Do stuff for "some_hook".
 
return $data;
}
 
 
3.4 How to access additional files in your multi file module
------------------------------------------------------------
 
All standard Phorum pages are run from the Phorum installation
directory. The hook functions that you write also work from
the same directory. So if you want to access files in your module
directory, you will have to specify the relative path to those
files. This path looks like:
 
./mods/<module>/<filename>
 
So let's say that our module "foo" has a subdirectory "images"
which contains "bar.gif", then we could display that image
using the HTML code:
 
<img src="./mods/foo/images/bar.gif" />
 
Another example: let's say that there is a function library
named "my_module_functions.php" in the module, which must be
included from then module code, then this is done using:
 
include("./mods/foo/my_module_functions.php");
 
 
3.5 Secure your PHP files agains hackers
----------------------------------------
 
To prevent hackers from loading your PHP module files directly, you
should add the following to the start of your PHP files:
 
if(!defined("PHORUM")) return;
 
This will make sure that the file will only work when loaded from
the Phorum application. If you are writing pages that are loaded
from the admin interface (like a settings screen for your module),
then use the following line instead:
 
if(!defined("PHORUM_ADMIN")) return;
 
This will make sure that the file will only work when loaded from
the Phorum admin interface.
 
 
3.6 Secure your pages from XSS
------------------------------
 
XSS stands for cross site scripting. This means that hackers
can feed HTML data to your application, which is displayed on
screen without stripping or escaping the HTML data. This way
it can be possible for hackers to feed malicous javascript
code into the browser of users on the forum, causing a security
risk. If you want to learn more about XSS, please visit
http://en.wikipedia.org/wiki/XSS
 
To prevent XSS security holes, you must take care that all
user input is properly sanitized before displaying it on screen.
Sanitizing can be done by either stripping all HTML from
the data (e.g. using http://www.php.net/strip_tags) or by escaping
all html characters (using http://www.php.net/htmlspecialchars).
 
Example:
 
If your module needs to display the username for a user on
screen, it must not simply do:
 
print $user["username"];
 
Instead you must use:
 
print htmlspecialchars($user["username"]);
 
It's not only for security that you have to sanitize data before
displaying it. You must use htmlspecialchars() to prevent some other
possible problems as well. Imagine you have a user with the username
"<b>ob". Without htmlspecialchars() the username would be interpreted
as HTML code, possibly making the full page bold from the username on.
 
 
3.7 Prevent namespace collisions
--------------------------------
 
When creating modules, you must always be aware that you are
working in the same namespace as other modules and Phorum itself.
This means that there is a risk of duplicate use of function
and variable names. By following a couple of simple rules, you
can greatly reduce this risk.
 
 
3.7.1 (Hook) functions
----------------------
 
Always construct names for your module functions like this:
 
phorum_mod_<module name>_<identifier>
 
So if you are writing functions for a module named "foo", all
function names will look like:
 
phorum_mod_foo_<identifier>
 
You can use whatever you like for the <identifier> part. When writing
a hook function, it is recommended to use the name of the hook for
which you are writing the function (this will make clear what the
function does, without having to check the module info). So in case
you are writing a hook function for the hook "some_hook", the full
function name would be:
 
phorum_mod_foo_some_hook
 
If your hook function handles multiple hooks at once, then
simply use one of the hook's names as the <identifier> or make up
something yourself.
 
 
3.7.2 Data stored in $PHORUM
----------------------------
 
When storing data in $PHORUM, always prepend the array key name
with mod_<module name>. If your module is named "foo", do not use:
 
$PHORUM["mydata"]
 
but instead:
 
$PHORUM["mod_foo_mydata"]
 
 
3.7.3 Language strings stored in $PHORUM
----------------------------------------
 
When storing your custom language strings, do not put them directly
in $PHORUM["DATA"]["LANG"] like Phorum does, because that might
result in conflicting language strings. Instead add an extra data level,
which makes sure that your module keeps all language strings to itself.
 
If your module is named "foo", you should store language strings in:
 
$PHORUM["DATA"]["LANG"]["mod_foo"]
 
See also section 2.3.
 
 
3.7.4 Data stored in messages, users and settings
-------------------------------------------------
 
When using the Phorum provided ways of storing data in messages,
users and settings, always prepend the data key with
mod_<module name>. SO if your module is named "foo", do not use
things like:
 
$new_message["meta"]["foodata"] = "Some data";
$user["foodata"] = "Some data";
phorum_db_update_settings(array("settings" => $foo_settings));
 
but instead:
 
$new_message["meta"]["mod_foo_foodata"] = "Some data";
$user["mod_foo_foodata"] = "Some data";
phorum_db_update_settings(array("mod_foo" => $foo_settings));
 
See also sections 2.4 (message data), 2.5 (user data) and 2.7 (settings).
 
 
4. Overview of available Phorum hooks
-------------------------------------------------------------------------------
 
In this chapter you will find an overview of all available Phorum
hooks and a description of what they do.
 
Remarks:
 
* Input is what your module function should expect as parameters.
 
* Return is what your module function should return. Most hooks
expect the same data structure as was sent. For those items,
the Return is listed simply as "Same as Input".
 
* Normally, hook functions are allowed to modify the data that was
sent as input. If this is not allowed, the input data will be
flagged as read-only.
 
* In most cases the hook description will provide only one or more
of the possible uses for the hook. The full leverage of each hook
is only limited by the imagination of the module writer (it's
as much a cliche as it is true).
 
* It may be that you need to hook into a spot where there is
currently no hook available. If that is the case, let the dev
team know by posting a message in the development forum
on phorum.org, explaining where and why you need an extra hook.
Hooks will be added as neccessary, especially while Phorum 5
is young.
 
 
4.1 Code hooks
--------------
 
Code hooks are hooks that are called from within the Phorum core
code. These hooks are typically used for modifying Phorum's internal
datastructures.
 
 
----------------------------------------------------------------------------
admin_general
 
Where : admin interface
When : Right before the PhorumInputForm object is shown.
Input : The PhorumInputForm object.
Return : Same as Input
 
This hook can be used for adding items to the form on the
"General Settings" page of the admin interface.
 
----------------------------------------------------------------------------
admin_file_purge
 
Where : admin interface, option "Purge Stale Files"
When : Right before stale files are deleted from the database.
Input : An array, containing a description of all stale files.
Return : Same as Input
 
The primary use of this hook would be to cleanup stale files, created
by an alternate storage system for attachments (see after_attach and
after_detach as well). The array that is passed on to the hook function
contains arrays, which contain the following fields:
 
file_id : Internal id to reference the file.
filename : Name of the file.
filesize : Filesize in KB.
add_datetime : Epoch timestamp for the time the file was created.
reason : A description why this file is considered to be stale.
 
----------------------------------------------------------------------------
after_attach
 
Where : include/posting/action_attachments.php
When : Just after a file attachment is saved in the database
Input : Two part array where the first element is the message array and
the second element is a file array that contains the name, size,
and file_id of the newly saved file.
Return : Same as Input
 
The primary use of this hook would be for creating an alternate storage
system for attachments. You would need to use the before_attach hook to
remove the file data and in this hook it could be saved properly. You will
need to use the file hook to retreive the file data later.
 
----------------------------------------------------------------------------
after_detach
 
Where : include/posting/action_attachments.php
When : Just after a file attachment is deleted from the database
Input : Two part array where the first element is the message array and
the second element is a file array that contains the name, size,
and file_id of the deleted file.
Return : Same as Input
 
The primary use of this hook would be for creating an alternate storage
system for attachments. Using this hook, you can delete the file from
your alternate storage.
 
----------------------------------------------------------------------------
after_header
 
Where : Every page, except for the admin interface pages
When : Right after the header is displayed.
Input : none
Return : none
 
This hook can be used for creating content at the end of the header,
just before the main content is displayed.
 
----------------------------------------------------------------------------
after_login
 
Where : login.php
When : After a successful login, just before redirecting the
user to a Phorum page.
Input : The redirection URL.
Return : Same as Input
 
This hook can be used for performing tasks after a successful user
login and for changing the page to which the user will be redirected
(by returning a different redirection URL). If you need to access the
user data, then you can do this through the global $PHORUM variable.
The user data will be in $PHORUM["user"].
 
----------------------------------------------------------------------------
after_logout
 
Where : login.php
When : After a logout, just before redirecting the user to
a Phorum page.
Input : The redirection URL.
Return : Same as Input
 
This hook can be used for performing tasks after a successful user
logout and for changing the page to which the user will be redirected
(by returning a different redirection URL). The user data will still
be availbale in $PHORUM["user"] at this point.
 
----------------------------------------------------------------------------
after_register
 
Where : register.php
When : Right after a successful registration of a new user is done
and all confirmation mails are sent.
Input : Array containing the user data of the user (read-only).
Return : Same as Input
 
This hook can be used for performing tasks (like logging and
notification) after a successful user registration.
 
----------------------------------------------------------------------------
before_attach
 
Where : include/posting/action_attachments.php
When : Just before a file attachment is saved in the database
Input : Two part array where the first element is the message array and
the second element is a file array that contains the name, size
and data.
Return : Same as Input
 
The primary use of this hook would be for creating an alternate storage
system for attachments. You would need to use the after_attach hook to
complete the process as you do not yet have the file_id for the file. You
will need to use the file hook to retreive the file data later.
 
----------------------------------------------------------------------------
before_editor
 
Where : posting.php
When : Just before the message editor is displayed.
Input : Array containing data for the message that will be shown
in the editor screen.
Return : Same as Input
 
This hook can be used for changing message data, just before the editor
is displayed. This is done after escaping message data for XSS prevention
is done. So in the hook, the module writer will have to be aware that
data is escaped and that he has to escape data himself if needed.
 
This hook is called every time the editor is displayed. If modifying
the message data does not have to be done on every request (for example
only on the first request when replying to a message), the module will
have to check the state the editor is in. Here's some hints on what
you could do to accomplish this:
 
* Check the editor mode: this can be done by looking at the "mode" field
in the message data. This field can be one of "post", "reply" and "edit".
 
* Check if it's the first request: this can be done by looking at the
$_POST array. If no field "message_id" can be found in there, the
editor is handing the first request.
 
Using this, an example hook function that appends the string "FOO!"
to the subject when replying to a message (how useful ;-) could look
like this:
 
function phorum_mod_foo_before_editor ($data)
{
if ($data["mode"] == "reply" && ! isset($_POST["message_id])) {
$data["reply"] = $data["reply"] . " FOO!";
}
 
return $data;
}
 
Beware: this hook function only changes message data before it is
displayed in the editor. From the editor, the user can still change
the data. Therefore, this hook cannot be used to control the data which
will be stored in the database. If you need that functionality, then
use the hooks pre_edit and/or pre_post instead.
 
----------------------------------------------------------------------------
before_footer
 
Where : Every page, except for the admin interface pages
When : Right before the footer is displayed.
Input : none
Return : none
 
This hook can be used for creating content at the end of the main
content, just before the footer. It can also be used for
performing tasks that have to be executed at the end of each page.
 
----------------------------------------------------------------------------
before_register
 
Where : register.php
When : Right before a new user is stored in the database.
Input : Array containing the user data of the user.
Return : Same as Input
 
This hook can be used for performing tasks before user registration.
This hook is useful if you want to add some data to or change some
data in the user data and to check if the user data is correct.
 
When checking the registration data, the hook can set the "error" field
in the returned user data array. When this field is set after running
the hook, the registration processed will be halted and the error
will be displayed. If you created a custom form field "foo" and you
require that field to be filled in, you could create a hook function
which looks like this:
 
function phorum_mod_foo_before_register ($data)
{
$myfield = trim($data['your_custom_field']);
if (empty($myfield)) {
$data['error'] = 'You need to fill in my custom field';
}
 
return $data;
}
 
----------------------------------------------------------------------------
buddy_add
 
Where : pm.php
When : Right after a buddy has been added successfully.
Input : The user id of the buddy that has been added.
Return : Same as Input
 
This hook can be used for performing actions after a buddy has been
added for a user (e.g. sending the new buddy a PM about this event,
update popularity counters, do logging, synchronizing with other
databases, etc.).
 
----------------------------------------------------------------------------
buddy_delete
 
Where : pm.php
When : Right after a buddy has been deleted successfully.
Input : The user id of the buddy that has been deleted.
Return : Same as Input
 
This hook can be used for performing actions after a buddy has
been deleted for a user.
 
----------------------------------------------------------------------------
cc_save_user
 
Where : control.php
When : Right before data for a user is saved in the control panel.
Input : Array containing the user data to save.
Return : Same as Input
 
This hook works the same way as the before_register hook, so you can
also use it for changing and checking the user data that will be
saved in the database. There's one difference. If you want to
check a custom field, you'll also need to check the panel which
you are on, because this hook is called from multiple panels.
The panel that you are on, will be stored in the 'panel' field
of the user data.
 
If you have added a custom field to the template for the option
"Edit My Profile" in the control panel, your hook function will
look like this:
 
function phorum_mod_foo_cc_save_user ($data)
{
// Only check data for the panel "user".
if ($data['panel'] != "user") return $data;
 
$myfield = trim($data['your_custom_field']);
if (empty($myfield)) {
$data['error'] = 'You need to fill in my custom field';
}
 
return $data;
}
 
----------------------------------------------------------------------------
check_post
 
Where : post.php
When : Right after performing preliminary posting checks, unless
these checks have returned something bad.
Input : Array containing:
0 => the $_POST array with form data
1 => $error, to return errors in
Return : Same as Input
 
This hook can be used for modifying data in the $_POST array and for
running additional checks on the data. If an error is put in $error,
Phorum will stop posting the message and show the error to the user
in the post-form.
 
Beware that $error can already contain an error on input, in case
multiple modules are run for this hook. Therefore you might want to
return immediately in your hook function in case $error is already
set.
 
Below is an example of how a function for this hook could look.
This example will disallow the use of the word "bar" in the
message body.
 
function phorum_mod_foo_check_post ($args) {
list ($message, $error) = $args;
if (!empty($error)) return $args;
 
if (stristr($message["body"], "bar") !== false) {
return array($message, "The body may not contain 'bar'");
}
 
return $args;
}
 
----------------------------------------------------------------------------
close_thread
 
Where : moderation.php
When : Right after a thread has been closed by a moderator.
Input : The id of the thread that has been closed (read-only).
Return : Same as Input
 
This hook can be used for performing actions like sending notifications
or making log entries after closing threads.
 
----------------------------------------------------------------------------
common
 
Where : common.php, so in practice every page
When : Right before the end of the common.php include script.
Input : none
Return : none
 
This hook can be used for applying custom settings or altering
Phorum settings based on external parameters.
 
----------------------------------------------------------------------------
common_no_forum
 
Where : common.php, so in practice every page
When : Right after no forum settings were found, before doing the redirect
Input : none
Return : none
 
This hook can be used for returning some other message (i.e. a 404-page)
to the visitor if the requested forum was not found.
 
----------------------------------------------------------------------------
common_post_user
 
Where : common.php, so in practice every page
When : Right after loading the user from the database, but just
before making descisions on language and template.
Input : none
Return : none
 
This hook can be used for applying custom settings or altering
Phorum settings based on external parameters.
 
----------------------------------------------------------------------------
common_pre
 
Where : common.php, so in practice every page
When : Right after loading the settings from the database, but just
before making descisions on language, template and user.
Input : none
Return : none
 
This hook can be used for applying custom settings or altering
Phorum settings based on external parameters.
 
----------------------------------------------------------------------------
delete
 
Where : moderation.php
When : Right after deleting a message from the database.
Input : Array of ids for messages that have been deleted (read-only).
Return : none
 
This hook can be used for cleaning up anything you may have created
with the post_post hook or any other hook that stored data tied to
messages.
 
----------------------------------------------------------------------------
external
 
The external hook functions are never called from any of the standard
Phorum pages. These functions are called by invoking script.php on the
command line with the --module parameter. This can be used to pipe
output from some arbitrary command to a specific module, which can do
something with that input. If your module does not need any command
line input and is meant to be run on a regular basis, you should
consider using the scheduled hook.
 
Mind that for using an external hook, the module in which it is
handled must be enabled in your admin interface. So if an external
hook is not running, the containing module might be disabled.
 
To run the external hook from the command line, you have to be in
the phorum installation directory. So running the external hook of
a module named "external_foo" would be done like this on a UNIX
system prompt:
 
# cd /your/phorum/dir
# php ./script.php --module=external_foo
 
For easy use, you can of course put these commands in a script file.
 
----------------------------------------------------------------------------
file
 
Where : file.php
When : When attachments are requested.
Input : Two part array where the first element is the mime type already
detected by file.php and the second part is the file array that
contains the filename, file_data, filesize, etc.
Return : Same as Input
 
This hook could be used to count file downloads, or along with after_attach
an alternate file data storage mechanism could be created.
 
----------------------------------------------------------------------------
format
 
Where : phorum_format_messages() in include/format_functions.php
When : Everytime phorum_format_messages() is called for formatting
a message, just before it is sent to the templates.
Input : Array of messages.
Return : Same as Input
 
This hook can be used for applying custom formatting to messages. The
message fields that are most applicable for this are "body" and "author".
When writing a module using this hook, you probably want to format
those fields. In practice you can apply formatting to all the fields
you want.
 
The changes you make to the messages are for displaying purposes
only, so the changes are not stored in the database.
 
----------------------------------------------------------------------------
hide
 
Where : moderation.php
When : Right after a message has been hidden by a moderator.
Input : The id of the message that has been hidden (read-only).
Return : Same as Input
 
This hook can be used for performing actions like sending notifications
or making log entries after hiding a message.
 
----------------------------------------------------------------------------
index
 
Where : include/index_new.php and include/index_classic.php
When : Right before the list of forums is displayed.
Input : Array of forums.
Return : Same as Input
 
This hook can be used for changing or adding data to the forums
in the list.
 
----------------------------------------------------------------------------
lang
 
The lang hook is a only a 'marker'. It flags Phorum that your module
supports multiple languages. It does not take a hook function in
your module information. If you do define a hook function, it will
never be called.
 
Read section 2.3 for information on the use of multiple languages.
 
----------------------------------------------------------------------------
list
 
Where : list.php
When : Right before the messages are formatted and displayed.
Input : Array of threads (or messages in threaded mode).
Return : Same as Input
 
This hook can be used for changing or adding data to the messages
in the list.
 
----------------------------------------------------------------------------
moderation
 
Where : moderation.php
When : At the start of moderation.php
Input : The id of the moderation step which is run (read-only).
Return : none
 
This hook can be used for logging moderator actions. You can
use the $PHORUM-array to retrieve additional info like the
moderating user's id and similar.
 
The moderation step id is the variable $mod_step that is used in
moderation.php. Please read that script to see what moderation
steps are available and for what moderation actions they stand.
 
When checking the moderation step id for a certain step, always use
the contstants that are defined for this in include/constants.php.
The numerical value of this id can change between Phorum releases.
 
----------------------------------------------------------------------------
move_thread
 
Where : moderation.php
When : Right after a thread has been moved by a moderator.
Input : The id of the thread that has been moved (read-only).
Return : none
 
This hook can be used for performing actions like sending notifications
or for making log entries after moving a thread.
 
----------------------------------------------------------------------------
pm_sent
 
Where : include/controlcenter/pm.php
When : Right after a PM and its email notifications have been sent.
Input : Array containing the private message data (read-only).
Return : none
 
This hook can be used for performing actions after sending a PM. Before
PM notification by email was put in the Phorum core, this hook was
used to send those notifications.
 
----------------------------------------------------------------------------
post_edit
 
Where : include/moderation_functions.php
When : Right after storing an edited message in the database.
Input : Array containing message data (read-only).
Return : none
 
This hook can be used for sending notifications or for making log entries
in the database when editing takes place.
 
----------------------------------------------------------------------------
post_post
 
Where : post.php
When : Right after storing a new message in the database and just
before the user is redirected back to the list.
Input : Array containing message data (read-only).
Return : none
 
This hook can be used for performing actions based on what the message
contained.
 
----------------------------------------------------------------------------
posting_permission
 
Where : posting.php
When : Right after Phorum has determined all abilities that apply
to the logged in user.
Input : none
Ouput : none
 
This hook can be used for setting up custom abilities and permissions
for users, by updating the applicable fields in $GLOBALS["PHORUM"]["DATA"]
(e.g. for giving certain users the right to make postings sticky, without
having to make the full moderator for a forum).
 
Read the code in posting.php before this hook is called to find out
what fields can be used.
 
Beware: Only use this hook if you know what you are doing and understand
Phorum's editor permission code. If used wrong, you can open up security
holes in your Phorum installation!
 
----------------------------------------------------------------------------
pre_edit
 
Where : include/moderation_functions.php
When : Right before storing an edited message in the database.
Input : Array containing message data.
Return : Same as Input
 
This hook can be used for changing the message data before storing it
in the database.
 
----------------------------------------------------------------------------
pre_post
 
Where : post.php
When : Right before storing a new message in the database.
Input : Array containing message data.
Return : Same as Input
 
This hook can be used for changing the message data before storing it
in the database.
 
----------------------------------------------------------------------------
profile
 
Where : profile.php and include/controlcenter/summary.php
When : Right before a user profile is displayed.
Input : Array containing user profile data.
Return : Same as Input
 
This hook can be used for making changes to the profile data. This
is for displaying purposes only, so the changes are not stored in the
database.
 
----------------------------------------------------------------------------
quote
 
Where : reply.php, read.php (for inline reply form support)
When : Right after the message to reply to has been loaded.
Input : Array containing:
0 => The message author
1 => The message body
Return : The quoted body to use in the post form.
 
When quoting a message for reply, by default Phorum formats quoted
messages using an old school email style of quoting. By using the quote
hook, you can implement a different quoting mechanism.
 
Your hook function will retrieve an array containing two elements:
the author and the body of the message to be quoted. The return
value for your hook function must be the quoted body that will
be pre-filled into the reply form.
 
The BBCode module that is distributed with Phorum has a quote hook
function. Because it does not make sense to have more than one quote
hook active, the BBCode module has an option to disable its quote hook
function. You need to make sure that its quote hook function is disabled
when using your own quote hook.
 
----------------------------------------------------------------------------
read
 
Where : read.php
When : Right before messages are formatted for displaying.
Input : Array of messages.
Return : Same as Input
 
This hook can be used for making changes to the message data when
reading messages. This is for displaying purposes only, so the
changes are not stored in the database.
 
----------------------------------------------------------------------------
read_user_info
 
Where : read.php post.php include/moderation_functions.php
When : Right after retrieving user data.
Input : Array of users.
Return : Same as Input
 
This hook can be used for changing information for the users before
being displayed. For example: add a border around user signatures.
This is for displaying purposes only, so the changes are not stored
in the database.
 
----------------------------------------------------------------------------
readthreads
 
Where : read.php
When : At the start of the threaded read handling, just before
sorting and displaying the threads.
Input : Array of messages.
Return : Same as Input
 
This hook does exactly the same as the read hook, except that this
one is only applied to messages when viewing the message list in
threaded mode.
 
----------------------------------------------------------------------------
reopen_thread
 
Where : moderation.php
When : Right after a thread has been reopened by a moderator.
Input : The id of the thread that has been reopened (read-only).
Return : Same as Input
 
This hook can be used for performing actions like sending notifications
or making log entries after reopening threads.
 
----------------------------------------------------------------------------
report
 
Where : report.php
When : Just before a reported message is sent to the moderators.
Input : Array with maildata (see report.php for the exact contents).
Return : Same as Input
 
This hook can be used for changing the report data that will be
sent to the moderators or for performing actions like making log
entries.
 
----------------------------------------------------------------------------
sanity_checks
 
Where : include/admin/sanity_checks.php
When : Just before the admin interface's sanity checks are run
Input : Array with sanity checks. Each sanity check is an array with:
function => The function that runs the sanity check
description => A description to show in the admin interface
Return : Same as Input
 
This hook can be used to add custom sanity checks to the admin
interface option "System Sanity Checks".
 
Each checking function is expected to return an array containing
two elements:
 
[0] A status, which can be one of
PHORUM_SANITY_OK No problem found
PHORUM_SANITY_WARN Problem found, but no fatal one
PHORUM_SANITY_CRIT Critical problem found
 
[1] A description of the problem that was found or NULL.
 
A general checking function looks like this:
 
function check_foo() {
$check_ok = ...some check...;
if (!$check_ok) {
return array(PHORUM_SANITY_CRIT, "Foo went wrong because ...");
} else {
return array(PHORUM_SANITY_OK, NULL);
}
}
 
----------------------------------------------------------------------------
scheduled
 
Scheduled hook functions are similar to external ones, except these
functions do not require any input from the command line. The modules
containing a scheduled hook are invoked by running script.php with
the --scheduled argument (no module name is taken; this argument
will run all scheduled hooks for all available modules).
 
Like the name of the hook already suggests, this hook can be used for
creating tasks which have to be executed on a regular basis. To
archieve this, you can let script.php run from a scheduling
service (like a cron job on a UNIX system).
 
In general, scheduled hooks are used for automating tasks you want
to execute without having to perform any manual action. Practical
uses for a scheduled hook could be housekeeping (cleanup of
stale/old data), daily content generation (like sending daily digests
containing all posted messages for that day) or forum statistics
generation.
 
Mind that for using a scheduled hook, the module in which it is
handled must be enabled in your admin interface. So if a scheduled
hook is not running, the containing module might be disabled.
 
To run the scheduled hook from the command line or from a scheduling
service, you have to be in the phorum installation directory. So
running the scheduled hooks for your Phorum installation would
be done like this on a UNIX system prompt:
 
# cd /your/phorum/dir
# php ./script.php --scheduled
 
When creating a scheduling service entry for running this
automatically, then remind to change the directory as well.
You might also have to use the full path to your PHP binary
(/usr/bin/php or whatever it is on your system), because
the scheduling service might not know the path to it. An entry
for the cron system on UNIX could look like this:
 
0 0 * * * cd /your/phorum/dir && /usr/bin/php ./script.php --scheduled
 
Please refer to your system's documentation to see how to
use your system's scheduling service.
 
----------------------------------------------------------------------------
search
 
Where : search.php
When : Right before messages are formatted for displaying.
Input : Array of messages.
Return : Same as Input
 
This hook can be used for making changes to the message data when
searching for messages. This is for displaying purposes only, so the
changes are not stored in the database.
 
----------------------------------------------------------------------------
send_mail
 
Where : include/email_functions.php in the function phorum_email_user()
When : Right before email is sent using PHP's mail() function.
Input : Array with maildata (read-only) containing:
addresses => Array of e-mail addresses,
from => The sender address,
subject => The mail subject,
body => The mail body,
bcc => Whether to use Bcc for mailing multiple recipients
Return : true/false - see description
 
This hook can be used for implementing an alternative mail sending
system (e.g. like the SMTP module does). The hook should return true if
Phorum should still send the mails himself. If you do not want to have
Phorum send the mails also, return false.
 
----------------------------------------------------------------------------
user_list
 
Where : include/users.php include/controlcenter/groupmod.php
When : Whenever phorum_user_get_list() is called.
Input : Array containing:
<user_id> => <data>
Where <data> is an array containing:
username => the username for the user
displayname => the way to display the username
Return : Same as Input
 
This hook can be used for reformatting the list of users in some
way, such as changing the sort order or changing the format of
the displayed names.
 
 
4.2 Template hooks
------------------
 
Template hooks are called from within Phorum's template files.
These hooks can be used to extend the user interface with custom
elements. From a hook function for one of these template hooks, the
module writer can print the HTML code that has to be added to the
interface at the postition of the hook call in the template.
 
 
----------------------------------------------------------------------------
tpl_editor_after_subject
 
Where : posting_messageform.tpl
When : After the Subject: field in the message editor.
Input : none
Return : none
 
This hook can be used to add custom form fields to the message editor.
In the default template, the hook is run from within a two column table.
Column one contains the labels and column two the form fields. So your
hook function for adding a field to the editor could look like this:
 
function phorum_mod_foo_tpl_editor_after_subject()
{
$value = isset($_POST["mod_foo"]) ? $_POST["mod_foo"] : "";
?>
<tr>
<td>
Foo field
</td>
<td>
<input type="text" name="mod_foo"
value="<?php print htmlspecialchars($value) ?>"/>
</td>
</tr>
<?php
}
 
----------------------------------------------------------------------------
tpl_cc_usersettings
 
Where : cc_usersettings.tpl
When : After the built-in usersettings fields.
Input : Array containing the user's current profile.
Return : Same as Input
 
This hook can be used to add extra fields to the settings pages in the
user's control center. Here's an example hook function that will add
an extra field to the "Edit My Profile" page.
 
function phorum_mod_foo_tpl_cc_usersettings($profile)
{
// Check if we're on the userprofile page of cc_usersettings.tpl.
if (! isset($profile["USERPROFILE"]) || ! $profile["USERPROFILE"])
return;
 
$value = isset($profile["shoesize"])
? htmlspecialchars($profile["shoesize"]) : "";
?>
<tr>
<td>Shoe size</td>
<td><input name="shoesize" type="text" value="<?=$value?>"></td>
</tr>
<?php
}
 
----------------------------------------------------------------------------
tpl_editor_attachment_buttons
 
Where : posting_attachments_list.tpl
When : Before the delete button for an attachment.
Input : Array containing attachment information.
Return : Same as Input
 
This hook can be used to add extra buttons to each attachment in the
editor, so you can do custom actions for attachments.
 
To make your buttons look the same as Phorum's buttons, use the
CSS class "PhorumSubmit".
 
Here's an example hook function that will add a button to the attachments,
which will send a javascript alert to the user when clicked.
 
function phorum_mod_foo_tpl_editor_attachment_buttons($data)
{
$id = $data["file_id"];
?>
<input type="submit" class="PhorumSubmit" value="Say it!"
onclick="alert('You clicked attachment id <?php print $id ?>')" />
<?php
}
 
----------------------------------------------------------------------------
tpl_editor_before_textarea
 
Where : posting_messageform.tpl
When : Before the textarea.
Input : none
Return : none
 
This hook can be used to add custom user interface elements before the
textarea in the message editor.
 
----------------------------------------------------------------------------
tpl_editor_buttons
 
Where : posting_buttons.tpl
When : Before the main editor buttons (like Preview, Post and Cancel).
Input : none
Return : none
 
This hook can be used to add extra buttons to the editor buttons.
 
To make your buttons look the same as Phorum's buttons, use the
CSS class "PhorumSubmit".
 
Here's an example hook function that will add a button to the editor,
which will send a javascript alert to the user when clicked.
 
function phorum_mod_foo_tpl_editor_buttons()
{ ?>
<input type="submit" class="PhorumSubmit" value="Say it!"
onclick="alert('Hello, foo!')" />
<?php
}
 
 
6. Support
-------------------------------------------------------------------------------
 
If you have questions about creating modules for Phorum, please visit
the website http://phorum.org/ and ask the development team for help in
the Development forum.
 
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_multiplehooks/example_multiplehooks.php
New file
0,0 → 1,15
<?php
 
// This module demonstrates the use of multiple hooks in a single module.
 
if(!defined("PHORUM")) return;
 
function phorum_mod_example_multiplehooks_after_header () {
print "Hello";
}
 
function phorum_mod_example_multiplehooks_before_footer () {
print "World!";
}
 
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_multiplehooks/info.txt
New file
0,0 → 1,4
title: Multiplehooks example module
desc: This is a module that demonstrates the use of multiple hooks in one module. It will display "Hello" after the header and "World!" before the footer of each page.
hook: after_header|phorum_mod_example_multiplehooks_after_header
hook: before_footer|phorum_mod_example_multiplehooks_before_footer
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_settings/example_settings.php
New file
0,0 → 1,23
<?php
 
// This module demonstrates the use of settings for a Phorum module.
// This module will display a configurable string for a configurable
// number of times, right after the page header (how useful is that? :-).
 
if(!defined("PHORUM")) return;
 
function phorum_mod_example_settings_after_header () {
$PHORUM = $GLOBALS["PHORUM"];
 
// Apply default values for the settings.
if (empty($PHORUM["mod_example_settings"]["displaytext"]))
$PHORUM["mod_example_settings"]["displaytext"] = "Hello, world!";
if (!isset($PHORUM["mod_example_settings"]["displaycount"]))
$PHORUM["mod_example_settings"]["displaytext"] = 1;
 
for ($i = 0; $i < $PHORUM["mod_example_settings"]["displaycount"]; $i++) {
print $PHORUM["mod_example_settings"]["displaytext"] . " ";
}
}
 
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_settings/settings.php
New file
0,0 → 1,64
<?php
 
// Make sure that this script is loaded from the admin interface.
if(!defined("PHORUM_ADMIN")) return;
 
// Save settings in case this script is run after posting
// the settings form.
if(count($_POST))
{
// Create the settings array for this module.
$PHORUM["mod_example_settings"] = array(
"displaytext" => $_POST["displaytext"],
"displaycount" => $_POST["displaycount"],
);
 
// Force the displaycount to be an integer value.
settype($PHORUM["mod_example_settings"]["displaycount"], "int");
 
if(! phorum_db_update_settings(array("mod_example_settings"=>$PHORUM["mod_example_settings"]))) {
$error="Database error while updating settings.";
} else {
echo "Settings Updated<br />";
}
}
 
// Apply default values for the settings.
if (!isset($PHORUM["mod_example_settings"]["displaytext"]))
$PHORUM["mod_example_settings"]["displaytext"] = "";
if (!isset($PHORUM["mod_example_settings"]["displaycount"]))
$PHORUM["mod_example_settings"]["displaycount"] = 1;
 
// We build the settings form by using the PhorumInputForm object. When
// creating your own settings screen, you'll only have to change the
// "mod" hidden parameter to the name of your own module.
include_once "./include/admin/PhorumInputForm.php";
$frm = new PhorumInputForm ("", "post", "Save");
$frm->hidden("module", "modsettings");
$frm->hidden("mod", "example_settings");
 
// Here we display an error in case one was set by saving
// the settings before.
if (!empty($error)) {
echo "$error<br />";
}
 
// This adds a break line to your form, with a description on it.
// You can use this to separate your form into multiple sections.
$frm->addbreak("Edit settings for the example_settings module");
 
// This adds a text message to your form. You can use this to
// explain things to the user.
$frm->addmessage("This is the settings screen for the example_settings module. This module is only written for demonstrating the use of a settings screen for you own modules. The module itself will display a configurable text for a configurable number of times on screen.");
 
// This adds a row with a form field for entering the display text.
$frm->addrow("Text to display (default: Hello, world!)", $frm->text_box('displaytext', $PHORUM["mod_example_settings"]["displaytext"], 50));
 
// This adds another row with a form field for entering the display count.
$frm->addrow("Number of times to display", $frm->text_box('displaycount', $PHORUM["mod_example_settings"]["displaycount"], 5));
 
// We are done building the settings screen.
// By calling show(), the screen will be displayed.
$frm->show();
 
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_settings/info.txt
New file
0,0 → 1,3
title: Settings example module
desc: This is a module that demonstrates the support module settings in a multiple file module.
hook: after_header|phorum_mod_example_settings_after_header
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_check_post/example_check_post.php
New file
0,0 → 1,19
<?php
 
// This module demonstrates how a hook function for the check_post
// hook could be written.
 
if(!defined("PHORUM")) return;
 
function phorum_mod_example_check_post_check_post ($args) {
list ($message, $error) = $args;
if (!empty($error)) return $args;
 
if (stristr($message["body"], "bar") !== false) {
return array($message, "The body may not contain 'bar'");
}
return $args;
}
 
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_check_post/info.txt
New file
0,0 → 1,3
title: Check_post example module
desc: This is a module that demonstrates how to use the check_post hook. It will disallow the use of the string "bar" in the message body.
hook: check_post|phorum_mod_example_check_post_check_post
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/lang/french.php
New file
0,0 → 1,3
<?php
$PHORUM["DATA"]["LANG"]["example_language"]["HelloWorld"] = "Salut le Monde!";
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/lang/dutch.php
New file
0,0 → 1,3
<?php
$PHORUM["DATA"]["LANG"]["example_language"]["HelloWorld"] = "Hallo, wereld!";
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/lang/english.php
New file
0,0 → 1,3
<?php
$PHORUM["DATA"]["LANG"]["example_language"]["HelloWorld"] = "Hello, world!";
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/lang/german.php
New file
0,0 → 1,3
<?php
$PHORUM["DATA"]["LANG"]["example_language"]["HelloWorld"] = "Hallo, Welt!";
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/example_language.php
New file
0,0 → 1,10
<?php
 
if(!defined("PHORUM")) return;
 
function phorum_mod_example_language_after_header () {
$PHORUM = $GLOBALS["PHORUM"];
print $PHORUM["DATA"]["LANG"]["example_language"]["HelloWorld"];
}
 
?>
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/example_language/info.txt
New file
0,0 → 1,4
title: Language example module
desc: This is a module that demonstrates the support of multiple languages in a multiple file module.
hook: lang|
hook: after_header|phorum_mod_example_language_after_header
/trunk/client/phorum/bibliotheque/phorum/docs/example_mods/helloworld.php
New file
0,0 → 1,19
<?php
 
// This is an example of a single file module for Phorum. Almost all
// programming courses start out with building a program that displays
// "Hello, world!" on screen. The Phorum developers have followed
// the tradition and created "Hello, world!" for the Phorum module
// system.
 
if(!defined("PHORUM")) return;
 
/* phorum module info
title: Single file "Hello, world!" module
desc: This is an example of a single file module. The module will display "Hello, world!" after displaying the page header.
hook: after_header|phorum_mod_helloworld_after_header
*/
 
function phorum_mod_helloworld_after_header () {
print "Hello, world!";
}