本文整理汇总了PHP中DateTimeObj::get方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeObj::get方法的具体用法?PHP DateTimeObj::get怎么用?PHP DateTimeObj::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeObj
的用法示例。
在下文中一共展示了DateTimeObj::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __viewIndex
public function __viewIndex()
{
$this->setTitle(__('Symphony') . ' – ' . __('Users'));
$this->appendSubheading(__('Users'), Widget::Anchor(__('Add a User'), Administration::instance()->getCurrentPageURL() . '/new/', array('title' => __('Add a new User'), 'class' => 'create button')));
$users = new UserIterator();
$aTableHead = array(array(__('Name'), 'col'), array(__('Email Address'), 'col'), array(__('Last Seen'), 'col'));
$aTableBody = array();
$colspan = count($aTableHead);
if ($users->length() == 0) {
$aTableBody = array(Widget::TableRow(array(Widget::TableData(__('None found.'), array('class' => 'inactive', 'colspan' => $colspan))), array('class' => 'odd')));
} else {
foreach ($users as $u) {
## Setup each cell
$td1 = Widget::TableData(Widget::Anchor($u->getFullName(), Administration::instance()->getCurrentPageURL() . '/edit/' . $u->id . '/', array('title' => $u->username)));
$td2 = Widget::TableData(Widget::Anchor($u->email, 'mailto:' . $u->email, array('title' => 'Email this user')));
if ($u->last_seen != NULL) {
$td3 = Widget::TableData(DateTimeObj::get(__SYM_DATETIME_FORMAT__, strtotime($u->last_seen)));
} else {
$td3 = Widget::TableData('Unknown', array('class' => 'inactive'));
}
$td3->appendChild(Widget::Input('items[' . $u->id . ']', NULL, 'checkbox'));
## Add a row to the body array, assigning each cell to the row
$aTableBody[] = Widget::TableRow(array($td1, $td2, $td3));
}
}
$table = Widget::Table(Widget::TableHead($aTableHead), NULL, Widget::TableBody($aTableBody));
$this->Form->appendChild($table);
$tableActions = $this->createElement('div');
$tableActions->setAttribute('class', 'actions');
$options = array(array(NULL, false, 'With Selected...'), array('delete', false, 'Delete'));
$tableActions->appendChild(Widget::Select('with-selected', $options));
$tableActions->appendChild(Widget::Input('action[apply]', 'Apply', 'submit'));
$this->Form->appendChild($tableActions);
}
示例2: processDependencies
public function processDependencies(array $params = array())
{
$datasources = $this->getDependencies();
if (!is_array($datasources) || empty($datasources)) {
return;
}
$datasources = array_map(create_function('$a', "return str_replace('\$ds-', '', \$a);"), $datasources);
$datasources = array_map(create_function('$a', "return str_replace('-', '_', \$a);"), $datasources);
$env = array('today' => DateTimeObj::get('Y-m-d'), 'current-time' => DateTimeObj::get('H:i'), 'this-year' => DateTimeObj::get('Y'), 'this-month' => DateTimeObj::get('m'), 'this-day' => DateTimeObj::get('d'), 'timezone' => DateTimeObj::get('P'), 'enm-newsletter-id' => $this->newsletter_id);
$this->_env['param'] = $env;
$this->_env['env']['pool'] = $params;
$dependencies = array();
foreach ($datasources as $handle) {
$profiler = Symphony::Profiler();
$profiler->seed();
$pool[$handle] =& DatasourceManager::create($handle, NULL, false);
$dependencies[$handle] = $pool[$handle]->getDependencies();
}
$dsOrder = $this->__findDatasourceOrder($dependencies);
foreach ($dsOrder as $handle) {
$ds = $pool[$handle];
$ds->processParameters($this->_env);
$ds->grab($this->_env['env']['pool']);
unset($ds);
}
$this->processParameters($this->_env);
}
示例3: fetchMemberIDBy
/**
* Given an array or string as `$needle` and an existing `$member_id`
* this function will return the `$member_id` if the given
* password matches this `$member_id`, otherwise null.
*
* @param array|string $needle
* @param integer $member_id
* @return Entry|null
*/
public function fetchMemberIDBy($needle, $member_id)
{
if (is_array($needle)) {
extract($needle);
} else {
$password = $needle;
}
if (empty($password)) {
extension_Members::$_errors[$this->get('element_name')] = array('message' => __('\'%s\' is a required field.', array($this->get('label'))), 'type' => 'missing', 'label' => $this->get('label'));
return null;
}
$data = Symphony::Database()->fetchRow(0, sprintf("\n\t\t\t\t\tSELECT `entry_id`, `reset`\n\t\t\t\t\tFROM `tbl_entries_data_%d`\n\t\t\t\t\tWHERE `password` = '%s'\n\t\t\t\t\tAND `entry_id` = %d\n\t\t\t\t\tLIMIT 1\n\t\t\t\t", $this->get('id'), $password, Symphony::Database()->cleanValue($member_id)));
// Check that if the password has been reset that it is still valid
if (!empty($data) && $data['reset'] == 'yes') {
$valid_id = Symphony::Database()->fetchVar('entry_id', 0, sprintf("\n\t\t\t\t\t\tSELECT `entry_id`\n\t\t\t\t\t\tFROM `tbl_entries_data_%d`\n\t\t\t\t\t\tWHERE `entry_id` = %d\n\t\t\t\t\t\tAND DATE_FORMAT(expires, '%%Y-%%m-%%d %%H:%%i:%%s') > '%s'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t", $this->get('id'), $data['entry_id'], DateTimeObj::get('Y-m-d H:i:s', strtotime('now - ' . $this->get('code_expiry')))));
// If we didn't get an entry_id back, then it's because it was expired
if (is_null($valid_id)) {
extension_Members::$_errors[$this->get('element_name')] = array('message' => __('Recovery code has expired.'), 'type' => 'invalid', 'label' => $this->get('label'));
} else {
$fields = array('reset' => 'no', 'expires' => null);
Symphony::Database()->update($fields, 'tbl_entries_data_' . $this->get('id'), ' `entry_id` = ' . $valid_id);
}
}
if (!empty($data)) {
return $member_id;
}
extension_Members::$_errors[$this->get('element_name')] = array('message' => __('Invalid %s.', array($this->get('label'))), 'type' => 'invalid', 'label' => $this->get('label'));
return null;
}
示例4: handleShutdown
function handleShutdown()
{
$error = error_get_last();
if ($error !== NULL && $error['type'] <= 1) {
file_put_contents(DOCROOT . '/manifest/newsletter-log.txt', '[' . DateTimeObj::get('Y/m/d H:i:s') . '] pid: ' . getmypid() . ' - ' . $error['message'] . ' in file: ' . $error['file'] . ' on line ' . $error['line'] . "\r\n", FILE_APPEND);
}
}
示例5: initializeContext
/**
* Initialize contextual XML (formerly params)
*/
public function initializeContext()
{
$this->View->context->register(array('system' => array('site-name' => Symphony::Configuration()->core()->symphony->sitename, 'site-url' => URL, 'admin-url' => URL . '/symphony', 'symphony-version' => Symphony::Configuration()->core()->symphony->version), 'date' => array('today' => DateTimeObj::get('Y-m-d'), 'current-time' => DateTimeObj::get('H:i'), 'this-year' => DateTimeObj::get('Y'), 'this-month' => DateTimeObj::get('m'), 'this-day' => DateTimeObj::get('d'), 'timezone' => date_default_timezone_get())));
if ($this->User) {
$this->View->context->register(array('session' => self::instance()->User->fields()));
}
}
示例6: lastUpdateFilterList
public static function lastUpdateFilterList()
{
if (!file_exists(WORKSPACE . self::$file)) {
return false;
}
return DateTimeObj::get(DateTimeObj::getSetting('datetime_format'), filemtime(WORKSPACE . self::$file));
}
示例7: __switchboard
function __switchboard($type)
{
$this->_page = isset($this->_context[0]) ? $this->_context[0] : 'view';
$this->_id = !empty($this->_context[1]) && is_numeric($this->_context[1]) ? $this->_context[1] : 0;
$this->_flag = $this->_context[2];
// Notices
if (isset($this->_flag)) {
$result = null;
switch ($this->_flag) {
case 'edited':
$result = __('Category updated at %1$s.');
break;
case 'deleted':
$result = __('Category deleted');
break;
case 'created':
$result = __('Category created at %1$s. <a href="%2$s">Create another?</a>');
break;
}
if ($result) {
$this->pageAlert(__($result, array(DateTimeObj::get(__SYM_TIME_FORMAT__), BASE_URL . '/list/new/' . $this->_id)), Alert::SUCCESS);
}
}
$function = ($type == 'action' ? '__action' : '__view') . ($this->_page == 'view' ? 'Index' : ucfirst($this->_page));
if (!method_exists($this, $function)) {
if ($type == 'action') {
return;
}
$this->_Parent->errorPageNotFound();
}
return $this->{$function}();
}
示例8: processRecordGroup
function processRecordGroup(&$wrapper, $element, $group, $ds, &$Parent, &$entryManager, &$fieldPool, &$param_pool, $param_output_only = false)
{
$xGroup = new XMLElement($element, NULL, $group['attr']);
$key = 'ds-' . $ds->dsParamROOTELEMENT;
if (is_array($group['records']) && !empty($group['records'])) {
foreach ($group['records'] as $entry) {
$data = $entry->getData();
$fields = array();
$xEntry = new XMLElement('entry');
$xEntry->setAttribute('id', $entry->get('id'));
$associated_entry_counts = $entry->fetchAllAssociatedEntryCounts();
if (is_array($associated_entry_counts) && !empty($associated_entry_counts)) {
foreach ($associated_entry_counts as $section_id => $count) {
$section_handle = $Parent->Database->fetchVar('handle', 0, "SELECT `handle` FROM `tbl_sections` WHERE `id` = '{$section_id}' LIMIT 1");
$xEntry->setAttribute($section_handle, '' . $count . '');
}
}
if (isset($ds->dsParamPARAMOUTPUT)) {
if ($ds->dsParamPARAMOUTPUT == 'system:id') {
$param_pool[$key][] = $entry->get('id');
} elseif ($ds->dsParamPARAMOUTPUT == 'system:date') {
$param_pool[$key][] = DateTimeObj::get('c', strtotime($entry->creationDate));
} elseif ($ds->dsParamPARAMOUTPUT == 'system:author') {
$param_pool[$key][] = $entry->get('author_id');
}
}
foreach ($data as $field_id => $values) {
if (!isset($fieldPool[$field_id]) || !is_object($fieldPool[$field_id])) {
$fieldPool[$field_id] =& $entryManager->fieldManager->fetch($field_id);
}
if (isset($ds->dsParamPARAMOUTPUT) && $ds->dsParamPARAMOUTPUT == $fieldPool[$field_id]->get('element_name')) {
$param_pool[$key][] = $fieldPool[$field_id]->getParameterPoolValue($values);
}
if (!$param_output_only) {
foreach ($ds->dsParamINCLUDEDELEMENTS as $handle) {
list($handle, $mode) = preg_split('/\\s*:\\s*/', $handle, 2);
if ($fieldPool[$field_id]->get('element_name') == $handle) {
$fieldPool[$field_id]->appendFormattedElement($xEntry, $values, $ds->dsParamHTMLENCODE ? true : false, $mode);
}
}
}
}
if (!$param_output_only) {
$xGroup->appendChild($xEntry);
}
}
}
if (is_array($group['groups']) && !empty($group['groups'])) {
foreach ($group['groups'] as $element => $group) {
foreach ($group as $g) {
processRecordGroup($xGroup, $element, $g, $ds, $Parent, $entryManager, $fieldPool, $param_pool, $param_output_only);
}
}
}
if (!$param_output_only) {
$wrapper->appendChild($xGroup);
}
return;
}
示例9: getValuesFromXML
function getValuesFromXML()
{
$xml_location = $this->get('xml_location');
if (General::validateURL($xml_location) != '') {
// is a URL, check cache
$cache_id = md5($xml_location);
$cache = new Cacheable($this->_Parent->_Parent->Database);
$cachedData = $cache->check($cache_id);
$creation = DateTimeObj::get('c');
if (!$cachedData || time() - $cachedData['creation'] > 5 * 60) {
if (Mutex::acquire($cache_id, 6, TMP)) {
$ch = new Gateway();
$ch->init();
$ch->setopt('URL', $xml_location);
$ch->setopt('TIMEOUT', 6);
$xml = $ch->exec();
$writeToCache = true;
Mutex::release($cache_id, TMP);
$xml = trim($xml);
if (empty($xml) && $cachedData) {
$xml = $cachedData['data'];
}
} elseif ($cachedData) {
$xml = $cachedData['data'];
}
} else {
$xml = $cachedData['data'];
}
$xml = simplexml_load_string($xml);
} elseif (substr($xml_location, 0, 1) == '/') {
// relative to DOCROOT
$xml = simplexml_load_file(DOCROOT . $this->get('xml_location'));
} else {
// in extension's /xml folder
$xml = simplexml_load_file(EXTENSIONS . '/xml_selectbox/xml/' . $this->get('xml_location'));
}
if (!$xml) {
return;
}
$items = $xml->xpath($this->get('item_xpath'));
$options = array();
foreach ($items as $item) {
$option = array();
$text_xpath = $item->xpath($this->get('text_xpath'));
$option['text'] = General::sanitize((string) $text_xpath[0]);
if ($this->get('value_xpath') != '') {
$value_xpath = $item->xpath($this->get('value_xpath'));
$option['value'] = General::sanitize((string) $value_xpath[0]);
}
if ((string) $option['value'] == '') {
$option['value'] = $option['text'];
}
$options[] = $option;
}
return $options;
}
示例10: __viewIndex
function __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Authors'))));
if (Administration::instance()->Author->isDeveloper()) {
$this->appendSubheading(__('Authors'), Widget::Anchor(__('Add an Author'), $this->_Parent->getCurrentPageURL() . 'new/', __('Add a new author'), 'create button'));
} else {
$this->appendSubheading(__('Authors'));
}
$authors = AuthorManager::fetch();
$aTableHead = array(array(__('Name'), 'col'), array(__('Email Address'), 'col'), array(__('Last Seen'), 'col'));
$aTableBody = array();
if (!is_array($authors) || empty($authors)) {
$aTableBody = array(Widget::TableRow(array(Widget::TableData(__('None found.'), 'inactive', NULL, count($aTableHead))), 'odd'));
} else {
$bOdd = true;
foreach ($authors as $a) {
if (intval($a->get('superuser')) == 1) {
$group = 'admin';
} else {
$group = 'author';
}
## Setup each cell
if (Administration::instance()->Author->isDeveloper() || Administration::instance()->Author->get('id') == $a->get('id')) {
$td1 = Widget::TableData(Widget::Anchor($a->getFullName(), $this->_Parent->getCurrentPageURL() . 'edit/' . $a->get('id') . '/', $a->get('username'), $group));
} else {
$td1 = Widget::TableData($a->getFullName(), 'inactive');
}
$td2 = Widget::TableData(Widget::Anchor($a->get('email'), 'mailto:' . $a->get('email'), 'Email this author'));
if ($a->get('last_seen') != NULL) {
$td3 = Widget::TableData(DateTimeObj::get(__SYM_DATETIME_FORMAT__, strtotime($a->get('last_seen'))));
} else {
$td3 = Widget::TableData('Unknown', 'inactive');
}
if (Administration::instance()->Author->isDeveloper()) {
if ($a->get('id') != Administration::instance()->Author->get('id')) {
$td3->appendChild(Widget::Input('items[' . $a->get('id') . ']', NULL, 'checkbox'));
}
}
## Add a row to the body array, assigning each cell to the row
$aTableBody[] = Widget::TableRow(array($td1, $td2, $td3), $bOdd ? 'odd' : NULL);
$bOdd = !$bOdd;
}
}
$table = Widget::Table(Widget::TableHead($aTableHead), NULL, Widget::TableBody($aTableBody));
$this->Form->appendChild($table);
if (Administration::instance()->Author->isDeveloper()) {
$tableActions = new XMLElement('div');
$tableActions->setAttribute('class', 'actions');
$options = array(array(NULL, false, __('With Selected...')), array('delete', false, __('Delete')));
$tableActions->appendChild(Widget::Select('with-selected', $options));
$tableActions->appendChild(Widget::Input('action[apply]', __('Apply'), 'submit'));
$this->Form->appendChild($tableActions);
}
}
示例11: write
public function write()
{
$section = $this->section->get('object');
$entry = null;
$entry_data = array();
// If it's an existing entry we want to load that entry object
foreach ($this->writes as $write) {
$field = $write->get('object');
$field_data = $write->get('data');
if ($field == SymQuery::SYSTEM_ID) {
$existing = SymQuery::$em->fetch($field_data, $section->get('id'));
if (is_array($existing) && !empty($existing)) {
$entry = current($existing);
break;
}
}
}
// If $entry is null, then it's a new entry, so fill it with some default metadata
if (is_null($entry)) {
$entry = SymQuery::$em->create();
$author = SymQuery::$symphony->Author;
// Build default entry data:
$entry->set('section_id', $section->get('id'));
if (is_object($author)) {
$entry->set('author_id', $author->get('id'));
}
$entry->set('creation_date', DateTimeObj::get('Y-m-d H:i:s'));
$entry->set('creation_date_gmt', DateTimeObj::getGMT('Y-m-d H:i:s'));
}
foreach ($this->writes as $write) {
$field = $write->get('object');
$field_data = $write->get('data');
if ($field instanceof Field) {
$field_handle = $field->get('element_name');
$entry_data[$field_handle] = $field_data;
}
}
if (__ENTRY_FIELD_ERROR__ == $entry->checkPostData($entry_data, $errors, $entry->get('id') ? true : false)) {
$validation_errors = array();
foreach ($errors as $field_id => $message) {
if (!in_array($field_id, SymQuery::$field_cache)) {
SymQuery::$field_cache[$field_id] = SymQuery::$fm->fetch($field_id, $section->get('id'));
}
$validation_errors[$field_id] = array('field' => SymQuery::$field_cache[$field_id], 'error' => $message);
}
$error = new SymWriteException('Unable to validate entry.');
$error->setValidationErrors($validation_errors);
throw $error;
}
if (__ENTRY_OK__ != $entry->setDataFromPost($entry_data, $error, false, $entry->get('id') ? true : false)) {
throw new SymQueryException(sprintf('Unable to save entry: %s', $error));
}
$entry->commit();
return $entry;
}
示例12: getMetaInfo
public static function getMetaInfo($file, $type)
{
$meta = array();
if (!file_exists($file) || !is_readable($file)) {
return $meta;
}
$meta['creation'] = DateTimeObj::get('c', filemtime($file));
if (General::in_iarray($type, fieldUpload::$imageMimeTypes) && ($array = @getimagesize($file))) {
$meta['width'] = $array[0];
$meta['height'] = $array[1];
}
return $meta;
}
示例13: view
public function view()
{
$this->setPageType('table');
$this->setTitle('Symphony – Cron');
$this->appendSubheading('Cron Tasks', [Widget::Anchor(__('Create New'), Administration::instance()->getCurrentPageURL() . 'new/', __('Create a cron task'), 'create button', null, ['accesskey' => 'c'])]);
Extension_Cron::init();
$iterator = new Lib\CronTaskIterator(realpath(MANIFEST . '/cron'), Symphony::Database());
$aTableHead = [['Name', 'col'], ['Description', 'col'], ['Enabled', 'col'], ['Last Executed', 'col'], ['Next Execution', 'col'], ['Last Output', 'col']];
$aTableBody = [];
if ($iterator->count() == 0) {
$aTableBody = [Widget::TableRow([Widget::TableData(__('None found.'), 'inactive', null, count($aTableHead))], 'odd')];
} else {
foreach ($iterator as $ii => $task) {
$td1 = Widget::TableData(Widget::Anchor($task->name, sprintf('%sedit/%s/', Administration::instance()->getCurrentPageURL(), $task->filename)));
$td1->appendChild(Widget::Label(__('Select Task %s', [$task->filename]), null, 'accessible', null, array('for' => 'task-' . $ii)));
$td1->appendChild(Widget::Input('items[' . $task->filename . ']', 'on', 'checkbox', array('id' => 'task-' . $ii)));
$td2 = Widget::TableData(is_null($task->description) ? 'None' : $task->description);
if (is_null($task->description)) {
$td2->setAttribute('class', 'inactive');
}
$td3 = Widget::TableData($task->enabledReal() == true ? 'Yes' : 'No');
if ($task->enabled == false) {
$td3->setAttribute('class', 'inactive');
}
$td4 = Widget::TableData(!is_null($task->getLastExecutionTimestamp()) ? DateTimeObj::get(__SYM_DATETIME_FORMAT__, $task->getLastExecutionTimestamp()) : 'Unknown');
if (is_null($task->getLastExecutionTimestamp())) {
$td4->setAttribute('class', 'inactive');
}
$td5 = Widget::TableData(!is_null($task->nextExecution()) ? self::__minutesToHumanReadable(ceil($task->nextExecution() * (1 / 60))) : 'Unknown');
if (is_null($task->nextExecution()) || $task->enabledReal() == false) {
$td5->setAttribute('class', 'inactive');
}
if (is_null($task->getLog())) {
$td6 = Widget::TableData('None', 'inactive');
} else {
$td6 = Widget::TableData(Widget::Anchor('view', sprintf('%slog/%s/', Administration::instance()->getCurrentPageURL(), $task->filename)));
}
$aTableBody[] = Widget::TableRow(array($td1, $td2, $td3, $td4, $td5, $td6));
}
}
$table = Widget::Table(Widget::TableHead($aTableHead), null, Widget::TableBody($aTableBody), 'selectable', null, array('role' => 'directory', 'aria-labelledby' => 'symphony-subheading', 'data-interactive' => 'data-interactive'));
$this->Form->appendChild($table);
$tableActions = new XMLElement('div');
$tableActions->setAttribute('class', 'actions');
$options = [[null, false, __('With Selected...')], ['enable', false, __('Enable')], ['disable', false, __('Disable')], ['delete', false, __('Delete'), 'confirm', null, ['data-message' => __('Are you sure you want to delete the selected tasks?')]]];
$tableActions->appendChild(Widget::Apply($options));
$this->Form->appendChild($tableActions);
}
示例14: login
/**
* Overload the Symphony::login function to bypass some code that
* forces use of the Administration class (which of course is not
* available in Shell). Hopefully this is fixed in the core Symphony code
*
*/
public static function login($username, $password, $isHash = false)
{
$username = self::Database()->cleanValue($username);
$password = self::Database()->cleanValue($password);
if (strlen(trim($username)) > 0 && strlen(trim($password)) > 0) {
$author = \AuthorManager::fetch('id', 'ASC', 1, null, sprintf("\n `username` = '%s'\n ", $username));
if (!empty($author) && \Cryptography::compare($password, current($author)->get('password'), $isHash)) {
self::$Author = current($author);
// Only migrate hashes if there is no update available as the update might change the tbl_authors table.
if (\Cryptography::requiresMigration(self::$Author->get('password'))) {
throw new ShellException('User details require updating. Please login to the admin interface.');
}
self::$Cookie->set('username', $username);
self::$Cookie->set('pass', self::$Author->get('password'));
self::Database()->update(array('last_seen' => \DateTimeObj::get('Y-m-d H:i:s')), 'tbl_authors', sprintf(" `id` = %d", self::$Author->get('id')));
return true;
}
}
return false;
}
示例15: grab
function grab(&$param_pool)
{
$result = NULL;
$Forum = $this->_Parent->ExtensionManager->create('forum');
$members = $this->_Parent->ExtensionManager->create('members');
$members->initialiseCookie();
if (!$members->isLoggedIn() || !isset($param_pool['ds-forum-discussions']) || empty($param_pool['ds-forum-discussions'])) {
$result = $this->emptyXMLSet();
} else {
if (!$members->Member) {
$members->initialiseMemberObject();
}
$member_id = $members->Member->get('id');
$member_read_cutoff_date = Symphony::Database()->fetchVar('local', 0, sprintf("SELECT `local` FROM `tbl_entries_data_%d` WHERE `entry_id` = %d LIMIT 1", Discussion::getUnreadCutoffField(), $member_id));
if (is_null($member_read_cutoff_date)) {
$member_read_cutoff_date = strtotime(Symphony::Database()->fetchVar('creation_date', 0, "SELECT `creation_date` FROM `tbl_entries` WHERE `id` = {$member_id} LIMIT 1"));
}
$discussion_last_active_field = Symphony::Configuration()->get('discussion-last-active-field', 'forum');
$pre_dated_discussions = Symphony::Database()->fetchCol('entry_id', sprintf("SELECT `entry_id` \n\t\t\t\t\t\tFROM `tbl_entries_data_%d` \n\t\t\t\t\t\tWHERE `entry_id` IN (" . @implode(',', $param_pool['ds-forum-discussions']) . ") \n\t\t\t\t\t\tAND `local` <= '%s'", $discussion_last_active_field, $member_read_cutoff_date));
$read_discussions = @implode(',', array_diff($param_pool['ds-forum-discussions'], $pre_dated_discussions));
if (empty($read_discussions)) {
$read_discussions = 0;
}
$read = $this->_Parent->Database->fetch(sprintf("SELECT * FROM `tbl_forum_read_discussions` \n\t\t\t\t\t\tWHERE `member_id` = {$member_id} \n\t\t\t\t\t\tAND `discussion_id` IN (%s)", $read_discussions));
if (empty($read) && empty($pre_dated_discussions)) {
$result = $this->emptyXMLSet();
} else {
$result = new XMLElement($this->dsParamROOTELEMENT);
foreach ($read as $r) {
$result->appendChild(new XMLElement('discussion', NULL, array('id' => $r['discussion_id'], 'comments' => $r['comments'], 'last-viewed' => DateTimeObj::get('c', $r['last_viewed']))));
if (isset($pre_dated_discussions[$r['discussion_id']])) {
unset($pre_dated_discussions[$r['discussion_id']]);
}
}
foreach ($pre_dated_discussions as $id) {
$result->appendChild(new XMLElement('discussion', NULL, array('id' => $id, 'comments' => '100000', 'last-viewed' => DateTimeObj::get('c', strtotime($member_registration_date)))));
}
}
}
return $result;
}