本文整理汇总了PHP中is_date函数的典型用法代码示例。如果您正苦于以下问题:PHP is_date函数的具体用法?PHP is_date怎么用?PHP is_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_date函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: check_data
function check_data()
{
global $Refs;
if (!is_date($_POST['date'])) {
display_error(_("The entered date is invalid."));
set_focus('date');
return false;
}
if (!is_date_in_fiscalyear($_POST['date'])) {
display_error(_("The entered date is not in fiscal year."));
set_focus('date');
return false;
}
if (!$Refs->is_valid($_POST['ref'])) {
display_error(_("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], ST_JOURNAL)) {
display_error(_("The entered reference is already in use."));
set_focus('ref');
return false;
}
return true;
}
开发者ID:knjy24,项目名称:FrontAccounting,代码行数:25,代码来源:revaluate_currencies.php
示例2: porto_page_title
function porto_page_title()
{
global $porto_settings;
$output = '';
if (!is_front_page()) {
} elseif (is_home()) {
$output .= $porto_settings['blog-title'];
}
if (is_singular()) {
$output .= porto_page_title_leaf();
} else {
if (is_post_type_archive()) {
if (is_search()) {
$output .= porto_page_title_leaf('search');
} else {
$output .= porto_page_title_archive();
}
} elseif (is_tax() || is_tag() || is_category()) {
$html = porto_page_title_leaf('term');
if (is_tag()) {
$output .= sprintf(__('Tag - %s', 'porto'), $html);
} elseif (is_tax('product_tag')) {
$output .= sprintf(__('Product Tag - %s', 'porto'), $html);
} else {
$output .= $html;
}
} elseif (is_date()) {
if (is_year()) {
$output .= porto_page_title_leaf('year');
} elseif (is_month()) {
$output .= porto_page_title_leaf('month');
} elseif (is_day()) {
$output .= porto_page_title_leaf('day');
}
} elseif (is_author()) {
$output .= porto_page_title_leaf('author');
} elseif (is_search()) {
$output .= porto_page_title_leaf('search');
} elseif (is_404()) {
$output .= porto_page_title_leaf('404');
} elseif (class_exists('bbPress') && is_bbpress()) {
if (bbp_is_search()) {
$output .= porto_page_title_leaf('bbpress_search');
} elseif (bbp_is_single_user()) {
$output .= porto_page_title_leaf('bbpress_user');
} else {
$output .= porto_page_title_leaf();
}
} else {
if (is_home() && !is_front_page()) {
if (get_option('show_on_front') == 'page') {
$output .= get_the_title(get_option('page_for_posts', true));
} else {
$output .= $porto_settings['blog-title'];
}
}
}
}
return apply_filters('porto_page_title', $output);
}
开发者ID:booklein,项目名称:wpbookle,代码行数:60,代码来源:page-title.php
示例3: can_process
function can_process()
{
global $Refs;
if (!is_date($_POST['CreditDate'])) {
display_error(_("The entered date is invalid."));
set_focus('CreditDate');
return false;
} elseif (!is_date_in_fiscalyear($_POST['CreditDate'])) {
display_error(_("The entered date is not in fiscal year."));
set_focus('CreditDate');
return false;
}
if ($_SESSION['Items']->trans_no == 0) {
if (!$Refs->is_valid($_POST['ref'])) {
display_error(_("You must enter a reference."));
set_focus('ref');
return false;
}
}
if (!check_num('ChargeFreightCost', 0)) {
display_error(_("The entered shipping cost is invalid or less than zero."));
set_focus('ChargeFreightCost');
return false;
}
if (!check_quantities()) {
display_error(_("Selected quantity cannot be less than zero nor more than quantity not credited yet."));
return false;
}
return true;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:30,代码来源:customer_credit_invoice.php
示例4: check_valid_entries
function check_valid_entries()
{
if (!is_date($_POST['DatePaid'])) {
display_error(tr("The entered date is invalid."));
set_focus('DatePaid');
return false;
}
if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
display_error(tr("The entered date is not in fiscal year."));
set_focus('DatePaid');
return false;
}
if (!check_num('amount', 0)) {
display_error(tr("The entered amount is invalid or less than zero."));
set_focus('amount');
return false;
}
if (!references::is_valid($_POST['ref'])) {
display_error(tr("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], systypes::bank_transfer())) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
if ($_POST['FromBankAccount'] == $_POST['ToBankAccount']) {
display_error(tr("The source and destination bank accouts cannot be the same."));
set_focus('ToBankAccount');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:34,代码来源:bank_transfer.php
示例5: ubik_title_archives
function ubik_title_archives()
{
if (is_category()) {
$title = sprintf(__('%s archives', 'ubik'), single_cat_title('', false));
} elseif (is_tag()) {
$title = sprintf(__('%s archives', 'ubik'), single_tag_title('', false));
} elseif (is_tax()) {
$title = sprintf(__('%s archives', 'ubik'), single_term_title('', false));
} elseif (is_post_type_archive()) {
$title = sprintf(__('%s archives', 'ubik'), post_type_archive_title('', false));
} elseif (is_author()) {
$title = sprintf(__('Posts by %s', 'ubik'), get_the_author_meta('display_name', get_query_var('author')));
} elseif (is_date()) {
if (get_query_var('second') || get_query_var('minute') || get_query_var('hour')) {
$title = sprintf(__('%s archives', 'ubik'), get_the_time(__('g:i a', 'ubik')));
} elseif (is_day()) {
$title = sprintf(__('%s daily archives', 'ubik'), get_the_date(_x('F j, Y', 'daily archives date format', 'ubik')));
} elseif (get_query_var('w')) {
$title = sprintf(__('Week %1$s of %2$s archives', 'ubik'), get_the_time(__('W', 'ubik')), get_the_time(__('Y', 'ubik')));
} elseif (is_month()) {
$title = sprintf(__('%s monthly archives', 'ubik'), get_the_date(_x('F Y', 'monthly archives date format', 'ubik')));
} elseif (is_year()) {
$title = sprintf(__('%s yearly archives', 'ubik'), get_the_date(_x('Y', 'yearly archives date format', 'ubik')));
} else {
$title = get_the_date();
}
} else {
$title = __('Archives', 'ubik');
}
return apply_filters('ubik_title_archives', $title);
}
开发者ID:synapticism,项目名称:ubik-title,代码行数:31,代码来源:ubik-title-core.php
示例6: isCptArchive
/**
* Test to see if the page is a date based archive page cpt archive
*
* @since 1.0.0
* @access public
* @param
* @return boolean
*/
public function isCptArchive()
{
if (is_category() || is_author() || is_tag() || is_date() || is_front_page() || is_home()) {
return false;
}
return true;
}
开发者ID:Beth3346,项目名称:wordpress-boilerplate,代码行数:15,代码来源:Utility.php
示例7: display
/**
* Display breadcrumbs
*/
public function display()
{
if (Habakiri::get('is_displaying_bread_crumb') === 'false') {
return;
}
global $wp_query;
// Set to home
$home_label = $this->get_home_label();
$this->set($home_label, home_url('/'));
// Set to blog
$post_type = $this->get_post_type();
if (is_category() || is_tag() || is_date() || is_author() || is_single() && $post_type === 'post') {
$show_on_front = get_option('show_on_front');
$page_for_posts = get_option('page_for_posts');
if ($show_on_front === 'page' && $page_for_posts) {
$this->set(get_the_title($page_for_posts), get_permalink($page_for_posts));
}
}
// Set current and ancestors
if (is_404()) {
$this->set_for_404();
} elseif (is_search()) {
$this->set_for_search();
} elseif (is_tax()) {
$this->set_for_tax();
} elseif (is_attachment()) {
$this->set_for_attachment();
} elseif (is_page() && !is_front_page()) {
$this->set_for_page();
} elseif (is_post_type_archive()) {
$this->set_for_post_type_archive();
} elseif (is_single()) {
$this->set_for_single();
} elseif (is_category()) {
$this->set_for_category();
} elseif (is_tag()) {
$this->set_for_tag();
} elseif (is_author()) {
$this->set_for_author();
} elseif (is_day()) {
$this->set_for_day();
} elseif (is_month()) {
$this->set_for_month();
} elseif (is_year()) {
$this->set_for_year();
} elseif (is_home() && !is_front_page()) {
$this->set_for_blog();
}
$bread_crumb = array();
$last_item = array_pop($this->bread_crumb);
foreach ($this->bread_crumb as $_bread_crumb) {
if (!empty($_bread_crumb['link'])) {
$bread_crumb[] = sprintf('<a href="%s">%s</a>', esc_url($_bread_crumb['link']), esc_html($_bread_crumb['title']));
} else {
$bread_crumb[] = esc_html($_bread_crumb['title']);
}
}
$bread_crumb[] = sprintf('<strong>%s</strong>', $last_item['title']);
printf('<div class="breadcrumbs">%s</div>', implode(' > ', apply_filters('habakiri_bread_crumb', $bread_crumb)));
}
开发者ID:ConductiveIO,项目名称:mbrady,代码行数:63,代码来源:class.breadcrumbs.php
示例8: get_archive_title
function get_archive_title()
{
$title = "";
$page_title = \get_the_archive_title();
if (\is_category()) {
//カテゴリーページ
$title = "『{$page_title』カテゴリーの記事}";
} elseif (\is_tag()) {
//タグページ
$title = "『{$page_title』タグが付けられた記事}";
} elseif (\is_tax()) {
//タクソノミーページ
$title = "『{$page_title』に分類された記事}";
} elseif (\is_author()) {
//作成者ページ
$title = "『{$page_title』が作成した記事}";
} elseif (\is_year() || \is_month() || \is_date()) {
//年
$title = "{$page_titleに作成された記事}";
} else {
//不明なアーカイブ
$title = $page_title;
}
return $title;
}
开发者ID:Aquei,项目名称:purely,代码行数:25,代码来源:purely-funcs.php
示例9: can_process
function can_process()
{
if (!is_date($_POST['date_'])) {
display_error(tr("The entered date for the issue is invalid."));
set_focus('date_');
return false;
} elseif (!is_date_in_fiscalyear($_POST['date_'])) {
display_error(tr("The entered date is not in fiscal year."));
set_focus('date_');
return false;
}
if (!references::is_valid($_POST['ref'])) {
display_error(tr("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], 28)) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
$failed_item = $_SESSION['issue_items']->check_qoh($_POST['Location'], $_POST['date_'], !$_POST['IssueType']);
if ($failed_item != null) {
display_error(tr("The issue cannot be processed because an entered item would cause a negative inventory balance :") . " " . $failed_item->stock_id . " - " . $failed_item->item_description);
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:28,代码来源:work_order_issue.php
示例10: pass
function pass($post)
{
global $DT_TIME, $MOD;
if (!is_array($post)) {
return false;
}
if (!$post['catid']) {
return $this->_(lang('message->pass_cate'));
}
if (strlen($post['title']) < 3) {
return $this->_(lang('message->pass_title'));
}
if ($post['totime']) {
if (!is_date($post['totime'])) {
return $this->_(lang('message->pass_date'));
}
if (strtotime($post['totime'] . ' 23:59:59') < $DT_TIME) {
return $this->_(lang('message->pass_todate'));
}
}
if (DT_MAX_LEN && strlen($post['content']) > DT_MAX_LEN) {
return $this->_(lang('message->pass_max'));
}
return true;
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:25,代码来源:sell.class.php
示例11: enlightenment_current_lead_posts
function enlightenment_current_lead_posts()
{
$grids = enlightenment_archive_grids();
$grid = enlightenment_get_grid(enlightenment_current_grid());
if (1 == $grid['content_columns']) {
$lead_posts = get_option('posts_per_page');
} elseif (is_home() && !is_page()) {
$lead_posts = $grids['post']['lead_posts'];
} elseif (is_author()) {
$lead_posts = $grids['author']['lead_posts'];
} elseif (is_date()) {
$lead_posts = $grids['date']['lead_posts'];
} elseif (is_post_type_archive()) {
$lead_posts = $grids[get_query_var('post_type')]['lead_posts'];
} elseif (is_category()) {
$lead_posts = $grids['category']['lead_posts'];
} elseif (is_tag()) {
$lead_posts = $grids['post_tag']['lead_posts'];
} elseif (is_tax('post_format')) {
$lead_posts = $grids['post']['lead_posts'];
} elseif (is_tax()) {
$lead_posts = $grids[get_queried_object()->taxonomy]['lead_posts'];
} elseif (is_search()) {
$lead_posts = $grids['post']['lead_posts'];
}
return apply_filters('enlightenment_current_lead_posts', $lead_posts);
}
开发者ID:brittbec13,项目名称:citizenmodern,代码行数:27,代码来源:grid-loop.php
示例12: editar
function editar()
{
$id = $this->input->post('id_pedido');
$data = array('logged' => $this->auth->logged(), 'page_title' => 'Administração', 'titulo' => 'Pedido N° ' . $id, 'description' => 'Detalhes do pedido');
//caso a validação esteja ok
if ($this->validation->run()) {
$where = array('id_pedido' => $this->input->post('id_pedido'));
$usar_ate = is_date($this->input->post('usar_ate')) ? $this->input->post('usar_ate') : null;
$dados = array('usar_ate' => dateDb($usar_ate), 'limite' => $this->input->post('limite'));
$dados = $this->input->xss_clean($dados);
$this->product->updatePedido($where, $dados);
$this->messages->add('Usuário atualizado com sucesso!', 'success');
// ser user message
redirect('pedido/index/' . $id);
die;
}
if ($this->auth->logged()) {
$data['pedido'] = $this->user->getPedidosById($id);
$this->validation->pedido_em = formataData('d/m/Y', $data['pedido']['pedido_em']);
$this->validation->liberado_em = is_date(formataData('d/m/Y', $data['pedido']['liberado_em'])) ? formataData('d/m/Y', $data['pedido']['liberado_em']) : 'dd-mm-aaaa 00:00';
$this->validation->downloads = $data['pedido']['downloads'];
$this->validation->usar_ate = is_date(formataData('d/m/Y', $data['pedido']['usar_ate'])) ? formataData('d/m/Y', $data['pedido']['usar_ate']) : 'dd-mm-aaaa';
$this->validation->limite = $data['pedido']['limite'];
}
$this->load->view('admin-pedido', $data);
}
开发者ID:nataliajulieta,项目名称:old,代码行数:26,代码来源:pedido.php
示例13: pass
function pass($post)
{
global $DT_TIME, $MOD;
if (!is_array($post)) {
return false;
}
if (!$post['catid']) {
return $this->_(lang('message->pass_cate'));
}
if (strlen($post['title']) < 3) {
return $this->_(lang('message->pass_title'));
}
if (strlen($post['thumb']) < 15) {
return $this->_(lang('message->pass_thumb'));
}
if (dround($post['price']) < 0.1) {
return $this->_(lang('message->pass_group_price'));
}
if (dround($post['marketprice']) < 0.1) {
return $this->_(lang('message->pass_group_mprice'));
}
if (dround($post['marketprice']) <= dround($post['price'])) {
return $this->_(lang('message->pass_group_eprice'));
}
if ($post['totime']) {
if (!is_date($post['totime'])) {
return $this->_(lang('message->pass_date'));
}
if (strtotime($post['totime'] . ' 23:59:59') < $DT_TIME) {
return $this->_(lang('message->pass_todate'));
}
}
return true;
}
开发者ID:hcd2008,项目名称:destoon,代码行数:34,代码来源:group.class.php
示例14: pesscore_config_get_utility_page_id
function pesscore_config_get_utility_page_id()
{
$page_id = null;
if (is_search()) {
$page_id = of_get_option('template_page_id_search', null);
} else {
if (is_category()) {
$page_id = of_get_option('template_page_id_blog_category', null);
} else {
if (is_tag()) {
$page_id = of_get_option('template_page_id_blog_tags', null);
} else {
if (is_author()) {
$page_id = of_get_option('template_page_id_author', null);
} else {
if (is_date() || is_day() || is_month() || is_year()) {
$page_id = of_get_option('template_page_id_date', null);
} else {
if (is_tax('dt_portfolio_category')) {
$page_id = of_get_option('template_page_id_portfolio_category', null);
} else {
if (is_tax('dt_gallery_category')) {
$page_id = of_get_option('template_page_id_gallery_category', null);
}
}
}
}
}
}
}
return apply_filters('pesscore_config_get_utility_page_id', $page_id);
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:32,代码来源:mod-archives-templates.php
示例15: can_process
function can_process()
{
if (!is_date($_POST['CreditDate'])) {
display_error(tr("The entered date is invalid."));
set_focus('CreditDate');
return false;
} elseif (!is_date_in_fiscalyear($_POST['CreditDate'])) {
display_error(tr("The entered date is not in fiscal year."));
set_focus('CreditDate');
return false;
}
if ($_SESSION['Items']->trans_no == 0) {
if (!references::is_valid($_POST['ref'])) {
display_error(tr("You must enter a reference."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], 11)) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
}
if (!check_num('ChargeFreightCost', 0)) {
display_error(tr("The entered shipping cost is invalid or less than zero."));
set_focus('ChargeFreightCost');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:30,代码来源:customer_credit_invoice.php
示例16: wp
public function wp(WP $WP)
{
if (is_404() && ($class_name = $this->get_404_class_name())) {
} elseif (is_search() && ($class_name = $this->get_search_class_name())) {
} elseif (is_front_page() && ($class_name = $this->get_front_page_class_name())) {
} elseif (is_home() && ($class_name = $this->get_home_class_name())) {
} elseif (is_post_type_archive() && ($class_name = $this->get_post_type_archive_class_name())) {
} elseif (is_tax() && ($class_name = $this->get_taxonomy_class_name())) {
// elseif (is_attachment() && $class_name = $this->get_attachment_class_name()):
} elseif (is_page() && ($class_name = $this->get_page_class_name())) {
} elseif (is_single() && ($class_name = $this->get_single_class_name())) {
} elseif (is_category() && ($class_name = $this->get_category_class_name())) {
} elseif (is_tag() && ($class_name = $this->get_tag_class_name())) {
} elseif (is_author() && ($class_name = $this->get_author_class_name())) {
} elseif (is_date() && ($class_name = $this->get_date_class_name())) {
// elseif (is_comments_popup() && $class_name = $this->get_comments_popup_class_name()):
// elseif (is_paged() && $class_name = $this->get_paged_class_name()):
} else {
$class_name = $this->get_index_class_name();
}
// must use Autoloader
if ($class_name && class_exists($class_name)) {
set_query_var($this->class_data['store_name'], new $class_name());
}
return;
}
开发者ID:p-o-t-s,项目名称:wpsb-class-selector,代码行数:26,代码来源:WPsB_Class_Selector.php
示例17: pass
function pass($post)
{
global $DT_TIME, $L;
if (!is_array($post)) {
return false;
}
if (!$post['title']) {
return $this->_($L['honor_pass_title']);
}
if (!$post['authority']) {
return $this->_($L['honor_pass_authority']);
}
if (!$post['thumb']) {
return $this->_($L['honor_pass_thumb']);
}
if (!$post['fromtime'] || !is_date($post['fromtime'])) {
return $this->_($L['honor_pass_fromdate']);
}
if (datetotime($post['fromtime'] . ' 00:00:00') > $DT_TIME) {
return $this->_($L['honor_pass_fromdate_error']);
}
if ($post['totime']) {
if (!is_date($post['totime'])) {
return $this->_($L['honor_pass_todate']);
}
if (datetotime($post['totime'] . ' 23:59:59') < $DT_TIME) {
return $this->_($L['honor_pass_todate_error']);
}
}
return true;
}
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:honor.class.php
示例18: can_process
function can_process()
{
global $selected_id;
if ($selected_id == -1) {
if (!references::is_valid($_POST['ref'])) {
display_error(tr("The dimension reference must be entered."));
set_focus('ref');
return false;
}
if (!is_new_reference($_POST['ref'], systypes::dimension())) {
display_error(tr("The entered reference is already in use."));
set_focus('ref');
return false;
}
}
if (strlen($_POST['name']) == 0) {
display_error(tr("The dimension name must be entered."));
set_focus('name');
return false;
}
if (!is_date($_POST['date_'])) {
display_error(tr("The date entered is in an invalid format."));
set_focus('date_');
return false;
}
if (!is_date($_POST['due_date'])) {
display_error(tr("The required by date entered is in an invalid format."));
set_focus('due_date');
return false;
}
return true;
}
开发者ID:ravenii,项目名称:guardocs,代码行数:32,代码来源:dimension_entry.php
示例19: mypace_custom_navi_menu
function mypace_custom_navi_menu($classes, $item)
{
global $wp_query;
$singular_slug = 'service';
$page_for_custom_type_title = 'サービス';
$page_for_posts = get_option('page_for_posts');
$post_type_query = $wp_query->query_vars['post_type'];
$del_flag = true;
$add_flag = false;
if (is_singular('post') || is_category() || is_tag()) {
$del_flag = false;
} elseif (is_author() || is_date() || is_author()) {
if (in_array($post_type_query, array('', 'post'))) {
$del_flag = false;
} elseif ($post_type_query == $custom_post_type) {
$add_flag = true;
}
} elseif (is_tax()) {
$taxonomy = get_taxonomy($wp_query->query_vars['taxonomy']);
if (count($taxonomy->object_type) == 1 && $taxonomy->object_type[0] == 'post') {
$del_flag = false;
} elseif (count($taxonomy->object_type) == 1 && $taxonomy->object_type[0] == $singular_slug) {
$add_flag = true;
}
} elseif (is_singular($singular_slug)) {
$add_flag = true;
}
if ($del_flag && is_numeric($page_for_posts) && $item->object_id == $page_for_posts && $item->object == 'page' && ($key = array_search('current_page_parent', $classes))) {
unset($classes[$key]);
} elseif ($add_flag && $item->title == $page_for_custom_type_title && $item->object == 'page') {
$classes[] = 'current_page_parent';
}
return $classes;
}
开发者ID:k111,项目名称:wp_theme_skeleton,代码行数:34,代码来源:functions.php
示例20: cpotheme_page_title
function cpotheme_page_title()
{
global $post;
if (isset($post->ID)) {
$current_id = $post->ID;
} else {
$current_id = false;
}
$title_tag = function_exists('is_woocommerce') && is_woocommerce() && is_singular('product') ? 'span' : 'h1';
echo '<' . $title_tag . ' class="pagetitle-title heading">';
if (function_exists('is_woocommerce') && is_woocommerce()) {
woocommerce_page_title();
} elseif (is_category() || is_tag() || is_tax()) {
echo single_tag_title('', true);
} elseif (is_author()) {
the_author();
} elseif (is_date()) {
_e('Archive', 'brilliance');
} elseif (is_404()) {
echo __('Page Not Found', 'brilliance');
} elseif (is_search()) {
echo __('Search Results for', 'brilliance') . ' "' . get_search_query() . '"';
} else {
echo get_the_title($current_id);
}
echo '</' . $title_tag . '>';
}
开发者ID:neetudave,项目名称:heartfulness-uk,代码行数:27,代码来源:markup.php
注:本文中的is_date函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论