本文整理汇总了PHP中mysql2timestamp函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql2timestamp函数的具体用法?PHP mysql2timestamp怎么用?PHP mysql2timestamp使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql2timestamp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query_init
//.........这里部分代码省略.........
$this->ItemQuery->where_locale($this->filters['lc']);
$this->ItemQuery->where_statuses($this->filters['statuses']);
$this->ItemQuery->where_types($this->filters['types']);
$this->ItemQuery->where_keywords($this->filters['keywords'], $this->filters['phrase'], $this->filters['exact']);
$this->ItemQuery->where_ID($this->filters['post_ID'], $this->filters['post_title']);
$this->ItemQuery->where_ID_list($this->filters['post_ID_list']);
$this->ItemQuery->where_datestart($this->filters['ymdhms'], $this->filters['week'], $this->filters['ymdhms_min'], $this->filters['ymdhms_max'], $this->filters['ts_min'], $this->filters['ts_max']);
$this->ItemQuery->where_datecreated($this->filters['ts_created_max']);
$this->ItemQuery->where_visibility($this->filters['visibility_array']);
$this->ItemQuery->where_featured($this->filters['featured']);
/*
* ORDER BY stuff:
*/
if ($this->filters['post_ID_list'] && $this->filters['orderby'] == 'ID_list') {
$order_by = 'FIELD(' . $this->Cache->dbIDname . ', ' . $this->filters['post_ID_list'] . ')';
} elseif ($this->filters['orderby'] == 'ID_list') {
// Use blog setting here because 'orderby' might be set to 'ID_list' as default filter
$this->filters['orderby'] = $this->Blog->get_setting('orderby');
}
if (empty($order_by)) {
$order_by = gen_order_clause($this->filters['orderby'], $this->filters['order'], $this->Cache->dbprefix, $this->Cache->dbIDname);
}
$this->ItemQuery->order_by($order_by);
/*
* GET TOTAL ROW COUNT:
*/
if ($this->single_post) {
// Single post: no paging required!
$this->total_rows = 1;
$this->total_pages = 1;
$this->page = 1;
} elseif ($this->filters['unit'] == 'days' || $this->filters['unit'] == 'all') {
$this->total_rows = NULL;
// unknown!
$this->total_pages = 1;
$this->page = 1;
} elseif ($this->filters['unit'] == 'posts') {
/*
* TODO: The result is incorrect when using AND on categories
* We would need to use a HAVING close and thyen COUNT, which would be a subquery
* This is nto compatible with mysql 3.23
* We need fallback code.
*/
$sql_count = '
SELECT COUNT( DISTINCT ' . $this->Cache->dbIDname . ') ' . $this->ItemQuery->get_from() . $this->ItemQuery->get_where();
//echo $DB->format_query( $sql_count );
parent::count_total_rows($sql_count);
//echo '<br />'.$this->total_rows;
} else {
debug_die('Unhandled LIMITING mode in ItemList:' . $this->filters['unit'] . ' (paged mode is obsolete)');
}
/*
* Paging LIMITs:
*/
if ($this->single_post) {
// Single post: no paging required!
} elseif ($this->filters['unit'] == 'all') {
// We want ALL results!
} elseif ($this->filters['unit'] == 'posts') {
// TODO: dh> check if $limit is NULL!? - though it should not arrive at $page>1 then..
// echo 'LIMIT POSTS ';
$pgstrt = '';
if ($this->page > 1) {
// We have requested a specific page number
$pgstrt = (intval($this->page) - 1) * $this->limit . ', ';
}
$this->ItemQuery->LIMIT($pgstrt . $this->limit);
} elseif ($this->filters['unit'] == 'days') {
// We are going to limit to x days:
// echo 'LIMIT DAYS ';
if (empty($this->filters['ymdhms_min'])) {
// We have no start date, we'll display the last x days:
if (!empty($this->filters['keywords']) || !empty($this->filters['cat_array']) || !empty($this->filters['authors'])) {
// We are in DAYS mode but we can't restrict on these! (TODO: ?)
$limits = '';
} else {
// We are going to limit to LAST x days:
$lastpostdate = $this->get_lastpostdate();
$lastpostdate = mysql2date('Y-m-d 00:00:00', $lastpostdate);
$lastpostdate = mysql2date('U', $lastpostdate);
// go back x days
$otherdate = date('Y-m-d H:i:s', $lastpostdate - ($this->limit - 1) * 86400);
$this->ItemQuery->WHERE_and($this->Cache->dbprefix . 'datestart > \'' . $otherdate . '\'');
}
} else {
// We have a start date, we'll display x days starting from that point:
// $dstart_mysql has been calculated earlier
// TODO: this is redundant with previous dstart processing:
// Add trailing 0s: YYYYMMDDHHMMSS
$dstart0 = $this->filters['ymdhms_min'] . '00000000000000';
$dstart_mysql = substr($dstart0, 0, 4) . '-' . substr($dstart0, 4, 2) . '-' . substr($dstart0, 6, 2) . ' ' . substr($dstart0, 8, 2) . ':' . substr($dstart0, 10, 2) . ':' . substr($dstart0, 12, 2);
$dstart_ts = mysql2timestamp($dstart_mysql);
// go forward x days
$enddate_ts = date('Y-m-d H:i:s', $dstart_ts + $this->limit * 86400);
$this->ItemQuery->WHERE_and($this->Cache->dbprefix . 'datestart < \'' . $enddate_ts . '\'');
}
} else {
debug_die('Unhandled LIMITING mode in ItemList:' . $this->filters['unit'] . ' (paged mode is obsolete)');
}
}
示例2: headers_content_mightcache
// TODO: dh> add entry for homepage (lastmod of latest item)
// TODO: dh> take comments into consideration for prio
// TODO: dh> use main Blog URL only, since google requires them to be on the same domain/path
// (see sitemap_plugin)
// Note: since URLs are likely to be clean ASCII, $io_charset can probably be faked to UTF-8 here
headers_content_mightcache('application/xml', '#', 'UTF-8');
// In most situations, you do NOT want to cache dynamic content!
echo '<?xml version="1.0" encoding="UTF-8"?' . '>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php
while ($Item =& mainlist_get_item()) {
// For each blog post, do everything below up to the closing curly brace "}"
// Age in days of the post
$age = ($localtimenow - mysql2timestamp($Item->datemodified)) / 86400;
// Prio: Recent posts will get higher priority compared to older posts, in case the SE doesn't want to index all posts!
// Change frequency: recent posts are more likely to change often than older posts, especially regarding comments.
// We hint SEs to check back more often (and not to waste indexing credits on old stuff).
if ($age < 8) {
$prio = 0.9;
$changefreq = 'hourly';
} elseif ($age < 30) {
$prio = 0.8;
$changefreq = 'daily';
} elseif ($age < 90) {
$prio = 0.7;
$changefreq = 'daily';
} elseif ($age < 365) {
$prio = 0.6;
$changefreq = 'weekly';
示例3: display_activateinfo
/**
* Display user activate info form content
*
* @param Object activateinfo Form
*/
function display_activateinfo($params)
{
global $current_User, $Settings, $UserSettings, $Plugins;
global $secure_htsrv_url, $rsc_path, $rsc_url, $dummy_fields;
if (!is_logged_in()) {
// if this happens, it means the code is not correct somewhere before this
debug_die("You must log in to see this page.");
}
// init force request new email address param
$force_request = param('force_request', 'boolean', false);
// get last activation email timestamp from User Settings
$last_activation_email_date = $UserSettings->get('last_activation_email', $current_User->ID);
if ($force_request || empty($last_activation_email_date)) {
// notification email was not sent yet, or user needs another one ( forced request )
$params = array_merge(array('form_action' => $secure_htsrv_url . 'login.php', 'form_name' => 'form_validatemail', 'form_class' => 'fform', 'form_layout' => 'fieldset', 'inskin' => false), $params);
$Form = new Form($params['form_action'], $params['form_name'], 'post', $params['form_layout']);
$Form->begin_form($params['form_class']);
$Form->add_crumb('validateform');
$Form->hidden('action', 'req_validatemail');
$Form->hidden('redirect_to', $params['redirect_to']);
if ($params['inskin']) {
$Form->hidden('inskin', $params['inskin']);
$Form->hidden('blog', $params['blog']);
}
$Form->hidden('req_validatemail_submit', 1);
// to know if the form has been submitted
$Form->begin_fieldset();
echo '<ol>';
echo '<li>' . T_('Please confirm your email address below:') . '</li>';
echo '</ol>';
// set email text input content only if this is not a forced request. This way the user may have bigger chance to write a correct email address.
$user_email = $force_request ? '' : $current_User->email;
// fp> note: 45 is the max length for evopress skin.
$Form->text_input($dummy_fields['email'], $user_email, 45, T_('Your email'), '', array('maxlength' => 255, 'class' => 'input_text', 'required' => true));
$Form->end_fieldset();
// Submit button:
$submit_button = array(array('name' => 'submit', 'value' => T_('Send me a new activation email now!'), 'class' => 'submit'));
$Form->buttons_input($submit_button);
if (!$params['inskin']) {
$Plugins->trigger_event('DisplayValidateAccountFormFieldset', array('Form' => &$Form));
}
$Form->end_form();
return;
}
// get notification email from general Settings
$notification_email = $Settings->get('notification_sender_email');
// convert date to timestamp
$last_activation_email_ts = mysql2timestamp($last_activation_email_date);
// get difference between local time and server time
$time_difference = $Settings->get('time_difference');
// get last activation email local date and time
$last_email_date = date(locale_datefmt(), $last_activation_email_ts + $time_difference);
$last_email_time = date(locale_shorttimefmt(), $last_activation_email_ts + $time_difference);
$user_email = $current_User->email;
echo '<ol start="1" class="expanded">';
$instruction = sprintf(T_('Open your email account for %s and find a message we sent you on %s at %s with the following title:'), $user_email, $last_email_date, $last_email_time);
echo '<li>' . $instruction . '<br /><b>' . sprintf(T_('Activate your account: %s'), $current_User->login) . '</b>';
$request_validation_url = 'href="' . regenerate_url('', 'force_request=1&validate_required=true&redirect_to=' . $params['redirect_to']) . '"';
echo '<p>' . sprintf(T_('NOTE: If you don\'t find it, check your "Junk", "Spam" or "Unsolicited email" folders. If you really can\'t find it, <a %s>request a new activation email</a>.'), $request_validation_url) . '</p></li>';
echo '<li>' . sprintf(T_('Add us (%s) to your contacts to make sure you receive future email notifications, especially when someone sends you a private message.'), '<b><span class="nowrap">' . $notification_email . '</span></b>') . '</li>';
echo '<li><b class="red">' . T_('Click on the activation link in the email.') . '</b>';
echo '<p>' . T_('If this does not work, please copy/paste that link into the address bar of your browser.') . '</p>';
echo '<p>' . sprintf(T_('If you need assistance, please send an email to %s'), '<b><a href="mailto:"' . $notification_email . '"><span class="nowrap">' . $notification_email . '</span></a></b>') . '</p></li>';
echo '</ol>';
if ((strpos($user_email, '@hotmail.') || strpos($user_email, '@live.') || strpos($user_email, '@msn.')) && file_exists($rsc_path . 'img/login_help/hotmail-validation.png')) {
// The user is on hotmail and we have a help screen to show him: (needs to be localized and include correct site name)
echo '<div class="center" style="margin: 2em auto"><img src="' . $rsc_url . 'img/login_help/hotmail-validation.png" /></div>';
}
}
示例4: utf8_strtolower
// has the form been submitted
$email = utf8_strtolower(param($dummy_fields['email'], 'string', $current_User->email));
// the email address is editable
if ($req_validatemail_submit) {
// Form has been submitted
param_check_email($dummy_fields['email'], true);
// check if user email was changed
$email_changed = $current_User->get('email') != $email;
// check if we really needs to send a new validation email
if (!$email_changed) {
// the email was not changed
$last_activation_email_date = $UserSettings->get('last_activation_email', $current_User->ID);
if (!empty($last_activation_email_date)) {
// at least one validation email was sent
// convert date to timestamp
$last_activation_email_ts = mysql2timestamp($last_activation_email_date);
$activate_requests_limit = $Settings->get('activate_requests_limit');
if ($servertimenow - $last_activation_email_ts < $activate_requests_limit) {
// a validation email was sent to the same email address less then the x seconds, where x is the "Activation requests limit" value
// get difference between local time and server time
$time_difference = $Settings->get('time_difference');
// get last activation email local date and time
$last_email_date = date(locale_datetimefmt(), $last_activation_email_ts + $time_difference);
$Messages->add(sprintf(T_("We have already sent you an activation message to %s at %s. Please allow %d minutes for delivery before requesting a new one."), $email, $last_email_date, $activate_requests_limit / 60));
}
}
}
// Call plugin event to allow catching input in general and validating own things from DisplayRegisterFormFieldset event
$Plugins->trigger_event('ValidateAccountFormSent');
if ($Messages->has_errors()) {
break;
示例5: Session
/**
* Constructor
*
* If valid session cookie received: pull session from DB
* Otherwise, INSERT a session into DB
*/
function Session()
{
global $DB, $Debuglog, $current_User, $localtimenow, $Messages, $Settings, $UserSettings;
global $Hit;
global $cookie_session, $cookie_expires, $cookie_path, $cookie_domain;
$Debuglog->add('Session: cookie_domain=' . $cookie_domain, 'request');
$Debuglog->add('Session: cookie_path=' . $cookie_path, 'request');
$session_cookie = param_cookie($cookie_session, 'string', '');
if (empty($session_cookie)) {
$Debuglog->add('Session: No session cookie received.', 'request');
} else {
// session ID sent by cookie
if (!preg_match('~^(\\d+)_(\\w+)$~', $session_cookie, $match)) {
$Debuglog->add('Session: Invalid session cookie format!', 'request');
} else {
// We have a valid session cookie:
$session_id_by_cookie = $match[1];
$session_key_by_cookie = $match[2];
$Debuglog->add('Session: Session ID received from cookie: ' . $session_id_by_cookie, 'request');
$timeout_sessions = NULL;
if ($this->user_ID != NULL) {
// User is not anonymous, get custom session timeout (may return NULL):
$timeout_sessions = $UserSettings->get('timeout_sessions', $this->user_ID);
}
if (empty($timeout_sessions)) {
// User is anonymous or has no custom session timeout. So, we use default session timeout:
$timeout_sessions = $Settings->get('timeout_sessions');
}
$row = $DB->get_row('
SELECT sess_ID, sess_key, sess_data, sess_user_ID, sess_start_ts, sess_lastseen_ts, sess_device
FROM T_sessions
WHERE sess_ID = ' . $DB->quote($session_id_by_cookie) . '
AND sess_key = ' . $DB->quote($session_key_by_cookie) . '
AND UNIX_TIMESTAMP(sess_lastseen_ts) > ' . ($localtimenow - $timeout_sessions));
if (empty($row)) {
$Debuglog->add('Session: Session ID/key combination is invalid!', 'request');
} else {
// ID + key are valid: load data
$Debuglog->add('Session: Session ID is valid.', 'request');
$this->ID = $row->sess_ID;
$this->key = $row->sess_key;
$this->user_ID = $row->sess_user_ID;
$this->start_ts = mysql2timestamp($row->sess_start_ts);
$this->lastseen_ts = mysql2timestamp($row->sess_lastseen_ts);
$this->is_validated = true;
$this->sess_device = $row->sess_device;
$Debuglog->add('Session: Session user_ID: ' . var_export($this->user_ID, true), 'request');
if (empty($row->sess_data)) {
$Debuglog->add('Session: No session data available.', 'request');
$this->_data = array();
} else {
// Some session data has been previsouly stored:
// Unserialize session data (using an own callback that should provide class definitions):
$old_callback = ini_set('unserialize_callback_func', 'session_unserialize_callback');
if ($old_callback === false || is_null($old_callback)) {
// NULL if ini_set has been disabled for security reasons
// Brutally load all classes that we might need:
session_unserialize_load_all_classes();
}
// TODO: dh> This can fail, if there are special chars in sess_data:
// It will be encoded in $evo_charset _after_ "SET NAMES", but
// get retrieved here, _before_ any "SET NAMES" (if $db_config['connection_charset'] is not set (default))!
$this->_data = @unserialize($row->sess_data);
if ($old_callback !== false) {
// Restore the old callback if we changed it:
ini_set('unserialize_callback_func', $old_callback);
}
if (!is_array($this->_data)) {
$Debuglog->add('Session: Session data corrupted!<br />
connection_charset: ' . var_export($DB->connection_charset, true) . '<br />
Serialized data was: --[' . var_export($row->sess_data, true) . ']--', array('session', 'error'));
$this->_data = array();
} else {
$Debuglog->add('Session: Session data loaded.', 'request');
// Load a Messages object from session data, if available:
if (($sess_Messages = $this->get('Messages')) && is_a($sess_Messages, 'Messages')) {
// dh> TODO: "old" messages should rather get prepended to any existing ones from the current request, rather than appended
$Messages->add_messages($sess_Messages);
$Debuglog->add('Session: Added Messages from session data.', 'request');
$this->delete('Messages');
}
}
}
}
}
}
if ($this->ID) {
// there was a valid session before
if ($this->lastseen_ts < $localtimenow - 60) {
// lastseen timestamp is older then a minute, it needs to be updated at page exit
$this->session_needs_save(true);
}
} else {
// create a new session! :
//.........这里部分代码省略.........
示例6: Widget
}
}
} else {
$msg = '';
}
$block_item_Widget = new Widget('block_item');
/**
* b2evolution
*/
$block_item_Widget->title = 'b2evolution' . get_manual_link('system-status-tab');
$block_item_Widget->disp_template_replaced('block_start');
// Instance name:
init_system_check(T_('Instance name'), $instance_name);
disp_system_check('note');
// Version:
$app_timestamp = mysql2timestamp($app_date);
init_system_check(T_('b2evolution version'), sprintf(T_('%s released on %s'), $app_version, date_i18n(locale_datefmt(), $app_timestamp)));
if (!empty($msg)) {
switch ($global_Cache->get('version_status_color')) {
case 'green':
disp_system_check('ok', $msg);
break;
case 'yellow':
disp_system_check('warning', $msg);
break;
default:
disp_system_check('error', $msg);
}
} else {
$msg = '<p>Updates from b2evolution.net are disabled!</p>
<p>You will <b>NOT</b> be alerted if you are running an insecure configuration.</p>';
示例7: mysql2date
/**
* Format a MYSQL date.
*
* @param string enhanced format string
* @param string MYSQL date YYYY-MM-DD HH:MM:SS
* @param boolean true to use GM time
*/
function mysql2date($dateformatstring, $mysqlstring, $useGM = false)
{
$m = $mysqlstring;
if (empty($m) || $m == '0000-00-00 00:00:00') {
return false;
}
// Get a timestamp:
$unixtimestamp = mysql2timestamp($m);
return date_i18n($dateformatstring, $unixtimestamp, $useGM);
}
示例8: apply_nofollow
/**
* Do we want to apply rel="nofollow" tag?
*
* @return boolean
*/
function apply_nofollow(&$data, $Comment)
{
global $localtimenow;
$hours = $this->Settings->get('nofollow_for_hours');
// 0=never, -1 always, otherwise for x hours
if ($hours == 0) {
// "never"
return;
}
if ($hours > 0 && mysql2timestamp($Comment->date) <= $localtimenow - $hours * 3600) {
return;
}
$data = preg_replace_callback('~(<a\\s)([^>]+)>~i', create_function('$m', '
if( preg_match( \'~\\brel=([\\\'"])(.*?)\\1~\', $m[2], $match ) )
{ // there is already a rel attrib:
$rel_values = explode( " ", $match[2] );
if( ! in_array( \'nofollow\', $rel_values ) )
{
$rel_values[] = \'nofollow\';
}
return $m[1]
.preg_replace(
\'~\\brel=([\\\'"]).*?\\1~\',
\'rel=$1\'.implode( " ", $rel_values ).\'$1\',
$m[2] )
.">";
}
else
{
return $m[1].$m[2].\' rel="nofollow">\';
}'), $data);
}
示例9: my_to_date_sh
function my_to_date_sh($in_date)
{
// short date_time string
// $temp = mktime(substr($in_date,11,2),substr($in_date,14,2),substr($in_date,17,2),substr($in_date,5,2),substr($in_date,8,2),substr($in_date,0,4));
// $temp = mktime((int)substr($in_date,11,2), (int)substr($in_date,14,2), (int)substr($in_date,17,2), (int)substr($in_date,5,2), (int)substr($in_date,8,2), (int)substr($in_date,0,4)); // 9/29/10
$temp = mysql2timestamp($in_date);
// 9/29/10
return good_date_time($in_date) ? date("H:i", $temp) : "";
//
}
示例10: deadline
/**
* Deadline
*/
function deadline($date)
{
$timestamp = mysql2timestamp($date);
if ($timestamp <= 0) {
return ' ';
// IE needs that crap in order to display cell border :/
}
return mysql2localedate($date);
}
示例11: elapsed
function elapsed($in_time)
{
// 4/26/11
$mins = (int) round((now() - mysql2timestamp($in_time)) / 60.0);
return $mins > 99 ? 99 : $mins;
}
示例12: echo_comment
/**
* Display a comment corresponding the given comment id
*
* @param int comment id
* @param string where to redirect after comment edit
* @param boolean true to set the new redirect param, false otherwise
* @param integer Comment index in the current list
*/
function echo_comment($comment_ID, $redirect_to = NULL, $save_context = false, $comment_index = NULL)
{
global $current_User, $localtimenow;
$CommentCache =& get_CommentCache();
/**
* @var Comment
*/
$Comment = $CommentCache->get_by_ID($comment_ID);
$Item =& $Comment->get_Item();
$Blog =& $Item->get_Blog();
$is_published = $Comment->get('status') == 'published';
$expiry_delay = $Item->get_setting('comment_expiry_delay');
$is_expired = !empty($expiry_delay) && $localtimenow - mysql2timestamp($Comment->get('date')) > $expiry_delay;
echo '<a name="c' . $comment_ID . '"></a>';
echo '<div id="comment_' . $comment_ID . '" class="bComment bComment';
// check if comment is expired
if ($is_expired) {
// comment is expired
echo 'expired';
} elseif ($Comment->is_meta()) {
// meta comment
echo 'meta';
} else {
// comment is not expired and not meta
$Comment->status('raw');
}
echo '">';
if ($current_User->check_perm('comment!CURSTATUS', 'moderate', false, $Comment) || $Comment->is_meta() && $current_User->check_perm('meta_comment', 'view', false, $Item)) {
// User can moderate this comment OR Comment is meta and current user can view it
echo '<div class="bSmallHead">';
echo '<div>';
if ($Comment->is_meta()) {
// Display ID for each meta comment
echo '<span class="badge badge-info">' . $comment_index . '</span> ';
}
echo '<div class="bSmallHeadRight">';
$Comment->permanent_link(array('before' => '', 'text' => $Comment->is_meta() ? T_('Meta link') : '#text#'));
echo '</div>';
echo '<span class="bDate">';
$Comment->date();
echo '</span>@<span class = "bTime">';
$Comment->time('#short_time');
echo '</span>';
if ($Comment->is_meta()) {
// Display only author for meta comment
$Comment->author('', '', ' · ' . T_('Author') . ': ', '');
} else {
// Display the detailed info for standard comment
$Comment->author_email('', ' · Email: <span class="bEmail">', '</span>');
echo ' · <span class="bKarma">';
$Comment->spam_karma(T_('Spam Karma') . ': %s%', T_('No Spam Karma'));
echo '</span>';
echo '</div>';
echo '<div style="padding-top:3px">';
if ($is_expired) {
echo '<div class="bSmallHeadRight">';
echo '<span class="bExpired">' . T_('EXPIRED') . '</span>';
echo '</div>';
}
$Comment->author_ip('IP: <span class="bIP">', '</span> · ', true, true);
$Comment->ip_country('', ' · ');
$Comment->author_url_with_actions('', true, true);
}
echo '</div>';
echo '</div>';
echo '<div class="bCommentContent">';
$Comment->format_status(array('template' => '<div class="floatright"><span class="note status_$status$"><span>$status_title$</span></span></div>'));
if (!$Comment->is_meta()) {
// Don't display the titles for meta comments
echo '<div class="bCommentTitle">';
echo $Comment->get_title();
if (get_param('p') == '') {
// Don't display this title on a post view page
echo ' ' . T_('in response to') . ' <a href="?ctrl=items&blog=' . $Blog->ID . '&p=' . $Item->ID . '">' . $Item->dget('title') . '</a>';
}
echo '</div>';
}
echo '<div class="bCommentText">';
$Comment->rating();
$Comment->avatar('crop-top-80x80');
if ($current_User->check_perm('meta_comment', 'edit', false, $Comment)) {
// Put the comment content into this container to edit by ajax
echo '<div id="editable_comment_' . $Comment->ID . '" class="editable_comment_content">';
}
$Comment->content('htmlbody', 'true');
if ($current_User->check_perm('meta_comment', 'edit', false, $Comment)) {
// End of the container that is used to edit meta comment by ajax
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '<div class="CommentActionsArea">';
//.........这里部分代码省略.........
示例13: do_diff
function do_diff($indx, $row)
{
// returns diff in seconds from problemstart- 9/29/10
switch ($indx) {
case 0:
$temp = mysql2timestamp($row['dispatched']);
break;
case 1:
$temp = mysql2timestamp($row['responding']);
break;
case 2:
$temp = mysql2timestamp($row['on_scene']);
break;
case 3:
$temp = mysql2timestamp($row['u2fenr']);
// 10/19/10
break;
case 4:
$temp = mysql2timestamp($row['u2farr']);
break;
case 5:
$temp = mysql2timestamp($row['clear']);
break;
case 6:
$temp = mysql2timestamp($row['problemend']);
break;
default:
dump($indx);
// error error error error error
}
return $temp - mysql2timestamp($row['problemstart']);
}
示例14: aprs_date_ok
function aprs_date_ok($indate)
{
// checks for date/time within 48 hours
return abs(time() - mysql2timestamp($indate)) < 2 * 24 * 60 * 60;
}
示例15: load_from_Request
/**
* Load data from Request form fields.
*
* @return boolean true if loaded data seems valid.
*/
function load_from_Request()
{
global $Messages, $localtimenow;
// Group ID
param('ivc_grp_ID', 'integer');
param_check_not_empty('ivc_grp_ID', T_('Please select a group'));
$this->set_from_Request('grp_ID', 'ivc_grp_ID', true);
// Code
param('ivc_code', 'string');
param_check_not_empty('ivc_code', T_('You must provide an invitation code!'));
param_check_regexp('ivc_code', '#^[A-Za-z0-9\\-_]{3,32}$#', T_('Invitation code must be from 3 to 32 letters, digits or signs "-", "_".'));
$this->set_from_Request('code', 'ivc_code');
// Expire date
if (param_date('ivc_expire_date', T_('Please enter a valid date.'), true) && param_time('ivc_expire_time')) {
// If date and time were both correct we may set the 'expire_ts' value
$this->set('expire_ts', form_date(get_param('ivc_expire_date'), get_param('ivc_expire_time')));
}
// Source
param('ivc_source', 'string');
$this->set_from_Request('source', 'ivc_source', true);
if (mysql2timestamp($this->get('expire_ts')) < $localtimenow) {
// Display a warning if date is expired
$Messages->add($this->ID == 0 ? T_('Note: The newly created invitation code is already expired') : T_('Note: The updated invitation code is already expired'), 'warning');
}
return !param_errors_detected();
}