Example #1
0
         require_once USERS_PKG_PATH . 'RoleUser.php';
     } else {
         require_once USERS_PKG_PATH . 'BitUser.php';
     }
     $eventUser = new BitUser();
     $userData = $eventUser->getUserInfo(array('user_id' => $_REQUEST['user_id']));
     // dont try and fool me
     if (!empty($userData)) {
         $userName = $userData['real_name'] ? $userData['real_name'] : $userData['login'];
         $rss->title = $userName . " at " . $gBitSystem->getConfig('site_title');
         $listHash['user_id'] = $_REQUEST['user_id'];
     }
 }
 if (!empty($_REQUEST['event_id'])) {
     $listHash['event_id'] = $_REQUEST['event_id'];
     $gEvent = new BitEvents($_REQUEST['event_id']);
     $gEvent->load();
     if (isset($gEvent->mContentId)) {
         // adjust feed title to event title
         $rss->title = $gEvent->getTitle() . " at " . $gBitSystem->getConfig('site_title');
         if (isset($userName)) {
             $rss->title = $userName . "'s Events in " . $rss->title;
         }
         $rss->description = $gEvent->parseData();
     }
 }
 $feeds = $event->getList($listHash);
 // set the rss link
 $rss->link = 'http://' . $_SERVER['HTTP_HOST'] . EVENTS_PKG_URL . (!empty($_REQUEST['event_id']) ? "?event_id=" . $_REQUEST['event_id'] : "");
 // get all the data ready for the feed creator
 foreach ($feeds as $feed) {
Example #2
0
/**
 * Params:
 * - title : if is "title", show the title of the post, else show the date of creation
 *
 * @version $Header$
 * @package blogs
 * @subpackage modules
 */
/**
 * required setup
 */
if (!defined('MAX_EVENTS_PREVIEW_LENGTH')) {
    define('MAX_EVENTS_PREVIEW_LENGTH', 100);
}
include_once EVENTS_PKG_PATH . 'BitEvents.php';
global $gBitSmarty, $gQueryUserId, $gBitSystem, $moduleParams;
$module_rows = $moduleParams['module_rows'];
$module_params = $moduleParams['module_params'];
$module_title = isset($moduleParams['title']) ? $moduleParams['title'] : tra("Upcoming Events");
$_template->tpl_vars['moduleTitle'] = new Smarty_variable($module_title);
$listHash = array('max_records' => $module_rows, 'parse_split' => !empty($module_params['preview']) && $module_params['preview'] ? TRUE : FALSE, 'sort_mode' => !empty($module_params['random']) && $module_params['random'] ? 'random' : 'event_time_asc', 'event_after' => $gBitSystem->getUTCTime(), 'event_before' => $gBitSystem->getUTCTime() + 60 * 60 * 24 * $gBitSystem->getConfig('events_upcoming_limit', 7));
/* Support for selecting entries only from one or more categories */
if (isset($module_params['pigeonholes'])) {
    $listHash['pigeonholes']['filter'] = split(",", $module_params['pigeonholes']);
}
$events = new BitEvents();
$list = $events->getList($listHash);
$maxPreviewLength = !empty($module_params['max_preview_length']) ? $module_params['max_preview_length'] : MAX_EVENTS_PREVIEW_LENGTH;
$_template->tpl_vars['maxPreviewLength'] = new Smarty_variable($maxPreviewLength);
$_template->tpl_vars['modUpcomingEvents'] = new Smarty_variable($list);
$_template->tpl_vars['eventsPackageActive'] = new Smarty_variable($gBitSystem->isPackageActive('events'));
Example #3
0
/**
 * @version $Header$
 * Copyright (c) 2004 bitweaver Events
 * @package events
 * @subpackage functions
 */
/**
 * required setup
 */
global $gContent;
require_once EVENTS_PKG_PATH . 'BitEvents.php';
require_once LIBERTY_PKG_PATH . 'lookup_content_inc.php';
// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if (empty($gContent) || !is_object($gContent) || !$gContent->isValid()) {
    // if events_id supplied, use that
    if (!empty($_REQUEST['events_id']) && is_numeric($_REQUEST['events_id'])) {
        $gContent = new BitEvents($_REQUEST['events_id']);
        // if content_id supplied, use that
    } elseif (!empty($_REQUEST['content_id']) && is_numeric($_REQUEST['content_id'])) {
        $gContent = new BitEvents(NULL, $_REQUEST['content_id']);
        // otherwise create new object
    } else {
        $gContent = new BitEvents();
    }
    //handle legacy forms that use plain 'events' form variable name
    // TODO not sure what this does - wolff_borg
    if (empty($gContent->mEventsId) && empty($gContent->mContentId)) {
    }
    $gContent->load();
    $gBitSmarty->assignByRef("gContent", $gContent);
}
Example #4
0
/**
 * Access calendar package to display event calendar
 *
 * @package  events
 * @version  $Header$
 * @author   nickpalmer
 */
