本文整理汇总了PHP中TimeAgo函数的典型用法代码示例。如果您正苦于以下问题:PHP TimeAgo函数的具体用法?PHP TimeAgo怎么用?PHP TimeAgo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TimeAgo函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TimeAgo
<span class=""><?php
echo $user . ' ' . $action . ' ';
?>
</a><a href="<?php
echo SITE_URL;
?>
/user.php?uid=<?php
echo $i['author'];
?>
" style="color: #FF4F00; text-decoration:none;"><?php
echo $author;
?>
</a><?php
echo "'s " . $i['type'];
?>
<a href="<?php
echo $url;
?>
" style="color: #FF4F00; text-decoration:none;"><?php
echo $title;
?>
.<a></span>
<span style="margin-left:10px; font-size:13px;"><?php
echo TimeAgo(date('Y-m-d', strtotime($timestamp)));
?>
</span>
</div>
<?php
}
}
示例2: TimeAgo
<a class="cp" data-toggle="modal" data-target="#newplugins"><i class="fa fa-plus"></i> Search Library/Plugins</a>
<!-- <a href="#"><i class="fa fa-cube"></i> Quick Hint</a> -->
<a href="https://github.com/rakibtg/playscript/issues" target="_blank"><i class="fa fa-bug"></i> Report Bug</a>
<a class="cp" data-toggle="modal" data-target="#sharemodel"><i class="fa fa-thumbs-o-up"></i> Share / About</a>
</div>
</div>
<!-- Modal Starts -->
<!-- Modal -->
<div class="modal fade" id="newplugins" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<b class="modal-title" id="myModalLabel">Search CSS/JS Libraries</b> <span class="updatecdn">Update Library</span> <span class="luo">last updated on <?php
echo TimeAgo(file_get_contents(GenerateHomeLink() . "modules/cdnjs/cheked_at.time"));
?>
</span>
</div>
<div class="modal-body">
<input type="text" class="pluginFinder" name="pluginName" style="width:70%;" placeholder="CSS or JS library name ex: jquery"> <span class="searchLibs">Search</span>
<br><small>Type the name for your plugin's, e.g: cookie</small>
<div class="plug_resutls"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
示例3: calculateRating
?>
" class="recent-project-title" title="<?php
echo $title;
?>
"><?php
echo $short_title;
?>
</a>
<span class="project-rating"><?php
echo calculateRating($project['project_id']);
?>
</span>
</div> <!-- project-bottom-details -->
<div class="project-author"><?php
echo TimeAgo(date('Y-m-d', strtotime($project['created_on'])));
?>
by <a href="user.php?uid=<?php
echo $project['created_by'];
?>
"><?php
echo $user['display_name'];
?>
</a></div>
<?php
if ($own_profile) {
echo '
<div class="project-bottom-details"><a href="upload.php?step=1&id=' . $project[project_id] . '" class="project-action-btn" style="width:100%; padding:0px 0px; border-radius: 0;">Edit Project</a></div>';
}
?>
示例4: calculateRating
?>
" class="recent-project-title" title="<?php
echo $title;
?>
"><?php
echo $short_title;
?>
</a>
<span class="project-rating"><?php
echo calculateRating($idea['ideathread_id']);
?>
</span>
</div> <!-- project-bottom-details -->
<div class="project-author"><?php
echo TimeAgo(date('Y-m-d', strtotime($idea['created_on'])));
?>
by <a href="user.php?uid=<?php
echo $idea['created_by'];
?>
"><?php
echo $user['display_name'];
?>
</a></div>
</div>
<?php
}
} else {
if ($users) {
示例5: strtolower
}
$_country_aux = $geoloc->get_country_by_host($conn, $user->get_ip());
$s_country = strtolower($_country_aux[0]);
$s_country_name = $_country_aux[1];
$geo_code = get_country($s_country);
$flag = !empty($geo_code) ? "<img src='" . $geo_code . "' border='0' align='top'/>" : '';
$logon_date = gmdate('Y-m-d H:i:s', Util::get_utc_unixtime($user->get_logon_date()) + 3600 * Util::get_timezone());
$activity_date = Util::get_utc_unixtime($user->get_activity());
$background = Session_activity::is_expired($activity_date) ? 'background:#FFD8D6;' : '';
$expired = Session_activity::is_expired($activity_date) ? "<span style='color:red'>(" . _('Expired') . ")</span>" : "";
$agent = explode('###', $user->get_agent());
if ($agent[1] == 'av report scheduler') {
$agent = array('AV Report Scheduler', 'wget');
}
$host = @array_shift(Asset_host::get_name_by_ip($conn, $user->get_ip()));
$host = $host == '' ? $user->get_ip() : $host;
echo " <tr id='" . $user->get_id() . "'>\n\t\t\t\t\t\t\t\t\t<td class='ops_user' {$me}><img class='user_icon' src='" . get_user_icon($user->get_login(), $pro) . "' alt='" . _('User icon') . "' title='" . _('User icon') . "' align='absmiddle'/> " . $user->get_login() . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_ip'>" . $user->get_ip() . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_host'>" . $host . $flag . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_agent'><a title='" . htmlentities($agent[1]) . "' class='info_agent'>" . htmlentities($agent[0]) . "</a></td>\n\t\t\t\t\t\t\t\t\t<td class='ops_id'>" . $user->get_id() . " {$expired}</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_logon'>" . $logon_date . "</td>\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<td class='ops_activity'>" . _(TimeAgo($activity_date, gmdate('U'))) . "</td>\n\t\t\t\t\t\t\t\t\t<td class='ops_actions'>{$action}</td>\t\n\t\t\t\t\t\t\t\t</tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>
<?php
$db->close();
$geoloc->close();
示例6: urlencode
echo "</div>";
echo "</li>";
echo "</div>";
} else {
if ($recentXml['type'] == "movie") {
$recentArtUrl = "" . $plexWatchPmsUrl . "/photo/:/transcode?url=http://127.0.0.1:" . $plexWatch['pmsHttpPort'] . "" . $recentXml['art'] . "&width=320&height=160";
$recentThumbUrl = "" . $plexWatchPmsUrl . "/photo/:/transcode?url=http://127.0.0.1:" . $plexWatch['pmsHttpPort'] . "" . $recentXml['thumb'] . "&width=153&height=225";
echo "<div class='dashboard-recent-media-instance'>";
echo "<li>";
if ($recentXml['thumb']) {
echo "<div class='poster'><div class='poster-face'><a href='info.php?id=" . $recentXml['ratingKey'] . "'><img src='includes/img.php?img=" . urlencode($recentThumbUrl) . "' class='poster-face'></img></a></div></div>";
} else {
echo "<div class='poster'><div class='poster-face'><a href='info.php?id=" . $recentXml->Video['ratingKey'] . "'><img src='images/poster.png' class='poster-face'></img></a></div></div>";
}
echo "<div class=dashboard-recent-media-metacontainer>";
$parentIndexPadded = sprintf("%01s", $recentXml['parentIndex']);
$indexPadded = sprintf("%02s", $recentXml['index']);
echo "<h3>" . $recentXml['title'] . " (" . $recentXml['year'] . ")</h3>";
$recentTime = $recentXml['addedAt'];
$timeNow = time();
$age = time() - strtotime($recentTime);
echo "<h4>Added " . TimeAgo($recentTime) . "</h4>";
echo "</div>";
echo "</li>";
echo "</div>";
}
}
}
echo "</ul>";
echo "</div>";
echo "</div>";
示例7: _
?>
</th>
<th><?php
echo _('Date');
?>
</th>
<th><?php
echo _('Last Security Event');
?>
</th>
</tr>
<?php
}
foreach ($events as $event) {
$sensor = $event['sensor_name'] != '' ? $event['ip'] . ' [' . $event['sensor_name'] . ']' : '-';
$ago = TimeAgo(strtotime($event['event_date']), time());
?>
<tr class="trc" txt="<?php
echo strtotime($event['event_date']);
?>
">
<td class="small nobborder center" width="16px">
<img src="" border="0"/>
</td>
<td class="small nobborder">
<b><?php
echo $sensor;
?>
</b>
</td>
示例8: get_root_category
?>
</a></p>
<p class="post_in_list_meta colorscheme_navi smalltext">
<span class="colorsquare <?php
echo get_root_category(get_the_category())->slug;
?>
"> </span>
<?php
$datetime = get_the_date('j. F Y H:i');
?>
<span title="<?php
echo "{$datetime}";
?>
">
<?php
echo '<img src="' . get_bloginfo('template_directory') . '/images/calendar16px.png" alt="kalender"/> ' . TimeAgo(get_the_time('U'));
?>
</span>
<?php
echo '<img src="' . get_bloginfo('template_directory') . '/images/category16px.png" alt="rubrik"/> ';
the_category(', ');
?>
<?php
if (has_tag()) {
echo '<img src="' . get_bloginfo('template_directory') . '/images/tag16px.png" alt="tag"/> ';
$tagcount = count(get_the_tags());
if ($tagcount == 1) {
the_tags('Thema: ', ' · ', '');
} elseif ($tagcount > 1) {
the_tags('Themen: ', ' · ', '');
}
示例9: _
echo _("Date");
?>
</th>
<th><?php
echo _("Last SIEM Event");
?>
</th>
</tr>
<?php
}
foreach ($events as $event) {
$hostname = Host::ip2hostname($conn, $event["ip"]);
if ($event["ip"] != $hostname) {
$hostname = $event["ip"] . " [{$hostname}]";
}
$ago = TimeAgo(strtotime($event["event_date"]), time());
?>
<tr class="trc" txt="<?php
echo strtotime($event["event_date"]);
?>
">
<td class="small nobborder center" width="16px"><img src="" border="0"></td>
<td class="small nobborder"><b><?php
echo $hostname;
?>
</b> </td>
<td class="small nobborder center"><?php
echo $event["event_date"];
?>
(<?php
echo $ago;
示例10: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
//$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
$title = '<span class="colorsquare ' . get_category($instance['category'])->slug . '"> </span>' . '<a href="' . get_category_link($instance['category']) . '">' . get_cat_name($instance['category']) . '</a>';
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
// WIDGET CODE GOES HERE
$parameters = array();
$parameters['post_type'] = array('comic', 'post');
$parameters['cat'] = $instance['category'];
$parameters['posts_per_page'] = 5;
query_posts($parameters);
$loopcounter = 0;
if (have_posts()) {
while (have_posts()) {
the_post();
$loopcounter++;
if ($loopcounter == 1) {
echo '<span class="post_in_list_thumbnail">';
if (has_post_thumbnail()) {
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('frontpage-category');
echo '</a>';
} else {
echo '<a href="' . get_permalink() . '"><img src="http://dummyimage.com/324x100/eeeeee/B50022.gif&text=' . get_category($instance['category'])->slug . '" alt=""/></a>';
}
echo '</span>';
}
echo '<p class="smalltext post_smallinfo contentarea">';
echo '<a href="' . get_permalink() . '">';
echo '<span class="post_smallinfo_category">';
$tmp = get_the_category();
echo $tmp[0]->cat_name;
echo ': </span>';
the_title();
echo '</a><br/>';
echo '<span class="post_smallinfo_time" title="' . get_the_date('j. F Y H:i') . '">';
echo TimeAgo(get_the_time('U'));
echo '</span>';
echo '</p>';
}
} else {
}
rewind_posts();
wp_reset_query();
wp_reset_postdata();
echo $after_widget;
}
示例11: while
while ($user = $users->fetchArray()) {
$userXml = simplexml_load_string($user['xml']);
echo "<tr>";
echo "<td align='right' width='40px'>";
if (empty($userXml->User['thumb'])) {
echo "<div class='users-poster-face'><a href='user.php?user=" . $user['user'] . "'><img src='images/gravatar-default-80x80.png' /></a></div>";
} else {
echo "<div class='users-poster-face'><a href='user.php?user=" . $user['user'] . "'><img src='" . $userXml->User['thumb'] . "' onerror=\"this.src='images/gravatar-default-80x80.png'\" /></a></div>";
}
echo "</td>";
echo "<td>";
echo "<div class='users-name'><a href='user.php?user=" . $user['user'] . "'> " . FriendlyName($user['user'], $user['platform']) . "</a> </div>";
echo "</td>";
require_once dirname(__FILE__) . '/includes/timeago.php';
$lastSeenTime = $user['time'];
echo "<td>" . TimeAgo($lastSeenTime) . "</td>";
echo "<td>" . $user['ip_address'] . "</td>";
echo "<td>" . $user['plays'] . "</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
?>
</div>
</div>
</div><!--/.fluid-row-->
<footer>
示例12: TwitterCacher
<div class="box" id="twitterFeed">
<h2>Radio Arte Is</h2>
<?php
require_once "TwitterCacher.php";
require_once "TimeAgo.php";
$twEmail = "radioarte";
$twPass = "wrte1401";
$tc = new TwitterCacher($twEmail, $twPass);
// I do this just to be a nice guy. So Twitter knows who we are.
$tc->setUserAgent("Mozilla/5.0 (compatible; TwitterCacher/1.0;)");
// Read the timeline from the cache, or from Twitter.
$timeline = json_decode($tc->getUserTimeline());
// Get the Tweet itself.
$text = $timeline[0]->text;
// Twitter uses GMT+0 but I convert it to my local time.
$date = TimeAgo(strtotime($timeline[0]->created_at));
?>
<p><?php
echo $text;
?>
<a href="http://twitter.com/<?php
echo $timeline[0]->user->screen_name;
?>
/status/<?php
echo $timeline[0]->id;
?>
"><?php
echo $date;
?>
</a></p>