本文整理汇总了PHP中is_date函数的典型用法代码示例。如果您正苦于以下问题:PHP is_date函数的具体用法?PHP is_date怎么用?PHP is_date使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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)));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}