Development

HowToIntegrateWordPressAndBbPressWithSymfony (diff)

You must first sign up to be able to contribute.

Changes between Version 1 and Version 2 of HowToIntegrateWordPressAndBbPressWithSymfony

Show
Ignore:
Author:
Michael.Nolan (IP: 82.68.59.25)
Timestamp:
03/18/07 23:42:14 (11 years ago)
Comment:

Make PHP syntax highlight and remove wiki links on WordPress?

Legend:

Unmodified
Added
Removed
Modified
  • HowToIntegrateWordPressAndBbPressWithSymfony

    v1 v2  
    1 = How To Integrate WordPress and bbPress with symfony = 
     1= How To Integrate !WordPress and bbPress with symfony = 
    22 
    33''Based on a [http://www.symfony-project.com/forum/index.php/m/23710/#msg_23710 forum post]'' 
    44 
    5 This article is based on my experience of creating the website [http://hi.edgehill.ac.uk/]. A bit of background to the site - it's aimed at people who've applied to the University to provide them with an insight to student life. It provides forums (bbPress), blogs from current students (WordPress MU) and other content features (symfony). The whole project has taken about 4-8 man weeks. 
     5This article is based on my experience of creating the website [http://hi.edgehill.ac.uk/]. A bit of background to the site - it's aimed at people who've applied to the University to provide them with an insight to student life. It provides forums (bbPress), blogs from current students (!WordPress MU) and other content features (symfony). The whole project has taken about 4-8 man weeks. 
    66 
    77Symfony provides the core functionality and ties everything together. Users register via the site with data pulled in from a legacy Oracle database holding information about applicants - this ensures that only real applicants can register. Once users are approved (either self registering or automatically via the invite link we sent through a mail merged email) they are added to the main University LDAP server. This allows (selected) staff and students to log in with their normal username/password rather than having to register again. 
    88 
    9 Integration with WordPress/bbPress is in three main areas: 
     9Integration with !WordPress/bbPress is in three main areas: 
    1010 
    1111== Login == 
    1212 
    13 All logins are done though symfony, login forms in *Press either submit their data to a symfony action or a (*Press) filter intercepts the request and redirects them to the symfony login page. Once they are logged in to a symfony session they can go back to *Press and will be automatically logged in. The idea is to replace functions provided in the pluggable.php file. I replace bb_check_login(), bb_current_user() and bb_logout() in bbPress and similar functions in WordPress. I use database storage for sessions and query this to determine if the user is logged in. If symfony says the user exists but *Press doesn't have a corresponding user then we add them to the database. 
     13All logins are done though symfony, login forms in *Press either submit their data to a symfony action or a (*Press) filter intercepts the request and redirects them to the symfony login page. Once they are logged in to a symfony session they can go back to *Press and will be automatically logged in. The idea is to replace functions provided in the pluggable.php file. I replace bb_check_login(), bb_current_user() and bb_logout() in bbPress and similar functions in !WordPress. I use database storage for sessions and query this to determine if the user is logged in. If symfony says the user exists but *Press doesn't have a corresponding user then we add them to the database. 
    1414 
    1515{{{ 
    1616#!php 
     17<?php 
    1718function get_currentuserinfo() { 
    1819        global $current_user, $wpdb; 
    3132        wp_set_current_user(0, $user_login); 
    3233} 
     34?> 
    3335}}} 
    3436 
    3941{{{ 
    4042#!php 
     43<?php 
    4144function bb_use_display_name( $name, $id ) { 
    4245    $user = bb_get_user( $id ); 
    5053add_filter( 'get_post_author', 'bb_use_display_name', 1, 2 ); 
    5154add_filter( 'get_user_name', 'bb_use_display_name', 1, 2 ); 
     55?> 
    5256}}} 
    5357 
    5660== RSS Feeds == 
    5761 
    58 The final key integration between symfony and bbPress/WordPress makes extensive use of sfFeed2Plugin which came along right on cue! In parts of the site where we want to include things like the latest blog or forum posts, I insert a component to load the data from *Press. Rather than querying the table directly, which would certainly be possible, I instead download an RSS feed and use information from that. This means that I don't have to reimplement the URL writing rules in symfony - *Press already knows what link should be provided for each item in the feed. Components are cached for between 10 minutes and a couple of hours to reduce the load time but keep the site fresh. 
     62The final key integration between symfony and bbPress/!WordPress makes extensive use of sfFeed2Plugin which came along right on cue! In parts of the site where we want to include things like the latest blog or forum posts, I insert a component to load the data from *Press. Rather than querying the table directly, which would certainly be possible, I instead download an RSS feed and use information from that. This means that I don't have to reimplement the URL writing rules in symfony - *Press already knows what link should be provided for each item in the feed. Components are cached for between 10 minutes and a couple of hours to reduce the load time but keep the site fresh.