コード例 #1
0
Bug fixes:
*/
require_once dirname(__FILE__) . "/../ext/BlogPost/BlogPost.php";
global $base_url, $network_info;
$user = get_login_user();
filter_all_post($_REQUEST);
filter_all_post($_POST, FALSE, TRUE);
// don't strip html *everywhere*, just strip bad tags - or we'll mutilate any html content.
// TO DO: This array should be populated from the database.
$sb_types = array('event' => array(array('caption' => 'Generic', 'sb_mc_type' => 'event/generic'), array('caption' => 'Conference', 'sb_mc_type' => 'event/conference'), array('caption' => 'Concert', 'sb_mc_type' => 'event/concert')), 'review' => array(array('caption' => 'Local Service', 'sb_mc_type' => 'review/localservice'), array('caption' => 'Event', 'sb_mc_type' => 'review/event'), array('caption' => 'Bar/Club', 'sb_mc_type' => 'review/club'), array('caption' => 'Restaurant', 'sb_mc_type' => 'review/restaurant'), array('caption' => 'Café', 'sb_mc_type' => 'review/cafe'), array('caption' => 'Hotel/Resort', 'sb_mc_type' => 'review/hotel'), array('caption' => 'Book', 'sb_mc_type' => 'review/book'), array('caption' => 'Album', 'sb_mc_type' => 'review/album'), array('caption' => 'Article', 'sb_mc_type' => 'review/article'), array('caption' => 'Magazine', 'sb_mc_type' => 'review/magazine'), array('caption' => 'Movie', 'sb_mc_type' => 'review/movie'), array('caption' => 'Software', 'sb_mc_type' => 'review/software'), array('caption' => 'Song', 'sb_mc_type' => 'review/song'), array('caption' => 'Website', 'sb_mc_type' => 'review/website')));
if ($_POST) {
    $succ_msg = NULL;
    // check to see if there are any errors
    $SbHelper = new SbHelper();
    $SbHelper->set_mc_type($_REQUEST['sb_mc_type']);
    $error_array = $SbHelper->processForm();
    // check for album creation
    if (@$_POST['new_album']) {
        // try to create new album
        $save_alb = createalbum();
        if ($save_alb['error'] == TRUE) {
            array_push($error_array, $save_alb['msg']);
        } else {
            $created_album_id = $save_alb;
        }
    }
    if (sizeof($error_array) && $_POST['save_publish_post'] == TRUE) {
        $post_err = "Your post could not be saved due to the following errors:<br />";
        $err = @implode('<br />', $error_array);
        $post_err .= $err;
    }