• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP english_date函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中english_date函数的典型用法代码示例。如果您正苦于以下问题:PHP english_date函数的具体用法?PHP english_date怎么用?PHP english_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了english_date函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: form_fields

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(BLOG_FOLDER, 'blog_users_model');
     $CI->load->module_model(BLOG_FOLDER, 'blog_posts_model');
     $post_title = '';
     $post_options = $CI->blog_posts_model->options_list('id', 'title', array(), 'date_added desc');
     if (empty($post_options)) {
         return lang('blog_error_no_posts_to_comment');
     }
     $fields['post_id'] = array('type' => 'select', 'options' => $post_options, 'label' => 'Post');
     if (!empty($values['id'])) {
         $post = $CI->blog_posts_model->find_by_key($values['post_id']);
         $post_title = $post->title;
         if (!$post->is_published()) {
             add_error(lang('blog_post_is_not_published'));
         }
         $fields['post_id'] = array('type' => 'hidden', 'value' => $post_title, 'displayonly' => TRUE);
         $fields['post_title'] = array('label' => 'Post', 'value' => $post_title, 'order' => 1);
         $fields['post_title']['displayonly'] = TRUE;
         $fields['post_published']['displayonly'] = TRUE;
         $fields['author_email']['displayonly'] = TRUE;
         $fields['author_name']['displayonly'] = TRUE;
         $fields['post_title']['displayonly'] = TRUE;
         $fields['author_website']['displayonly'] = TRUE;
         $fields['ip_host']['displayonly'] = TRUE;
         $fields['date_submitted'] = array('displayonly' => TRUE, 'value' => english_date($values['date_added'], TRUE));
         $ip_host = !empty($values['author_ip']) ? gethostbyaddr($values['author_ip']) . ' (' . $values['author_ip'] . ')' : '';
         $fields['ip_host'] = array('label' => 'IP/Host', 'value' => $ip_host, 'order' => 5, 'displayonly' => TRUE);
         $fields['Reply to this Comment'] = array('type' => 'section');
         $replies = $this->find_all_array(array('parent_id' => $values['id']));
         $reply_arr = array();
         foreach ($replies as $r) {
             $reply_arr[] = $r['content'];
         }
         $fields['replies'] = array('label' => 'Replies', 'displayonly' => TRUE, 'value' => implode('<br /><br />', $reply_arr));
         if ($values['author_id'] == $CI->fuel_auth->user_data('id') or $CI->fuel_auth->is_super_admin()) {
             $fields['reply'] = array('label' => 'Reply', 'type' => 'textarea');
             $notify_options = array('Commentor' => lang('blog_comment_notify_option2'), 'All' => lang('blog_comment_notify_option1'), 'None' => lang('blog_comment_notify_option3'));
             $fields['reply_notify'] = array('label' => 'Notfiy', 'type' => 'enum', 'options' => $notify_options);
         }
         // hidden
         $fields['author_ip'] = array('type' => 'hidden');
     } else {
         $fields['author_ip'] = array('type' => 'hidden', 'value' => $_SERVER['REMOTE_ADDR'], 'label' => 'Author IP Address');
         $fields['is_spam'] = array('type' => 'hidden');
         $fields['date_added']['type'] = 'hidden';
         // so it will auto add
         $fields['last_modified']['type'] = 'hidden';
         // so it will auto add
     }
     // set author to current fuel user
     if (empty($fields['author_id']) and $CI->fuel_auth->user_data('id')) {
         $fields['author_id'] = array('value' => $CI->fuel_auth->user_data('id'));
     }
     $fields['author_id'] = array('type' => 'hidden');
     return $fields;
 }
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:59,代码来源:blog_comments_model.php


