private function get_user_dbs($user = null) { $this->load->helper('restdb'); // used for properize if (empty($user) && !$this->session->userdata('username')) { redirect('login'); } if (empty($user) && $this->session->userdata('username')) { $user = $this->session->userdata('username'); } // Prepare output data $data = array(); // Get user data $query = $this->get_user($user); if ($query->num_rows() > 0) { $data['user'] = $query->first_row('array'); $full_name = !empty($data['user']['name_full']) ? $data['user']['name_full'] : $data['user']['username']; $data['user']['name_full'] = properize($full_name); } // Then check for database entries for that user $query = $this->get_database($user); if ($query->num_rows() > 0) { $data['connections'] = $query->result_array(); } return $data; }
require "../src/js_base.php"; ?> <script src="<?php echo $baseurl; ?> dashboard/favorites/js.php"></script> <script> var favoritesObj = JSON.parse("<?php echo json_encode(array_values($_SESSION['data']['fav'])); ?> "); var favorites = $.map(favoritesObj, function(el) { return el }); function prepareHTML(NextLoadArray) { var NextContent = '<div class="card-panel white"><h5 class="center" style="margin-bottom:26px;">A few of <?php echo properize($_SESSION['fname']); ?> favorites</h5> <ul class="collection" style="margin-top:10px; display:none;" id="trails">'; $.each( NextLoadArray, function( key, value ) { if(value['loopcount'] == 1) { var distance = value['loops'][1]['distance']; var steps = value['loops'][1]['steps']; } else { var distance = 0; var steps = 0; $.each(value.loops, function( id, details ) { distance = Number(value['loops'][id]['distance']) + distance; steps = Number(value['loops'][id]['steps']) + steps; }); distance = distance.toFixed(2); }
?> <div class="post-author-container"> <h4><i class='fa fa-user'></i>Post Author<i class='fa fa-caret-down'></i></h4> <?php /** * Display Author of Post in Sidebar * So far not compatible with the "married_couples" array within * the Authors Class. It only scans the singles array. */ $authors = new AuthorInfo($post->ID); foreach ($authors->singles as $author) { echo get_the_post_thumbnail($author['ID'], 'thumbnail-card'); echo '<h5>' . $author['author_info']['display_name'] . '</h5>'; echo '<p>' . $author['author_info']['description'] . '</p>'; echo '<ul>'; echo '<li><a href="' . get_bloginfo('url') . '/author/' . $author['author_info']['user_login'] . '"><i class="fa fa-paper-plane-o"></i> View All Posts (' . $author['author_info']['post_count'] . ')</a></li>'; echo $author['author_info']['website'] ? '<li><a href="' . $author['author_info']['website'] . '"><i class="fa fa-globe"></i> ' . properize($author['author_info']['first_name']) . ' Website </a></li>' : null; echo '<li><i class="fa fa-map-marker"></i> Hometown: ' . $author['author_info']['hometown'] . '</li>'; echo '</ul>'; } ?> </div> <?php dynamic_sidebar('single_sidebar'); // Default Sidebar } else { dynamic_sidebar('default_sidebar'); }