本文整理汇总了PHP中format_datetime函数的典型用法代码示例。如果您正苦于以下问题:PHP format_datetime函数的具体用法?PHP format_datetime怎么用?PHP format_datetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_datetime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
// Get Users
$users = $this->social_auth->get_users('active', 1);
$users_view = NULL;
// Title Stuff
$this->data['page_title'] = 'Users';
$this->data['sub_title'] = 'Manage';
// Users View Loop
foreach ($users as $user) {
$this->data['user_id'] = $user->user_id;
$this->data['name'] = $user->name;
$this->data['avatar'] = $this->social_igniter->profile_image($user->user_id, $user->image, $user->email);
$this->data['profile'] = base_url() . 'profile/' . $user->username;
$this->data['created_on'] = format_datetime('SIMPLE_ABBR', $user->created_on);
$this->data['last_login'] = format_datetime('SIMPLE_TIME_ABBR', $user->last_login);
// Alerts
$this->data['user_alerts'] = item_alerts_user($user);
// Actions
$this->data['user_state'] = item_user_state($user->active);
$this->data['user_edit'] = base_url() . 'users/manage/' . $user->user_id;
$this->data['user_delete'] = base_url() . 'api/users/destroy/id/' . $user->user_id;
// View
$users_view .= $this->load->view(config_item('dashboard_theme') . '/partials/item_users.php', $this->data, true);
}
// Final Output
$this->data['users_view'] = $users_view;
$this->data['message'] = validation_errors() ? validation_errors() : $this->session->flashdata('message');
$this->render('dashboard_wide');
}
开发者ID:reverseproductions,项目名称:socialigniter,代码行数:30,代码来源:users.php
示例2: discGetDiscussion
function discGetDiscussion($DID)
{
$q = db_query("select DID, Author, Body, add_time, Topic, name AS product_name, " . " " . PRODUCTS_TABLE . ".productID AS productID from " . DISCUSSIONS_TABLE . ", " . PRODUCTS_TABLE . " where " . DISCUSSIONS_TABLE . ".productID=" . PRODUCTS_TABLE . ".productID AND DID=" . (int) $DID);
$row = db_fetch_row($q);
$row["add_time"] = format_datetime($row["add_time"]);
return $row;
}
开发者ID:gblok,项目名称:rsc,代码行数:7,代码来源:discussion_functions.php
示例3: render_content_date_published
/**
* Render the date published for a content record
*
* @param sfSympalContent $content
* @param string $slot
* @return string $datePublished
*/
function render_content_date_published(sfSympalContent $content, $slot)
{
if ($content->date_published) {
sfSympalToolkit::loadHelpers('Date');
return format_datetime($content->date_published, sfSympalConfig::get('date_published_format'));
} else {
return '0000-00-00';
}
}
开发者ID:slemoigne,项目名称:sympal,代码行数:16,代码来源:SympalContentSlotHelper.php
示例4: output_datetime
function output_datetime($date = 'now', $input = FALSE)
{
if ($date == NULL) {
return '';
}
$abbr = $input ? '' : '<abbr title="' . format_datetime($date) . '">';
$date_output = date('d-m-Y H:i', strtotime($date));
$abbr_end = $input ? '' : '</abbr>';
return $abbr . $date_output . $abbr_end;
}
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:10,代码来源:MY_date_helper.php
示例5: __construct
private function __construct(array $data)
{
foreach ($data as $key => $value) {
$this->data[$key] = $value;
}
$this->id = intval($this->data['id']);
$this->shortname = $this->data['diminutif'];
if (!is_null($this->axDate)) {
$this->axDate = format_datetime($this->axDate, '%d/%m/%Y');
}
}
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:group.php
示例6: get_comments
private function get_comments($request)
{
try {
$object = Objects::findObject($request['oid']);
$comments = $object->getComments();
$clean_comments = array();
foreach ($comments as $comment) {
$user_name = $comment->getCreatedByDisplayName();
$updated_on = format_datetime($comment->getUpdatedOn());
$text = escape_html_whitespace(convert_to_links(clean($comment->getText())));
$clean_comment = array("author" => $user_name, "date" => $updated_on, "text" => $text);
$clean_comments[] = $clean_comment;
}
return $this->response('json', $clean_comments);
} catch (Exception $exception) {
throw $exception;
}
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:18,代码来源:ApiController.class.php
示例7: getArrayInfo
function getArrayInfo($include_trash_info = false, $include_archive_info = false) {
if ($this->getCreatedOn()){
$dateCreated = $this->getCreatedOn()->isToday() ? lang('today') ." ". format_time($this->getCreatedOn()) : format_datetime($this->getCreatedOn());
}
if ($this->getUpdatedOn()){
$dateUpdated = $this->getUpdatedOn()->isToday() ? lang('today') ." ". format_time($this->getUpdatedOn()) : format_datetime($this->getUpdatedOn());
}
$info = array(
'object_id' => $this->getId(),
'ot_id' => $this->getObjectTypeId(),
'name' => $this->getName(),
'type' => $this->getObjectTypeName(),
'icon' => $this->getType()->getIconClass(),
'createdBy' => $this->getCreatedByDisplayName(),
'createdById' => $this->getCreatedById(),
'dateCreated' => $dateCreated,
'updatedBy' => $this->getUpdatedByDisplayName(),
'updatedById' => $this->getUpdatedById(),
'dateUpdated' => $dateUpdated,
'url' => $this->getViewUrl()
);
if ($include_trash_info) {
$dateTrashed = $this->getTrashedOn() instanceof DateTimeValue ? ($this->getTrashedOn()->isToday() ? format_time($this->getTrashedOn()) : format_datetime($this->getTrashedOn())) : lang('n/a');
$info['deletedBy'] = $this->getTrashedByDisplayName();
$info['deletedById'] = $this->getColumnValue('trashed_by_id');
$info['dateDeleted'] = $dateTrashed;
}
if ($include_archive_info) {
$dateArchived = $this->getArchivedOn() instanceof DateTimeValue ? ($this->getArchivedOn()->isToday() ? format_time($this->getArchivedOn()) : format_datetime($this->getArchivedOn())) : lang('n/a');
$archived_by = Contacts::findById($this->getArchivedById());
$info['archivedBy'] = $archived_by instanceof Contact ? $archived_by->getObjectName() : lang('n/a');
$info['archivedById'] = $this->getArchivedById();
$info['dateArchived'] = $dateArchived;
}
return $info;
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:38,代码来源:Object.class.php
示例8: checkbox_field
?>
<tr>
<td><?php
echo checkbox_field('project_' . $project->getId(), $company->isProjectCompany($project), array('id' => 'projectPermissionsCheckbox' . $project->getId(), 'disabled' => !logged_user()->isProjectUser($project)));
?>
</td>
<td>
<label for="projectPermissionsCheckbox<?php
echo $project->getId();
?>
" class="checkbox normal">
<?php
if ($project->isCompleted()) {
?>
<del><span title="<?php
echo lang('project completed on by', format_datetime($project->getCompletedOn()), $project->getCompletedByDisplayName());
?>
"><?php
echo clean($project->getName());
?>
</span></del>
<?php
} else {
?>
<?php
echo clean($project->getName());
}
// if
?>
</label>
</td>
开发者ID:469306621,项目名称:Languages,代码行数:31,代码来源:update_permissions.php
示例9: foreach
<p>...para a próxima transmissão</p>
</div>
<p class="proximos">Próximos programas ao vivo:</p>
</div>
<!-- /contador -->
<ul class="lista-calendario grid2">
<?php
foreach ($displays as $k => $d) {
?>
<li>
<div class="barra-grade">
<p class="hora"><?php
echo format_datetime($d->getDateStart(), "d/M HH:mm");
?>
</p>
<a href="#" class="btn-toggle"><?php
echo $d->Program->getTitle();
?>
</a>
<a href="#" class="botao btn-toggle"></a>
</div>
<div class="grade toggle" style="display:none; width:auto; padding-bottom:25px;">
<div class="capa-foto" style="width:auto;">
<img src="<?php
echo $d->retriveLiveImage();
?>
" alt="<?php
echo $d->retriveTitle();
开发者ID:GustavoAdolfo,项目名称:cmais-frontend-2,代码行数:31,代码来源:_display-2c-broadcast2.php
示例10: printView
//.........这里部分代码省略.........
<input type="submit" value="Send" />
<input type="button" onclick="$(this).parents('form').toggle(); $(this).parents('tr:first').removeClass('tblib-hover')" value="Cancel" />
</div>
</form>
<?php
}
}
}
?>
</td>
<?php
$last_congid = NULL;
foreach ($this->_members as $id => $mdetail) {
$td_class = '';
if ($mdetail['congregationid'] != $last_congid) {
$td_class = 'thick-left-border';
$last_congid = $mdetail['congregationid'];
}
?>
<td class="<?php
echo $td_class;
?>
">
<?php
if ($mdetail['role_id']) {
if ($editing && empty($mdetail['readonly'])) {
$currentval = array();
foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $pid => $pdetails) {
$currentval[$pid] = $pdetails['name'];
}
if (empty($role_objects[$mdetail['role_id']])) {
$role_objects[$mdetail['role_id']] =& $GLOBALS['system']->getDBObject('roster_role', $mdetail['role_id']);
}
if (empty($role_objects[$mdetail['role_id']])) {
// must've been a problem
continue;
}
$role_objects[$mdetail['role_id']]->printChooser($date, $currentval);
} else {
$names = array();
foreach (array_get($ddetail['assignments'], $mdetail['role_id'], array()) as $personid => $vs) {
if (!$public) {
$n = '<a href="' . BASE_URL . '?view=persons&personid=' . $personid . '" title="Assigned by ' . ents($vs['assigner']) . ' on ' . format_datetime($vs['assignedon']) . '">' . nbsp(ents($vs['name'])) . '</a>';
if (empty($vs['email'])) {
$n .= ' <img src="' . BASE_URL . 'resources/img/no_email.png" style="display:inline" title="No Email Address" />';
}
$names[] = $n;
} else {
$names[] = nbsp($vs['name']);
}
}
echo implode("<br />", $names);
}
} else {
if (!empty($ddetail['service'][$mdetail['congregationid']])) {
if ($public && (!defined('SHOW_SERVICE_NOTES_PUBLICLY') || !SHOW_SERVICE_NOTES_PUBLICLY)) {
// no notes in public view
unset($ddetail['service'][$mdetail['congregationid']]['notes']);
}
$dummy_service->populate($ddetail['service'][$mdetail['congregationid']]['id'], $ddetail['service'][$mdetail['congregationid']]);
$dummy_service->printFieldvalue($mdetail['service_field']);
}
}
?>
</td>
<?php
}
if (!$public && count($this->_members) > REPEAT_DATE_THRESHOLD) {
?>
<td class="nowrap thick-left-border">
<strong><?php
echo str_replace(' ', ' ', date('j M y', strtotime($date)));
?>
</strong>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</tbody>
<?php
if (!$public && count($to_print) > 6) {
$this->_printTableFooter($editing, $public);
}
?>
</table>
<?php
if ($editing) {
?>
<input type="submit" class="btn" value="Save" accesskey="s" />
</form>
<?php
}
}
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:101,代码来源:roster_view.class.php
示例11: date
<language>en-us</language>
<pubDate><?php
echo date(DATE_RSS);
?>
</pubDate>
<?php
foreach ($sessionsForImages as $data) {
?>
<item>
<title><?php
echo $data["name"];
?>
</title>
<pubDate><?php
echo date(DATE_RSS, strtotime(format_datetime($data["created_at"], "y-MM-dd HH:mm")));
?>
</pubDate>
<description>
Total test cases: <?php
echo $data["total"];
?>
<br/>
Passed: <?php
echo $data["pass"];
?>
<br/>
Failed: <?php
echo $data["fail"];
?>
<br/>
开发者ID:alex1818,项目名称:TestReportCenter,代码行数:31,代码来源:environmentBuildSuccess.rss.php
示例12: get_url
}
$conversation_block .= '<td style="width:20px;'.$read_style.'">';
if ($show_user_icon) {
$conversation_block .= '<div class="db-ico ico-user"></div>';
}
$info_text = $info->getTextBody();
if (strlen_utf($info_text) > 90) $info_text = substr_utf($info_text, 0, 90) . "...";
$view_url = get_url('mail', 'view', array('id' => $info->getId(), 'replace' => 1));
$conversation_block .= '<td>';
$conversation_block .= ' <a style="'.$read_style.'" class="internalLink" href="'.$view_url.'" onclick="og.openLink(\''.$view_url.'\');return false;" title="'.$info->getFrom().'">';
$conversation_block .= $from;
if (!$is_current) $conversation_block .= ' </a><span class="desc">- '.$info_text.'</span></td>';
$info_date = $info->getReceivedDate() instanceof DateTimeValue ? ($info->getReceivedDate()->isToday() ? format_time($info->getReceivedDate()) : format_datetime($info->getReceivedDate())) : lang('n/a');
$conversation_block .= '</td><td style="text-align:right;padding-right:3px"><span class="desc">'. lang('date').': </span>'. $info_date .'</td>';
} //foreach
$conversation_block .= '</table>';
$conversation_block .= '</div>';
} else {
$conversation_block = '';
}
if($email->getBodyHtml() != ''){
if (defined('SANDBOX_URL')) {
$html_content = $email->getBodyHtml();
// prevent some outlook malformed tags
if(substr_count($html_content, "<style") != substr_count($html_content, "</style>") && substr_count($html_content, "/* Font Definitions */") >= 1) {
$p1 = strpos($html_content, "/* Font Definitions */", 0);
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:view.php
示例13: format_value_to_print
function format_value_to_print($col, $value, $type, $obj_type_id, $textWrapper = '', $dateformat = 'Y-m-d')
{
switch ($type) {
case DATA_TYPE_STRING:
if (preg_match(EMAIL_FORMAT, strip_tags($value))) {
$formatted = strip_tags($value);
} else {
if ($col == 'is_user') {
$formatted = $value == 1 ? lang('yes') : lang('no');
} else {
if (strpos($value, "�") !== false) {
$value = preg_replace('/\\xA0/s', ' ', $value);
}
$value = utf8_safe($value);
$formatted = $textWrapper . $value . $textWrapper;
}
}
break;
case DATA_TYPE_INTEGER:
if ($col == 'priority') {
switch ($value) {
case 100:
$formatted = lang('low priority');
break;
case 200:
$formatted = lang('normal priority');
break;
case 300:
$formatted = lang('high priority');
break;
case 400:
$formatted = lang('urgent priority');
break;
default:
$formatted = clean($value);
}
} elseif ($col == 'time_estimate') {
if ($value > 0) {
$formatted = DateTimeValue::FormatTimeDiff(new DateTimeValue(0), new DateTimeValue($value * 60), 'hm', 60);
} else {
$formatted = clean($value);
}
} else {
$formatted = clean($value);
}
break;
case DATA_TYPE_BOOLEAN:
$formatted = $value == 1 ? lang('yes') : lang('no');
break;
case DATA_TYPE_DATE:
if ($value != 0) {
if (str_ends_with($value, "00:00:00")) {
$dateformat .= " H:i:s";
}
try {
$dtVal = DateTimeValueLib::dateFromFormatAndString($dateformat, $value);
} catch (Exception $e) {
$formatted = $value;
}
if (!isset($formatted)) {
$formatted = format_date($dtVal, null, 0);
}
} else {
$formatted = '';
}
break;
case DATA_TYPE_DATETIME:
if ($value != 0) {
try {
$dtVal = DateTimeValueLib::dateFromFormatAndString("{$dateformat} H:i:s", $value);
} catch (Exception $e) {
$formatted = $value;
}
if ($dtVal instanceof DateTimeValue) {
if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() || $obj_type_id == ProjectTasks::instance()->getObjectTypeId()) {
$dtVal->advance(logged_user()->getTimezone() * 3600, true);
}
if ($obj_type_id == ProjectEvents::instance()->getObjectTypeId() && ($col == 'start' || $col == 'duration')) {
$formatted = format_datetime($dtVal);
} else {
$formatted = format_date($dtVal, null, 0);
}
}
} else {
$formatted = '';
}
break;
default:
$formatted = $value;
}
if ($formatted == '') {
$formatted = '--';
}
return $formatted;
}
开发者ID:abhinay100,项目名称:feng_app,代码行数:95,代码来源:format.php
示例14: lang
?>
</span></div>
<?php
}
// if
if ($message->getCreatedBy() instanceof User) {
?>
<div class="author"><?php
echo lang('posted on by', format_datetime($message->getCreatedOn()), $message->getCreatedBy()->getCardUrl(), clean($message->getCreatedBy()->getDisplayName()));
?>
</div>
<?php
} else {
?>
<div class="author"><?php
echo lang('posted on', format_datetime($message->getCreatedOn()));
?>
</div>
<?php
}
// if
?>
</div>
<div class="content">
<?php
if ($createdBy instanceof User && $createdBy->getContact()->hasAvatar()) {
?>
<div class="avatar"><img src="<?php
echo $createdBy->getContact()->getAvatarUrl();
?>
" alt="<?php
开发者ID:bklein01,项目名称:Project-Pier,代码行数:31,代码来源:view.php
示例15: foreach
<div class="comments">
<?php
foreach ($entry['comments'] as $comment) {
?>
<blockquote>
<p><?php
echo nl2br(ents(trim($comment['contents'])));
?>
</p>
<small class="author">
Added by
<?php
echo $comment['creator_fn'] . ' ' . $comment['creator_ln'] . ' (#' . $entry['creator'] . ')';
?>
<?php
echo format_datetime($comment['created']);
?>
</small>
</blockquote>
<?php
}
?>
</div>
<?php
}
if (!empty($show_form)) {
?>
<h4>Add Update:</h4>
<?php
$dummy->printUpdateForm();
?>
开发者ID:howardgrigg,项目名称:jethro-pmm,代码行数:31,代码来源:single_note.template.php
示例16: format_datetime
<thead>
<tr>
<th id="th_test_case">
<span class="sort">
<a id="detailed_case_see_none" class="see_only_failed_button sort_btn non_nft_button active" href="javascript:;" onClick="hideShowAll('tableOfResults', '1', 'hide');" title="Changed">Changed</a>
<a id="detailed_case_see_all" class="see_all_button sort_btn non_nft_button" href="javascript:; " onClick="hideShowAll('tableOfResults', '0', 'hide');" title="See all">See all</a>
</span>
</th>
<th class="column_head_1">
<?php
echo format_datetime($lastSessions[1]["created_at"], "y-MM-dd HH:mm");
?>
</th>
<th class="column_head_separate"></th><th class="column_head_1">
<?php
echo format_datetime($lastSessions[0]["created_at"], "y-MM-dd HH:mm");
?>
</th>
</tr>
</thead>
<?php
$previousFeatureKey = "";
?>
<?php
$line = 0;
?>
<?php
foreach ($currentSession["results"] as $resultKey => $result) {
?>
<?php
开发者ID:alex1818,项目名称:TestReportCenter,代码行数:31,代码来源:compareTestsetSuccess.php
示例17: executeMobilegetvideos
public function executeMobilegetvideos(sfWebRequest $request)
{
require_once '/var/frontend/lib/vendor/symfony/lib/helper/DateHelper.php';
if ($request->isXmlHttpRequest()) {
$return = '';
$start = 0;
$items = intval($request->getParameter('items'));
$site = intval($request->getParameter('site'));
$page = intval($request->getParameter('page'));
if ($page >= 1) {
$start = $page * $items - $items;
}
if ($site > 0) {
$assets = Doctrine_Query::create()->select('a.*')->from('Asset a, AssetVideo av')->where('a.asset_type_id = 6')->andWhere('av.asset_id = a.id')->andWhere('a.is_active = ?', 1)->andWhere('a.site_id = ?', $site)->andWhere('av.youtube_id != ""')->orderBy('a.id desc')->limit($items)->offset($start)->execute();
foreach ($assets as $d) {
$return .= ' <!--VIDEO ITEM-->';
$return .= ' <li>';
$return .= ' <a href="http://www.youtube.com/embed/' . $d->AssetVideo->getYoutubeId() . '?rel=0">';
$return .= ' <fieldset class="ui-grid-a">';
$return .= ' <div class="ui-block-a">';
$return .= ' <div class="fotinho">';
$return .= ' <img class="" src="http://img.youtube.com/vi/' . $d->AssetVideo->getYoutubeId() . '/0.jpg" alt="' . $d->getTitle() . '" width="100%">';
$return .= ' </div>';
$return .= ' </div>';
$return .= ' <div class="ui-block-b video">';
$return .= ' <h4>' . $d->getTitle() . '</h4>';
if ($d->getCreatedAt() != "") {
$return .= ' <p class="data">' . format_datetime($d->getCreatedAt(), "dd/MM/yyyy HH:mm:ss") . '</p>';
}
if ($d->AssetVideo->getDuration() != "") {
$return .= ' <p class="duracao">Duração: ' . format_datetime($d->AssetVideo->getDuration(), "HH:mm:ss") . '</p>';
}
$return .= ' </div>';
$return .= ' </fieldset>';
$return .= ' </a>';
$return .= ' <div class="linha2"></div>';
$return .= ' </li>';
$return .= ' <!--/VIDEO ITEM-->';
}
}
echo $return;
}
die;
}
开发者ID:GustavoAdolfo,项目名称:cmais-frontend-2,代码行数:44,代码来源:actions.class-2.php
示例18: create_public_post
function create_public_post()
{
// Validation Rules
$this->form_validation->set_rules('comment_name', 'Name', 'required');
$this->form_validation->set_rules('comment_email', 'Email Address', 'required|valid_email');
$this->form_validation->set_rules('comment', 'Comment', 'required');
// Validates
if ($this->form_validation->run() == true) {
/*
// Akismet Enabled
if (config_item('comments_akismet') == 'TRUE')
{
$this->load->library('akismet');
$comment = array('author' => $this->input->post('comment_name'), 'email' => $this->input->post('comment_email'), 'body' => $this->input->post('comment'));
$config = array('blog_url' => config_item('site_url'), 'api_key' => config_item('site_akismet_key'), 'comment' => $comment);
$this->akismet->init($config);
if ($this->akismet->errors_exist())
{
if ($this->akismet->is_error('AKISMET_INVALID_KEY'))
{
return FALSE;
}
elseif ($this->akismet->is_error('AKISMET_RESPONSE_FAILED'))
{
return FALSE;
}
elseif ($this->akismet->is_error('AKISMET_SERVER_NOT_FOUND'))
{
return FALSE;
}
else
{
return TRUE;
}
}
else
{
if ($this->akismet->is_spam())
{
$this->form_validation->set_message('akistmet_validate', 'We think your comment might be spam!"');
return FALSE;
}
else
{
return TRUE;
}
}
}
// ReCAPTCHA Enabled
if (config_item('comments_recaptcha') == 'TRUE')
{
$this->load->library('recaptcha');
if ($this->recaptcha->check_answer($this->input->ip_address(), $this->input->post('recaptcha_challenge_field'), $val))
{
$recaptcha = TRUE;
}
else
{
$this->form_validation->set_message('check_captcha', $this->lang->line('recaptcha_incorrect_response'));
$recaptcha = FALSE;
}
}
*/
log_message('debug', 'COOOOM inside validation');
if ($content = $this->social_igniter->check_content_comments($this->input->post('content_id'))) {
log_message('debug', 'COOOOM inside content');
$user = $this->social_auth->get_user('email', $this->input->post('comment_email'));
if (!$user) {
log_message('debug', 'COOOOM inside create user');
$username = url_username($this->input->post('comment_name'), 'none', true);
$email = $this->input->post('comment_email');
$password = random_string('unique');
$additional_data = array('name' => $this->input->post('comment_name'));
$level = config_item('comments_group');
// Register User
if ($this->social_auth->register($username, $password, $email, $additional_data, $level)) {
log_message('debug', 'COOOOM inside register');
$user = $this->social_auth->get_user('email', $this->input->post('comment_email'));
}
}
$comment_data = array('reply_to_id' => $this->input->post('reply_to_id'), 'content_id' => $content->content_id, 'owner_id' => $content->user_id, 'module' => $content->module, 'type' => $content->type, 'user_id' => $user->user_id, 'comment' => $this->input->post('comment'), 'geo_lat' => $this->input->post('geo_lat'), 'geo_long' => $this->input->post('geo_long'), 'approval' => $content->comments_allow);
// Insert
if ($comment = $this->social_tools->add_comment($comment_data)) {
log_message('debug', 'COOOOM inside comment created');
$comment_data['comment_id'] = $comment->comment_id;
$comment_data['created_at'] = format_datetime(config_item('comments_date_style'), $comment->created_at);
$comment_data['name'] = $comment->name;
$comment_data['username'] = $comment->username;
$comment_data['gravatar'] = $comment->gravatar;
$comment_data['image'] = $comment->image;
$comment_data['sub'] = '';
// Set Reply Id For Comments
if ($comment->reply_to_id) {
$comment_data['sub'] = 'sub_';
$comment_data['reply_id'] = $comment->reply_to_id;
//.........这里部分代码省略.........
开发者ID:reverseproductions,项目名称:socialigniter,代码行数:101,代码来源:comments.php
示例19: use_helper
<?php
use_helper('Date');
/*
* Action for Comment : List by post
* Vars : $commentPager
*/
echo _open('div.comment.list_by_article');
echo $commentPager->renderNavigationTop();
echo _open('ul.elements');
foreach ($commentPager as $comment) {
echo _open('li.element');
echo _tag('p.author', _tag('strong.mr10', $comment->name ? escape($comment->name) : escape('<anonymous>')) . _tag('span.quiet', format_datetime($comment->createdAt, 'f')));
echo _tag('p', nl2br(escape($comment->text)));
echo _close('li');
}
echo _close('ul');
echo $commentPager->renderNavigationBottom();
echo _close('div');
开发者ID:Regmaya,项目名称:diem-project,代码行数:19,代码来源:_listByArticle.php
示例20: unset
unset($form['target']);
unset($form['id']);
}
op_include_form('searchCommunityWiki', $form, $options);
?>
<?php
if ($pager->getNbResults()) {
?>
<?php
$list = array();
foreach ($pager->getResults() as $key => $topic) {
$list[$key] = array();
$list[$key][__('Name', array(), 'community_wiki_form')] = $topic->getName();
$list[$key][__('%community% Name')] = $topic->getCommunity()->getName();
$list[$key][__('Body', array(), 'community_wiki_form')] = $topic->getBody();
$list[$key][__('Date Updated', array(), 'form_community')] = format_datetime($topic->getUpdatedAt(), 'f');
}
$options = array('title' => __('Search Results'), 'pager' => $pager, 'link_to_page' => 'communityWiki/search?page=%d', 'list' => $list, 'link_to_detail' => $link_to_detail);
op_include_parts('searchResultList', 'searchResultCommunityWiki', $options);
} else {
if ('topic' === $type) {
$message = __('Your search queries did not match any community topics.');
} else {
if ('wiki' === $type) {
$message = __('Your search queries did not match any community events.');
}
}
op_include_box('searchCommunityWikiResult', $message, array('title' => __('Search Results')));
}
开发者ID:hiroyaxxx,项目名称:opCommunityWikiPlugin,代码行数:31,代码来源:searchSuccess.php
注:本文中的format_datetime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论