function formatCreated($discussionItems) { $discussionCreated = $discussionItems[2]; for ($i = 3; $i < 6; $i++) { $discussionCreated .= ' ' . $discussionItems[$i]; } return humanTiming(strtotime($discussionCreated)); }
function build_thread($thread) { echo "<div class='children'>"; foreach ($thread as $child) { $score = $child['votes_up'] - $child['votes_down']; //Create tag for user level $user_level_tag = "<span style='font-size: 10pt; color: red; text-decoration: none;'>"; switch ($child['author_user_level']) { case 'admin': $user_level_tag .= "[admin]"; break; case 'mod': $user_level_tag = "[mod]"; break; default: $user_level_tag = ""; } $user_level_tag .= "</span>"; $thread_text_formatted = nl2br($child['thread_text']); echo "<div id='block_" . $child['thread_id'] . "'>\r\n <table>\r\n <tr>"; switch ($child['vote_value']) { case 'up': $up_image = "up_voted"; $down_image = "down_vote"; break; case 'down': $up_image = "up_vote"; $down_image = "down_voted"; break; default: $up_image = "up_vote"; $down_image = "down_vote"; } echo "<td valign=top><a href='" . URL . "community/_addVote/" . $child['thread_id'] . "/up'><img src='" . URL . "public/img/" . $up_image . ".png' border=0/></a><br /><br /><a href='" . URL . "community/_addVote/" . $child['thread_id'] . "/down'><img src='" . URL . "public/img/" . $down_image . ".png' border=0/></a></td>"; echo "<td>\r\n <td>\r\n <a name='comment_" . $child['thread_id'] . "'>\r\n <div class='comment'><span class='comment_info'>\r\n <a href='../../overview/showuserprofile/" . $child['author_user_id'] . "'>" . $child['author_user_name'] . "</a> " . $user_level_tag . "\r\n Capital(" . $score . ")\r\n " . humanTiming($child['thread_timestamp']) . "\r\n </span>\r\n\t\t\t\t<form method='post' action='" . URL . "community/_editComment/" . $child['thread_id'] . "'>\r\n <div class='thread_text_block'>" . $thread_text_formatted . "</div>\r\n\t\t\t\t</form></div>\r\n <div class='thread_actions'><a href='javascript: void(0)' onclick='commentReply(" . $child['thread_id'] . ")' class='commentReply'>Reply</a> -"; if (Session::get('user_logged_in') == true && ($child['author_user_id'] == $_SESSION["user_id"] || $_SESSION["user_level"] == 'admin')) { echo " <a href='javaScript:void(0);' class='editLink'>Edit</a>"; echo " - <a href='" . URL . "community/deleteThread/" . $child['thread_id'] . "'>Delete</a>"; } echo "\r\n\t\t\t\t<div class='thread_reply''>\r\n\t\t\t\t<form method='post' action='" . URL . "community/_addComment/" . $child['thread_id'] . "'>\r\n\t\t\t\tAdd Comment:<br />\r\n\t\t\t\t<textarea name='thread_text' placeholder='Please be sure to read the etiquette before posting.'></textarea><br />\r\n\t\t\t\t<input type='submit' class='button' value='Add Comment' />\r\n\t\t\t\t</form>\r\n\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n </a>\r\n </td></tr>\r\n </table>\r\n \r\n </div>"; build_thread($child['children']); } echo "</div>"; }
function last_still($camera_name, $file_path) { $folder_name = $camera_name; $camera_path = $file_path . $folder_name; $scanned_directory = array_diff(scandir($camera_path, 1), array('..', '.', 'test')); if ($scanned_directory[0] == "" or $scanned_directory[0] == NULL) { $scanned_directory[0] = $scanned_directory[1]; } $path_to_photos = $camera_path . "/" . $scanned_directory[0]; $images_array = glob($path_to_photos . '/*.jpg'); sort($images_array); rsort($images_array); $i_count = count($images_array); $last_img_name = ""; for ($i = 0; $i < 100; $i++) { if ($images_array[$i] !== NULL) { $last_img_name = $images_array[$i]; //echo $images_array[$i]; break; } } $pieces = explode("_", $last_img_name); $time_period = $pieces[2]; $year = substr($time_period, 0, 4); $month = substr($time_period, 4, 2); $day = substr($time_period, 6, 2); $hour = substr($time_period, 8, 2); $minute = substr($time_period, 10, 2); $test_date = "2015-05-10"; $time_formatted = "2015-04-22 "; //$time_in_12_hour_format = date("g:i a", strtotime($time_formatted)); $full_date_time = $year . "-" . $month . "-" . $day . " " . $time_formatted; $time_to_be_calculated = strtotime($year . "-" . $month . "-" . $day . $hour . ":" . $minute); $time_passed = humanTiming($time_to_be_calculated) . " ago"; if ($time_passed == NULL) { $time_passed = "Just Now "; } elseif ($time_passed == "") { $time_passed = "Just Now "; } elseif ($time_passed == 0) { $time_passed = "Just Now "; } return $time_passed; }
function tag_theme($topic_array, $generate_page, $page_title, $description, $topic_image) { global $lang_module, $module_info, $module_name, $module_file, $topicalias, $module_config; $xtpl = new XTemplate('tag.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file); $xtpl->assign('LANG', $lang_module); $xtpl->assign('TITLE', $page_title); $xtpl->assign('IMGWIDTH1', $module_config[$module_name]['homewidth']); if (!empty($description)) { $xtpl->assign('DESCRIPTION', $description); if (!empty($topic_image)) { $xtpl->assign('HOMEIMG1', $topic_image); $xtpl->parse('main.description.image'); } $xtpl->parse('main.description'); } if (!empty($topic_array)) { foreach ($topic_array as $topic_array_i) { $xtpl->assign('TOPIC', $topic_array_i); $xtpl->assign('TIME', humanTiming($topic_array_i['publtime'])); if (!empty($topic_array_i['src'])) { $xtpl->parse('main.topic.homethumb'); } if (defined('NV_IS_MODADMIN')) { $xtpl->assign('ADMINLINK', nv_link_edit_page($topic_array_i['id']) . ' ' . nv_link_delete_page($topic_array_i['id'])); $xtpl->parse('main.topic.adminlink'); } if (isset($topic_array_i['uploader_link']) and !empty($topic_array_i['uploader_link'])) { $xtpl->parse('main.topic.uploader_link'); } else { $xtpl->parse('main.topic.uploader'); } $xtpl->parse('main.topic'); } } if (!empty($topic_other_array)) { foreach ($topic_other_array as $topic_other_array_i) { $topic_other_array_i['publtime'] = nv_date('H:i d/m/Y', $topic_other_array_i['publtime']); $xtpl->assign('TOPIC_OTHER', $topic_other_array_i); $xtpl->parse('main.other.loop'); } $xtpl->parse('main.other'); } if (!empty($generate_page)) { $xtpl->assign('GENERATE_PAGE', $generate_page); $xtpl->parse('main.generate_page'); } $xtpl->parse('main'); return $xtpl->text('main'); }
<?php date_default_timezone_set('Asia/Singapore'); echo mktime(); $dte = ""; echo "<br>" . date("Y-m-d"); $dte = date("Y-m-d") . " " . date("H:i:s"); echo "<br>" . $dte; echo "<br>"; $time = strtotime('2010-04-28 17:25:43'); echo 'event happened ' . humanTiming($time) . ' ago' . "<br>"; $time = strtotime('2016-03-01 17:25:43'); echo 'event happened ' . humanTiming($time) . ' ago' . "<br>"; $time = strtotime('2016-03-06 23:42:00'); echo 'event happened ' . humanTiming($time) . ' ago' . "<br>"; $time = strtotime('2010-04-28 17:25:43'); echo 'event happened ' . humanTiming($time) . ' ago' . "<br>"; function humanTiming($time) { $time = mktime() - $time + 3600; // to get the time since that moment $time = $time < 1 ? 1 : $time; $tokens = array(31536000 => 'year', 2592000 => 'month', 604800 => 'week', 86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second'); foreach ($tokens as $unit => $text) { if ($time < $unit) { continue; } $numberOfUnits = floor($time / $unit); return $numberOfUnits . ' ' . $text . ($numberOfUnits > 1 ? 's' : ''); } }
$time = $time < 1 ? 1 : $time; $tokens = array(31536000 => 'year', 2592000 => 'month', 604800 => 'week', 86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second'); foreach ($tokens as $unit => $text) { if ($time < $unit) { continue; } $numberOfUnits = floor($time / $unit); return $numberOfUnits . ' ' . $text . ($numberOfUnits > 1 ? 's' : ''); } } $db_conx = new mysqli("**SERVER**", "**DATABASE**", "**PASSWORD**", "**USERNAME**") or die("cannot connect"); $getposts = $db_conx->prepare("SELECT id, tstmp, email, name, comment FROM comments ORDER BY tstmp DESC"); $getposts->execute(); $getposts->bind_result($id, $ts, $email, $name, $comment); while ($getposts->fetch()) { $ago = humanTiming($ts) . ' ago'; $ts = date("d/m/Y", strtotime($ts)) . "<br>" . date("H:i", strtotime($ts)); ?> <tr><td><?php echo $name; ?> </td><td><a href='mailto:<?php echo $email; ?> '><?php echo $email; ?> </a></td><td><?php echo $comment; ?> </td><td><?php
function datetime_elapsed($time) { if (version_compare(PHP_VERSION, '5.4.0') >= 0) { return datetime_ago($time); } else { return humanTiming($time); } }
function komen($idg, $access_token, $onfb) { $json = file_get_contents('https://graph.facebook.com/v2.2/' . $idg . '/comments?access_token=' . $access_token); $result = json_decode($json); foreach ($result->data as $r) { if (!empty($r->message)) { echo '<div class="bales"><div class="panel panel-default">'; echo '<div class="panel-heading">'; echo '<img src ="https://graph.facebook.com/' . $r->from->id . '/picture" class="pull-left">'; echo '<p>' . $r->from->name . '<br>'; echo humanTiming(strtotime($r->created_time)) . ' ago<i class="fa fa-thumbs-up"> <a>' . $r->like_count . '</a></i></p>'; echo '</div><div class="panel-body">'; $idk = $r->id; komen_img($idk, $access_token); echo '<pre>' . formatUrlsInText(htmlentities($r->message)) . '</pre>'; echo '</div></div></div>'; } } echo '<p align="center"><a class="btn btn-danger btn-xs" href="https://www.facebook.com/permalink.php?story_fbid=' . $onfb . '&id=' . $idg . '" target="_BLANK">Full story</a></p>'; }
<p><?php echo $user_data->username; ?> </p> </div> <div class="form-group"> <label>Email:</label> <p style="text-transform: lowercase;"><?php echo $user_data->email; ?> </p> </div> <div class="form-group"> <label>Joined Since:</label> <p><?php humanTiming($user_data->joined_date); ?> </p> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div role="tabpanel" class="tab-pane" id="security"> <div class="panel panel-default securityPanel">
default: $up_image = "up_vote"; $down_image = "down_vote"; } echo "<td valign='top'><a href='" . URL . "community/_addVote/" . $thread->thread_id . "/up'><img src='" . URL . "public/img/" . $up_image . ".png' border=0/></a><br /><br /><a href='" . URL . "community/_addVote/" . $thread->thread_id . "/down'><img src='" . URL . "public/img/" . $down_image . ".png' border=0/></a></td>"; echo "<td>"; if ($thread->thread_parent_id != NULL) { echo "Commented in <a href='" . URL . "community/thread/" . $thread->thread_parent_id . "' class='threadLink'>" . $thread->parent_thread_title . "</a>"; } else { echo "<a href='" . URL . "community/thread/" . $thread->thread_id . "' class='threadLink'>" . $thread->thread_title . "</a>"; } echo "<br />"; if ($thread->thread_parent_id != NULL) { echo "<div style='margin-bottom: 2px; margin-left: 8px; background-color: #cee4ea;'><em>\"" . $thread->thread_text . "\"</em></div>"; } echo "<span class='post_info'>Posted by <a href='#' class='userLink'>" . $thread->user_name . "</a> Capital(" . $score . ") " . humanTiming($thread->thread_timestamp); if (Session::get('user_logged_in') == true && ($thread->thread_author_user_id == $_SESSION["user_id"] || $_SESSION["user_level"] == 'admin')) { echo "<br /><a href='" . URL . "community/deleteThread/" . $thread->thread_id . "'>Delete</a>"; } echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; } } ?> </div> </div> <script> function followUser(userID, username) {
function dashboard_shortcode() { global $wpdb; $forms = $wpdb->get_results($wpdb->prepare("SELECT title, is_active FROM wp_rg_form ")); $active_forms = count($forms); $completed = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_form_meta.display_meta, wp_rg_lead.orderStatus, wp_rg_lead.date_created, wp_rg_lead.id, wp_rg_lead.form_id, wp_rg_form.title FROM wp_rg_lead LEFT JOIN wp_rg_form ON wp_rg_lead.form_id = wp_rg_form.id LEFT JOIN wp_rg_form_meta ON wp_rg_lead.form_id = wp_rg_form_meta.form_id WHERE wp_rg_lead.created_by = %d AND wp_rg_lead.orderStatus = 'complete' ORDER BY wp_rg_lead.date_created DESC", wp_get_current_user()->ID)); $completed_orders = count($completed); $grouped_feed = array(); $grouped_orders_mtd = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_form.title, COUNT(wp_rg_form.title) as counter, wp_rg_lead.date_created FROM wp_rg_lead LEFT JOIN wp_rg_form ON wp_rg_lead.form_id = wp_rg_form.id LEFT JOIN wp_rg_form_meta ON wp_rg_lead.form_id = wp_rg_form_meta.form_id WHERE wp_rg_lead.created_by = %d AND wp_rg_lead.orderStatus = 'complete' AND wp_rg_lead.date_created BETWEEN\n DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW() GROUP BY wp_rg_form.title", wp_get_current_user()->ID)); $grouped_orders_ytd = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_form.title, COUNT(wp_rg_form.title) as counter, wp_rg_lead.date_created FROM wp_rg_lead LEFT JOIN wp_rg_form ON wp_rg_lead.form_id = wp_rg_form.id LEFT JOIN wp_rg_form_meta ON wp_rg_lead.form_id = wp_rg_form_meta.form_id WHERE wp_rg_lead.created_by = %d AND wp_rg_lead.orderStatus = 'complete' AND wp_rg_lead.date_created BETWEEN\n DATE_SUB(NOW(), INTERVAL 365 DAY) AND NOW() GROUP BY wp_rg_form.title", wp_get_current_user()->ID)); foreach ($grouped_orders_ytd as $g) { $groupedytd[$g->title] = $g->counter; } foreach ($grouped_orders_mtd as $g) { $groupedmtd[$g->title] = $g->counter; //echo 'COunt: '.$g->counter; } $total_companies_ytd = $groupedytd['Company Incorporation'] + $groupedytd['Company Incorporation - Special Purpose']; $total_new_smsf_ytd = $groupedytd['New SMSF'] + $groupedytd['SMSF Trust Deed']; $total_pensions_ytd = $groupedytd['SMSF Pension']; $total_sdv_ytd = $groupedytd['SMSF Trust Deed Upgrade']; $total_inv_ytd = $groupedytd['Investment Strategy']; $total_lrba_ytd = $groupedytd['Limited Recourse Borrowing Arrangement']; $total_companies_mtd = $groupedmtd['Company Incorporation'] + $groupedmtd['Company Incorporation - Special Purpose']; $total_new_smsf_mtd = $groupedmtd['New SMSF'] + $groupedmtd['SMSF Trust Deed']; $total_pensions_mtd = $groupedmtd['SMSF Pension']; $total_sdv_mtd = $groupedmtd['SMSF Trust Deed Upgrade']; $total_inv_mtd = $groupedmtd['Investment Strategy']; $total_lrba_mtd = $groupedmtd['Limited Recourse Borrowing Arrangement']; $_user_id = get_current_user_id(); $nsfprice = get_user_meta($_user_id, 'smsf_establishment', 1); $sdvprice = get_user_meta($_user_id, 'smsf_deed', 1); $cotprice = get_user_meta($_user_id, 'smsf_change', 1); $lrbaprice = get_user_meta($_user_id, 'smsf_borrowing', 1); $coyprice = get_user_meta($_user_id, 'company_inc', 1); $coyspprice = get_user_meta($_user_id, 'company_incsp', 1); $abpprice = get_user_meta($_user_id, 'account_base_pension', 1); $trisprice = get_user_meta($_user_id, 'transition_to_retirement', 1); $statdecprice = get_user_meta($_user_id, 'statutory_declaration', 1); $acqprice = get_user_meta($_user_id, 'acquire_an_asset', 1); $sellprice = get_user_meta($_user_id, 'sell_an_asset', 1); $worktestprice = get_user_meta($_user_id, 'satisfy_work_test', 1); $consentprice = get_user_meta($_user_id, 'trust_consent', 1); $windupprice = get_user_meta($_user_id, 'wind_up_smsf', 1); $corprice = get_user_meta($_user_id, 'met_condition_of_release', 1); $totalrevmtd = $nsfprice * $total_new_smsf_mtd + $total_companies_mtd * $coyprice + $total_pensions_mtd * $abpprice; $totalrevmtd = $totalrevmtd + $sdvprice * $total_sdv_mtd + $total_con_mtd * $conprice + $total_lrba_mtd * $lrbaprice; $totalrevmtd = number_format($totalrevmtd, 2, '.', ','); $totalrevytd = $nsfprice * $total_new_smsf_ytd + $total_companies_ytd * $coyprice + $total_pensions_ytd * $abpprice; $totalrevytd = $totalrevytd + $sdvprice * $total_sdv_ytd + $total_con_ytd * $conprice + $total_lrba_ytd * $lrbaprice; $totalrevytd = number_format($totalrevytd, 2, '.', ','); $total_companies = $total_companies_mtd + $total_companies_ytd; $total_new_smsf = $total_new_smsf_mtd + $total_new_smsf_ytd; $total_pensions = $total_pensions_mtd + $total_pensions_ytd; $total_sdv = $total_sdv_mtd + $total_sdv_ytd; $total_inv = $total_in_mtd + $total_inv_ytd; $total_lrba = $total_lrba_mtd + $total_lrba_ytd; if (is_null($total_companies)) { $total_companies = 0; } if (is_null($total_new_smsf)) { $total_new_smsf = 0; } if (is_null($total_pensions)) { $total_pensions = 0; } if (is_null($total_sdv)) { $total_sdv = 0; } if (is_null($total_inv)) { $total_inv = 0; } if (is_null($total_lrba)) { $total_lrba = 0; } $coys = 0; $inc_coys = 0; $inc_coys_feed = ''; $order_feed = ''; $form_id_excluded = array(3, 4, 5, 60, 66, 68, 71); foreach ($completed as $c) { if ($c->form_id == "11" || $c->form_id == "58") { $coys = $coys + 1; } if (!in_array($c->form_id, $form_id_excluded)) { // if((($c->form_id != "71") && ($c->form_id != "68"))){ $order_feed = $order_feed . ' ' . '<li> <div class="col1"> <div class="cont"> <div class="cont-col1"> <div class="label label-sm label-info"> <i class="fa fa-shopping-cart"></i> </div> </div> <div class="cont-col2"> <div class="desc"> ' . $c->title . ' ordered ( #' . $c->form_id . $c->id . ' ) </div> </div> </div> </div> <div class="col2"> <div class="date"> ' . humanTiming(strtotime($c->date_created)) . ' </div> </div> </li>'; } } if ($coys > 0) { $coys_percent = round($coys / $completed_orders * 100); } else { $coys_percent = 0; } $saved = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_form_meta.display_meta, wp_rg_lead.asic_status, wp_rg_lead.orderStatus, wp_rg_lead.date_created, wp_rg_lead.id, wp_rg_lead.form_id, wp_rg_form.title FROM wp_rg_lead LEFT JOIN wp_rg_form ON wp_rg_lead.form_id = wp_rg_form.id LEFT JOIN wp_rg_form_meta ON wp_rg_lead.form_id = wp_rg_form_meta.form_id WHERE wp_rg_lead.created_by = %d AND wp_rg_lead.orderStatus = 'incomplete'", wp_get_current_user()->ID)); $allOrders = $wpdb->get_results($wpdb->prepare("SELECT wp_rg_lead.asic_status, wp_rg_lead.orderStatus, wp_rg_lead.date_created, wp_rg_lead.id, wp_rg_lead.form_id, wp_rg_form.title FROM wp_rg_lead LEFT JOIN wp_rg_form ON wp_rg_lead.form_id = wp_rg_form.id LEFT JOIN wp_rg_form_meta ON wp_rg_lead.form_id = wp_rg_form_meta.form_id WHERE wp_rg_lead.created_by = %d AND wp_rg_lead.asic_status <> 'Order complete' AND wp_rg_lead.asic_status <> ''", wp_get_current_user()->ID)); foreach ($allOrders as $s) { if ($s->form_id == "11" || $s->form_id == "58") { $inc_coys = $inc_coys + 1; $inc_coys_feed = $inc_coys_feed . ' ' . '<li> <div class="col1"> <div class="cont" style="width:50%;"> <div class="cont-col1"> <div class="label label-sm label-warning"> <i class="fa fa-exclamation"></i> </div> </div> <div class="cont-col2" > <div class="desc"> ' . $s->title . ' ( #' . $s->form_id . $s->id . ' ) </div> </div> </div> <div class="col3"> <div class="desc"> ' . $s->asic_status . ' </div> </div> </div> </li>'; } } $saved_orders = count($saved); //get current user logged ing $current_user = wp_get_current_user(); $user_id = $current_user->ID; //Count total Courses $args = array('post_type' => 'sfwd-courses', 'numberposts' => -1, 'orderby' => 'date', 'order' => 'DESC'); $courses = get_posts($args); $tcourses = count($courses); //Count total enrolled and not enrolled $total_enrolled = 0; $total_not_enrolled = 0; $total_completed = 0; $ii = 0; foreach ($courses as $key => $course) { $ii++; $status = ''; $course_id = $course->ID; $meta = get_post_meta($course_id, '_sfwd-courses', true); if (!empty($meta['sfwd-courses_course_access_list'])) { $course_access_list = explode(',', $meta['sfwd-courses_course_access_list']); } else { $course_access_list = array(); } //$topics = $course['topics']; //if(strlen(get_the_title( $key )) > 0) { $accreditation_activity_code = get_post_custom_values('accreditation_activity_code', $course_id); $issue_date_aac = get_post_custom_values('issue_date_aac', $course_id); $expiry_date_aac = get_post_custom_values('expiry_date_acc', $course_id); $cpd_points = get_post_custom_values('cpd_points', $course_id); $issue_date_cpd = get_post_custom_values('issue_date_cpd', $course_id); $expiry_date_cpd = get_post_custom_values('expiry_date_cpd', $course_id); $cpe_points = get_post_custom_values('cpe_points', $course_id); $issue_date_cpe = get_post_custom_values('issue_date_cpe', $course_id); $expiry_date_cpe = get_post_custom_values('expiry_date_cpe', $course_id); $fpa_points = get_post_custom_values('fpa_points', $course_id); $issue_date_fpa = get_post_custom_values('issue_date_fpa', $course_id); $expiry_date_fpa = get_post_custom_values('expiry_date_fpa', $course_id); $published_date = get_the_date('M. d, Y', $course_id); //echo $enrolledOrNot.'<br/>'; if (in_array($user_id, $course_access_list) || learndash_user_group_enrolled_to_course($user_id, $course_id)) { $enrolled = 'Enrolled = ' . $total_enrolled; $total_enrolled++; // echo " you are enrolled to $user_id, $course_id <br>"; } else { $enrolled = '<a href="' . get_permalink($course_id) . '">Enrol Now</a> = ' . $total_not_enrolled; $total_not_enrolled++; // echo " you are not enrolled to $user_id, $course_id <br>"; } //date("d/m/Y", get_user_meta( $user_id, 'course_completed_'.$course_id, $single )) if (strlen(get_user_meta($user_id, 'course_completed_' . $course_id, $single)) > 0) { $dateCompleted = date("d/m/Y", get_user_meta($user_id, 'course_completed_' . $course_id, $single)); $enrolled = 'Completed'; // echo " you completted = $user_id, $course_id <br>"; $total_completed++; } else { $dateCompleted = ''; } } // echo "<pre>"; // print_r($companies); // echo "</pre>"; //foreach($leads as $lead){ //$output .= '<tr><td>'.$lead->id.'</td><td>'.get_reference($lead->form_id, $lead->id, $wpdb).'</td><td>'.$lead->title.'</td><td>'.date("d/m/Y", strtotime($lead->date_created)).'</td><td>'.$lead->orderStatus.'</td><td><button class="btn default btn-xs purple" onclick="SetHiddenFormSettingsTPO('.$lead->id.', \'update\',\''.get_action_link($lead->form_id, $lead->id, $wpdb).'\')"><i class="fa fa-edit"></i> Resume</button> <button class="btn default btn-xs black" onclick="SetHiddenFormSettingsTPO('.$lead->id.', \'delete\',\''.get_action_link($lead->form_id, $lead->id, $wpdb).'\')"><i class="fa fa-trash-o"></i> Delete</button></tr></form>'; //} $output = ' <style type="text/css"> .glyphicon { margin-right:4px !important; /*override*/ } .pagination .glyphicon { margin-right:0px !important; /*override*/ } .pagination a { color:#555; } .panel ul { padding:0px; margin:0px; list-style:none; } .news-item { padding:4px 4px; margin:0px; border-bottom:1px dotted #555; list-style: none; font-size: 14px; } </style> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="dashboard-stat purple"> <div class="visual"> <i class="fa fa-shopping-cart"></i> </div> <div class="details"> <div class="number"> ' . $completed_orders . ' </div> <div class="desc"> Completed Orders </div> </div> <a class="more" href="#"> View more <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="dashboard-stat blue"> <div class="visual"> <i class="fa fa-save"></i> </div> <div class="details"> <div class="number"> ' . $saved_orders . ' </div> <div class="desc"> Saved Orders </div> </div> <a class="more" href="#"> View more <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="dashboard-stat green"> <div class="visual"> <i class="fa fa-calendar"></i> </div> <div class="details"> <div class="number"> $' . $totalrevmtd . ' </div> <div class="desc"> Revenue (MTD) </div> </div> <a class="more" href="#"> View more <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12"> <div class="dashboard-stat yellow-casablanca"> <div class="visual"> <i class="fa fa-dollar"></i> </div> <div class="details"> <div class="number"> $' . $totalrevytd . ' </div> <div class="desc"> Revenue (YTD) </div> </div> <a class="more" href="#"> View more <i class="m-icon-swapright m-icon-white"></i> </a> </div> </div> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="portlet box purple-wisteria"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-calendar"></i>Document Orders </div> <div class="actions"> <a href="javascript:;" class="btn btn-sm btn-default easy-pie-chart-reload"> <i class="fa fa-repeat"></i> Reload </a> </div> </div> <div class="portlet-body"> <div class="row"> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;"> ' . $total_companies . ' </span> </div> Companies </div> </div> <div class="margin-bottom-10 visible-sm"> </div> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;"> ' . $total_new_smsf . ' </span> </div> New Funds </div> </div> <div class="margin-bottom-10 visible-sm"> </div> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;"> ' . $total_pensions . ' </span> </div> Pensions </div> </div> <div class="margin-bottom-10 visible-sm"> </div> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;"> ' . $total_sdv . ' </span> </div> SMSF Deed Upgrades </div> </div> <div class="margin-bottom-10 visible-sm"> </div> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;">' . $total_lrba . ' </span> </div> LRBAs </div> </div> <div class="margin-bottom-10 visible-sm"> </div> <div class="col-md-2"> <div style="text-align: center;"> <div> <span style="font-size: 34px;">' . $total_inv . ' </span> </div> Investment Strategies </div> </div> </div> </div> </div> </div> </div> <div class="row "> <div class="col-md-6 col-sm-6"> <div class="portlet box blue-steel"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-bell-o"></i>Recent Activities </div> </div> <div class="portlet-body"> <div class="scrollable"> <ul class="feeds"> ' . $order_feed . ' </ul> </div> </div> </div> </div> <div class="col-md-6 col-sm-6"> <div class="portlet box yellow" > <div class="portlet-title"> <div class="caption"> <i class="fa fa-bell-o"></i>Orders which need attention </div> </div> <div class="portlet-body"> <div class="scrollable" id="inc_coys"> <ul class="feeds"> ' . $inc_coys_feed . ' </ul> </div> </div> </div> </div> </div> <div class="row "> <div class="col-md-3 col-sm-3 "> <div class="portlet box purple-wisteria"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-calendar"></i>Courses </div> <div class="actions"> <a href="javascript:;" class="btn btn-sm btn-default easy-pie-chart-reload"> <i class="fa fa-repeat"></i> Reload </a> </div> </div> <div class="portlet-body" style="height:320px;"> <div style="text-align: center; height:33%"> <div> <span style="font-size: 34px;">' . $tcourses . '</span> </div> Available </div> <div class="margin-bottom-30 visible-sm"> </div> <div style="text-align: center; height:33%"> <div> <span style="font-size: 34px;"> ' . $total_enrolled . '</span> </div> Enrolled </div> <div class="margin-bottom-30 visible-sm"> </div> <div style="text-align: center; height:33%"> <div> <span style="font-size: 34px;"> ' . $total_completed . ' </span> </div> Completed </div> <div class="margin-bottom-30 visible-sm"> </div> </div> </div> </div> <div class="col-md-3 col-sm-3"> <div class="portlet box blue-steel"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-rss"></i>The Dunn Thing </div> </div> <div class="portlet-body" style="height:320px;"> <div class="scrollable"> <ul class="feeds"> <li>' . rss_feed() . '</li> </ul> </div> </div> </div> </div> <div class="col-md-6 col-sm-6"> <div class="portlet box blue"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-gift"></i>Upcoming Training </div> </div> <div class="portlet-body" style="height:320px;"> '; if (i4w_has_tags("177,181,185")) { $output2 = '[table id=11 datatables_filter=0 datatables_lengthchange=0 datatables_paginate=0 datatables_info=0 /]'; } else { $output2 = '[table id=11 datatables_filter=0 datatables_lengthchange=0 datatables_paginate=0 datatables_info=0 hide_columns="3" /]'; } $output = $output . $output2 . ' </div> </div> </div> </div> <script type="text/javascript"> $(function () { jQuery(".scrollable").slimscroll({ height: "300px", size: "10px", position: "right", color: "#ffcc00", alwaysVisible: true, railVisible: true, railColor: "#222", railOpacity: 0.3, wheelStep: 10, allowPageScroll: true, disableFadeOut: true }); jQuery(".demo1").bootstrapNews({ newsPerPage: 3, autoplay: true, pauseOnHover:true, direction: \'up\', newsTickerInterval: 4000, onToDo: function () { } }); jQuery(".demo2").bootstrapNews({ newsPerPage: 4, autoplay: true, pauseOnHover: true, navigation: false, direction: \'down\', newsTickerInterval: 2500, onToDo: function () { } }); jQuery("#demo3").bootstrapNews({ newsPerPage: 3, autoplay: false, onToDo: function () { } }); }); </script>'; return $output; }
function getTimeAgo() { $this->info->created_at = new DateTime($this->info->created_at); return humanTiming($this->info->created_at); }
//up here so that there's $userIsMemberOfProject can be conditioned $postQuery = "SELECT * FROM project_posts\n WHERE project_id = {$projectId}\n ORDER BY date_posted DESC"; if ($result = @mysql_query($postQuery, $dbc)) { //successful query if (mysql_num_rows($result) > 0) { //return results (ie. there are posts for this project) $projectPostsArray = array(); //store posts in an array while ($row = mysql_fetch_array($result)) { $authorId = $row['author_id']; $postContent = $row['post_content']; //format the date /*$dt = date_create($row['date_posted']); $datePosted = date_format($dt, 'F j, Y');*/ $time = strtotime($row['date_posted']); $datePosted = humanTiming($time) . ' ago'; //humanTiming() is a function located in mainfunctions.php $authorQuery = "SELECT first_name, last_name FROM users\n WHERE user_id = {$authorId}"; if ($authorQueryResult = @mysql_query($authorQuery, $dbc)) { //successful query $authorQueryRow = mysql_fetch_array($authorQueryResult); $authorName = $authorQueryRow['first_name'] . " " . $authorQueryRow['last_name']; } //end of $authorQuery result $projectPostsArray[] = array("author_id" => $authorId, "author_name" => $authorName, "post_content" => $postContent, "date_posted" => $datePosted); } //end of while $row $projectHasPosts = true; } else { $projectHasPosts = false; }
/<?php echo $fetch['foto2']; ?> " alt="" /> </div> <div class="desc col-xs-12 col-lg-6"> <div class="user-post-title"> <?php echo $fetch['judul']; ?> </div> <div class="user-post-content"> <?php echo truncate($isi, $charLimit); ?> </div> <div class="readmore text-right "> <a href="detailberita.php?id=<?php echo $fetch['beritaID']; ?> ">selengkapnya</a> </div> <div class="author hidden-xs">Oleh <?php echo $fetch['username']; ?> , <?php echo humanTiming($tgl); ?> yang lalu</div> </div> </div>
$up_image = "up_voted"; $down_image = "down_vote"; break; case 'down': $up_image = "up_vote"; $down_image = "down_voted"; break; default: $up_image = "up_vote"; $down_image = "down_vote"; } echo "<td><a href='" . URL . "community/_addVote/" . $thread->thread_id . "/up'><img src='" . URL . "public/img/" . $up_image . ".png' border=0/></a><br /><br /><a href='" . URL . "community/_addVote/" . $thread->thread_id . "/down'><img src='" . URL . "public/img/" . $down_image . ".png' border=0/></a></td>"; echo "<td>"; echo $taggedInfo . "<a href='" . URL . "community/thread/" . $thread->thread_id . "' class='threadLink'>" . $thread->thread_title . "</a>"; echo "<br />"; echo "<span class='post_info'>Posted by " . $user_level_tag . "<a href='../../overview/showuserprofile/" . $thread->user_id . "' class='userLink'>" . $thread->user_name . "</a> Capital(" . $score . ") " . humanTiming($thread->thread_timestamp); if (Session::get('user_logged_in') == true && ($thread->thread_author_user_id == $_SESSION["user_id"] || $_SESSION["user_level"] == 'admin')) { echo "<br /><a href='" . URL . "community/deleteThread/" . $thread->thread_id . "'>Delete</a>"; } echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; } } echo "<div id = 'paginationButtons'>"; if ($this->page > 1 && count($arr_threads) > 0) { echo "<a href = '" . URL . "community/index/" . ($this->page - 1) . "/" . $this->quantity . "' class = 'button'>Previous</a>"; echo "<span> </span>"; } if (count($arr_threads) > 0 && count($this->threads) > $this->quantity) {
<div class="well" style="background-color:#FFF; color:#313300;" > <table class='table table-stripped' style='border:0px;' > <tr> </tr> <th>Answers</th> <th>Action</th> <?php if ($total > 0) { while ($display = mysql_fetch_array($rows)) { //Successful echo "\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t<tr>\r\n\t\t\t \r\n\t\t\t <td> \t\r\n\t\t\t <p>{$display['reply_content']}</p>\r\n\t\t\t <img src='{$display['profile_pic']}' width='25px' height='25px' class='img-circle' title='{$display['name']} {$display['surname']}' />\r\n\t\t\t "; $time = strtotime($display['reply_date']); echo '<span style="color: #00678F; font-size:10px;">posted ' . humanTiming($time) . ' ago by ' . $display['name'] . ' ' . $display['surname'] . ' </span> '; echo "\r\n\t\t\t \r\n\t\t\t </td> \r\n\t\t\t \r\n\t\t\t\t<form method='post' action='deletea.php' >\r\n\t\t\t\t<td>\r\n\t\t\t\t<input name='qid' id='qid' type='hidden' value='{$g}'/>\r\n\t\t\t\t<input name='q' id='q' type='hidden' value='{$q}'/>\r\n\t\t\t\t<input name='id' id='id' type='hidden' value='{$display['id']}'/>\r\n\t\t\t\t<button type='submit' class='btn btn-danger' Onclick='return ConfirmDelete();' title='Deleting this answer will permanately remove it from the system'><i class='fa fa-trash'>delete</i>\r\n</button>\r\n\t\t\t </td>\r\n\t\t\t\t</form> \r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\r\n\t\t\t"; } } else { echo "<p style='color:#f00;'>No questions found</p> "; } ?> </table> </div> <?php if (isset($page)) { $result = "SELECT count(*) As Total from replies where topic_id = '" . $_SESSION['SUB_ID'] . "'"; $qrycount1 = "SELECT count(*) As Total from replies where topic_id = '" . $_SESSION['SUB_ID'] . "'"; $count = mysql_query($qrycount1); $rs1 = mysql_fetch_array($count); $totalrelated = $rs1["Total"];
echo '<div class="count">' . $count . ' instas cached.</div>'; echo '<ol>'; foreach ($all_instas as $insta) { echo '<li>' . instas($insta) . '</li>'; } echo '</ol>'; ?> </div> <div class="col-md-3"> <h5>Instagram Backup Cache</h5> <?php $all_instas = get_transient('instas_backup'); $time = get_transient('instas_backup_time'); echo humanTiming($time); echo '<br/>'; if (!is_array($all_instas) || !isset($all_instas[0]->created_time)) { echo '<pre>'; print_r($all_instas); echo '</pre>'; } usort($all_instas, 'now_feed_cmp'); $count = count($all_instas); echo '<div class="count">' . $count . ' instas cached.</div>'; echo '<ol>'; foreach ($all_instas as $insta) { echo '<li>' . instas($insta) . '</li>'; } echo '</ol>'; ?>
function get_tweets($count) { $about = get_page_by_path('about'); $handle = get_field('twitter', $about); include_once get_template_directory() . '/libraries/twitteroauth/twitteroauth.php'; $twitter_customer_key = 'w6jdx2IiW59vScHvUyYR6LJ5i'; $twitter_customer_secret = '4kYwLxdDXyIPi5ndLAht3Ln1oFX3iRTHxYqakghmeAGEVglTpY'; $twitter_access_token = '4343711140-4bb6E3bLjnIChxGwtD71disJm3C6H3Oo2u4qXFX'; $twitter_access_token_secret = '7NVIEwXODgcK6hB46UheZG9bPkFT63Ck8Fbwi4UaKzl1T'; $connection = new TwitterOAuth($twitter_customer_key, $twitter_customer_secret, $twitter_access_token, $twitter_access_token_secret); $raw_tweets = $connection->get('statuses/user_timeline', array('screen_name' => $handle, 'count' => $count)); $tweets = new ArrayObject(); $twitter_url = 'http://twitter.com/' . $handle; echo '<div class="twitter">'; echo '<div class="follow">'; echo '<h3 class="title">'; echo '<a href="' . $twitter_url . '" target="_blank">Follow us on Twitter @' . $handle . '</a>'; echo '</h3>'; echo '</div>'; echo '<div class="tweets">'; $counter = 0; foreach ($raw_tweets as $tweet) { if (isset($tweet->errors)) { // $tweet = 'Error :'. $raw_tweets[$counter]->errors[0]->code. ' - '. $raw_tweets[$counter]->errors[0]->message; } else { $text = makeClickableLinks($tweet->text); $timestamp = strtotime($tweet->created_at); $elapsed = humanTiming($timestamp); $id = $tweet->id; $url = 'http://twitter.com/' . $handle . '/status/' . $id; echo '<div class="tweet">'; echo '<div class="text">'; echo utf8_encode($text); echo '</div>'; echo '<a href="' . $url . '" target="_blank" class="timestamp">'; echo $elapsed; echo '</a>'; echo '</div>'; } } echo '</div>'; echo '</div>'; }