示例2: list_items

 function list_items($limit = null, $offset = 0, $col = 'name', $order = 'asc')
 {
     $CI =& get_instance();
     $CI->load->helper('array');
     $CI->load->helper('convert');
     if (!isset($this->filters['group_id'])) {
         return array();
     }
     $group_id = $this->filters['group_id'];
     // not encoded yet... then decode
     if (!$this->_encoded) {
         $this->filters['group_id'] = uri_safe_encode($group_id);
         // to pass the current folder
         $this->_encoded = TRUE;
     } else {
         $group_id = uri_safe_decode($group_id);
     }
     $asset_dir = $this->get_dir($group_id);
     $assets_path = $CI->asset->assets_server_path . $asset_dir . DIRECTORY_SEPARATOR;
     $tmpfiles = directory_to_array($assets_path, TRUE, $CI->config->item('assets_excluded_dirs', 'fuel'), FALSE);
     $files = get_dir_file_info($assets_path, TRUE);
     $cnt = count($tmpfiles);
     $return = array();
     $asset_type_path = WEB_PATH . $CI->config->item('assets_path') . $asset_dir . '/';
     //for ($i = $offset; $i < $cnt - 1; $i++)
     for ($i = 0; $i < $cnt; $i++) {
         if (!empty($tmpfiles[$i]) && !empty($files[$tmpfiles[$i]])) {
             $key = $tmpfiles[$i];
             if (empty($this->filters['name']) || !empty($this->filters['name']) && (strpos($files[$key]['name'], $this->filters['name']) !== FALSE || strpos($key, $this->filters['name']) !== FALSE)) {
                 $file['id'] = uri_safe_encode(assets_server_to_web_path($files[$tmpfiles[$i]]['server_path'], TRUE));
                 //$file['filename'] = $files[$key]['name'];
                 $file['name'] = $key;
                 $file['preview/kb'] = $files[$key]['size'];
                 $file['link'] = NULL;
                 $file['last_updated'] = english_date($files[$key]['date'], true);
                 $return[] = $file;
             }
         }
     }
     $return = array_sorter($return, $col, $order, TRUE);
     // do a check for empty limit values to prevent issues found where an empty $limit value would return nothing in 5.16
     $return = empty($limit) ? array_slice($return, $offset) : array_slice($return, $offset, $limit);
     // after sorting add the images
     foreach ($return as $key => $val) {
         if (is_image_file($return[$key]['name'])) {
             $return[$key]['preview/kb'] = $return[$key]['preview/kb'] . ' kb <div class="img_crop"><a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank"><img src="' . $asset_type_path . $return[$key]['name'] . '" border="0"></a></div>';
             $return[$key]['link'] = '<a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank">' . $asset_dir . '/' . $return[$key]['name'] . '</a>';
         } else {
             $return[$key]['preview/kb'] = $return[$key]['preview/kb'];
             $return[$key]['link'] = '<a href="' . $asset_type_path . $return[$key]['name'] . '" target="_blank">' . $asset_dir . '/' . $return[$key]['name'] . '</a>';
         }
     }
     return $return;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:54,代码来源:assets_model.php


示例3: list_items

 function list_items($limit = NULL, $offset = NULL, $col = 'date_added', $order = 'desc')
 {
     // set the filter again here just in case the table names are different
     $this->filters = array('title', 'content_filtered', $this->_tables['users'] . '.first_name', $this->_tables['users'] . '.last_name');
     $this->db->select($this->_tables['blog_posts'] . '.id, title, CONCAT(' . $this->_tables['users'] . '.first_name, " ", ' . $this->_tables['users'] . '.last_name) AS author, ' . $this->_tables['blog_posts'] . '.date_added, ' . $this->_tables['blog_posts'] . '.published', FALSE);
     $this->db->join($this->_tables['users'], $this->_tables['users'] . '.id = ' . $this->_tables['blog_posts'] . '.author_id', 'left');
     $data = parent::list_items($limit, $offset, $col, $order);
     foreach ($data as $key => $val) {
         $data[$key]['date_added'] = english_date($data[$key]['date_added'], TRUE);
     }
     return $data;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:12,代码来源:blog_posts_model.php


示例4: options_list

 function options_list($ref_id, $table_name, $include_current = false)
 {
     $CI =& get_instance();
     $CI->load->helper('date');
     $options = $this->find_all_array(array('ref_id' => $ref_id, 'table_name' => $table_name), 'version_timestamp desc');
     $return = array();
     $i = 0;
     foreach ($options as $val) {
         if ($i == 0 && $include_current) {
             $return[$val['version']] = 'Current Version';
         } else {
             $return[$val['version']] = 'Version ' . $val['version'] . ' - ' . english_date($val['version_timestamp'], true);
         }
         $i++;
     }
     return $return;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:17,代码来源:archives_model.php


示例5: options_list

 /**
  * Returns an option list of saved archives based on a record ID and table name
  *
  * @access	public
  * @param	string	The record ID
  * @param	string	The table name
  * @param	boolean	Determines whether to include the currently active record in the archive list (optional)
  * @param	boolean	Order by for options list (optional)
  * @return	array Key/value array with the key being the archive ID value
  */
 public function options_list($ref_id = NULL, $table_name = NULL, $include_current = array(), $order_by = TRUE)
 {
     if ($order_by === TRUE) {
         $order_by = 'version_timestamp desc';
     }
     $CI =& get_instance();
     $CI->load->helper('date');
     $options = $this->find_all_array(array('ref_id' => $ref_id, 'table_name' => $table_name), $order_by);
     $return = array();
     $i = 0;
     foreach ($options as $val) {
         if ($i == 0 && !empty($include_current)) {
             $return[$val['version']] = 'Current Version';
         } else {
             $return[$val['version']] = 'Version ' . $val['version'] . ' - ' . english_date($val['version_timestamp'], true);
         }
         $i++;
     }
     return $return;
 }
开发者ID:magicjoey,项目名称:FUEL-CMS,代码行数:30,代码来源:fuel_archives_model.php


示例6: get_archive

 /**
  * Retrieves an archived value
  *
  * @access	public
  * @param	int The record ID associated with the archive
  * @param	int The version of the archive to retrieve (optional)
  * @param	boolean Determines whether to return all of the archives fields or just the data field value (optional)
  * @return	array
  */
 public function get_archive($ref_id, $version = NULL, $all_data = FALSE)
 {
     $CI =& get_instance();
     $CI->load->module_model(FUEL_FOLDER, 'fuel_archives_model');
     $CI->load->helper('date');
     // best to use ref_id and version because it is more secure
     $where = array('table_name' => $this->table_name, 'ref_id' => $ref_id, 'version' => $version);
     $archive = $CI->fuel_archives_model->find_one_array($where);
     $return = $archive;
     $return['data'] = array();
     if (!empty($archive)) {
         // check for serialization for backwards compatibility
         $data = is_serialized_str($archive['data']) ? @unserialize($archive['data']) : json_decode($archive['data'], TRUE);
         if (!empty($data) and is_array($data)) {
             foreach ($data as $key => $val) {
                 // reformat dates
                 if (is_date_format($val)) {
                     $date_ts = strtotime($val);
                     $return['data'][$key] = english_date($val);
                     $return['data'][$key . '_hour'] = date('h', $date_ts);
                     $return['data'][$key . '_min'] = date('i', $date_ts);
                     $return['data'][$key . '_ampm'] = date('a', $date_ts);
                 } else {
                     $return['data'][$key] = $val;
                 }
             }
         }
     }
     return $all_data ? $return : $return['data'];
 }
开发者ID:prgoncalves,项目名称:Beatcrumb-web,代码行数:39,代码来源:base_module_model.php


示例7: is_english_format

<pre class="brush: php">
is_english_format('01/01/2010');
// returns TRUE
</pre>


<h2>english_date('<var>date</var>', <var>[long]</var>, <var>[timezone]</var>, <var>[delimiter]</var>)</h2>
<p>Returns a date in 'english' (mm/dd/yyy) format. 
The <dfn>long</dfn> parameter determines whether to include the time or not.
The <dfn>timezone</dfn> parameter determines whether to include the time or not.
The <dfn>delimiter</dfn> parameter determines whether to include the time or not.
</p>
<pre class="brush: php">
english_date(time());
// returns <?php 
echo english_date(time());
?>
</pre>


<h2>english_date_verbose('<var>date</var>')</h2>
<p>Returns date in 'verbose' ( Jan. 1, 2010) format.</p>
<pre class="brush: php">
english_date_verbose(time());
// returns <?php 
echo english_date_verbose(time());
?>
</pre>


<h2>time_verbose('<var>time</var>', <var>[include_seconds]</var>)</h2>
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:31,代码来源:my_date_helper.php


示例8: _form


//.........这里部分代码省略.........
                         require_once APPPATH . 'controllers/' . $segments[0] . '/' . $segments[1] . EXT;
                         $controller = $segments[1];
                         $method = !empty($segments[2]) ? $segments[2] : 'index';
                         $class_methods = get_class_methods($segments[1]);
                         if (in_array($method, $class_methods)) {
                             $uses_controller = TRUE;
                         }
                     }
                 } else {
                     if (file_exists(APPPATH . 'controllers/' . $segments[0] . $route['default_controller'] . EXT)) {
                         require_once APPPATH . 'controllers/' . $segments[0] . $route['default_controller'] . EXT;
                         $class_methods = get_class_methods($route['default_controller']);
                         if (in_array('index', $class_methods)) {
                             $uses_controller = TRUE;
                         }
                     }
                 }
             }
         }
     }
     $page_vars = array();
     if (!empty($_POST)) {
         $page_vars = array();
         foreach ($_POST as $key => $val) {
             $key = end(explode('--', $key));
             $page_vars[$key] = $val;
         }
     }
     if (!empty($id)) {
         $lang = $this->input->get('lang');
         if (!$lang) {
             $lang = $this->fuel->language->default_option();
         }
         $page_vars = array_merge($this->fuel_pagevariables_model->find_all_by_page_id($id, $lang), $page_vars);
         // the following will pre-populate fields of a different language to the default values
         if (empty($page_vars) and $this->fuel->language->has_multiple() and $lang != $this->fuel->language->default_option()) {
             $page_vars = $this->fuel_pagevariables_model->find_all_by_page_id($id, $this->fuel->language->default_option());
         }
     }
     // page variables
     $layout = $this->fuel->layouts->get($layout);
     if (!empty($layout)) {
         $layout->set_field_values($page_vars);
         $fields = $layout->fields();
         $import_field = $layout->import_field();
     }
     if (!empty($import_field)) {
         $this->js_controller_params['import_field'] = $import_field;
     }
     // since the form builder is cleared above, we'll add in a script tag to make sure that the initialize code gets executed again
     $this->form_builder->add_js('<script></script>');
     $this->form_builder->id = 'layout_fields';
     $this->form_builder->name_prefix = 'vars';
     $this->form_builder->set_fields($fields);
     $this->form_builder->set_field_values($page_vars);
     $conflict = $this->_has_conflict($fields);
     if (!empty($conflict)) {
         $vars['layout_fields'] = $conflict;
     } else {
         //$vars['layout_fields'] = '';
         $vars['layout_fields'] = $this->form_builder->render();
     }
     // other variables
     $vars['id'] = $id;
     $vars['data'] = $saved;
     $vars['action'] = !empty($saved['id']) ? 'edit' : 'create';
     $action_uri = $vars['action'] . '/' . $id . '/';
     $vars['form_action'] = $this->fuel->admin->is_inline() ? $this->module_uri . '/inline_' . $action_uri : $this->module_uri . '/' . $action_uri;
     $vars['versions'] = $this->fuel_archives_model->options_list($id, $this->model->table_name());
     $vars['publish'] = !empty($saved['published']) && is_true_val($saved['published']) ? 'Unpublish' : 'Publish';
     $vars['import_view'] = $import_view;
     $vars['view_twin'] = $view_twin;
     $vars['routes'] = $routes;
     $vars['uses_controller'] = $uses_controller;
     $vars['others'] = $this->model->get_others('location', $id);
     if (!empty($saved['location'])) {
         $related = $saved;
         $related['page_vars'] = $page_vars;
         $vars['related_items'] = $this->model->related_items($related);
     }
     $actions = $this->load->module_view(FUEL_FOLDER, '_blocks/module_create_edit_actions', $vars, TRUE);
     $vars['actions'] = $actions;
     $vars['error'] = $this->model->get_errors();
     if (!empty($saved['last_modified'])) {
         $vars['last_updated'] = lang('pages_last_updated_by', english_date($vars['data']['last_modified'], true), $vars['data']['email']);
     }
     $notifications = $this->load->module_view(FUEL_FOLDER, '_blocks/notifications', $vars, TRUE);
     $vars['notifications'] = $notifications;
     if ($vars['action'] == 'edit') {
         $crumbs = array($this->module_uri => $this->module_name, '' => character_limiter(strip_tags($vars['data'][$this->display_field]), 50));
     } else {
         $crumbs = array($this->module_uri => $this->module_name, '' => lang('action_create'));
     }
     $this->fuel->admin->set_titlebar($crumbs);
     // do this after rendering so it doesn't render current page'
     if (!empty($vars['data'][$this->display_field])) {
         $this->fuel->admin->add_recent_page($this->uri->uri_string(), $vars['data'][$this->display_field], $this->module);
     }
     return $vars;
 }