/**
 * required setup
 */
require_once '../kernel/setup_inc.php';
require_once EVENTS_PKG_PATH . 'BitEvents.php';
if ($gBitSystem->isPackageActive('calendar')) {
    include_once CALENDAR_PKG_PATH . 'Calendar.php';
    $gBitSystem->verifyPermission('p_calendar_view');
    // now, lets get the ball rolling!
    $gCalendar = new Calendar();
    $gCalendar->processRequestHash($_REQUEST, $_SESSION['calendar']);
    // Setup which content types we want to view.
    $listHash['content_type_guid'] = array('bitevents');
    $events = new BitEvents();
    if (empty($_REQUEST['event_after'])) {
        $_REQUEST['event_after'] = $gBitSystem->getUTCTime();
    }
    $listevents = $events->getList($_REQUEST);
    // Build the calendar
    $gCalendar->buildCalendar($listHash, $_SESSION['calendar']);
    // And display it with a nice title.
    $gCalendar->display(tra('Events Calendar'), FALSE, EVENTS_PKG_URL . 'calendar.php');
}
Example #5
0
/**
 * @version $Header$
 *
 * @author nickpalmer
 * @package events
 * @subpackage functions
 */
require_once EVENTS_PKG_PATH . 'BitEvents.php';
/**
 * required setup
 */
$formEventsDisplayOptions = array("events_use_24" => array('label' => 'Use 24 Hour', 'note' => 'Time display uses 24 hour format.', 'type' => 'toggle'), "events_minute_interval" => array('label' => 'Minutes Interval', 'note' => 'Number of minute steps for the event time minute drop down ( default is 15 minutes ). Multiple of this time should be 60 minutes.', 'type' => 'input'), "events_end_year" => array('label' => 'Events End Year', 'note' => 'End year in events date set. Can be a specific year or +# (i.e. +1) to allow events a certain number of years in the future.', 'type' => 'input'), "events_upcoming_limit" => array('label' => 'Look ahead limit', 'note' => 'Number of days look ahead period to be used with upcoming events displays such as upcoming module.', 'type' => 'input'));
$gBitSmarty->assign('formEventsDisplayOptions', $formEventsDisplayOptions);
$formEventsFeatureOptions = array("events_moderation" => array('label' => 'Events Moderation', 'note' => 'Use content status to moderate events. Note, there is no UI for doing the moderation yet.', 'type' => 'toggle'), "events_show_primary" => array('label' => 'Auto Show Primary', 'note' => 'Automatically show the primary attachment.', 'type' => 'toggle'), "events_use_types" => array('label' => 'Use Event Types', 'note' => 'Use the event types features.', 'type' => 'toggle'), "events_allow_no_type" => array('label' => 'Allow No Types', 'note' => 'Include in the event types an empty choice.', 'type' => 'toggle'));
$gBitSmarty->assign('formEventsFeatureOptions', $formEventsFeatureOptions);
$be = new BitEvents();
$eventTypes = $be->loadEventTypes(true);
$gBitSmarty->assign('eventTypes', $eventTypes);
if (!empty($_REQUEST['events_preferences'])) {
    $events = array_merge($formEventsDisplayOptions, $formEventsFeatureOptions);
    foreach ($events as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, EVENTS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, EVENTS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, EVENTS_PKG_NAME);
        }
    }
    // Update some types?
    foreach ($eventTypes as $id => $data) {