As a seven year PHP web developer, I decided to start helping people create their own things buy providing classes or libraries.
This is actually my first attempt at creating a framework to help people.
The idea originally came to my head when people found A LOT of forums did not suit their needs or the developers wouldn't add the features you requested, which led to a custom. Some people have really good PHP knowledge to create one or very little.
The framework can be integrated into CMS's or custom site code, so either way it's flexible and fast for whatever needs.
The framework is a bunch of library and classes that uses PHP's PDO extension for database abstraction.
It uses PHP's interfaces, classes, class extending, interface implementing,. PHP chaining and reflection class.
PHP 5.3 is a HIGH must have.
The framework supports the basic and hard stuff that is needed, it's just your job to piece the framework together in your application(s).
What's supported?
- Categories
- Forums
- Boards
- Threads
- Topics
- Replies
- Post count
- Breadcrumbs
- Announcement topics
- Members
- Category re-ordering
- MySQL & PostGreSQL databases (more can be added)
- Private messaging (Creating, recieving and replying)
- Private messaging folders
- E-mail topic to friend
- FAQ system
- Post icons
- Signatures
- Avatars
- HTML
- Emotions (need to provide your own)
- Session manager
- Login security and authentication
- Sha1 hashed passwords
- And a little more..
To be done
- BBCode (partly done)
- Groups
- Access rights
- Banning
- Buddy list
- Ignore list
- Moderators
- Ranks
- Subscribe to forum
- Subscribe to thread
- Templating
- Admin
Quick example
This example creates a forum and checks if an announcement has been created.
More examples in the download.
PLEASE NOTE: Usually you just have to include tff.php. I included all files for example purposes.
Code:
<?php
define( 'LOAD_TFF', true );
define( 'TFF_ROOT', '../src' );
define( 'TFF_DSN', 'dbi.mysql://root:bluh@localhost/tff_dev?persist' );
define( 'TFF_DS_PREFIX', 'tff_' );
ini_set( 'include_path', ini_get( 'include_path' ) . PATH_SEPARATOR . TFF_ROOT .
PATH_SEPARATOR . TFF_ROOT . '/lang' .
PATH_SEPARATOR . TFF_ROOT . '/util' .
PATH_SEPARATOR . TFF_ROOT . '/PLI' .
PATH_SEPARATOR . TFF_ROOT . '/message' .
PATH_SEPARATOR . TFF_ROOT . '/test' );
// Pull in the rest of The Forum Framework
require_once( 'tff_en.php' );
require_once( 'class_tff.iobserver.php' );
require_once( 'class_tff.iobservable.php' );
require_once( 'class_tff.imessage.php' );
require_once( 'class_tff.ipostbreadcrumb.php' );
require_once( 'class_tff.observableimpl.php' );
require_once( 'class_tff.message.categoryadd.php' );
require_once( 'class_tff.message.forumadd.php' );
require_once( 'class_tff.message.memberadd.php' );
require_once( 'class_tff.iorderable.php' );
require_once( 'class_tff.istorable.php' );
require_once( 'class_tff.bbexception.php' );
require_once( 'class_tff.pli.pliexception.php' );
require_once( 'class_tff.pli.php' );
require_once( 'class_tff.board.php' );
require_once( 'class_tff.member.php' );
require_once( 'class_tff.category.php' );
require_once( 'class_tff.forum.php' );
require_once( 'class_tff.post.php' );
require_once( 'class_tff.thread.php' );
require_once( 'class_tff.announcement.php' );
require_once( 'class_tff.bbutil.php' );
print "<h2>Now let's load a forum...</h2>\n";
$testForum = new Tff_Forum();
$testForum->load( 1 );
print nl2br( $testForum->debugDumpProperties() );
/*
$testForum->setName( 'Yet Another Forum' );
$testForum->setAbout( 'Testing updating a forum' );
$testForum->setOrder( 40 );
$testForum->setCategoryId( 9999 );
print "<hr />\n";
print nl2br( $testForum->debugDumpProperties() );
*/
/*
$testForum->getObservable()->attach( new Tff_Category() );
$testForum->add();
$testForum->update();
print "<hr />\n";
print nl2br( $testForum->debugDumpProperties() );
*/
print "<hr />\n";
/*
print "<h2>All Threads for this Forum</h2>\n";
foreach ( $testForum->getAllThreads() as $currentThread )
{
print nl2br( $currentThread->debugDumpProperties() );
print "<h4>----</h4>\n";
print nl2br( $currentThread->getLatestPoster()->debugDumpProperties() );
print "<h4>--------</h4>\n";
print nl2br( $currentThread->getAuthor()->debugDumpProperties() );
print "<br /><br />\n";
}
print "<hr />\n";
print "<h2>Some Threads for this Forum</h2>\n";
foreach ( $testForum->getSomeThreads( 0, 1 ) as $currentThread )
{
print nl2br( $currentThread->debugDumpProperties() );
print "<h4>----</h4>\n";
print nl2br( $currentThread->getLatestPoster()->debugDumpProperties() );
print "<h4>--------</h4>\n";
print nl2br( $currentThread->getAuthor()->debugDumpProperties() );
print "<br /><br />\n";
}
*/
print "<h2>All Announcements for this Forum</h2>\n";
foreach ( $testForum->getAllAnnouncements() as $currentAnn )
{
print nl2br( $currentAnn->debugDumpProperties() );
print "<h4>----</h4>\n";
print nl2br( $currentAnn->getAuthor()->debugDumpProperties() );
print "<br /><br />\n";
}
/* EOF */
Download includes documentation, examples and the framework.
The Forum Framework.zip