开发者ID:prgoncalves,项目名称:Beatcrumb-web,代码行数:101,代码来源:pages.php


示例9: lang

	<?php 
echo $actions;
?>

</div>

<div id="notification" class="notification">
	<?php 
echo $notifications;
?>
	<?php 
if (!empty($data['last_modified'])) {
    ?>
	<p class="ico ico_info last_updated"><?php 
    echo lang('pages_last_updated_by', english_date($data['last_modified'], true), $data['email']);
    ?>
</p>
	<?php 
} else {
    ?>

	<?php 
}
?>
</div>
<div id="main_content">

	<?php 
if (!empty($page_navs)) {
    ?>
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:30,代码来源:page_create_edit.php


示例10: foreach

<?php

if ($this->fuel_auth->has_permission('logs')) {
    if (!empty($latest_activity)) {
        ?>
<div class="dashboard_pod" style="width: 450px;">

	<h3>Latest Activity</h3>
	<ul class="nobullets">
		<?php 
        foreach ($latest_activity as $val) {
            ?>
		<li><strong><?php 
            echo english_date($val['entry_date'], true);
            ?>
:</strong> <?php 
            echo $val['message'];
            ?>
 by <?php 
            echo $val['name'];
            ?>
</li>
		<?php 
        }
        ?>
	</ul>
	<a href="<?php 
        echo fuel_url('manage/activity');
        ?>
">View all activity</a>
</div>
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:31,代码来源:dashboard_ajax.php


示例11: is_date_english_format

<p>Returns a boolean value as to whether the date is in a valid 'english' (mm/dd/yyy) format.</p>
<pre class="brush: php">
is_date_english_format('01/01/2010');
// returns TRUE
</pre>


<h2>english_date('<var>date</var>', <var>[long]</var>, <var>[timezone]</var>, <var>[delimiter]</var>)</h2>
<p>Returns a date in 'english' (mm/dd/yyy) format. 
The <dfn>long</dfn> parameter determines whether to include the time or not.
The <dfn>timezone</dfn> parameter determines whether to include the time or not.
The <dfn>delimiter</dfn> parameter determines whether to include the time or not.
</p>
<pre class="brush: php">
english_date(time());
// returns <?=english_date(time())?>
</pre>


<h2>english_date_verbose('<var>date</var>')</h2>
<p>Returns date in 'verbose' ( Jan. 1, 2010) format.</p>
<pre class="brush: php">
english_date_verbose(time());
// returns <?=english_date_verbose(time())?>
</pre>


<h2>time_verbose('<var>time</var>', <var>[include_seconds]</var>)</h2>
<p>Returns the time into a verbose format (e.g. 12hrs 10mins 10secs).</p>
<pre class="brush: php">
time_verbose(time(), TRUE);
开发者ID:rodrigowebe,项目名称:FUEL-CMS,代码行数:31,代码来源:my_date_helper.php


示例12: english_date

	<?php 
echo $actions;
?>

</div>

<div id="notification" class="notification">
	<?php 
echo $notifications;
?>
	<?php 
if (!empty($data['last_modified'])) {
    ?>
	<p class="ico ico_info last_updated"> Last updated <?php 
    echo english_date($data['last_modified'], true);
    ?>
 by <?php 
    echo $data['email'];
    ?>
</p>
	<?php 
} else {
    ?>

	<?php 
}
?>
</div>
<div id="main_content">
开发者ID:kieranklaassen,项目名称:FUEL-CMS,代码行数:29,代码来源:page_create_edit.php


示例13: get_archive

	/**
	 * Retrieves an archived value
	 *
	 * @access	public
	 * @param	string
	 * @param	int
	 * @param	boolean
	 * @return	array
	 */	
	function get_archive($ref_id, $version = NULL, $all_data = FALSE)
	{
		$CI =& get_instance();
		$CI->load->module_model(FUEL_FOLDER, 'archives_model');
		$CI->load->helper('date');
		
		// best to use ref_id and version because it is more secure
		$where = array('table_name' => $this->table_name, 'ref_id' => $ref_id, 'version' => $version);
		$archive = $CI->archives_model->find_one_array($where);
		$return = $archive;
		$return['data'] = array();
		if (!empty($archive))
		{
			$data = unserialize($archive['data']);
			foreach($data as $key => $val)
			{
				// reformat dates
				if (is_date_format($val))
				{
					$date_ts = strtotime($val);
					$return['data'][$key] = english_date($val);
					$return['data'][$key.'_hour'] = date('h', $date_ts);
					$return['data'][$key.'_min'] = date('i', $date_ts);
					$return['data'][$key.'_ampm'] = date('a', $date_ts);
				}
				else
				{
					$return['data'][$key] = $val;
				}
			}
		}
		return ($all_data) ? $return : $return['data'];
	}
开发者ID:rodrigowebe,项目名称:FUEL-CMS,代码行数:42,代码来源:base_module_model.php



注:本文中的english_date函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP enkripsi函数代码示例发布时间:2022-05-15
下一篇:
PHP engelsystem_log函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap