本文整理汇总了PHP中_d函数的典型用法代码示例。如果您正苦于以下问题:PHP _d函数的具体用法?PHP _d怎么用?PHP _d使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_d函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findMatch
public function findMatch($request, $setAsCurrent = false)
{
_d($request, 'find Match');
_d($setAsCurrent, 'setAsCurrent');
foreach ($this->routes as $route) {
if ($route->matches($request)) {
if ($setAsCurrent) {
$this->current = $route;
}
return $route;
}
}
return false;
}
示例2: get_userdata
$User = get_userdata($Note->value->author);
?>
<tr>
<th class="column-author column-username"><?php
echo get_avatar($User->ID, 32);
?>
<?php
echo esc_html($User->display_name);
?>
<br />
<span><?php
echo _d(get_option('date_format'), $Note->created);
?>
</span>
<span><?php
echo _d(get_option('time_format'), $Note->created);
?>
</span></th>
<td>
<div id="note-<?php
echo $Note->id;
?>
">
<?php
if ($Note->value->sent == 1) {
?>
<p class="notesent"><?php
_e('Sent to the Customer:', 'Shopp');
?>
</p>
<?php
示例3: elseif
} elseif ($user) {
?>
<div class="user-card">
<img src="<?php
echo $user->photoUrl;
?>
" alt="">
<div class="user-data">
Name: <?php
echo _e($user->firstName . ' ' . $user->lastName);
?>
<br>
Nickname: <?php
echo _d($user->nickname, 'empty');
?>
<br>
Profile: <a href="<?php
echo $user->profileUrl;
?>
"><?php
echo $user->profileUrl;
?>
</a><br>
</div>
</div>
<div class="sign-out"><a href="signout.php">Выйти</a></div>
<?php
示例4: notes_meta_box
function notes_meta_box($Purchase)
{
global $Notes;
add_filter('shopp_order_note', 'esc_html');
add_filter('shopp_order_note', 'wptexturize');
add_filter('shopp_order_note', 'convert_chars');
add_filter('shopp_order_note', 'make_clickable');
add_filter('shopp_order_note', 'force_balance_tags');
add_filter('shopp_order_note', 'convert_smilies');
add_filter('shopp_order_note', 'wpautop');
?>
<form action="<?php
echo ShoppAdminController::url(array('id' => $Purchase->id));
?>
" method="post">
<?php
if (!empty($Notes->meta)) {
?>
<table>
<?php
foreach ($Notes->meta as $Note) {
$User = get_userdata($Note->value->author);
?>
<tr>
<th class="column-author column-username"><?php
echo get_avatar($User->ID, 32);
?>
<?php
echo esc_html($User->display_name);
?>
<br />
<span><?php
echo _d(get_option('date_format'), $Note->created);
?>
</span>
<span><?php
echo _d(get_option('time_format'), $Note->created);
?>
</span></th>
<td>
<div id="note-<?php
echo $Note->id;
?>
">
<?php
if ($Note->value->sent == 1) {
?>
<p class="notesent"><?php
_e('Sent to the Customer:', 'Shopp');
?>
</p>
<?php
}
?>
<?php
echo apply_filters('shopp_order_note', $Note->value->message);
?>
</div>
<p class="notemeta">
<span class="notectrls">
<button type="submit" name="delete-note[<?php
echo $Note->id;
?>
]" value="delete" class="button-secondary deletenote"><small>Delete</small></button>
<button type="button" name="edit-note[<?php
echo $Note->id;
?>
]" value="edit" class="button-secondary editnote"><small>Edit</small></button>
<?php
do_action('shopp_order_note_controls');
?>
</span>
</p>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
?>
<div id="notation">
<p><label for="notes"><?php
_e('New Note', 'Shopp');
?>
:</label><br />
<textarea name="note" id="note" cols="50" rows="10"></textarea></p>
<?php
do_action('shopp_order_new_note_ui');
?>
<p class="alignright">
<button type="button" name="cancel-note" value="cancel" id="cancel-note-button" class="button-secondary"><?php
_e('Cancel', 'Shopp');
?>
</button>
<button type="submit" name="save-note" value="save" class="button-primary"><?php
_e('Save Note', 'Shopp');
?>
//.........这里部分代码省略.........
示例5: _e
<div id="order">
<br class="clear" />
<div id="receipt" class="shopp">
<table class="transaction" cellspacing="0">
<tr><th><?php
_e('Order Num', 'Shopp');
?>
:</th><td><?php
echo $Purchase->id;
?>
</td></tr>
<tr><th><?php
_e('Order Date', 'Shopp');
?>
:</th><td><?php
echo _d(get_option('date_format'), $Purchase->created);
?>
</td></tr>
<?php
if (!empty($Purchase->card) && !empty($Purchase->cardtype)) {
?>
<tr><th><?php
_e('Billed To', 'Shopp');
?>
:</th><td><?php
!empty($Purchase->card) ? printf("%'X16d", $Purchase->card) : '';
?>
<?php
echo !empty($Purchase->cardtype) ? '(' . $Purchase->cardtype . ')' : '';
?>
</td></tr><?php
示例6: in_array
</div>
</td>
<td class="discount column-discount<?php echo in_array('discount',$hidden)?' hidden':''; ?>"><?php
if ($Promotion->type == "Percentage Off") echo percentage($Promotion->discount);
if ($Promotion->type == "Amount Off") echo money($Promotion->discount);
if ($Promotion->type == "Free Shipping") echo $this->Settings->get("free_shipping_text");
if ($Promotion->type == "Buy X Get Y Free") echo __('Buy','Ecart').' '.$Promotion->buyqty.' '.__('Get','Ecart').' '.$Promotion->getqty.' '.__('Free','Ecart');
?></td>
<td class="applied column-applied<?php echo in_array('applied',$hidden)?' hidden':''; ?>"><?php echo $Promotion->target; ?></td>
<td class="eff column-eff<?php echo in_array('eff',$hidden)?' hidden':''; ?>"><strong><?php echo $status[$Promotion->status]; ?></strong><?php
$starts = (mktimestamp($Promotion->starts) > 1) ?
_d(get_option('date_format'),mktimestamp($Promotion->starts)) :
_d(get_option('date_format'),mktimestamp($Promotion->created));
$ends = (mktimestamp($Promotion->ends) > 1) ?
" — " . _d(get_option('date_format'),mktimestamp($Promotion->ends)) :
", " . __('does not expire','Ecart');
echo "<br />".$starts.$ends;
?></td>
</tr>
<?php endforeach; ?>
</tbody>
<?php else: ?>
<tbody><tr><td colspan="5"><?php _e('No promotions found.','Ecart'); ?></td></tr></tbody>
<?php endif; ?>
</table>
</form>
<div class="tablenav">
<?php if ($page_links) echo "<div class='tablenav-pages'>$page_links</div>"; ?>
<div class="clear"></div>
</div>
示例7: tag
function tag ($property,$options=array()) {
global $Ecart;
$taxes = isset($options['taxes'])?$options['taxes']:false;
$taxrate = 0;
if ($property == "item-unitprice" || $property == "item-total")
$taxrate = ecart_taxrate($taxes);
// Return strings with no options
switch ($property) {
case "receipt":
// Skip the receipt processing when sending order notifications in admin without the receipt
if (defined('WP_ADMIN') && isset($_POST['receipt']) && $_POST['receipt'] == "no") return;
if (isset($options['template']) && is_readable(ECART_TEMPLATES."/".$options['template']))
return $this->receipt($template);
else return $this->receipt();
break;
case "url": return ecarturl(false,'account'); break;
case "id": return $this->id; break;
case "customer": return $this->customer; break;
case "date":
if (empty($options['format'])) $options['format'] = get_option('date_format').' '.get_option('time_format');
return _d($options['format'],((is_int($this->created))?$this->created:mktimestamp($this->created)));
break;
case "card": return (!empty($this->card))?sprintf("%'X16d",$this->card):''; break;
case "cardtype": return $this->cardtype; break;
case "txnid":
case "transactionid": return $this->txnid; break;
case "firstname": return esc_html($this->firstname); break;
case "lastname": return esc_html($this->lastname); break;
case "company": return esc_html($this->company); break;
case "email": return esc_html($this->email); break;
case "phone": return esc_html($this->phone); break;
case "address": return esc_html($this->address); break;
case "xaddress": return esc_html($this->xaddress); break;
case "city": return esc_html($this->city); break;
case "state":
if (strlen($this->state > 2)) return esc_html($this->state);
$regions = Lookup::country_zones();
$states = $regions[$this->country];
return $states[$this->state];
break;
case "postcode": return esc_html($this->postcode); break;
case "country":
$countries = $Ecart->Settings->get('target_markets');
return $countries[$this->country]; break;
case "shipaddress": return esc_html($this->shipaddress); break;
case "shipxaddress": return esc_html($this->shipxaddress); break;
case "shipcity": return esc_html($this->shipcity); break;
case "shipstate":
if (strlen($this->shipstate > 2)) return esc_html($this->shipstate);
$regions = Lookup::country_zones();
$states = $regions[$this->country];
return $states[$this->shipstate];
break;
case "shippostcode": return esc_html($this->shippostcode); break;
case "shipcountry":
$countries = $Ecart->Settings->get('target_markets');
return $countries[$this->shipcountry]; break;
case "shipmethod": return esc_html($this->shipmethod); break;
case "totalitems": return count($this->purchased); break;
case "has-items":
case "hasitems":
if (empty($this->purchased)) $this->load_purchased();
return (count($this->purchased) > 0);
break;
case "items":
if (!isset($this->_items_loop)) {
reset($this->purchased);
$this->_items_loop = true;
} else next($this->purchased);
if (current($this->purchased) !== false) return true;
else {
unset($this->_items_loop);
return false;
}
case "item-id":
$item = current($this->purchased);
return $item->id; break;
case "item-product":
$item = current($this->purchased);
return $item->product; break;
case "item-price":
$item = current($this->purchased);
return $item->price; break;
case "item-name":
$item = current($this->purchased);
return $item->name; break;
case "item-description":
$item = current($this->purchased);
return $item->description; break;
case "item-options":
if (!isset($options['after'])) $options['after'] = "";
$item = current($this->purchased);
return (!empty($item->optionlabel))?$options['before'].$item->optionlabel.$options['after']:''; break;
case "item-sku":
$item = current($this->purchased);
return $item->sku; break;
case "item-download":
//.........这里部分代码省略.........
示例8: date
/**
* Provides the date the purchase order was created
*
* @api `shopp('purchase.date')`
* @since 1.0
*
* @param string $result The output
* @param array $options The options
* - **format**: Sets the PHP date formatting to use. Defaults to the WordPress date and time formats
* @param ShoppPurchase $O The working object
* @return string The purchase order date
**/
public static function date($result, $options, $O)
{
if (empty($options['format'])) {
$options['format'] = get_option('date_format') . ' ' . get_option('time_format');
}
return _d($options['format'], is_int($O->created) ? $O->created : sDB::mktime($O->created));
}
示例9: notes_meta_box
function notes_meta_box ($Purchase) {
global $Notes;
add_filter('ecart_order_note', 'esc_html');
add_filter('ecart_order_note', 'wptexturize');
add_filter('ecart_order_note', 'convert_chars');
add_filter('ecart_order_note', 'make_clickable');
add_filter('ecart_order_note', 'force_balance_tags');
add_filter('ecart_order_note', 'convert_smilies');
add_filter('ecart_order_note', 'wpautop');
?>
<?php if (!empty($Notes->meta)): ?>
<table>
<?php foreach ($Notes->meta as $Note): $User = get_userdata($Note->value->author); ?>
<tr>
<th><?php echo esc_html($User->user_nicename); ?><br />
<span><?php echo _d(get_option('date_format').' '.get_option('time_format'), $Note->created); ?></span></th>
<td>
<div id="note-<?php echo $Note->id; ?>">
<?php echo apply_filters('ecart_order_note',$Note->value->message); ?>
</div>
<p class="notemeta">
<span class="notectrls">
<button type="submit" name="delete-note[<?php echo $Note->id; ?>]" value="delete" class="button-secondary deletenote"><small>Delete</small></button>
<button type="button" name="edit-note[<?php echo $Note->id; ?>]" value="edit" class="button-secondary editnote"><small>Edit</small></button>
<?php do_action('ecart_order_note_controls'); ?>
</span>
</p>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div id="notation">
<p><label for="notes"><?php _e('New Note','Ecart'); ?>:</label><br />
<textarea name="note" id="note" cols="50" rows="10"></textarea></p>
<?php do_action('ecart_order_new_note_ui'); ?>
<p class="alignright">
<button type="button" name="cancel-note" value="cancel" id="cancel-note-button" class="button-secondary"><?php _e('Cancel','Ecart'); ?></button>
<button type="submit" name="save-note" value="save" class="button-primary"><?php _e('Save Note','Ecart'); ?></button>
</p>
</div>
<p class="alignright" id="add-note">
<button type="button" name="add-note" value="add" id="add-note-button" class="button-secondary"><?php _e('Add Note','Ecart'); ?></button></p>
<br class="clear" />
<?php
}
示例10: _u
?>
)</a></span>
</div>
<?php
} else {
?>
<div class="entry">
<h2><a href="<?php
echo _u('e', $rows[$c][0], $rows[$c][1]);
?>
"><?php
echo $rows[$c][2];
?>
</a></h2>
<span class="s_date"><?php
echo _d('j F Y', $rows[$c][4]);
?>
</span>
<?php
if ($rows[$c][7] == 'y' || $rows[$c][7] == 'c' && $rows[$c][9] != 0) {
?>
<span class="s_comments"><a href="<?php
echo _u('e', $rows[$c][0], $rows[$c][1]);
?>
#comentarios"><?php
echo $rows[$c][9] == 0 ? 'Sin comentarios' : "{$rows[$c][9]} Comentario(s)";
?>
</a></span>
<?php
}
?>
示例11: in_array
?>
"><?php
echo $Promotion->scope;
?>
</td>
<td class="eff column-eff<?php
echo in_array('eff', $hidden) ? ' hidden' : '';
?>
"><strong><?php
echo $status[$Promotion->status];
?>
</strong><?php
if (mktimestamp($Promotion->starts > 1) && mktimestamp($Promotion->ends) > 1) {
echo "<br />" . _d(get_option('date_format'), mktimestamp($Promotion->starts)) . " — " . _d(get_option('date_format'), mktimestamp($Promotion->ends));
} else {
echo "<br />" . _d(get_option('date_format'), mktimestamp($Promotion->created)) . ", " . __('does not expire', 'Shopp');
}
?>
</td>
</tr>
<?php
}
?>
</tbody>
<?php
} else {
?>
<tbody><tr><td colspan="5"><?php
_e('No promotions found.', 'Shopp');
?>
</td></tr></tbody>
示例12: empty
echo BASE_STATIC;
?>
images/no-avatar.png" alt="" width="54" height="54" /></div>
<div class="ccontent">
<div class="cinfo">
<a href="#comment-<?php
echo $rowsC[$c][3];
?>
">#<?php
echo $rowsC[$c][3];
?>
</a> <b><?php
echo empty($rowsC[$c][6]) ? $rowsC[$c][4] : "<a rel=\"nofollow\" href=\"{$rowsC[$c][6]}\" target=\"_blank\">{$rowsC[$c][4]}</a>";
?>
</b> el <?php
echo _d('j F Y', $rowsC[$c][8]);
?>
.
<?php
if (COMMENTS_STATUS == 'y') {
?>
<span class="creply"><a href="#comentar" onclick="javascript:re('<?php
echo $rowsC[$c][3];
?>
', '<?php
echo $rowsC[$c][4];
?>
')">Responder</a></span><?php
}
?>
</div>
示例13: _dd
/**
* Shortcut for _d(); die;
*
* @param mixed $var
* @return void
*/
function _dd($var)
{
_d($var);
die;
}
示例14: tag
function tag($property, $options = array())
{
global $Shopp;
if ($property == "item-unitprice" || $property == "item-total") {
$taxrate = shopp_taxrate($options['taxes']);
}
// Return strings with no options
switch ($property) {
case "url":
return $Shopp->link('cart');
break;
case "id":
return $this->id;
break;
case "date":
if (empty($options['format'])) {
$options['format'] = get_option('date_format');
}
return _d($options['format'], is_int($this->created) ? $this->created : mktimestamp($this->created));
break;
case "card":
return !empty($this->card) ? sprintf("%'X16d", $this->card) : '';
break;
case "cardtype":
return $this->cardtype;
break;
case "transactionid":
return $this->transactionid;
break;
case "firstname":
return $this->firstname;
break;
case "lastname":
return $this->lastname;
break;
case "company":
return $this->company;
break;
case "email":
return $this->email;
break;
case "phone":
return $this->phone;
break;
case "address":
return $this->address;
break;
case "xaddress":
return $this->xaddress;
break;
case "city":
return $this->city;
break;
case "state":
if (strlen($this->state > 2)) {
return $this->state;
}
$regions = $Shopp->Settings->get('zones');
$states = $regions[$this->country];
return $states[$this->state];
break;
case "postcode":
return $this->postcode;
break;
case "country":
$countries = $Shopp->Settings->get('target_markets');
return $countries[$this->country];
break;
case "shipaddress":
return $this->shipaddress;
break;
case "shipxaddress":
return $this->shipxaddress;
break;
case "shipcity":
return $this->shipcity;
break;
case "shipstate":
if (strlen($this->shipstate > 2)) {
return $this->shipstate;
}
$regions = $Shopp->Settings->get('zones');
$states = $regions[$this->country];
return $states[$this->shipstate];
break;
case "shippostcode":
return $this->shippostcode;
break;
case "shipcountry":
$countries = $Shopp->Settings->get('target_markets');
return $countries[$this->shipcountry];
break;
case "shipmethod":
return $this->shipmethod;
break;
case "totalitems":
return count($this->purchased);
break;
case "hasitems":
if (count($this->purchased) > 0) {
//.........这里部分代码省略.........
示例15: _delivery_format
/**
* Helper to provide formated timeframes
*
* @internal
* @since 1.0
*
* @param string $result The output
* @param array $options The options
* @param ShoppShiprates $O The working object
* @return string The formatted estimate
**/
private static function _delivery_format($estimate, $options = array())
{
$periods = array('h' => 3600, 'd' => 86400, 'w' => 604800, 'm' => 2592000);
$defaults = array('dateformat' => get_option('date_format'), 'dateseparator' => '—');
$options = array_merge($defaults, $options);
extract($options, EXTR_SKIP);
if (!$dateformat) {
$dateformat = 'F j, Y';
}
$estimates = explode("-", $estimate);
if (empty($estimates)) {
return "";
}
if (count($estimates) > 1 && $estimates[0] == $estimates[1]) {
$estimates = array($estimates[0]);
}
$result = "";
for ($i = 0; $i < count($estimates); $i++) {
list($interval, $p) = sscanf($estimates[$i], '%d%s');
if (empty($interval)) {
$interval = 1;
}
if (empty($p)) {
$p = 'd';
}
if (!empty($result)) {
$result .= $dateseparator;
}
$result .= _d($dateformat, current_time('timestamp') + $interval * $periods[$p]);
}
return $result;
}