本文整理汇总了PHP中appthemes_display_date函数的典型用法代码示例。如果您正苦于以下问题:PHP appthemes_display_date函数的具体用法?PHP appthemes_display_date怎么用?PHP appthemes_display_date使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了appthemes_display_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appthemes_coupon_add_column_data
/**
* Displays coupon custom columns data.
*
* @param string $column_index
* @param int $post_id
*
* @return void
*/
function appthemes_coupon_add_column_data($column_index, $post_id)
{
$coupon = get_post($post_id);
$coupon_meta = get_post_custom($post_id);
switch ($column_index) {
case 'discount':
if ($coupon_meta['type'][0] == 'flat') {
$discount = (double) $coupon_meta['amount'][0];
appthemes_display_price($discount);
} else {
$discount = (int) $coupon_meta['amount'][0];
echo $discount . '%';
}
break;
case 'usage':
$uses = isset($coupon_meta['use_count'][0]) ? $coupon_meta['use_count'][0] : 0;
if (empty($coupon_meta['use_limit'][0])) {
printf(__('%d / Unlimited', 'appthemes-coupons'), $uses);
} else {
printf(_x('%1$d / %2$d', 'Coupon usage, 1 - uses, 2 - limit', 'appthemes-coupons'), $uses, $coupon_meta['use_limit'][0]);
}
break;
case 'expires':
if (empty($coupon_meta['end_date'][0])) {
_e('Not expiring', 'appthemes-coupons');
} else {
echo appthemes_display_date($coupon_meta['end_date'][0], 'date');
}
break;
case 'status':
if ($coupon->post_status == 'publish') {
_e('Active', 'appthemes-coupons');
} else {
_e('Inactive', 'appthemes-coupons');
}
break;
}
}
示例2: cp_manage_users_custom_column
/**
* Displays the coumn values for each user.
*
* @param string $r
* @param string $column_name
* @param int $user_id
*
* @return string
*/
function cp_manage_users_custom_column($r, $column_name, $user_id)
{
switch ($column_name) {
case 'cp_ads_count':
global $cp_counts;
if (!isset($cp_counts)) {
$cp_counts = cp_count_ads();
}
if (!array_key_exists($user_id, $cp_counts)) {
$cp_counts = cp_count_ads();
}
if ($cp_counts[$user_id] > 0) {
$r .= "<a href='edit.php?post_type=" . APP_POST_TYPE . "&author={$user_id}' title='" . esc_attr__('View ads by this author', APP_TD) . "' class='edit'>";
$r .= $cp_counts[$user_id];
$r .= '</a>';
} else {
$r .= 0;
}
break;
case 'last_login':
$r = get_user_meta($user_id, 'last_login', true);
if (!empty($r)) {
$r = appthemes_display_date($r);
}
break;
case 'registered':
$user_info = get_userdata($user_id);
$r = $user_info->user_registered;
if (!empty($r)) {
$r = appthemes_display_date($r, 'datetime', true);
}
break;
case 'id':
$r = $user_id;
break;
}
return $r;
}
示例3: get_author_posts_url
?>
</span>
<a href="<?php
echo get_author_posts_url(get_the_author_meta('ID'));
?>
"><?php
the_author_meta('display_name');
?>
</a>
</li>
<li><span><?php
_e('Member Since:', APP_TD);
?>
</span> <?php
echo appthemes_display_date(get_the_author_meta('user_registered'), 'date', true);
?>
</li>
</ul>
<?php
cp_author_info('sidebar-ad');
?>
<div class="pad5"></div>
<div class="clr"></div>
</div>
示例4: display
/**
* Displays the order status summary
* @param object $post Wordpress Post object
* @return void
*/
function display($post)
{
$order = appthemes_get_order($post->ID);
?>
<style type="text/css">
#admin-order-status th{
padding-right: 10px;
text-align: right;
width: 40%;
}
</style>
<table id="admin-order-status">
<tbody>
<tr>
<th><?php
_e('ID', APP_TD);
?>
: </th>
<td><?php
echo $order->get_ID();
?>
</td>
</tr>
<tr>
<th><?php
_e('Status', APP_TD);
?>
: </th>
<td><?php
echo $order->get_display_status();
?>
</td>
</tr>
<tr>
<th><?php
_e('Gateway', APP_TD);
?>
: </th>
<td>
<?php
$gateway_id = $order->get_gateway();
if (!empty($gateway_id)) {
$gateway = APP_Gateway_Registry::get_gateway($gateway_id);
if ($gateway) {
echo $gateway->display_name('admin');
} else {
_e('Unknown', APP_TD);
}
} else {
_e('Undecided', APP_TD);
}
?>
</td>
</tr>
<tr>
<th><?php
_e('Currency', APP_TD);
?>
: </th>
<td><?php
echo APP_Currencies::get_currency_string($order->get_currency());
?>
</td>
</tr>
<?php
if ($order->is_recurring()) {
$period = $order->get_recurring_period();
?>
<tr>
<th><?php
_e('Recurs:', APP_TD);
?>
</th>
<td><?php
printf(_n('Every day', 'Every %d days', $period, APP_TD), $period);
?>
</td>
</tr>
<tr>
<th><?php
_e('Payment Date:', APP_TD);
?>
</th>
<td><?php
echo appthemes_display_date(get_post($order->get_id())->post_date, 'date');
?>
</td>
</tr>
<?php
}
?>
<?php
if ($order->get_parent() != 0) {
?>
<tr>
//.........这里部分代码省略.........
示例5: appthemes_get_profile_pic
<div class="post">
<div id="user-photo"><?php
appthemes_get_profile_pic($curauth->ID, $curauth->user_email, 250);
?>
</div>
<div class="author-main">
<ul class="author-info">
<li><strong><?php
_e('Member Since:', APP_TD);
?>
</strong> <?php
echo appthemes_display_date($curauth->user_registered, 'date', true);
?>
</li>
<?php
if (!empty($curauth->user_url)) {
?>
<li><div class="dashicons-before globeico"></div><a href="<?php
echo esc_url($curauth->user_url);
?>
"><?php
echo strip_tags($curauth->user_url);
?>
</a></li><?php
}
?>
<?php
示例6: display
/**
* Displays metabox content.
*
* @param object $post
*
* @return void
*/
public function display($post)
{
$this->display_styles();
$this->display_scripts($post);
?>
<table id="attachments" class="form-table">
<thead>
<tr id="attachments_header">
<th class="thumb"><?php
_e('Thumbnail', APP_TD);
?>
</th>
<th class="title"><?php
_e('Title', APP_TD);
?>
</th>
<th class="date"><?php
_e('Upload Date', APP_TD);
?>
</th>
<th class="dimensions"><?php
_e('Dimensions', APP_TD);
?>
</th>
<th class="delete"><?php
_e('Detach/Sort', APP_TD);
?>
</th>
</tr>
</thead>
<tbody class="attachments">
<?php
$menu_order = 0;
foreach ($this->get_attachments($post) as $attachment) {
?>
<tr id="media-attachment-<?php
echo $attachment->ID;
?>
" class="media-attachment">
<td class="thumb"><?php
echo $this->display_attachment_thumbnail($attachment);
?>
</td>
<td class="title"><input type="text" name="attachment[<?php
echo $attachment->ID;
?>
][post_title]" value="<?php
echo $attachment->post_title;
?>
" /></td>
<td class="date"><?php
echo appthemes_display_date($attachment->post_date, 'date');
?>
</td>
<td class="dimensions"><?php
echo $this->display_attachment_dimensions($attachment);
?>
</td>
<td class="icons delete">
<span class="delete ui-icon ui-icon-circle-minus"></span>
<span class="grip ui-icon ui-icon-grip-solid-horizontal"></span>
<input class="menu_order" type="hidden" name="attachment[<?php
echo $attachment->ID;
?>
][menu_order]" value="<?php
echo $menu_order;
?>
" />
</td>
</tr>
<?php
$menu_order++;
}
?>
</tbody>
<tfoot>
<tr>
<td><input id="upload_media_button" class="upload_button button" type="button" value="<?php
_e('Add Media Attachment', APP_TD);
?>
" /></td>
<td colspan="4"></td>
</tr>
</tfoot>
</table>
<?php
}
示例7: cp_custom_fields
//.........这里部分代码省略.........
<tbody id="list">
<?php
$rowclass = '';
$i = 1;
foreach ($results as $result) {
$rowclass = 'even' == $rowclass ? 'alt' : 'even';
?>
<tr class="<?php
echo $rowclass;
?>
">
<td style="padding-left:10px;"><?php
echo $i;
?>
.</td>
<td><a href="?page=fields&action=editfield&id=<?php
echo $result->field_id;
?>
"><strong><?php
echo esc_html(translate($result->field_label, APP_TD));
?>
</strong></a></td>
<td><?php
echo $result->field_type;
?>
</td>
<td><?php
echo esc_html(translate($result->field_desc, APP_TD));
?>
</td>
<td><?php
echo appthemes_display_date($result->field_modified);
?>
<?php
_e('by', APP_TD);
?>
<?php
echo $result->field_owner;
?>
</td>
<td style="text-align:center">
<?php
// show the correct edit options based on perms
switch ($result->field_perm) {
case '1':
// core fields no editing
?>
<a href="?page=fields&action=editfield&id=<?php
echo $result->field_id;
?>
"><img src="<?php
echo get_template_directory_uri();
?>
/images/edit.png" alt="" /></a>
<img src="<?php
echo get_template_directory_uri();
?>
/images/cross-grey.png" alt="" />
<?php
break;
case '2':
示例8: appthemes_display_date
</strong></label></div>
<div id="active_membership_pack" class="ad-static-field"><?php
echo appthemes_display_date($current_user->membership_expires);
?>
</div>
<div class="clr"></div>
</li>
<li>
<div class="labelwrapper"><label><strong><?php
_e('New Expiration:', APP_TD);
?>
</strong></label></div>
<div id="active_membership_pack" class="ad-static-field">
<?php
echo appthemes_display_date(appthemes_mysql_date($current_user->membership_expires, $membership->duration));
?>
</div>
<div class="clr"></div>
</li>
<?php
}
?>
<li>
<div class="labelwrapper"><label><?php
_e('Price:', APP_TD);
?>
</label></div>
<div id="review" class="ad-static-field"><?php
appthemes_display_price($membership->price);
示例9: elseif
</a></li>
<?php
} elseif ($membership) {
?>
<li><strong><?php
_e('Membership Pack:', APP_TD);
?>
</strong> <?php
echo stripslashes($membership->pack_name);
?>
</li>
<li><strong><?php
_e('Membership Expires:', APP_TD);
?>
</strong> <?php
echo appthemes_display_date($current_user->membership_expires);
?>
</li>
<li><a href="<?php
echo CP_MEMBERSHIP_PURCHASE_URL;
?>
"><?php
_e('Renew or Extend Your Membership Pack', APP_TD);
?>
</a></li>
<?php
} else {
?>
<li><a href="<?php
echo CP_MEMBERSHIP_PURCHASE_URL;
?>
示例10: appthemes_get_reg_date
function appthemes_get_reg_date($reg_date)
{
return appthemes_display_date($reg_date);
}
示例11: cp_profile_fields
function cp_profile_fields($user)
{
global $appthemes_extended_profile_fields;
?>
<h3><?php
_e('Extended Profile', 'appthemes');
?>
</h3>
<table class="form-table">
<?php
foreach ($appthemes_extended_profile_fields as $field_id => $field_values) {
if (isset($field_values['protected']) && $field_values['protected'] == 'yes' && !is_admin()) {
$protected = 'disabled="disabled"';
} else {
$protected = '';
}
//TODO - use this value for display purposes while protecting stored value
//prepare, modify, or filter the field value based on the field ID
switch ($field_id) {
case 'active_membership_pack':
$the_display_value = get_pack(get_the_author_meta($field_id, $user->ID), '', 'pack_name');
break;
default:
$the_display_value = false;
break;
}
$the_value = get_the_author_meta($field_id, $user->ID);
//begin writing the row and heading
?>
<tr id="<?php
echo $field_id;
?>
_row">
<th><label for="<?php
echo $field_id;
?>
"><?php
echo esc_html($field_values['title']);
?>
</label></th>
<td>
<?php
//print the appropriate profile field based on the type of field
switch ($field_values['type']) {
case 'date':
?>
<input type="text" name="<?php
echo $field_id;
?>
" id="<?php
echo $field_id;
?>
" value="<?php
esc_attr_e($the_value);
?>
" class="regular-text" size="35" <?php
if (!empty($protected)) {
echo 'style="display: none;"';
}
?>
/><br />
<span class="description" <?php
if (!empty($protected)) {
echo 'style="display: none;"';
}
?>
><?php
echo $field_values['admin_description'];
?>
<br /></span>
<input type="text" name="<?php
echo $field_id;
?>
_display" id="<?php
echo $field_id;
?>
" value="<?php
esc_attr_e(appthemes_display_date($the_value));
?>
" class="regular-text" size="35" disabled="disabled" /><br />
<span class="description"><?php
echo $field_values['description'];
?>
</span>
<?php
break;
case 'active_membership_pack':
?>
<input type="text" name="<?php
echo $field_id;
?>
" id="<?php
echo $field_id;
?>
" value="<?php
esc_attr_e($the_value);
?>
" class="regular-text" size="35" <?php
if (!empty($protected)) {
//.........这里部分代码省略.........
示例12: cp_membership_reminder_cron
function cp_membership_reminder_cron()
{
global $wpdb, $cp_options;
if (!$cp_options->membership_ending_reminder_email) {
return;
}
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$subject = sprintf(__('Membership Subscription Ending on %s', APP_TD), $blogname);
$siteurl = home_url('/');
$days_before = $cp_options->membership_ending_reminder_days;
$days_before = is_numeric($days_before) ? $days_before : 7;
$timestamp = wp_next_scheduled('cp_send_membership_reminder');
$timestamp = $timestamp - 1 * 24 * 60 * 60 + get_option('gmt_offset') * 3600;
// minus 1 day to get current schedule time, plus GMT offset
$date_max = date('Y-m-d H:i:s', $timestamp + $days_before * 24 * 60 * 60);
$date_min = date('Y-m-d H:i:s', $timestamp + ($days_before - 1) * 24 * 60 * 60);
$query_users = $wpdb->prepare("SELECT {$wpdb->users}.ID FROM {$wpdb->users}\n\t\tLEFT JOIN {$wpdb->usermeta} ON {$wpdb->users}.ID = {$wpdb->usermeta}.user_id\n\t\tWHERE {$wpdb->usermeta}.meta_key = 'membership_expires'\n\t\tAND {$wpdb->usermeta}.meta_value < %s\n\t\tAND {$wpdb->usermeta}.meta_value > %s\n\t\t", $date_max, $date_min);
$userids = $wpdb->get_col($query_users);
if (!$userids) {
return;
}
foreach ($userids as $user_id) {
$user = get_userdata($user_id);
$mailto = $user->user_email;
$user_login = appthemes_clean($user->user_login);
$membership = get_pack($user->active_membership_pack);
$membership_pack_name = appthemes_clean($membership->pack_name);
$membership_expires = appthemes_display_date($user->membership_expires);
$message = html('p', sprintf(__('Hi %s,', APP_TD), $user_login)) . PHP_EOL;
$message .= html('p', sprintf(__('Your membership pack will expire in %d days! Please renew your membership to continue posting classified ads.', APP_TD), $days_before)) . PHP_EOL;
$message_details = __('Membership Details', APP_TD) . '<br />';
$message_details .= __('-----------------', APP_TD) . '<br />';
$message_details .= sprintf(__('Membership Pack: %s', APP_TD), $membership_pack_name) . '<br />';
$message_details .= sprintf(__('Membership Expires: %s', APP_TD), $membership_expires) . '<br />';
$message_details .= sprintf(__('Renew Your Membership Pack: %s', APP_TD), CP_MEMBERSHIP_PURCHASE_URL) . '<br />';
$message .= html('p', $message_details) . PHP_EOL;
$message .= html('p', sprintf(__('For questions or problems, please contact us directly at %s', APP_TD), get_option('admin_email')));
$message .= html('p', __('Regards,', APP_TD) . '<br />' . sprintf(__('Your %s Team', APP_TD), $blogname));
$message .= html('p', $siteurl);
$email = array('to' => $mailto, 'subject' => $subject, 'message' => $message);
$email = apply_filters('cp_email_user_membership_reminder', $email, $order);
appthemes_send_email($email['to'], $email['subject'], $email['message']);
}
}
示例13: cp_ad_listing_add_column_data
/**
* Displays ad listing custom columns data.
*
* @param string $column_index
* @param int $post_id
*
* @return void
*/
function cp_ad_listing_add_column_data($column_index, $post_id)
{
$post = get_post($post_id);
if (!$post) {
return;
}
$post_meta = get_post_custom($post_id);
switch ($column_index) {
case 'cp_sys_expire_date':
if (isset($post_meta['cp_sys_expire_date'][0]) && !empty($post_meta['cp_sys_expire_date'][0])) {
echo appthemes_display_date($post_meta['cp_sys_expire_date'][0]);
}
break;
case 'cp_price':
cp_get_price($post->ID, 'cp_price');
break;
case 'cp_daily_count':
if (isset($post_meta['cp_daily_count'][0]) && !empty($post_meta['cp_daily_count'][0])) {
echo $post_meta['cp_daily_count'][0];
}
break;
case 'cp_total_count':
if (isset($post_meta['cp_total_count'][0]) && !empty($post_meta['cp_total_count'][0])) {
echo $post_meta['cp_total_count'][0];
}
break;
}
}
示例14: cp_profile_fields
function cp_profile_fields($user)
{
global $appthemes_extended_profile_fields;
?>
<h3><?php
_e('Extended Profile', APP_TD);
?>
</h3>
<table class="form-table">
<?php
foreach ($appthemes_extended_profile_fields as $field_id => $field_values) {
if (isset($field_values['protected']) && $field_values['protected'] == 'yes' && !is_admin()) {
$protected = 'disabled="disabled"';
} else {
$protected = '';
}
//TODO - use this value for display purposes while protecting stored value
//prepare, modify, or filter the field value based on the field ID
switch ($field_id) {
case 'active_membership_pack':
$user_active_pack = get_the_author_meta($field_id, $user->ID);
$package = cp_get_membership_package($user_active_pack);
$the_display_value = $package ? $package->pack_name : false;
break;
default:
$the_display_value = false;
break;
}
$the_value = get_the_author_meta($field_id, $user->ID);
//begin writing the row and heading
?>
<tr id="<?php
echo esc_attr($field_id);
?>
_row">
<th><label for="<?php
echo esc_attr($field_id);
?>
"><?php
echo esc_html($field_values['title']);
?>
</label></th>
<td>
<?php
//print the appropriate profile field based on the type of field
switch ($field_values['type']) {
case 'date':
$display_date = !empty($the_value) ? appthemes_display_date($the_value) : '';
if (!$protected) {
?>
<input type="text" name="<?php
echo esc_attr($field_id);
?>
" id="<?php
echo esc_attr($field_id);
?>
" value="<?php
echo esc_attr($the_value);
?>
" class="regular-text" size="35" /><br />
<span class="description"><?php
echo esc_attr($field_values['admin_description']);
?>
<br /></span>
<?php
}
?>
<input type="text" name="<?php
echo esc_attr($field_id);
?>
_display" id="<?php
echo esc_attr($field_id);
?>
" value="<?php
echo esc_attr($display_date);
?>
" class="regular-text" size="35" disabled="disabled" /><br />
<span class="description"><?php
echo $field_values['description'];
?>
</span>
<?php
break;
case 'active_membership_pack':
if (!$protected) {
?>
<input type="text" name="<?php
echo esc_attr($field_id);
?>
" id="<?php
echo esc_attr($field_id);
?>
" value="<?php
echo esc_attr($the_value);
?>
" class="regular-text" size="35" /><br />
<span class="description"><?php
echo esc_attr($field_values['admin_description']);
?>
//.........这里部分代码省略.........
示例15: the_permalink
<td>
<h3>
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a>
</h3>
<div class="meta"><span class="folder"><?php
echo get_the_term_list(get_the_id(), APP_TAX_CAT, '', ', ', '');
?>
</span> | <span class="clock"><span><?php
echo appthemes_display_date($post->post_date, 'date');
?>
</span></span></div>
</td>
<td class="text-center"><?php
echo $ad_views;
?>
</td>
<td class="text-center"><span style="color:<?php
echo $fontcolor;
?>
;"><?php
echo $post_status_name;
?>