The Forum Framework

Results 1 to 13 of 13
  1. #1
    Apprentice Dechesnes is offline
    MemberRank
    Oct 2010 Join Date
    North YorkshireLocation
    7Posts

    The Forum Framework

    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


  2. #2
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: The Forum Framework

    Thanks a lot. This is great work.

  3. #3

    Re: The Forum Framework

    Awesome work, but BBcode for more awesomeness. D:

  4. #4
    Software Engineer Evil[]Power is offline
    MemberRank
    Apr 2010 Join Date
    Look behind...Location
    1,191Posts

    Re: The Forum Framework

    Whoa thanks a lot , so we can creat forum designs with that or what? plz explain , Thanks!

  5. #5
    Apprentice Dechesnes is offline
    MemberRank
    Oct 2010 Join Date
    North YorkshireLocation
    7Posts

    Re: The Forum Framework

    Depends on your term 'design'. The whole point of it, is to help people create their own forum software. Code it from the ground up.
    Last edited by Dechesnes; 05-10-10 at 11:48 AM.

  6. #6
    Software Engineer Evil[]Power is offline
    MemberRank
    Apr 2010 Join Date
    Look behind...Location
    1,191Posts
    Ahh ok i just found the point of it , it's great man thx!

    Ok , i see , downloaded it but it sounds all confusing if someone could post a tutorial ( i prefer video tuts) on how to use it , please thanks!
    Last edited by CrashOveride; 08-10-10 at 02:41 AM.

  7. #7
    Account Upgraded | Title Enabled! Bonitão is offline
    MemberRank
    May 2009 Join Date
    795Posts

    Re: The Forum Framework

    evilpower this is a framework.. meaning its not just download, install then run, a framework like helps you code things, like usually makes it simpler to do things i aint explaining it right but i hope you know what i mean, if you dont just find the definition of framework

  8. #8
    win CioNide is offline
    MemberRank
    Jun 2008 Join Date
    2,560Posts

    Re: The Forum Framework

    Can I see some screenshots?

  9. #9
    Software Engineer Evil[]Power is offline
    MemberRank
    Apr 2010 Join Date
    Look behind...Location
    1,191Posts

    Re: The Forum Framework

    Quote Originally Posted by MeetMeInHabbo View Post
    evilpower this is a framework.. meaning its not just download, install then run, a framework like helps you code things, like usually makes it simpler to do things i aint explaining it right but i hope you know what i mean, if you dont just find the definition of framework
    Okay thanks!

  10. #10
    Apprentice Dechesnes is offline
    MemberRank
    Oct 2010 Join Date
    North YorkshireLocation
    7Posts

    Re: The Forum Framework

    Quote Originally Posted by Myco View Post
    Can I see some screenshots?
    Screenshots of what? I'm currently building a forum based around the framework.

  11. #11
    Novice HostGeek is offline
    MemberRank
    Oct 2010 Join Date
    4Posts

    Re: The Forum Framework

    Woah, This is awesome! Thanks a lot!

  12. #12
    Account Upgraded | Title Enabled! tycob is offline
    MemberRank
    Nov 2009 Join Date
    Installation 04Location
    263Posts

    Re: The Forum Framework

    This is wicked! Nice one! Hoping for finished one!Could give me the SQL code?
    Last edited by tycob; 26-11-10 at 12:11 AM.

  13. #13
    Ginger by design. jMerliN is offline
    MemberRank
    Feb 2007 Join Date
    2,497Posts

    Re: The Forum Framework

    1. Bad naming convention.
    2. Exceptions are bad.
    3. Inefficient implementation of database-driven sessions. Named sessions unsupported -- this is bad. Also, no session level security whatsoever. Also, this may cause much weirdness if anyone decides to add AJAX capabilities to pages using this framework.
    4. No SSL awareness and proper SSL enforcement capabilities.
    5. PW Hashes aren't salted.
    6. Variable notation does not distinguish between untrusted input and trusted input. I didn't look over all of the code so I'll say that I'll bet there's an XSS in there somewhere, I'm just too lazy to find it.
    7. I didn't see any code detecting DB charset. In modern web dev, esp for discussion software, charset is highly important.


    I didn't do a thorough code review so I can't really comment on the correctness or implementation specific details, I just looked for what I found to be pretty big issues.

    Otherwise it looks like it's pretty well written for the features it provides.



Advertisement