function __construct() { parent::__construct(Config::getCfg('site')['pagetitle'], "", 0); $boards = Model::get()->getBoards(); $archiveBoards = array_filter($boards, function ($b) { return $b->isArchive(); }); $plainBoards = array_filter($boards, function ($b) { return !$b->isArchive(); }); $html = "<div class='boardlist_big'><h1>Archived Boards</h1><hr style='width:64px;'>"; foreach ($archiveBoards as $b) { $html .= Site::parseHtmlFragment("indexArchiveBoard.html", ["%ago%", "%crawltime%", "%shortname%", "%longname%", "%posts%", "%threads%", "%firstcrawl%"], [ago(time() - $b->getLastCrawl()), $b->getLastCrawl(), $b->getName(), $b->getLongName(), $b->getNoPosts(), $b->getNoThreads(), date("j F Y", $b->getFirstCrawl())]); } $html .= "</div>"; $html .= "<script type='text/javascript' src='/script/boardUpdate.js'></script>"; if (count($plainBoards) > 0) { $html .= "<div class='boardlist_big'><h1>Boards</h1><hr style='width:64px;'>"; foreach ($plainBoards as $b) { $html .= Site::parseHtmlFragment("indexBoard.html", ["%ago%", "%crawltime%", "%shortname%", "%longname%", "%posts%", "%threads%", "%firstcrawl%"], [ago(time() - $b->getLastCrawl()), $b->getLastCrawl(), $b->getName(), $b->getLongName(), $b->getNoPosts(), $b->getNoThreads(), date("j F Y", $b->getFirstCrawl())]); } $html .= "</div>"; } $this->setBody($html); }
function newPosts() { $db = Database::obtain(); $sql = 'SELECT nickname,topic,name,forum_topics.date FROM forum_posts INNER JOIN users ON forum_posts.poster = users.id INNER JOIN forum_topics ON forum_posts.topic = forum_topics.id ORDER BY date DESC LIMIT 5'; $posts = $db->fetch_array($sql); $return = ''; foreach ($posts as $post) { $return = '<tr><td><img src="theme/images/bullet_green.png"></td><td><a href="admin.php?page=forum&topic=' . $post['topic'] . '">' . $post['name'] . '</a></td><td> </td><td>' . $post['nickname'] . '</td><td><img src="theme/images/time_red.png">' . ago($post['date']) . '</td></tr>'; } return $return; }
/** * Widget HTML * * If you want to have an all inclusive single widget file, you can do so by * dumping your css styles with base_encoded images along with all of your * html string, right into this method. * * @param array $widget * @param array $params * @param array $sidebar */ function html($widget, $params, $sidebar) { echo '<h2>Recently Edited Docs</h2><ul>'; $args = array('child_of' => 14, 'sort_order' => 'DESC', 'sort_column' => 'post_modified', 'hierarchical' => 0, 'post_status' => 'publish'); $pages = get_pages($args); $n = 5; $i = 0; while ($i < $n) { // Work out page author. $userid = get_post_meta($pages[$i]->ID, '_edit_last', true); $username = apply_filters('the_modified_author', get_userdata($userid)->display_name); echo '<li><a href="' . get_permalink($pages[$i]->ID) . '">' . $pages[$i]->post_title . '</a> - <small>' . ago($pages[$i]->post_modified) . ' by ' . $username . '</small></li>'; $i++; } }
function getComment($comment) { $time = $comment->getAttribute("timestamp"); $author = $comment->getAttribute("author"); $ip = $comment->getAttribute("ip"); $subject = $comment->firstChild->nodeValue; $msg = $comment->lastChild->nodeValue; $msg = str_replace(array("\r", "\n"), "<br />", $msg); $msg = str_replace(array("[[", "]]"), array("<", ">"), $msg); $time = ago(time() - $time * 1); /* return '<li class="comment">' . ' <div class="subject">' . $subject . '</div>' . ' <div class="title"><span class="author">' . $author . '</span> <span class="date">' . $time . '</span></div>' . ' <div class="message">' . ' <div class="text">' . $msg . '</div>' . ' </div>' . '</li>'; */ return '<li class="comment">' . ' <img src="style/comment.png" class="avatar">' . ' <span class="user-name author">' . $author . '</span> <br>' . ' <span class="comment-html">' . ' <strong>' . $subject . '</strong><br/><br/>' . $msg . ' </span><br>' . ' <a class="comment-time">' . $time . '</a>' . '</li>'; }
/** * Display out latest Tweets using the Twitter 1.1 API */ function display_latest_tweets($username, $no_tweets, $reply) { $twitterConnection = new TwitterOAuth(rd_options('reedwan_tweet_consumer_key'), rd_options('reedwan_tweet_consumer_secret'), rd_options('reedwan_tweet_access_token'), rd_options('reedwan_tweet_token_secret')); $twitterData = $twitterConnection->get('statuses/user_timeline', array('screen_name' => $username, 'count' => $no_tweets, 'exclude_replies' => $reply)); if ($twitterData && is_array($twitterData)) { ?> <?php foreach ($twitterData as $tweet) { ?> <li> <i class="fa-twitter"></i> <span> <?php $latestTweet = $tweet->text; $latestTweet = preg_replace('/http:\\/\\/([a-z0-9_\\.\\-\\+\\&\\!\\#\\~\\/\\,]+)/i', '<a href="http://$1" target="_blank">http://$1</a>', $latestTweet); echo $latestTweet; ?> </span> <?php $twitterTime = strtotime($tweet->created_at); $timeAgo = ago($twitterTime); ?> <div class="meta"><a href="http://twitter.com/<?php echo $tweet->user->screen_name; ?> /statuses/<?php echo $tweet->id_str; ?> " class="jtwt_date"><?php echo $timeAgo; ?> </a></div> </li> <?php } ?> <?php } }
function ago($tm, $rcs = 0) { $tm = strtotime($tm); $cur_tm = time(); $dif = $cur_tm - $tm; $pds = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade'); $lngh = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600); for ($v = sizeof($lngh) - 1; $v >= 0 && ($no = $dif / $lngh[$v]) <= 1; $v--) { } if ($v < 0) { $v = 0; } $_tm = $cur_tm - $dif % $lngh[$v]; $no = floor($no); if ($no != 1) { $pds[$v] .= 's'; } $x = sprintf("%d %s ", $no, $pds[$v]); if ($rcs == 1 && $v >= 1 && $cur_tm - $_tm > 0) { $x .= ago($_tm); } return $x; }
function yui_grid_node_submitted($node) { $user = user_load(array("uid" => $node->uid)); $vars = array("account" => $user); gravatar_preprocess_user_picture($vars); $html = <<<HTML <div class="usercard clearfix"> <div class="submitted margin_bottom_1em">@datetime</div> <div class="left"> !picture </div> <div class="right"> <div class="name">!username</div> <div> <!-- <span class="role">Journalist</span> not sure how to do this part yet --> <span class="points">!points</span> </div> </div> </div> HTML; return t($html, array('!username' => theme('username', $node), '!picture' => $vars["picture"], '!points' => userpoints_get_current_points($node->uid), '@datetime' => ago($node->created))); }
" <?php echo $comment["is_answer"] == 1 ? 'checked' : ''; ?> > <?php } ?> <span class="commented-by"><?php echo $comment["name"]; ?> :</span> <span class="comment-by-user"><?php echo $comment["comment"]; ?> </span> <span class="ago"> <?php echo ago($comment["created_on"]) . " ago"; ?> </span> </div> <?php } } ?> </div> </div> </div> <?php } ?> </div>
<?php echo $val['name']; ?> </span> <span class="description"> <?php echo $val['content']; ?> </span> <span class="alt" style="position: relative"> <img data-load-image="<?php echo avatar($val['member']); ?> ?v=1450717687" src="" alt="" style="position: absolute;top: -16px;left: -45px;width: 30px;height: 30px;"> Son mesaj <strong>fraksiyon</strong> tarafından <span><?php echo ago(strtotime($val['date'])); ?> </span> gönderildi. </span> </span> </a> </li> <?php } ?> </ul> <div class="pagination space"> <ul class="pagination"><li><a href="http://dizilab.com/mr-robot/forum?sayfa=1">İlk Sayfa</a></li><li class="active"><a href="http://dizilab.com/mr-robot/forum?sayfa=1">1</a></li><li class=""><a href="http://dizilab.com/mr-robot/forum?sayfa=2">2</a></li><li class=""><a href="http://dizilab.com/mr-robot/forum?sayfa=3">3</a></li><li class=""><a href="http://dizilab.com/mr-robot/forum?sayfa=4">4</a></li><li class=""><a href="http://dizilab.com/mr-robot/forum?sayfa=5">5</a></li><li class=""><a href="http://dizilab.com/mr-robot/forum?sayfa=6">6</a></li><li><a href="http://dizilab.com/mr-robot/forum?sayfa=11">Son Sayfa</a></li></ul> </div> </div> <div class="clear"></div>
function rocknrolla_parallax_tweets($atts) { extract( shortcode_atts(array( "count" => '3', "title" => 'Follow us on Twitter', 'animation' => 'fadeInUp' ), $atts) ); global $smof_data; $consumer_key = $smof_data['rnr_twitter_consumer_key']; $consumer_secret = $smof_data['rnr_twitter_cosumer_secret']; $access_token = $smof_data['rnr_twitter_access_token']; $access_token_secret = $smof_data['rnr_twitter_access_token_secret']; $twitter_id = $smof_data['rnr_twitter_username']; if( $twitter_id && $consumer_key && $consumer_secret && $access_token && $access_token_secret && $count ) { $transName = 'list_tweets_1'; $cacheTime = 10; delete_transient($transName); if(false === ($twitterData = get_transient($transName))) { // require the twitter auth class @require_once 'widgets/twitteroauth/twitteroauth.php'; $twitterConnection = new TwitterOAuth( $consumer_key, // Consumer Key $consumer_secret, // Consumer secret $access_token, // Access token $access_token_secret // Access token secret ); $twitterData = $twitterConnection->get( 'statuses/user_timeline', array( 'screen_name' => $twitter_id, 'count' => $count, 'exclude_replies' => false ) ); if($twitterConnection->http_code != 200) { $twitterData = get_transient($transName); } // Save our new transient. set_transient($transName, $twitterData, 60 * $cacheTime); } $twitter = get_transient($transName); $rnr_tweet_feed = '<div data-effect="'.$animation.'" class="rnr-animate animated">'; $rnr_tweet_feed .= '<p class="twitter-feed-icon"><i class="fa fa-twitter"></i></p>'; $rnr_tweet_feed .= '<p class="twitter-author"><a href="http://twitter.com/'. $twitter_id .'" target="_blank">'. $title .'</a></p>'; $rnr_tweet_feed .= '</div>'; $rnr_tweet_feed .= '<div data-effect="'.$animation.'" class="rnr-animate animated twitter-slider" id="twitter-feed"><div class="flexslider">'; $rnr_tweet_feed .= '<ul class="slides">'; foreach($twitter as $tweet): $rnr_tweet_feed .= '<li class="slide">'; $rnr_tweet_feed .= '<p class="jtwt_tweet_text">'; $latestTweet = $tweet->text; $latestTweet = preg_replace('/http:\/\/([a-z0-9_\.\-\+\&\!\#\~\/\,]+)/i', ' <a href="http://$1" target="_blank">http://$1</a> ', $latestTweet); $latestTweet = preg_replace('/@([a-z0-9_]+)/i', ' <a href="http://twitter.com/$1" target="_blank">@$1</a> ', $latestTweet); $rnr_tweet_feed .= $latestTweet . '</p>'; $twitterTime = strtotime($tweet->created_at); $timeAgo = ago($twitterTime); $rnr_tweet_feed .= '<a href="http://twitter.com/'. $twitter_id .'/statuses/'. $tweet->id_str .'" class="jtwt_date">'. $timeAgo .'</a>'; $rnr_tweet_feed .= '</li>'; endforeach; $rnr_tweet_feed .= '</ul></div>'; $rnr_tweet_feed .= '</div>'; } else{ $rnr_tweet_feed = '<h4>Configure the Twitter API Settings inside the Theme Options first.</h4>'; } return $rnr_tweet_feed; }
exit; } $db1 = new dbClass(); $db1->setDBVars($dbhost, $dbname, $dbuser, $dbpass); $db1->openConnection(); $ip = $_SERVER['REMOTE_ADDR']; $sql = "SELECT COUNT(*) FROM `{$dbname}`.`{$dbtable}` WHERE `ip`='{$ip}';"; $rowOut = $db1->queryRowArray($sql); $ip_exists = $rowOut[0]; if ($ip_exists > 0) { $sql = "SELECT COUNT(*) FROM `{$dbname}`.`{$dbtable}`"; $rowOut = $db1->queryRowArray($sql); $count = $rowOut[0]; } else { $db1->execCommand("INSERT INTO `{$dbname}`.`{$dbtable}` (`ip`) VALUES ('{$ip}');"); $sql = "SELECT COUNT(*) FROM `{$dbname}`.`{$dbtable}`;"; $rowOut = $db1->queryRowArray($sql); $count = $rowOut[0]; } echo "<table>"; echo "<tr><td>" . $txtVisitors . "</td><td>" . $count . "</td></tr>"; echo "<tr><td>" . $txtYourIP . "</td><td>" . $ip . "</td></tr>"; echo "</table>"; if (ago($_SESSION['entrytime']) > 600) { // -------------- REMOVE OLD IP ENTRIES ------------------------------------------------------------------------ $db1->execCommand("DELETE FROM `{$dbname}`.`{$dbtable}` WHERE modified < (now() - INTERVAL {$purge_length} MINUTE);"); // ------------------------------------------------------------------------------------------------------------- $_SESSION['entrytime'] = time(); echo "Purged Rows"; } $db1->closeConnection();
function fix_atom_entry($entry, $kind) { $item = array(); $item['id'] = $entry->id; $item['id'] = preg_replace('/\\?.*$/', '', $item['id']); # FIXME: this b/c id is not canonical if (!$item['id']) { throw new Exception('No ID in item $entry'); } $item['title'] = $entry->title; $item['content'] = $entry->content; $item['author'] = array(); $item['author']['name'] = $entry->author(); $item['author']['uri'] = $entry->author(0, array('param' => 'uri')); $item['author']['url'] = $item['author']['uri']; $item['author']['photo'] = $entry->author(0, array('param' => 'avatar')); $item['author']['canonical_name'] = $entry->author(0, array('param' => 'canonical_name')); $item['updated'] = $entry->updated; $item['updated_relative'] = ago($entry->updated, time()); $item['updated_formatted'] = strftime("%B %e, %y", $entry->updated); $item['published'] = $entry->published; $item['published_relative'] = ago($entry->published, time()); $item['published_formatted'] = strftime("%B %e, %y", $entry->published); # Get various <link> tags. TBD: refactor these $link_elems = $entry->model->getElementsByTagName('link'); foreach ($link_elems as $link_elem) { if ($link_elem->getAttribute('rel') == 'company') { $item['company_url'] = $link_elem->getAttribute('href'); } if ($link_elem->getAttribute('rel') == 'topic_at_sfn') { $item['at_sfn'] = $link_elem->getAttribute('href'); } if ($link_elem->getAttribute('rel') == 'replies') { $item['replies_url'] = $link_elem->getAttribute('href'); } } $in_reply_to_elem = $entry->model->getElementsByTagName('in-reply-to')->item(0); if ($in_reply_to_elem) { $item['in_reply_to'] = $in_reply_to_elem->nodeValue; } global $xml_sfn_ns; $item['sfn_id'] = sfn_element_value($entry, 'id'); $item['topic_style'] = sfn_element_value($entry, 'topic_style'); if ($kind == 'topic' && !$item['topic_style']) { throw new Exception("SFN feed problem: no sfn:topic_style on {$kind} " . $item['id']); } if ($kind == 'topic') { $item['reply_count'] = sfn_element_value($entry, 'reply_count'); if (!($item['reply_count'] > 0)) { $item['reply_count'] = 0; } } $item['follower_count'] = sfn_element_value($entry, 'follower_count'); $item['me_too_count'] = sfn_element_value($entry, 'me_too_count'); $item['star_count'] = sfn_element_value($entry, 'star_count'); $item['flag_count'] = sfn_element_value($entry, 'flag_count'); $item['tags'] = preg_split('/, */', sfn_element_value($entry, 'tags')); $emotitag_elem = sfn_element($entry, 'emotitag'); if ($emotitag_elem) { $item['emotitag_face'] = $emotitag_elem->getAttribute('face'); $item['emotitag_severity'] = $emotitag_elem->getAttribute('severity'); $item['emotitag_emotion'] = trim($emotitag_elem->nodeValue); } $item['star_promoted'] = sfn_element_present($entry, 'star_promoted'); $item['company_promoted'] = sfn_element_present($entry, 'company_promoted'); return $item; }
echo "<li><a href='?page=settings_exec&action=disableSensorFromXML&id={$row['share_id']}'>Disable</a></li>"; } echo "<li><a href='?page=settings_exec&action=deleteSensorFromXML&id={$row['share_id']}'>Delete</a></li>"; echo "</ul>"; echo "</div>"; echo "</div>"; echo "<div style='font-size:20px;'>" . $row['description'] . "</div>"; echo "<div style='font-size:11px;'>"; echo "<b>{$lang['Sensorname']}:</b> " . $xmlData->sensor->name . "<br />"; echo "<b>{$lang['Location']}:</b> " . $xmlData->sensor->location . "<br />"; echo "<b>{$lang['XML URL']}:</b> <a href='{$row['url']}' target='_blank'>" . $row['url'] . "</a>"; echo "</div>"; echo "<div style='display:inline-block; width:100px; margin:10px; font-size:20px;'>"; echo "<img style='margin-right:10px;' src='images/thermometer02.png' alt='icon' />"; echo $xmlData->sensor->temp . "°"; echo "</div>"; if ($xmlData->sensor->humidity > 0) { echo "<div style='display:inline-block; width:100px; margin:10px; font-size:20px;'>"; echo "<img style='margin-right:10px;' src='images/water.png' alt='icon' />"; echo $xmlData->sensor->humidity . "%"; echo "</div>"; } echo "<div style='font-size:10px'>"; echo ago($xmlData->sensor->lastUpdate); echo "</div>"; echo "</div>"; } } else { echo "<div class='alert'>{$lang['Nothing to display']}</div>"; } echo "</fieldset>";
<li <? print $addtinal_style ?> id="log_item_<? print $log_check['id'] ?>"> <a href="<?php print site_url('userbase/action:profile/username:'******'username']); ?> " class="user_photo" style="background-image: url('<?php print $thumb; ?> ')"></a> <a href="<?php print site_url('userbase/action:profile/username:'******'username']); ?> " class="mw_blue_link"><? print user_name($author['id']); ?></a> <? get_dashboard_action($data['id']); ?> <div class="user_activity_bar"> <date><?php print ago($log_check['created_on']); ?> <? if($log_check['created_by'] == user_id()): ?> <a class="comment_delete" href="javascript:mw.users.log_delete(<? print $log_check['id'] ?>, '#log_item_<? print $log_check['id'] ?>');">delete</a> <? endif; ?> </date>
/** * Returns a date based on how long ago the date occurred (i.e 5 minutes ago) * * @param string $timestring The date to convert * @return string The date in time ago words */ function time_ago_in_words($timestring) { $datetime = new \DateTime($timestring); return ago($datetime); }
} elseif ($c['feedback'] == "1") { $feedback = "<span class=\"neutral_comment\">Neutral</span>"; } elseif ($c['feedback'] == "2") { $feedback = "<span class=\"negative_comment\">Negative</span>"; } $modify = ""; if (isset($_SESSION['admin'])) { $modify = "<a href=\"?base=gmcp&page=manblog&action=pdel&id=" . $c['id'] . "\">Delete</a> | "; } $quote = ""; $pm = ""; if (isset($_SESSION['id'])) { $quote = "<a href=\"#comment-" . $c['id'] . "-" . $c['author'] . "\" class=\"quote\">Quote</a> | "; $pm = " | <a href=\"?base=ucp&page=mail&uc=" . $c['author'] . "\">PM</a>"; } echo "\n\t\t\t<div class=\"well\"><img src=\"" . get_gravatar($c['email']) . "\" alt=\"" . $c['author'] . "\" class=\"img-responsive\" style=\"float:left;padding-right:10px;\"/>\n\t\t\t<h4 style=\"margin:0px;\">" . $c['author'] . "</h4>\n\t\t\t\t<b>Feedback:</b> " . $feedback . "<br/>\n\t\t\t\t<small>Posted " . ago($c['date']) . ", on " . date('M j, Y', $c['date']) . "</small><br/>\n\t\t\t\t<small>" . $modify . $quote . "<a href=\"#comment-link-" . $c['id'] . "\" class=\"permalink\">Permalink</a><a href=\"?base=main&page=gmblog&id=" . $id . "#comment-" . $c['id'] . "\" class=\"permalinkshow linkid-" . $c['id'] . "\">?base=main&page=gmblog&id=" . $id . "#comment-" . $c['id'] . "</a>" . $pm . "</small><hr/>\n\t\t\t\t<div id=\"comment-" . $c['id'] . "\">" . $clean_comment . "</div>\n\t\t\t\t</div>"; } } } else { $gb = $mysqli->query("SELECT * FROM " . $prefix . "gmblog ORDER BY id DESC") or die; $rows = $gb->num_rows; if ($rows < 1) { echo "<div class=\"alert alert-danger\">Oops! No blogs to display right now!</div>"; } else { echo "<h2 class=\"text-left\">" . $servername . " GM Blogs</h2><hr/>"; while ($b = $gb->fetch_assoc()) { $gc = $mysqli->query("SELECT * FROM " . $prefix . "bcomments WHERE bid='" . $b['id'] . "' ORDER BY id ASC") or die; $cc = $gc->num_rows; echo "\n\t\t\t[" . $b['date'] . "]\n\t\t\t\t<b><a href=\"?base=main&page=gmblog&id=" . $b['id'] . "\">" . $b['title'] . "</a></b> by\n\t\t\t\t<a href=\"?base=main&page=members&name=" . $b['author'] . "\">" . $b['author'] . "</a> \n\t\t<span class=\"commentbubble\">\n\t\t\t<b>" . $b['views'] . "</b> views | <b>" . $cc . "</b> comments\n\t\t"; if (isset($_SESSION['gm'])) { echo "\n\t\t\t<span class=\"commentbubble\">\n\t\t\t\t<a href=\"?base=admin&page=manblog&action=edit&id=" . $b['id'] . "\">Edit</a> | \n\t\t\t\t<a href=\"?base=admin&page=manblog&action=del\">Delete</a> | \n\t\t\t\t<a href=\"?base=admin&page=manblog&action=lock\">Lock</a> \n\t\t\t";
<hr/> <h2 class="text-left">Recent Comments</h2><br/> <ul class="list-group"> <?php while ($comments = $getcomments->fetch_assoc()) { $clean_comment = $commentpurifier->purify($comments['comment']); $clean_comment = strlen($clean_comment) > 50 ? substr($clean_comment, 0, 50) . '...' : $clean_comment; if ($comments['feedback'] == 0) { $feedback = "<span class=\"positive_comment\">Positive</span>"; } elseif ($comments['feedback'] == 1) { $feedback = "<span class=\"neutral_comment\">Neutral</span>"; } if ($comments['feedback'] == 2) { $feedback = "<span class=\"negative_comment\">Negative</span>"; } echo "<li class=\"list-group-item\">\n\t\t\t\t\t<a href=\"?base=main&page=members&name=" . $comments['author'] . "\">" . $comments['author'] . "</a> - " . $feedback . " - Posted " . ago($comments['date']) . ".<br/>\n\t\t\t\t\t" . $clean_comment . "\n\t\t\t\t\t</li>"; } ?> </ul> <hr/> </div> </div> </div> <?php } elseif ($admin == "voteconfig") { include 'sources/admin/voteconfig.php'; } elseif ($admin == "gmlog") { include 'sources/admin/gmlog.php'; } elseif ($admin == "manevent") { include 'sources/admin/manage-event.php'; } elseif ($admin == "mannews") {
echo "<tbody>"; while ($row = $result->fetch_array()) { $sValueQuery = $mysqli->query("SELECT temp_value, humidity_value, time_updated FROM " . $db_prefix . "sensors_log WHERE sensor_id='{$row['sensor_id']}' ORDER BY time_updated DESC LIMIT 1"); $sValues = $sValueQuery->fetch_array(); if ($_GET['id'] == $row['sensor_id']) { $klass = "info"; } echo "<tr row-key='{$row['sensor_id']}' row-name='{$row['name']}' class='{$klass}'>"; unset($klass); echo "<td>"; echo "<a href='?page=sensors_data&id={$row['sensor_id']}'><span class='hidden-phone'>#{$row['sensor_id']}: </span>{$row['name']}</a>"; echo "<div class='visible-phone'>" . ago($sValues['time_updated']) . "</div>"; echo "</td>"; echo "<td>{$sValues['temp_value']}°</td>"; echo "<td>{$sValues['humidity_value']}%</td>"; echo "<td class='hidden-phone'>" . ago($sValues['time_updated']) . "</td>"; echo "<td class='hidden-phone'>{$row['clientname']}</td>"; echo "<td class='hidden-phone' style='text-align:right;'>"; //echo "<a class='btn' href='?page=sensors_data&action=removeSensor&id={$row['sensor_id']}'>".$lang['Data']."</a> "; $monitorSensor = getField("monitoring", "" . $db_prefix . "sensors", "WHERE sensor_id='{$row['sensor_id']}'"); if ($row['public'] == 1) { echo "<a class='btn btn-success' href='?page=sensors_exec&action=setSensorNonPublic&id={$row['sensor_id']}'>{$lang['Public']}</a>"; } else { echo "<a class='btn btn-info' href='?page=sensors_exec&action=setSensorPublic&id={$row['sensor_id']}'>{$lang['Non public']}</a>"; } echo " "; if ($monitorSensor == 0) { echo "<a class='btn btn-success' href='?page=sensors_exec&action=addSensor&id={$row['sensor_id']}&name={$row['sensor_id']}&location={$row['clientname']}'>" . $lang['Monitor'] . "</a>"; } else { echo "<a class='btn btn-danger' href='?page=sensors_exec&action=removeSensor&id={$row['sensor_id']}'>" . $lang['Stop'] . "</a>"; }
$charEdit['name'] = $editorInfo['firstName']; } else { $charEdit = mysql_fetch_assoc(mysql_query("SELECT name FROM {$server_cdb}.characters WHERE guid = '" . $editorInfo['character'] . "'")); } echo '<div class="post-edited">' . $Forum['Forum67'] . ' ' . $charEdit['name'] . ' ' . $Forum['Forum68'] . ' ' . $reply['last_date'] . '</div>'; } $content = $reply['content']; $content = postX($content, $posterInfo['class']); echo '<div class="post-detail">' . stripslashes($content) . '<br><br></div> </td> <td class="post-info"> <div class="post-info-int"> <div class="postData"> <a href="#' . $i . '">#' . $i . '</a> <div class="date" onmouseover="Tooltip.show(this,\'' . $Forum['Forum69'] . '' . $reply['date'] . '\')">' . ago(strtotime($reply['date'])) . '</div> </div> <!--<div class="blizzard_icon"><a class="nextBlizz" href="#" onmouseover="Tooltip.show(this,\'' . $Forum['Forum71'] . '\')"></a></div>--> </div> </td> </tr> </table> <div class="post-options">'; if (isset($_SESSION['username'])) { if ($thread['locked'] == 1) { if ($userInfo['class'] != "") { echo '<div class="respond">'; if ($reply['author'] == $userInfo['id']) { echo '<a class="ui-button button2 " href="../edit-post/?p=' . $postid['id'] . '"><span><span>' . $Forum['Forum22'] . '</span></span></a>';
function demographic() { $bulan = addslashes($_GET['m']); if ($bulan == "") { $bulan = date("F Y"); $days_ago = date('Y-m-01'); // hard-coded '01' for first day $days_now = date('Y-m-t'); } else { $bulan = urldecode($bulan); $days_ago = date('Y-m-01', strtotime($bulan)); // hard-coded '01' for first day $days_now = date('Y-m-t', strtotime($bulan)); } $numberDays = cal_days_in_month(CAL_GREGORIAN, date('n', strtotime($bulan)), date('Y', strtotime($bulan))); $days_ago = date('Y-m-01', strtotime($bulan)); // hard-coded '01' for first day $days_now = date('Y-m-01', strtotime('+1 month', strtotime($bulan))); $t = time(); //male female $ll = new LL_Account(); global $db; $query3 = "Select (Select count(*) from {$ll->table_name} where macc_gender='Male' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}')) AS Male,\n(Select count(*) from {$ll->table_name} where macc_gender='Female' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}')) AS Female "; $gender = $db->query($query3, 1); // pr($gender); // macc_lyb_status $query4 = "Select (Select count(*) from {$ll->table_name} where macc_lyb_status='LYB Club' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}')) AS Club,\n(Select count(*) from {$ll->table_name} where macc_lyb_status='The Body Shop Friend' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}')) AS Stampcard,\n(Select count(*) from {$ll->table_name} where macc_lyb_status='LYB Fan' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}')) AS Fan "; $lyb = $db->query($query4, 1); // pr($lyb); //macc_address_city // $query5="SELECT DISTINCT macc_address_city FROM {$ll->table_name} "; // // $cities = $db->query($query5,2); //// pr($cities); // // foreach($cities as $number=>$city){ // if($city->macc_address_city!="") { // $city->macc_address_city = str_replace(".","",$city->macc_address_city); // $city->macc_address_city = str_replace(",","",$city->macc_address_city); // $text[] = "(Select count(*) as count from {$ll->table_name} where macc_address_city='{$city->macc_address_city}' AND (macc_acquire_date BETWEEN '$days_ago' AND '$days_now')) AS " . str_replace("/", "", str_replace(" ", "", str_replace("-", "", $city->macc_address_city))); // } //// if($number>10)break; // } //// pr($text); // $imp = "Select ". implode(",",$text)." ORDER BY count DESC"; global $db; $q = "SELECT macc_address_city,COUNT(*) as count FROM {$ll->table_name} GROUP BY macc_address_city ORDER BY count DESC LIMIT 0,20"; $arrSl = $db->query($q, 2); // pr($arrSl); // echo $imp; // $nrcities = $db->query($imp,2); // pr($nrcities); ?> <div class="row"> <div class="col-md-12"> <h1> Demographic Dashboard <small><?php echo $bulan; ?> </small> </h1> <ol class="breadcrumb"> <li> <?php echo Lang::t('Select Timeframe'); ?> </li> <li class="active"> <?php $start = new DateTime('11 months ago'); // So you don't skip February if today is day the 29th, 30th, or 31st $start->modify('first day of this month'); $end = new DateTime(); $interval = new DateInterval('P1M'); $period = new DatePeriod($start, $interval, $end); ?> <select id="apptimeselector_<?php echo $t; ?> "> <?php foreach ($period as $dt) { ?> <option value="<?php echo urlencode($dt->format('F Y')); ?> " <?php if ($dt->format('F Y') == $bulan) { echo "selected"; } ?> > <?php echo $dt->format('F Y') . "<br>"; ?> </option> <?php } ?> </select> <script> $("#apptimeselector_<?php echo $t; ?> ").change(function(){ var slc = $("#apptimeselector_<?php echo $t; ?> ").val(); openLw("Demographic","<?php echo _SPPATH; ?> BIWebDemographic/demographic?m="+slc,"fade"); }); </script> </li> </ol> </div> </div> <?php $arrUserswPic = $ll->getWhere("macc_foto != '' AND (macc_acquire_date BETWEEN '{$days_ago}' AND '{$days_now}') ORDER BY macc_acquire_date DESC LIMIT 0,8"); $arrUsers = $ll->getOrderBy(" macc_acquire_date DESC LIMIT 0,8"); ?> <div class="row"> <!--<div class="col-md-6"> <div class="box box-danger"> <div class="box-header with-border"> <h3 class="box-title">Latest Members</h3> <div class="box-tools pull-right"> <span class="label label-danger">8 New Members</span> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i> </button> <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i> </button> </div> </div> <div class="box-body no-padding"> <ul class="users-list clearfix"> <?php foreach ($arrUsers as $user) { if ($user->macc_foto == "") { $url = _SPPATH . "images/noimage.jpg"; } else { $url = "http://43.231.128.129/" . $user->macc_foto; } ?> <li> <img src="<?php echo $url; ?> " alt="<?php echo $user->macc_first_name . " " . $user->macc_last_name; ?> "> <a class="users-list-name" href="#"><?php echo $user->macc_first_name . " " . $user->macc_last_name; ?> </a> <span class="users-list-date"><?php echo ago(strtotime($user->macc_acquire_date)); ?> </span> </li> <?php } ?> </ul> </div> <div class="box-footer text-center"> <a href="javascript::" class="uppercase">View All Users</a> </div> </div> </div> --> <div class="col-md-6"> <!-- USERS LIST --> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title">Latest Customers</h3> <!--<div class="box-tools pull-right"> <span class="label label-danger">8 New Members</span> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i> </button> <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i> </button> </div>--> </div> <!-- /.box-header --> <div class="box-body no-padding"> <ul class="users-list clearfix"> <?php foreach ($arrUserswPic as $user) { ?> <li style="height: 160px;"> <img src="<?php echo _LOKASI; echo $user->macc_foto; ?> " alt="User Image"> <span class="users-list-name" ><?php echo $user->macc_first_name . " " . $user->macc_last_name; ?> </span> <span class="users-list-date"><?php echo ago(strtotime($user->macc_acquire_date)); ?> </span> </li> <?php } ?> </ul> <!-- /.users-list --> </div> <!-- /.box-body --> <div class="box-footer text-center"> <a href="javascript:openLw('LL_Account', '<?php echo _SPPATH; ?> LLAccWeb/LL_Account', 'fade'); activkanMenuKiri('LL_Account');" class="uppercase">View All Customers</a> </div> <!-- /.box-footer --> </div> <!--/.box --> </div> <?php $arrColor = array("#00a65a", "#00c0ef"); $c = new Charting(); $c->color = array_pop($arrColor); $c->label = "Male"; $c->value = $gender->Male; $arrData[] = $c; $c = new Charting(); $c->color = array_pop($arrColor); $c->label = "Female"; $c->value = $gender->Female; $arrData[] = $c; ?> <div class="col-md-3"><?php Charting::morrisDonut("287px", $arrData, 1, "Gender", "default"); ?> </div> <?php $arrColor = array("#4da65a", "#7bcd03", "#53ddde"); $arrData = array(); $c = new Charting(); // $c->color = array_pop($arrColor); $c->color = "#e90057"; $c->label = "Fan"; $c->value = $lyb->Fan; $arrData[] = $c; $c = new Charting(); // $c->color = array_pop($arrColor); $c->color = "#cd6949"; $c->label = "Club"; $c->value = $lyb->Club; $arrData[] = $c; $c = new Charting(); // $c->color = array_pop($arrColor); $c->color = "#f4bb1b"; $c->label = "Stampcard"; $c->value = $lyb->Stampcard; $arrData[] = $c; ?> <div class="col-md-3"><?php Charting::morrisDonut("287px", $arrData, 1, "Member Type", "default"); ?> </div> <?php $arrData = array(); $arrlegend = array(); foreach ($arrSl as $attr => $value) { if ($value->macc_address_city == "") { $value->macc_address_city = "Unknown"; } $c = new Charting(); $c->color = "#" . $this->random_color(); $c->label = str_replace(" ", "_", $value->macc_address_city); $c->value = $value->count; $arrData[] = $c; // $arrlegend[$attr] = $value; } // asort($arrlegend); //pr($arrlegend); // $arrlegend = array_reverse($arrlegend,1); // $arrData = array(); // foreach($arrSl as $attr=>$value){ // $c = new Charting(); // $c->color = "#".$this->random_color(); // // $c->label = str_replace(" ","_",$value->macc_address_city); // $c->value = $value->count; // //// $c->label = ucwords(strtolower(str_replace("_"," ",$attr))); //// $c->value = $value; // $arrData[] = $c; // $arrColors[$attr] = $c->color; //// $arrlegend[$attr] = $value; // } ?> </div> <div class="row"> <div class="col-md-12"> <div class="box box-default"> <div class="box-header with-border"> <h3 class="box-title">Locations</h3> <div class="box-tools pull-right"> <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i> </button> <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> </div> </div> <div class="box-body chart-responsive"> <div class="col-md-6"> <?php Charting::morrisDonut("300px", $arrData, 0, "Locations", "default", 0); ?> </div> <div class="col-md-6"> <?php ?> <ul class="nav nav-pills nav-stacked"> <?php foreach ($arrSl as $attr => $value) { if ($value->macc_address_city == "") { $value->macc_address_city = "Unknown"; } ?> <li style="line-height: 30px;"> <div style="margin-top:5px; float: left; width: 20px; height: 20px; background-color: <?php echo $arrColors[$attr]; ?> ;"></div> <?php echo ucwords(str_replace("_", " ", strtolower($value->macc_address_city))); ?> <span class="pull-right "> <?php echo $value->count; ?> </span></li> <?php } ?> </ul> </div> </div> <!-- /.box-body --> </div> </div> </div> <style> ul.legend li{ list-style: none; line-height: 30px; } ul.legend li div{ float: left; margin-top: 10px; margin-right: 15px; } .legend-item{ float: left; margin: 10px; line-height: 30px; margin-right: 5px; } .legend-item div{ float: left; margin-top: 10px; margin-right: 5px; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb { float: right; background: transparent; margin-top: 0; margin-bottom: 0; font-size: 12px; padding: 7px 5px; position: absolute; top: 15px; right: 10px; border-radius: 2px; } .users-list-name{ white-space: nowrap; } </style> <?php }
<div class="comment"> <p><?php echo $node->body; ?> </p> <p class="by">by <a href="/user/<?php echo $node->uid; ?> /<?php echo $node->name; ?> "><?php echo $node->name; ?> </a> <?php echo ago($node->created); ?> </p> </div> <?php } } ?> </div> <?php if ($logged_in) { ?> <?php echo simple_inline_comments($nid . "-comments", $nid); ?> <?php
// shows an user album // child = user id // child2 = album id if (!$this->child || !$this->child2) { die('XXX wrong album params'); } $user = User::get($this->child); if (!$user) { die('XXX NO SUCH USER'); } $album = PhotoAlbum::get($this->child2); if ($album->owner != 0 && $album->owner != $this->child) { throw new \Exception('epic HACK attempt'); } echo '<h1>Photo album ' . $album->name . ' by ' . UserLink::render($this->child) . '</h1>'; echo 'Created ' . ago($album->time_created) . '<br/>'; // shows album content $images = File::getByCategory(USER, $this->child2, $this->child); if (!$images && $album->owner) { echo '» ' . ahref('u/album/delete/' . $this->child2, 'Delete empty album') . '<br/>'; } if ($session->id == $this->child) { echo '» ' . ahref('u/album/upload/' . $this->child2, 'Add photos') . '<br/>'; } foreach ($images as $im) { $a = new XhtmlComponentA(); $a->href = getThumbUrl($im->id, 0, 0); $a->rel = 'lightbox[album]'; $a->content = showThumb($im->id, $im->name, 150, 150); echo $a->render(); echo ahref('u/photo/show/' . $im->id, 'Details');
<div class="item"> <?php echo $this->template->get_user_image($photo, 'online'); ?> <p class="message"> <a href="#" class="name"> <small class="text-muted pull-right"><i class="fa fa-clock-o"></i> <?php echo ago(strtotime($date)); ?> </small> <?php echo $fullname; ?> </a> <?php echo html_escape($chat); ?> </p> </div>
$positionInUnits = 0; } $remainedTime = $currentTime - $difference % $sizes[$positionInUnits]; $amountOfTime = floor($amountOfTime); if ($amountOfTime != 1) { $units[$positionInUnits] .= 's'; } $when = sprintf("%d %s ", $amountOfTime, $units[$positionInUnits]); if ($parameters['numberOfUnits'] == 0 && $positionInUnits >= 1 && $currentTime - $remainedTime > 0) { $when .= when($remainedTime); } return $when; } $timeInPast = strtotime('2015-11-12 11:11:00'); $timeInFuture = strtotime('2015-11-14 11:12:00'); echo ' <br/>', date('Y-m-d H:i:s', PHP_INT_MAX); echo ' <br/>'; echo ' <br/>'; //@formatter:off echo ' <br/>', sprintf('The incident has taken place %1$s ago', ago(strtotime($timeInPast))); echo ' <br/>', sprintf('The incident is going to take place %1$s', ago(strtotime($timeInFuture), 20)); echo ' <br/>'; // // .................................................. echo ' <br/>', sprintf('The incident has taken place %1$s ago', _ago(strtotime($timeInPast), 0)); echo ' <br/>', sprintf('The incident is going to take place in %1$s', _ago(strtotime($timeInFuture), 20)); echo ' <br/>'; //SEE MINGIT MOODI TÖÖTAB echo ' <br/>', sprintf('The incident happened %1$s ago', when(array('numberOfUnits' => 20, 'timestamp' => '2015-11-12 11:11:00'))); echo ' <br/>', sprintf('The incident will happen in %1$s ', when(array('numberOfUnits' => 20, 'timestamp' => '2017-11-14 11:12:00'))); echo ' <br/>'; //@formatter:on
function parser_twitter_results($results = array(), $mention) { $options_latest = array(); $options_latest = array("date" => date("YmdHis")); global $skyscraper_options; $i = 0; if (is_array($results)) { foreach ($results as $tweet) { $options_latest[$i] = array(); $options_latest[$i]["text"] = $tweet["text"]; $options_latest[$i]["created_at"] = ago(strtotime($tweet["created_at"])); if ($mention) { $options_latest[$i]["name"] = $tweet["from_user_name"]; } else { $options_latest[$i]["name"] = $tweet["user"]["name"]; } $i++; if ($i == $skyscraper_options["num_tweets"]) { break; } } } return $options_latest; }
<?php } ?> <?php if (!empty($rowResult['showAddress'])) { ?> <p><?php echo $rowResult['address']; ?> </p> <?php } ?> <ul class="list-inline list-unstyled"> <li><span><i class="glyphicon glyphicon-calendar"></i><?php echo ago(strtotime($rowResult['residential_updated_dt'])); ?> </span></li> <?php if (!empty($_SESSION['user']['id']) && $_SESSION['user']['id'] == $rowResult['uid']) { ?> <li>|</li> <li> <a href="<?php echo $currentURL; ?> /residential/edit?id=<?php echo $rowResult['residential_id']; ?> "><span class="fa fa-globe"></span> Edit</a> | <a onClick="var x=confirm('do you really want to delete this post?'); return x;" href="<?php echo $currentURL;
<div class="user-profile-left"> <h3 class="title"> <span class="blue">Laboratuvar Analizi</span> </h3> <ul class="user-about"> <?php if (!empty($user['info'])) { ?> <li><span>Hakkında</span><?php echo $user['info']; ?> </li><?php } ?> <li><span>Kayıt Tarihi</span><?php echo ago(strtotime($user['create_date'])); ?> </li> <li><span>Dizi İzleme Süresi</span><?php echo whtime($min['min']); ?> </li> </ul> <h3 class="title"> <span>Takip Ettikleri (<?php echo number_format($uye_takip); ?> )</span> </h3> <ul class="user-fav-list"> <?php
<center><b>Bug tracker allows you to view current bugs on the server, also you are able to send bug notices to be fixed.</b></center> <br /> <?php if (count($bugs) == 0) { alert("No bugs has been submited."); } else { echo "<center>" . $pages . "</cemter>"; echo "<table width='100%'>"; echo "<tr><td width='2%'></td><td width='30%'><center><b>Title</b></center></td><td><center><b>Category</b></center></td><td><center><b>Priority</b></center></td><td><center><b>Author</b></center></td><td><center><b>Done</b></center></td><td><center><b>Time</b></center></td></tr>"; foreach ($bugs as $bug) { $status = $bug['closed'] == 0 ? "open.gif" : "closed.gif"; echo "<tr class='bugtrackerRow'><td><center><img src='" . WEBSITE . "/public/images/bugtracker/" . $status . "'></center></td><td width='30%'><center><a href='" . WEBSITE . "/index.php/bugtracker/view/" . $bug['id'] . "'>" . truncateString($bug['title'], 26) . "</a></center></td><td><center>" . bugtracker_getCategory($bug['category']) . "</center></td><td><center>" . bugtracker_getPriorityImage($bug['priority']) . " " . bugtracker_getPriority($bug['priority']) . "</center></td><td><center><a href='" . WEBSITE . "/index.php/character/view/" . $bug['name'] . "'>" . $bug['name'] . "</a></center></td><td><center><div class='bugtrackerProgressBar'><div class='bugtrackerProgress' style='width: " . $bug['done'] . "%;'></div></div>" . $bug['done'] . "%</center></td><td><center>" . ago($bug['time']) . "</center></td></tr>"; } echo "</table>"; } echo "<center>" . $pages . "</cemter>";
?> <a href="#"><img src="<?php echo assets('assets/img/forum-latest.png'); ?> " class="forum-post-latest" width="8" height="8"></a> <?php echo char_link(playerIdToName($latest->posted_by)); ?> , <abbr title="<?php echo Carbon\Carbon::createFromTimestamp($latest->created); ?> "><?php echo ago($latest->created); ?> </abbr> </small> </td> </tr> <?php } ?> <?php } else { ?> <tr> <td colspan="4">There are no threads as of right now. Why don't you create one?</td> </tr> <?php
foreach ($comments as $val) { ?> <div class="forum-message "> <div class="image"> <img src="<?php echo avatar($val['usaid']); ?> " alt=""> </div> <div class="message-content"> <div class="top"> <a href="http://dizilab.com/uye/fraksiyon"><?php echo $val['username']; ?> </a> <span style="padding-left: 10px; float: right"> <?php echo ago(strtotime($val['tarih'])); ?> </span> </div> <p class="spoiler-text" style="line-height: 38px; background-color: #1A1D1F; text-align: center; font-size: 12px; color: #dfe4e6; cursor: pointer; display: none"> Bu yorum dizi hakkında spoiler içermektedir. <span style="color: #edce7b;text-decoration: underline;">Okumak istiyorsanız tıklayın.</span> </p> <p style="display: block"><?php echo $val['content']; ?> </p> <div class="alt"> <div class="alt-right"> <a href="javascript:;" class="like" onclick="comment_like(362391)"> <span class="fa fa-heart" style="font-size: 15px;"></span> </a>