function ajax_load_more_activity($offset)
 {
     $i = 0;
     $actArr = array();
     while ($i < 3) {
         $this->db->limit(1, $offset);
         $this->db->select('id, user_id');
         $this->db->from('activity');
         $this->db->order_by('time DESC');
         $result = $this->db->get();
         $act = $result->row();
         if (!$act) {
             break;
         }
         $isOK = check_friend($act->user_id);
         if ($isOK) {
             array_push($actArr, $act->id);
             $i++;
         }
         $offset++;
     }
     if (!$actArr) {
         return false;
     }
     $this->db->select('*');
     $this->db->from('activity a');
     $this->db->join('user u', 'a.user_id=u.id ');
     $this->db->where_in('a.id', $actArr);
     $this->db->order_by('a.time DESC');
     $result = $this->db->get();
     $html = '';
     foreach ($result->result() as $activity) {
         $profile_link = base_url() . index_page() . 'profiles/detail/' . $activity->id . '/' . $activity->name . '.html';
         $html .= '<div class="commentItem"><div class="f-l w420"><a href="' . $profile_link . '">';
         if ($activity->avatar) {
             $html .= '<img alt="" src="' . base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_avatar_path') . $activity->avatar . '&q=100&w=29&h=29" />';
         } else {
             $html .= '<img alt="" src="' . base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_avatar_path') . 'noavatar' . $activity->gender . '.jpg&q=100&w=29&h=29" />';
         }
         $html .= '</a><p><span class="userName"><a href="' . $profile_link . '">' . $activity->name . '</a></span>';
         if ($activity->type == 1) {
             $html .= ' har postet <strong>' . $activity->data . '</strong>';
         } else {
             if ($activity->type == 2) {
                 $html .= ' har tilføjet <strong>' . $activity->data . '</strong> billeder';
             } else {
             }
         }
         $html .= '</p></div><div class="f-r w100 text-r"><p>' . get_time_difference_php($activity->time) . '</p></div></div>';
     }
     return $html;
 }
Exemple #2
0
 echo '<div id = "target_username">' . $target_username . '</div>';
 echo '<div id = "main_avatar"><img src="' . $target_avatar . '" alt = "' . $target_username . ' avatar"></div>';
 echo '<a href = "#" id = "sh_hd_jobs">Show jobs</a>';
 echo '<div id = "jobs_div">';
 echo '<div id = "only_jobs_div">';
 include_once 'functions/get_jobs.php';
 $ec_jobs = get_jobs($cur_jobs, false);
 echo $ec_jobs;
 echo '</div>';
 echo '</div>';
 echo '<div id = "fans_count_div"><span id = "fans_count"></span> <span id = "f_text">fans</span></div>';
 echo '<div id = "idols_count_div"><span id = "idols_count"></span> <span id = "i_text">idols</span></div>';
 echo '</div>';
 echo '<div id = "right_user_navigation">';
 //Search a friend list and show a friend request form (if not found)
 $cf_status = check_friend($target_requests, $user_info_o, $target_info_o);
 $isfriend = $cf_status['isfriend'];
 $isrequested = $cf_status['isrequested'];
 //If $isfriend is false and friend request wasn't send, then show a form
 echo '<div id = "user_nav">';
 if ($isfriend == False and $isrequested == False) {
     echo '<div id = "target_rqsts">' . $target_requests . '</div>';
     echo '<a href = "#" id = "snd_frnd_reqst">Send a friend request</a>';
 } elseif ($isfriend == True) {
     echo '<a href = "watch_video.php?user='******'">Watch videos</a>';
     echo '<br>';
     echo '<a href = "#" class = "send_message_b">Send message</a>';
 }
 echo '<div id = "fan_cntrl">';
 if ($isfan === false) {
     echo '<a href = "#" id = "bec_fan">Become a fan</a>';