function last_contact($date, $show_only_date, $user_ID)
{
    //global $show_only_date;
    if ($show_only_date) {
        $data = mysql2localedate($date);
    } else {
        $data = mysql2localedatetime($date);
    }
    $login = user_login($user_ID, false);
    if ($login != '') {
        $threads_url = get_dispctrl_url('threads', 'colselect_submit=Filter+list&u=' . $login);
        $data = '<a href="' . $threads_url . '">' . $data . '</a>';
    }
    return $data;
}
示例#2
0
/**
 * Return the given date in the correct date format
 *
 * @param string Date
 * @param boolean TRUE to show only date
 * @return string Date
*/
function col_thread_date($date, $show_only_date)
{
    if ($show_only_date) {
        return mysql2localedate($date);
    }
    return mysql2localedatetime($date);
}
示例#3
0
    $Form->hidden('expiry_delay', $edited_Item->get_setting('comment_expiry_delay'));
    $Form->hidden('goal_ID', $edited_Item->get_setting('goal_ID'));
    $Form->hidden('item_order', $edited_Item->order);
    $creator_User = $edited_Item->get_creator_User();
    $Form->hidden('item_owner_login', $creator_User->login);
    $Form->hidden('item_owner_login_displayed', 1);
} elseif (!isset($edited_Item->status)) {
    $highest_publish_status = get_highest_publish_status('post', $Blog->ID, false);
    $edited_Item->set('status', $highest_publish_status);
}
if ($current_User->check_perm('admin', 'restricted')) {
    // These fields can be edited only by users which have an access to back-office
    if ($current_User->check_perm('blog_edit_ts', 'edit', false, $Blog->ID)) {
        // Time stamp field values
        $Form->hidden('item_dateset', $edited_Item->get('dateset'));
        $Form->hidden('item_issue_date', mysql2localedate($edited_Item->get('issue_date')));
        $Form->hidden('item_issue_time', substr($edited_Item->get('issue_date'), 11));
    }
    // Tags
    $Form->hidden('item_tags', $item_tags);
    $Form->hidden('suggest_item_tags', $UserSettings->get('suggest_item_tags'));
}
$disp_edit_categories = true;
if (!$params['disp_edit_categories']) {
    // When categories are hidden, we store a cat_ID in the hidden input
    if ($edited_Item->ID > 0) {
        // Get cat_ID from existing Item
        $main_Chapter = $edited_Item->get_main_Chapter();
        $cat = $main_Chapter->ID;
    } else {
        // Forums skin get cat_ID from $_GET
if (empty($comment_Item)) {
    $comment_Item =& $edited_Comment->get_Item();
}
$form_action = url_add_param($admin_url, 'ctrl=comments');
$display_params = array_merge($display_params, array('textarea_lines' => 16, 'form_comment_text' => T_('Comment content')));
$Form = new Form($form_action, 'comment_edit', 'post');
$Form->begin_form('evo_comment');
$Form->add_crumb('comment');
$Form->hidden('blog', $Blog->ID);
$Form->hidden('mname', 'collections');
$Form->hidden('action_type', 'comment');
$Form->hidden('comment_ID', $edited_Comment->ID);
$Form->hidden('redirect_to', $edited_Comment->get_permanent_url());
if ($current_User->check_perm('admin', 'restricted') && $current_User->check_perm('blog_edit_ts', 'edit', false, $Blog->ID)) {
    // ------------------------------------ TIME STAMP -------------------------------------
    $Form->hidden('comment_issue_date', mysql2localedate($edited_Comment->get('date')));
    $Form->hidden('comment_issue_time', substr($edited_Comment->get('date'), 11));
}
$Form->begin_fieldset(get_request_title(array_merge(array('edit_links_template' => array('before' => '<span class="pull-right">', 'after' => '</span>', 'advanced_link_class' => 'btn btn-info btn-sm', 'close_link_class' => 'btn btn-default btn-sm')), $params)));
$Form->info(T_('In response to'), $comment_Item->get_title());
if ($Blog->get_setting('threaded_comments')) {
    // Display a reply comment ID only when this feature is enabled in blog settings
    $Form->text_input('in_reply_to_cmt_ID', $edited_Comment->in_reply_to_cmt_ID, 10, T_('In reply to comment ID'), T_('(leave blank for normal comments)'));
}
if ($edited_Comment->get_author_User()) {
    $Form->info(T_('Author'), $edited_Comment->get_author());
} else {
    $Form->text_input('newcomment_author', $edited_Comment->author, 20, T_('Author'), '', array('maxlength' => 100, 'style' => 'width: 100%;'));
    $Form->text_input('newcomment_author_email', $edited_Comment->author_email, 20, T_('Email'), '', array('maxlength' => 255, 'style' => 'width: 100%;'));
    $Form->text_input('newcomment_author_url', $edited_Comment->author_url, 20, T_('Website URL'), '', array('maxlength' => 255, 'style' => 'width: 100%;'));
}
/**
 * Deadline
 */
function deadline($date)
{
    $timestamp = mysql2timestamp($date);
    if ($timestamp <= 0) {
        return '&nbsp;';
        // IE needs that crap in order to display cell border :/
    }
    return mysql2localedate($date);
}
示例#6
0
 /**
  * Create icon with dataobject history
  */
 function history_info_icon()
 {
     $history = array();
     $UserCache =& get_Cache('UserCache');
     // HANDLE CREATOR STUFF
     if (!empty($this->creator_field) && !empty($this->{$this->creator_field})) {
         // We have a creator:
         $creator_User =& $UserCache->get_by_ID($this->{$this->creator_field});
         if (!empty($this->datecreated_field) && !empty($this->{$this->datecreated_field})) {
             // We also have a create date:
             $history[0] = sprintf(T_('Created on %s by %s'), mysql2localedate($this->{$this->datecreated_field}), $creator_User->dget('preferredname'));
         } else {
             // We only have a cretaor:
             $history[0] = sprintf(T_('Created by %s'), $creator_User->dget('preferredname'));
         }
     } elseif (!empty($this->datecreated_field) && !empty($this->{$this->datecreated_field})) {
         // We only have a create date:
         $history[0] = sprintf(T_('Created on %s'), mysql2localedate($this->{$this->datecreated_field}));
     }
     // HANDLE LAST UPDATE STUFF
     if (!empty($this->lasteditor_field) && !empty($this->{$this->lasteditor_field})) {
         // We have a creator:
         $creator_User =& $UserCache->get_by_ID($this->{$this->lasteditor_field});
         if (!empty($this->datemodified_field) && !empty($this->{$this->datemodified_field})) {
             // We also have a create date:
             $history[1] = sprintf(T_('Last mod on %s by %s'), mysql2localedate($this->{$this->datemodified_field}), $creator_User->dget('preferredname'));
         } else {
             // We only have a cretaor:
             $history[1] = sprintf(T_('Last mod by %s'), $creator_User->dget('preferredname'));
         }
     } elseif (!empty($this->datemodified_field) && !empty($this->{$this->datemodified_field})) {
         // We only have a create date:
         $history[1] = sprintf(T_('Last mod on %s'), mysql2localedate($this->{$this->datemodified_field}));
     }
     return get_icon('history', $what = 'imgtag', array('title' => implode(' - ', $history)), true);
 }