/** * Display the mail queue... * * @uses ManageMail template */ public function action_browse() { global $scripturl, $context, $txt; require_once SUBSDIR . '/Mail.subs.php'; loadTemplate('ManageMail'); // First, are we deleting something from the queue? if (isset($_REQUEST['delete'])) { checkSession('post'); deleteMailQueueItems($_REQUEST['delete']); } // Fetch the number of items in the current queue $status = list_MailQueueStatus(); $context['oldest_mail'] = empty($status['mailOldest']) ? $txt['mailqueue_oldest_not_available'] : time_since(time() - $status['mailOldest']); $context['mail_queue_size'] = comma_format($status['mailQueueSize']); // Build our display list $listOptions = array('id' => 'mail_queue', 'title' => $txt['mailqueue_browse'], 'items_per_page' => 20, 'base_href' => $scripturl . '?action=admin;area=mailqueue', 'default_sort_col' => 'age', 'no_items_label' => $txt['mailqueue_no_items'], 'get_items' => array('function' => 'list_getMailQueue'), 'get_count' => array('function' => 'list_getMailQueueSize'), 'columns' => array('subject' => array('header' => array('value' => $txt['mailqueue_subject']), 'data' => array('function' => create_function('$rowData', ' return Util::shorten_text(Util::htmlspecialchars($rowData[\'subject\'], 50)); ')), 'sort' => array('default' => 'subject', 'reverse' => 'subject DESC')), 'recipient' => array('header' => array('value' => $txt['mailqueue_recipient']), 'data' => array('sprintf' => array('format' => '<a href="mailto:%1$s">%1$s</a>', 'params' => array('recipient' => true))), 'sort' => array('default' => 'recipient', 'reverse' => 'recipient DESC')), 'priority' => array('header' => array('value' => $txt['mailqueue_priority'], 'class' => 'centertext'), 'data' => array('function' => create_function('$rowData', ' global $txt; // We probably have a text label with your priority. $txtKey = sprintf(\'mq_mpriority_%1$s\', $rowData[\'priority\']); // But if not, revert to priority 0. return isset($txt[$txtKey]) ? $txt[$txtKey] : $txt[\'mq_mpriority_1\']; '), 'class' => 'centertext'), 'sort' => array('default' => 'priority', 'reverse' => 'priority DESC')), 'age' => array('header' => array('value' => $txt['mailqueue_age']), 'data' => array('function' => create_function('$rowData', ' return time_since(time() - $rowData[\'time_sent\']); ')), 'sort' => array('default' => 'time_sent', 'reverse' => 'time_sent DESC')), 'check' => array('header' => array('value' => '<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />'), 'data' => array('function' => create_function('$rowData', ' return \'<input type="checkbox" name="delete[]" value="\' . $rowData[\'id_mail\'] . \'" class="input_check" />\'; ')))), 'form' => array('href' => $scripturl . '?action=admin;area=mailqueue', 'include_start' => true, 'include_sort' => true), 'additional_rows' => array(array('position' => 'bottom_of_list', 'class' => 'submitbutton', 'value' => ' <input type="submit" name="delete_redirects" value="' . $txt['quickmod_delete_selected'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="right_submit" /> <a class="linkbutton" href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a> '))); require_once SUBSDIR . '/GenericList.class.php'; createList($listOptions); }
function c_twhois($input) { if ($input == "") { $output = "Which user do you want to check?\r<strong>twhois username</strong>"; } else { $url = "http://twitter.com/status/user_timeline/" . htmlentities($input) . ".json?count=10"; $rawdata = _feeder($url, null, true); $data = json_decode($rawdata, true); if (isset($data[0]["user"]["id"])) { $output = ""; if ($input == $data[0]["user"]["name"]) { $output .= "<strong>" . $input . "</strong> hasn't provided a real name.\r"; } else { $output .= "<strong>" . $input . "</strong> is really <strong>" . $data[0]["user"]["name"] . "</strong>. \r"; } //.$data[0]["user"]["description"].".\r"; $output .= "They are Twitter user number <strong>" . $data[0]["user"]["id"] . "</strong>, and have been a Twitter user for <strong>" . time_since(strtotime($data[0]["user"]["created_at"])) . "</strong>.\r"; $output .= "They have <strong>" . $data[0]["user"]["friends_count"] . "</strong> friends, and <strong>"; $output .= $data[0]["user"]["followers_count"] . "</strong> followers.\r"; $output .= "They have tweeted <strong>" . $data[0]["user"]["statuses_count"] . "</strong> times.\r"; if ($data[0]["user"]["location"] != "") { $output .= "They are based in <strong>" . $data[0]["user"]["location"] . "</strong>."; } else { $output .= "Not sure where they are in the world."; } } else { $output = "Dunno, sorry."; } } return $output; }
function componentStatus() { $data = json_decode(file_get_contents('http://bigcommerce.statuspage.io/index.json')); $compontent_statuses = []; foreach ($data->components as $component) { $component_status = ['name' => $component->name, 'status' => ucwords($component->status), 'last_updated' => time_since($component->updated_at)]; $component_statuses[] = $component_status; } return $component_statuses; }
function fauna_trackback($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <? if ($comment->comment_type == "trackback" || $comment->comment_type == "pingback") { ?> <? if (!$runonce) { $runonce = true; ?> <h2 id="trackbacks"><?php _e('Trackbacks & Pingbacks'); ?> </h2> <? } ?> <li><a name="comment-<?php comment_ID(); ?> " href="<? echo($comment->comment_author_url); ?>" title="Visit <? echo($comment->comment_author); ?>"> <? if (function_exists('comment_favicon')) { comment_favicon($before='<img src="', $after='" alt="" class="trackback-avatar" />'); }; ?> <strong><u><? echo($comment->comment_author); ?></u></strong> <small> <?php comment_type(__('commented'), __('trackbacked'), __('pingbacked')); ?> <?php _e('on'); ?> <?php if (function_exists('time_since')) { echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago"; } else { ?> <?php comment_date(); ?> , <?php comment_time(); } ?> </small> <?php /* Trackback body text is disabled by default. To enable it, remove lines 22 and 24 of this file. comment_text() */ ?> </a> </li> <?php edit_comment_link(__("<li>Edit This</li>")); ?> <? } ?> <?php }
function k2_entry_date() { global $post; $output = '<abbr class="published entry-date" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">'; if (function_exists('time_since')) { $output .= sprintf(__('%s ago', 'k2_domain'), time_since(abs(strtotime($post->post_date_gmt . ' GMT')), time())); } else { $output .= get_the_time(get_option('date_format')); } $output .= '</abbr>'; return $output; }
function fauna_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; if ($comment->comment_type != "trackback" && $comment->comment_type != "pingback") { if($odd == $bgcolor) { $bgcolor = $even; } else { $bgcolor = $odd; } /* Assign .comment-author CSS class to weblog administrator */ $is_author = false; if($comment->comment_author_email == get_settings(admin_email)) { $is_author = true; } ?> <li id="comment-<?php comment_ID() ?>" <?php if ($is_author == true) { $class .= ' '.$author; } else { $class .= ' '.$bgcolor; }?> <?php post_class($class); ?>> <div class="comment-body"> <div class="comment-header"> <?php if (function_exists('comment_favicon')) { ?><a href="<? echo($comment->comment_author_url); ?>" title="Visit <? echo($comment->comment_author); ?>"><? comment_favicon($before='<img src="', $after='" alt="" class="comment-avatar" />'); ?></a><?php } ?> <?php echo get_avatar( $comment, 48 ); ?> <em><a href="#comment-<? echo($comment->comment_ID) ?>" title="<?php _e('Permanent link to this comment') ?>"><? echo($comment_number) ?></a></em> <strong><? comment_author_link(); ?></strong> <?php if ( function_exists(comment_subscription_status) ) { if (comment_subscription_status()) { ?><?php _e('(subscribed to comments)') ?><? }} ?> <?php _e('says:') ?> <?php if ($comment->comment_approved == '0') : ?> <small><?php _e('Your comment is awaiting moderation. This is just a spam counter-measure, and will only happen the first time you post here. Your comment will be approved as soon as possible.') ?></small> <?php endif; ?> </div> <?php comment_text() ?> <?php echo comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ')) ?> <small> <?php _e('Posted') ?> <?php if (function_exists('time_since')) { echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago"; } else { ?> <?php comment_date(); ?>, <?php comment_time(); } ?> <? } ?> <?php edit_comment_link(__("Edit This"), ' | '); ?> </small> </div> </li> <?php }
/** * Local Time * * * @copyright Electric Function, Inc. * @package Hero Framework * @author Electric Function, Inc. */ function local_time($time, $format = FALSE) { if ($time == '0000-00-00 00:00:00' or $time == '0000-00-00') { return 'n/a'; } $time = strtotime($time); // see if we should return something like "X minutes ago" $time_since = time_since($time); if (!empty($time_since) and setting('use_time_since') == '1' and $format == FALSE) { return $time_since; } else { if ($format == FALSE) { // return in the default date format return date(setting('date_format'), $time); } else { // return in specified format return date($format, $time); } } }
function dashboard() { $idtoken = _VERSION_ . "-" . md5($_SERVER["HTTP_HOST"]); $magpieCacheAge = 60 * 60 * 24; if (function_exists('apache_request_headers')) { $hdrs = apache_request_headers(); if (isset($hdrs['Pragma']) && $hdrs['Pragma'] == 'no-cache' || isset($hdrs['Cache-Control']) && $hdrs['Cache-Control'] == 'no-cache') { $magpieCacheAge = 0; } } define('MAGPIE_FETCH_TIME_OUT', 2); define('MAGPIE_CACHE_AGE', $magpieCacheAge); $rs = rss_query("select id, title, position, url, obj, unix_timestamp(daterefreshed), itemcount " . " from " . getTable('dashboard') . " order by position asc"); $rss = array(); while (list($id, $title, $pos, $url, $obj, $ts, $cnt) = rss_fetch_row($rs)) { if ($obj && time() - $ts < $magpieCacheAge) { $rss[$title] = unserialize($obj); } else { $old_level = error_reporting(E_ERROR); $rss[$title] = fetch_rss($url . $idtoken); error_reporting($old_level); if ($rss[$title] && is_object($rss[$title])) { $rss[$title]->items = array_slice($rss[$title]->items, 0, $cnt); rss_query('update ' . getTable('dashboard') . " set obj='" . rss_real_escape_string(serialize($rss[$title])) . "', " . " daterefreshed=now()\twhere id={$id}"); } } if ($rss[$title] && is_object($rss[$title])) { if ($pos == 0) { echo "\n\t\t\t\t\t\t\t<h2 style=\"margin-bottom: 0.5em\">{$title}</h2>\n\t\t\t\t\t\t\t<div id=\"db_main\">\n\t\t\t\t\t\t\t<ul>"; foreach ($rss[$title]->items as $item) { echo "<li class=\"item unread\">\n" . "<h4><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></h4>\n" . "<h5>Posted: " . time_since(strtotime($item['pubdate'])) . " ago </h5>\n" . "<div class=\"content\">" . $item['content']['encoded'] . "</div>\n</li>\n"; } echo "</ul></div>\n"; } else { echo "<div class=\"frame db_side\">\n"; db_side($title, $rss[$title]); echo "</div>"; } } } }
/** * Display the mail queue... */ function BrowseMailQueue() { global $scripturl, $context, $modSettings, $txt, $smcFunc; global $sourcedir; // First, are we deleting something from the queue? if (isset($_REQUEST['delete'])) { checkSession('post'); $smcFunc['db_query']('', ' DELETE FROM {db_prefix}mail_queue WHERE id_mail IN ({array_int:mail_ids})', array('mail_ids' => $_REQUEST['delete'])); } // How many items do we have? $request = $smcFunc['db_query']('', ' SELECT COUNT(*) AS queue_size, MIN(time_sent) AS oldest FROM {db_prefix}mail_queue', array()); list($mailQueueSize, $mailOldest) = $smcFunc['db_fetch_row']($request); $smcFunc['db_free_result']($request); $context['oldest_mail'] = empty($mailOldest) ? $txt['mailqueue_oldest_not_available'] : time_since(time() - $mailOldest); $context['mail_queue_size'] = comma_format($mailQueueSize); $listOptions = array('id' => 'mail_queue', 'title' => $txt['mailqueue_browse'], 'items_per_page' => 20, 'base_href' => $scripturl . '?action=admin;area=mailqueue', 'default_sort_col' => 'age', 'no_items_label' => $txt['mailqueue_no_items'], 'get_items' => array('function' => 'list_getMailQueue'), 'get_count' => array('function' => 'list_getMailQueueSize'), 'columns' => array('subject' => array('header' => array('value' => $txt['mailqueue_subject']), 'data' => array('function' => create_function('$rowData', ' global $smcFunc; return $smcFunc[\'strlen\']($rowData[\'subject\']) > 50 ? sprintf(\'%1$s...\', htmlspecialchars($smcFunc[\'substr\']($rowData[\'subject\'], 0, 47))) : htmlspecialchars($rowData[\'subject\']); '), 'class' => 'smalltext'), 'sort' => array('default' => 'subject', 'reverse' => 'subject DESC')), 'recipient' => array('header' => array('value' => $txt['mailqueue_recipient']), 'data' => array('sprintf' => array('format' => '<a href="mailto:%1$s">%1$s</a>', 'params' => array('recipient' => true)), 'class' => 'smalltext'), 'sort' => array('default' => 'recipient', 'reverse' => 'recipient DESC')), 'priority' => array('header' => array('value' => $txt['mailqueue_priority']), 'data' => array('function' => create_function('$rowData', ' global $txt; // We probably have a text label with your priority. $txtKey = sprintf(\'mq_mpriority_%1$s\', $rowData[\'priority\']); // But if not, revert to priority 0. return isset($txt[$txtKey]) ? $txt[$txtKey] : $txt[\'mq_mpriority_1\']; '), 'class' => 'smalltext'), 'sort' => array('default' => 'priority', 'reverse' => 'priority DESC')), 'age' => array('header' => array('value' => $txt['mailqueue_age']), 'data' => array('function' => create_function('$rowData', ' return time_since(time() - $rowData[\'time_sent\']); '), 'class' => 'smalltext'), 'sort' => array('default' => 'time_sent', 'reverse' => 'time_sent DESC')), 'check' => array('header' => array('value' => '<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />'), 'data' => array('function' => create_function('$rowData', ' return \'<input type="checkbox" name="delete[]" value="\' . $rowData[\'id_mail\'] . \'" class="input_check" />\'; '), 'class' => 'smalltext'))), 'form' => array('href' => $scripturl . '?action=admin;area=mailqueue', 'include_start' => true, 'include_sort' => true), 'additional_rows' => array(array('position' => 'below_table_data', 'value' => '<input type="submit" name="delete_redirects" value="' . $txt['quickmod_delete_selected'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" /><a class="button_link" href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a> '))); require_once $sourcedir . '/Subs-List.php'; createList($listOptions); loadTemplate('ManageMail'); $context['sub_template'] = 'browse'; }
public function getTimeAgo(){ //retorna a data em tanto tempo atras global $CONF; $this->_check_get(); require_once('tool/utility.php'); return time_since($this->unixdate); }
$template->set_filenames(array('picture_modify' => 'picture_modify.tpl')); $admin_url_start = $admin_photo_base_url . '-properties'; $admin_url_start .= isset($_GET['cat_id']) ? '&cat_id=' . $_GET['cat_id'] : ''; $src_image = new SrcImage($row); $template->assign(array('tag_selection' => $tag_selection, 'U_SYNC' => $admin_url_start . '&sync_metadata=1', 'U_DELETE' => $admin_url_start . '&delete=1&pwg_token=' . get_pwg_token(), 'PATH' => $row['path'], 'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image), 'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image), 'NAME' => isset($_POST['name']) ? stripslashes($_POST['name']) : @$row['name'], 'TITLE' => render_element_name($row), 'DIMENSIONS' => @$row['width'] . ' * ' . @$row['height'], 'FILESIZE' => @$row['filesize'] . ' KB', 'REGISTRATION_DATE' => format_date($row['date_available']), 'AUTHOR' => htmlspecialchars(isset($_POST['author']) ? stripslashes($_POST['author']) : @$row['author']), 'DATE_CREATION' => $row['date_creation'], 'DESCRIPTION' => htmlspecialchars(isset($_POST['description']) ? stripslashes($_POST['description']) : @$row['comment']), 'F_ACTION' => get_root_url() . 'admin.php' . get_query_string_diff(array('sync_metadata')))); $added_by = 'N/A'; $query = ' SELECT ' . $conf['user_fields']['username'] . ' AS username FROM ' . USERS_TABLE . ' WHERE ' . $conf['user_fields']['id'] . ' = ' . $row['added_by'] . ' ;'; $result = pwg_query($query); while ($user_row = pwg_db_fetch_assoc($result)) { $row['added_by'] = $user_row['username']; } $intro_vars = array('file' => l10n('Original file : %s', $row['file']), 'add_date' => l10n('Posted %s on %s', time_since($row['date_available'], 'year'), format_date($row['date_available'], array('day', 'month', 'year'))), 'added_by' => l10n('Added by %s', $row['added_by']), 'size' => $row['width'] . '×' . $row['height'] . ' pixels, ' . sprintf('%.2f', $row['filesize'] / 1024) . 'MB', 'stats' => l10n('Visited %d times', $row['hit']), 'id' => l10n('Numeric identifier : %d', $row['id'])); if ($conf['rate'] and !empty($row['rating_score'])) { $query = ' SELECT COUNT(*) FROM ' . RATE_TABLE . ' WHERE element_id = ' . $_GET['image_id'] . ' ;'; list($row['nb_rates']) = pwg_db_fetch_row(pwg_query($query)); $intro_vars['stats'] .= ', ' . sprintf(l10n('Rated %d times, score : %.2f'), $row['nb_rates'], $row['rating_score']); } $query = ' SELECT * FROM ' . IMAGE_FORMAT_TABLE . ' WHERE image_id = ' . $row['id'] . ' ;';
list($tpl_var['w'], $tpl_var['h']) = $params->sizing->ideal_size; if (($tpl_var['crop'] = round(100 * $params->sizing->max_crop)) > 0) { list($tpl_var['minw'], $tpl_var['minh']) = $params->sizing->min_size; } else { $tpl_var['minw'] = $tpl_var['minh'] = ""; } $tpl_var['sharpen'] = $params->sharpen; } $tpl_vars[$type] = $tpl_var; } $template->assign('derivatives', $tpl_vars); $template->assign('resize_quality', ImageStdParams::$quality); $tpl_vars = array(); $now = time(); foreach (ImageStdParams::$custom as $custom => $time) { $tpl_vars[$custom] = $now - $time <= 24 * 3600 ? l10n('today') : time_since($time, 'day'); } $template->assign('custom_derivatives', $tpl_vars); } break; case 'watermark': $watermark_files = array(); foreach (glob(PHPWG_ROOT_PATH . 'themes/default/watermarks/*.png') as $file) { $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH)); } if (($glob = glob(PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'watermarks/*.png')) !== false) { foreach ($glob as $file) { $watermark_files[] = substr($file, strlen(PHPWG_ROOT_PATH)); } } $watermark_filemap = array('' => '---');
function returnPost($username, $postnum, $set) { $query = "SELECT * FROM posts WHERE username = '******' AND postnum ='{$postnum}'"; $result = mysql_query($query); $num = mysql_numrows($result); if ($num > 0) { $username = mysql_result($result, 0, "username"); $postnum = mysql_result($result, 0, "postnum"); $description = mysql_result($result, 0, "description"); $time = mysql_result($result, 0, "time"); } $resultdiff = mysql_query("SELECT TIMESTAMPDIFF(SECOND,'{$time}',CURRENT_TIMESTAMP)"); $row = mysql_fetch_array($resultdiff); $ago = $row["TIMESTAMPDIFF(SECOND,'{$time}',CURRENT_TIMESTAMP)"]; $timesince = time_since($ago); $jsonpost['username'] = array(); $jsonpost['postnum'] = array(); $jsonpost['description'] = array(); $jsonpost['ago'] = array(); $jsonpost['set'] = array(); array_push($jsonpost['username'], $username); array_push($jsonpost['postnum'], $postnum); array_push($jsonpost['description'], $description); array_push($jsonpost['ago'], $timesince); array_push($jsonpost['set'], $set); return $jsonpost; }
// $print .= ($count2 == 1) ? ', 1 '.$name2 : ", $count2 {$name2}s"; // } // } return $print; } while ($row = mysql_fetch_array($result)) { // variables from table $postid = $row['public_postid']; $post_title = $row['post_title']; $post_date = $row['post_date']; $post_id = $row['postid']; $post_syntax = $row['post_syntax']; $ps = "[{$post_syntax}]"; $syntax = $post_syntax; if ($post_syntax = "") { $post_syntax = null; } $post_hits = $row['post_hits']; if (empty($post_hits)) { $post_hits = "0"; $count = substr_count($post_text, "\n"); } $my_time = strtotime($post_date); $postdate = time_since($my_time); echo "<i class='icon-file'><img src='http://icons.iconarchive.com/icons/semlabs/web-blog/48/post-remove-icon.png' height='20' width='20'> <a href='{$post_id}'> </i>{$post_title}</a><br> <small>{$postdate} ago</small>"; echo "<br>"; echo "<i><span id='status' class='unreviewed'> <small> viewed <b>{$post_hits}</b> times</small></span></class></span><br><br>"; } if (empty($postid)) { echo "<i><span id='status' class='unreviewed'> <large><font color='black'><i>No recent paste</font></large></span></class></span><br><br>"; }
?> <div id="post-<?php the_ID(); ?> " class="<?php redo_post_class($post_index++, $post_asides); ?> <?php if (is_home() and $redo_asidescategory != 0) { echo 'rightmargin'; } ?> "> <div class="entry-head"> <?php printf(__('%1$s', 'redo_domain'), '<div class="published_sm" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">' . (function_exists('time_since') ? sprintf(__('%s ago', 'redo_domain'), time_since(abs(strtotime($post->post_date_gmt . " GMT")), time())) : '<div class="day">' . get_the_time(__('d', 'redo_domain')) . '</div><div class="month">' . get_the_time(__('M', 'redo_domain')) . '</div>') . '</div>'); ?> <h3 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title='<?php printf(__('Permanent Link to "%s"', 'redo_domain'), wp_specialchars(get_the_title(), 1)); ?> '><?php the_title(); ?> </a></h3> <?php /* Edit Link */
/** Template function. Call this from your template to insert a list of * forthcoming events. Available template variables are: * - template_month: %MONTH% * - template_day: %MONTH% %DATE% %SINCE% (only with Time Since plugin) * - template_event: %DATE% %TIME% %LINK% %TITLE% %AUTHOR% */ function ec3_get_events($limit, $template_event = '<a href="%LINK%">%TITLE% (%TIME%)</a>', $template_day = '%DATE%:', $date_format = 'j F', $template_month = '', $month_format = 'F Y') { global $ec3, $wpdb, $tableposts, $tablepost2cat, $tableusers, $wp_version; if (!$date_format) { $date_format = get_settings('date_format'); } // Support older versions of Wordpress. if (ereg('^1[.]', $wp_version)) { $user_nicename = 'user_nickname'; } else { $user_nicename = 'user_nicename'; } // Start at midnight to show all of today's events $now = gmdate('Y-m-d 00:00:00'); $calendar_entries = $wpdb->get_results("SELECT\r\n p.id AS id,\r\n post_title,\r\n post_date,\r\n u.{$user_nicename} AS author\r\n FROM {$tableposts} p, {$tablepost2cat} p2c, {$tableusers} u\r\n WHERE post_status = 'publish'\r\n AND post_date_gmt > '{$now}'\r\n AND p.id = post_id\r\n AND p.post_author = u.id\r\n AND category_id = {$ec3->event_category}\r\n ORDER BY post_date\r\n LIMIT {$limit}"); echo "<ul class='event_list'>"; echo "<!-- Generated by Event Calendar v{$ec3->version} -->\n"; if (count($calendar_entries)) { $time_format = get_settings('time_format'); $current_date = false; $current_month = false; $data = array(); $time_now = time() + 60 * 60 * get_settings("gmt_offset"); foreach ($calendar_entries as $entry) { $data['MONTH'] = mysql2date($month_format, $entry->post_date); if ((!$current_month || $current_month != $data['MONTH']) && $template_month) { if ($current_month) { echo "</ul></li>\n"; } echo "<li class='event_list_month'>" . ec3_format_str($template_month, $data) . "\n<ul>\n"; $current_month = $data['MONTH']; } // To use %SINCE%, you need Dunstan's 'Time Since' plugin. if (function_exists('time_since')) { $data['SINCE'] = time_since($time_now, abs(strtotime($entry->post_date))); } $data['DATE'] = mysql2date($date_format, $entry->post_date); if ((!$current_date || $current_date != $data['DATE']) && $template_day) { if ($current_month || $current_date) { echo "</ul></li>\n"; } echo "<li class='event_list_day'>" . ec3_format_str($template_day, $data) . "\n<ul>\n"; $current_date = $data['DATE']; } $data['TIME'] = mysql2date($time_format, $entry->post_date); $data['TITLE'] = $entry->post_title; $data['LINK'] = get_permalink($entry->id); $data['AUTHOR'] = $entry->author; echo " <li>" . ec3_format_str($template_event, $data) . "</li>\n"; } if ($template_day || $template_month) { echo "</ul></li>\n"; } } else { echo "<li>" . __('No events.', 'ec3') . "</li>\n"; } echo "</ul>\n"; }
public function getUpdateTimeAgo(){ //retorna a data em tanto tempo atras if ($this->unixupdatetime==null) return null; global $CONF; $this->_check_get(); require_once('tool/utility.php'); return time_since($this->unixupdatetime); }
function wpi_get_relative_date($timestamp) { if (wpi_user_func_exists('time_since')) { $date = abs(strtotime($timestamp) - 60 * 120); return time_since($date) . ' ' . __('ago', WPI_META); } else { return $timestamp; } }
</p> <div class="social__slider--feed__meta"> <a href="https://twitter.com/intent/favorite?tweet_id=<?php echo $item->id; ?> "><i class="fa fa-star"></i></a> <a href="https://twitter.com/intent/retweet?tweet_id=<?php echo $item->id; ?> "><i class="fa fa-retweet"></i></a> <a href="https://twitter.com/intent/tweet?in-reply-to=<?php echo $item->id; ?> "><i class="fa fa-reply"></i></a> <?php echo time_since(strtotime($item->created_at)); ?> </div> </div> </div> </li> <?php } ?> <?php } ?> <?php } ?> <?php
<h3 class="entry-title"><a href="<?php the_permalink(); ?> " rel="bookmark" title='<?php printf(__('Permanent Link to "%s"', 'k2_domain'), wp_specialchars(strip_tags(the_title('', '', false)), 1)); ?> '><?php the_title(); ?> </a></h3> <div class="entry-meta"> <span class="chronodata"> <?php /* Date & Author */ printf(__('Published %1$s %2$s', 'k2_domain'), $multiple_users ? sprintf(__('by %s', 'k2_domain'), '<span class="vcard author"><a href="' . get_author_posts_url(get_the_author_ID()) . '" class="url fn" title="' . sprintf(__('View all posts by %s', 'k2_domain'), attribute_escape(get_the_author())) . '">' . get_the_author() . '</a></span>') : '', '<abbr class="published" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">' . (function_exists('time_since') ? sprintf(__('%s ago', 'k2_domain'), time_since(abs(strtotime($post->post_date_gmt . " GMT")), time())) : get_the_time($dateformat)) . '</abbr>'); ?> </span> </div> </div> <!-- .entry-head --> <div class="entry-content"> <p class="<?php echo $classname; ?> "><?php echo $attachment_link; ?> <br /><?php echo basename($post->guid); ?>
function files_display() { $status = call_user_func(CACHEPREFIX . 'get_status'); if (empty($status['scripts'])) { return; } if (isset($_GET['DUMP'])) { print_table($status['scripts']); exit; } $time = time(); $sort = 0; $nogroup = preg_replace('/\\&?GROUP\\=[\\-0-9]+/', '', $_SERVER['REQUEST_URI']); $nosort = preg_replace('/\\&?SORT\\=[\\-0-9]+/', '', $_SERVER['REQUEST_URI']); $group = empty($_GET['GROUP']) ? 0 : intval($_GET['GROUP']); if ($group < 0 || $group > 9) { $group = 1; } $groupset = array_fill(0, 9, ''); $groupset[$group] = ' class="b" '; echo '<div class="meta"> <a ', $groupset[0], 'href="', $nogroup, '">ungroup</a> | <a ', $groupset[1], 'href="', $nogroup, '&GROUP=1">1</a> | <a ', $groupset[2], 'href="', $nogroup, '&GROUP=2">2</a> | <a ', $groupset[3], 'href="', $nogroup, '&GROUP=3">3</a> | <a ', $groupset[4], 'href="', $nogroup, '&GROUP=4">4</a> | <a ', $groupset[5], 'href="', $nogroup, '&GROUP=5">5</a> </div>'; if (!$group) { $files =& $status['scripts']; } else { $files = array(); foreach ($status['scripts'] as $data) { if (preg_match('@^[/]([^/]+[/]){' . $group . '}@', $data['full_path'], $path)) { if (empty($files[$path[0]])) { $files[$path[0]] = array('full_path' => '', 'files' => 0, 'hits' => 0, 'memory_consumption' => 0, 'last_used_timestamp' => '', 'timestamp' => ''); } $files[$path[0]]['full_path'] = $path[0]; $files[$path[0]]['files']++; $files[$path[0]]['memory_consumption'] += $data['memory_consumption']; $files[$path[0]]['hits'] += $data['hits']; if ($data['last_used_timestamp'] > $files[$path[0]]['last_used_timestamp']) { $files[$path[0]]['last_used_timestamp'] = $data['last_used_timestamp']; } if ($data['timestamp'] > $files[$path[0]]['timestamp']) { $files[$path[0]]['timestamp'] = $data['timestamp']; } } } } if (!empty($_GET['SORT'])) { $keys = array('full_path' => SORT_STRING, 'files' => SORT_NUMERIC, 'memory_consumption' => SORT_NUMERIC, 'hits' => SORT_NUMERIC, 'last_used_timestamp' => SORT_NUMERIC, 'timestamp' => SORT_NUMERIC); $titles = array('', 'path', $group ? 'files' : '', 'size', 'hits', 'last used', 'created'); $offsets = array_keys($keys); $key = intval($_GET['SORT']); $direction = $key > 0 ? 1 : -1; $key = abs($key) - 1; $key = isset($offsets[$key]) && !($key == 1 && empty($group)) ? $offsets[$key] : reset($offsets); $sort = array_search($key, $offsets) + 1; $sortflip = range(0, 7); $sortflip[$sort] = -$direction * $sort; if ($keys[$key] == SORT_STRING) { $direction = -$direction; } $arrow = array_fill(0, 7, ''); $arrow[$sort] = $direction > 0 ? ' ▼' : ' ▲'; $direction = $direction > 0 ? SORT_DESC : SORT_ASC; $column = array(); foreach ($files as $data) { $column[] = $data[$key]; } array_multisort($column, $keys[$key], $direction, $files); } echo '<table border="0" cellpadding="3" width="960" id="files"> <tr class="h">'; foreach ($titles as $column => $title) { if ($title) { echo '<th><a href="', $nosort, '&SORT=', $sortflip[$column], '">', $title, $arrow[$column], '</a></th>'; } } echo ' </tr>'; foreach ($files as $data) { echo '<tr> <td class="v" nowrap><a title="recheck" href="?RECHECK=', rawurlencode($data['full_path']), '">x</a>', $data['full_path'], '</td>', $group ? '<td class="vr">' . number_format($data['files']) . '</td>' : '', '<td class="vr">', number_format(round($data['memory_consumption'] / 1024)), 'K</td>', '<td class="vr">', number_format($data['hits']), '</td>', '<td class="vr">', time_since($time, $data['last_used_timestamp']), '</td>', '<td class="vr">', empty($data['timestamp']) ? '' : time_since($time, $data['timestamp']), '</td> </tr>'; } echo '</table>'; }
</td> <td valign="top" ><div style="width:600px;height:20px;color:#993300;background-color:#FCE8BD;padding-top:7px;padding-left:10px;font-size:12px;float:left;"> <div style="width:450px;float:left;" ><b> <a href="<?=$base_url?>/userprofile/<?=strip_tags($name)?>" class="gotouser"> <?php print $temp_user->rpx_data['profile']['name']['givenName']." ".$temp_user->rpx_data['profile']['name']['familyName']; ?> </a></b> <?php $result = db_fetch_object(db_query("SELECT * FROM {alim_commentedurl} WHERE cid = %d", $cid)); ?> <?php $count = db_affected_rows($result); ?> <?php if(($result->cid)!='') { ?><span style="color:#339933;"><br /> Edited<?php print " (".$count.")"; ?></span> <?php print time_since($uptime)." ago "; ?><?php } else { ?> <?php print $created." ago "; } ?></div> <div style="width:150px;float:left;"> <?php if ($user->uid){ ?> <?php print vud_widget_proxy($cid, 'comment', 'vote', 'plain', $readonly=NULL); ?> <?php } else{?> <span id="not_log" ><?php print vud_widget_proxy($cid, 'comment', 'vote', 'plain', $readonly=NULL); ?> <a class="rpxnow" style="text-decoration:none;color:#333333;font-size:11px;float:right;" onclick="return false;" href="https://alim-foundation.rpxnow.com/openid/v2/signin?token_url=<?php print $base_url; ?>/rpx/end_point"> <img style="padding-right:5px;" src="<?php print $img_theme_path; ?>/likebut.jpg" /><img style="padding-right:5px;" src="<?php print $img_theme_path; ?>/unlikebut.jpg" /></a> </span>
$opt .= "<a href='".$base_url."/comment/delete/".$row['comments_cid']."?destination=group-post/".arg(1)."/".arg(2)."' class='popups-form-reload' style='text-decoration: underline; font-size: 13px; color:#660000; padding-left:5px;' >Delete</a> "; $opt .= "<a href='".$base_url."/comment/edit/".$row['comments_cid']."/".arg(1)."' class='popups-form-reload' style='text-decoration: underline; font-size: 13px; color:#660000; padding-left:5px;' >Edit</a> "; } $resultcid = db_fetch_object(db_query("SELECT cid FROM {alim_commentedurl} WHERE cid = %d", $row['comments_cid'])); $count = db_affected_rows($resultcid); if(($resultcid->cid)!='') { $opt .="<span style=color:#339933;>Edited (".$count.") </span> ". time_since($row['comments_timestamp'])." ago ".$comm_auth."</div></div>"; } else { $opt .=time_since($row['comments_timestamp'])." ago ".$comm_auth."</div></div>"; } } } if($i>0) print "<div class='group_display'><span class='grp_reply'>Replies</span><br />"; print $opt; if($i>0) print "</div>"; ?> <br />
$years = $months / 12; return add_s($years, 'year'); } else { return add_s($months, 'month'); } } function add_s($num, $word) { $num = floor($num); if ($num == 1) { return $num . ' ' . $word . ' ago'; } else { return $num . ' ' . $word . 's ago'; } } $query = $_REQUEST['search']; $jsonurl = "http://search.twitter.com/search.json?q=" . urlencode($query); $json = file_get_contents($jsonurl, 0, null, null); $json_output = json_decode($json); if (count($json_output->results) > 0) { foreach ($json_output->results as $result) { $time_since = time_since("{$result->created_at}"); echo '<div class="tweet">'; echo '<img width="48" height="48" src="' . "{$result->profile_image_url}" . '" class="left" />'; echo '<p><a class="from_user" href="http://twitter.com/' . "{$result->from_user}" . '">' . $result->from_user . ": </a>" . makeURL($result->text) . "</p>"; echo "<small>" . $time_since . " | From: " . html_entity_decode($result->source) . "</small>"; echo '</div>'; } } else { echo '<div class="tweet"><p>Sorry, no results found</p></div>'; }
echo _KUNENA_MOVED . ' '; } } else { echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $leaf->catid, $leaf->thread, 1, $fbConfig->messages_per_page, _GEN_LAST_POST, $last_reply[$leaf->id]->id); } if ($leaf->name) { echo ' ' . _GEN_BY . ' ' . CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, stripslashes($last_reply[$leaf->id]->name), 'nofollow', 'topic_latest_post_user'); } ?> </span> <!-- /Latest Post --> <br /> <!-- Latest Post Date --> <span class="topic_date"> <?php echo time_since($last_reply[$leaf->id]->time, time() + $fbConfig->board_ofset * 3600); ?> <?php echo _KUNENA_AGO; ?> </span> <!-- /Latest Post Date --> </div> </td> <?php if ($is_Moderator) { ?> <td class = "td-7" align="center">
break; case "sharing": $actionText = "Shared: "; break; case "post": $actionText = "Posted: "; break; case "vote": $actionText = "Received Vote on: "; default: $actionText = "Did: "; } ?> <tr> <td class="when"><?php echo time_since($action->date); ?> </td> <td class="type"><?php echo $actionText; ?> </td> <td class="what"><a href="<?php echo $action->url; ?> "><?php echo $action->post_title; ?> </a></td> <!--<td><pre><?php //print_r($action);
/** Get a human-readable 'time since' the current event. */ function ec3_get_since() { // To use %SINCE%, you need Dunstan's 'Time Since' plugin. if (function_exists('time_since')) { $event = ec3_sensible_start_event(); if (!empty($event)) { return time_since(time(), ec3_to_time($event->start)); } } return ''; }
?> <div class="entry-meta"> <?php _e("Filed in"); ?> <?php the_category(','); ?> <?php the_tags(' and ' . __('tagged') . ' ', ', ', ''); ?> <?php if (function_exists('time_since')) { echo time_since(abs(strtotime($post->post_date_gmt . " GMT")), time()) . " ago"; } else { the_time('F jS, Y'); } ?> <? /* by <?php the_author_posts_link(); ?> */ ?> </div> <?php } ?> <?php
/** * Get Client Log * * Get the client's log, formatted * * @param int $client_id The client ID * @param int $latest How many items to get, in descending order * * @return bool TRUE upon success */ function GetClientLog($client_id, $latest = 10, $date_format = 'Y-m-d H:i:s') { // include time_since helper $this->load->helper('time_since'); $this->db->where('client_id', $client_id); $this->db->limit(10); $this->db->order_by('client_log_date desc, client_log_id desc'); $log = $this->db->get('client_log'); if ($log->num_rows() == 0) { return FALSE; } $return = array(); foreach ($log->result_array() as $row) { // unserialize variables from database $variables = unserialize($row['variables']); // line will hold this line of the log $line = ''; // do we begin with a customer name? if (isset($variables['customer_id'])) { // yes, there's a customer $line .= '<a href="customers/edit/' . $variables['customer_id'] . '">'; // do we have a name? if (!empty($variables['customer_first_name'])) { $line .= $variables['customer_first_name'] . ' ' . $variables['customer_last_name']; } else { $line .= 'Customer #' . $variables['customer_id']; } $line .= '</a>'; } else { $line .= 'A customer'; } // generate date $date_line = time_since($client_id, $row['client_log_date']); // prepend currency symbol if (isset($variables['amount'])) { $variables['amount'] = $this->config->item('currency_symbol') . $variables['amount']; } if ($row['trigger_id'] == '1') { // charge $line .= ' was <a href="' . site_url('transactions/charge/' . $variables['charge_id']) . '">charged ' . $variables['amount'] . '</a> ' . $date_line; } elseif ($row['trigger_id'] == '2') { // recurring charge $line .= ' was <a href="' . site_url('transactions/charge/' . $variables['charge_id']) . '">charged ' . $variables['amount'] . '</a> for <a href="' . site_url('transactions/recurring/' . $variables['recurring_id']) . '">recurring charge #' . $variables['recurring_id'] . '</a> ' . $date_line; } elseif ($row['trigger_id'] == '3') { $line .= '\'s <a href="' . site_url('transactions/recurring/' . $variables['recurring_id']) . '">recurring charge #' . $variables['recurring_id'] . '</a> expired ' . $date_line; } elseif ($row['trigger_id'] == '4') { $line .= '\'s <a href="' . site_url('transactions/recurring/' . $variables['recurring_id']) . '">recurring charge #' . $variables['recurring_id'] . '</a> was cancelled ' . $date_line; } elseif ($row['trigger_id'] == '9') { $line .= '\'s customer profile was created ' . $date_line; } elseif ($row['trigger_id'] == '10') { $line .= ' began a new <a href="' . site_url('transactions/recurring/' . $variables['recurring_id']) . '">recurring charge #' . $variables['recurring_id'] . '</a> ' . $date_line; } $return[] = $line; } return $return; }
echo get_avatar(get_the_author_email(), 100); ?> </div> <div class="col-sm-9 col"> <h4 class="list-group-item-heading"> <?php the_title(); ?> </h4> <div class="list-group-item-text"> <?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 110, "…"); ?> </br></br><?php echo time_since($post->post_date); ?> <small>By <?php echo the_author_meta('display_name'); ?> </small> </div> </div> <div class="col-sm-1 col"> <div class="list-group-item-info views" data-toggle="tooltip" data-placement="bottom" data-original-title="浏览"> <?php echo getPostViews(get_the_ID()); ?> </div> </div>