function latestFeeds($userId)
 {
     $data['title'] = "Latest feeds";
     $data['id'] = $userId ? $userId : $this->session->userdata('login_user_id');
     $data['userDetails'] = $userDetails = userDetails($data['id']);
     $this->load->view('followingsActivity_view', $data);
 }
 /**
  * Function send invite email to the all invited friends
  * @param
  * @author : Amit
  * @return
  */
 function submit()
 {
     $this->load->library('email');
     $config['mailtype'] = 'html';
     $config['wordwrap'] = true;
     $this->email->initialize($config);
     $this->email->from('info@pinterestclone', 'Pinterest');
     unset($_POST['submit']);
     $message = $_POST['message'];
     unset($_POST['message']);
     $userdetails = userDetails();
     foreach ($_POST as $value) {
         $text = 'Hi,';
         $text .= '<br/>';
         $text .= 'You have been invited to join TagIt By ' . $userdetails['name'];
         $text .= '<br/>';
         $text .= 'Please click the following link to join ' . site_url('/invite/entry/' . base64_encode($value));
         $text .= '<br/>';
         $text .= 'Thanks';
         $text .= '<br/>';
         $text .= 'TagIt';
         $this->email->to($value);
         $this->email->subject('You are invitted');
         $this->email->message($text);
         $this->email->send();
     }
     echo json_encode(true);
 }
 /**
  * Function handle home and welcome page of a logged user
  * @param   :
  * @author  : Amit
  * @return
  */
 function index()
 {
     $userID = false;
     $order = false;
     $limit = $this->config->item('pin_load_limit');
     $page = $this->uri->segment(3, 1);
     $nextOffset = ($page - 1) * $limit;
     $nextPage = $page + 1;
     $sql = "SELECT *\n                    FROM\n                        pins";
     if ($userID) {
         $sql .= " WHERE\n                        user_id= {$userID} ";
     }
     if ($order) {
         $sql .= " ORDER BY\n                        ' {$order}'";
     } else {
         //$sql .= " ORDER BY
         // RAND()";
         $sql .= " ORDER BY time DESC";
     }
     $sql .= " LIMIT {$nextOffset},{$limit}";
     $query = $this->db->query($sql);
     if ($query->num_rows() > 0) {
         $row = $query->result();
     }
     if (!empty($row)) {
         $data['row'] = $row;
     } else {
         $data['row'] = false;
     }
     $data['title'] = 'Welcome';
     //if a valid login
     if ($this->session->userdata('login_user_id')) {
         $fb_data = $this->session->userdata('fb_data');
         $this->load->model('Facebook_model');
         $data = array('fb_data' => $fb_data);
         //facebook data
         $data['id'] = $this->session->userdata('login_user_id');
         //logged user id
         $data['userDetails'] = $userDetails = userDetails($data['id']);
         //logged user details from user id
         if (!empty($row)) {
             $data['row'] = $row;
         } else {
             $data['row'] = false;
         }
         $data['offset'] = $nextOffset;
         $data['page'] = $nextPage;
         $this->load->view('welcome', $data);
     } else {
         if ($this->session->userdata('noentry_message')) {
             $data['invalid'] = $this->session->userdata('noentry_message');
             $this->session->unset_userdata('noentry_message');
         }
         $data['offset'] = $nextOffset;
         $data['page'] = $nextPage;
         $this->load->view('welcome', $data);
     }
 }
 /**
  * Function display all likes of a user
  * @param  : <Int> $id
  * @author : Amit
  * @return
  */
 public function index($id = false)
 {
     $data['title'] = "Like";
     $data['id'] = $id ? $id : $this->session->userdata('login_user_id');
     //logged user id
     $data['userDetails'] = $userDetails = userDetails($data['id']);
     //logged user details from user id
     if (empty($userDetails)) {
         redirect();
     }
     $this->load->view('like_view', $data);
 }
 /**
  * Function display embed pin popup page
  * @param  : <Int> $boardId,$pinId
  * @author : Anup
  * @return
  */
 public function embed($boardId, $pinId)
 {
     $data['title'] = "Action";
     $data['pinId'] = $pinId;
     $data['boardId'] = $boardId;
     $pinDetails = getPinDetails($pinId);
     $data['pin_url'] = $pinDetails->pin_url;
     $data['source_url'] = $pinDetails->source_url;
     $data['pin_link'] = site_url('board/pins/' . $boardId . '/' . $pinId);
     $data['site_link'] = site_url();
     $userDetails = userDetails($pinDetails->user_id);
     $data['user'] = $userDetails['name'];
     $data['user_link'] = site_url('user/index/' . $pinDetails->user_id);
     $data['source_name'] = GetDomain($pinDetails->source_url);
     $this->load->view('embedPin_view', $data);
 }
 /**
  * Function load the the user page from the user id
  * @param   : $id
  * @author  : Pawan
  * @return
  */
 public function index($id)
 {
     if ($id) {
         $data['id'] = $id;
     } else {
         redirect();
     }
     // no user for given id load the home page
     $data['userDetails'] = $userDetails = userDetails($data['id']);
     //logged user details from user id
     $data['title'] = $userDetails['name'];
     if (empty($userDetails)) {
         redirect();
     }
     $this->load->view('home', $data);
 }
 public function ajaxEmbed()
 {
     $data['title'] = "Action";
     $data['pinId'] = $pinId = $this->input->post('pin_id');
     $data['boardId'] = $boardId = $this->input->post('board_id');
     $pinDetails = getPinDetails($pinId);
     $data['pin_url'] = $pinDetails->pin_url;
     $data['source_url'] = $pinDetails->source_url;
     $data['pin_link'] = site_url('board/pins/' . $boardId . '/' . $pinId);
     $data['site_link'] = site_url();
     $userDetails = userDetails($pinDetails->user_id);
     $data['user'] = $userDetails['name'];
     $data['user_link'] = site_url('user/index/' . $pinDetails->user_id);
     $data['source_name'] = GetDomain($pinDetails->source_url);
     $value = $this->load->view('embedPin_view', $data, true);
     echo json_encode($value);
 }
?>
</label></div>
                </div>
            </div>
        </div>
    </div>
    <div id="Container" style="margin-left: 250px;">
        <div id="alpha" class="container Mcenter clearfix transitions-enabled">
            <?php 
if (is_array($userFollows)) {
    ?>
                <?php 
    foreach ($userFollows as $userFollowsKey => $userFollowsValue) {
        ?>
                    <?php 
        $userDetails = userDetails($userFollowsValue->user_id);
        ?>
                    <?php 
        $pinCount = getAllPins($userFollowsValue->user_id);
        ?>

                    <div class="pin_item">

                        <!--Follow/un follow button -->
                        <?php 
        $id_ref = $userFollowsValue->user_id;
        ?>
                        <div id="follow_unfollow_<?php 
        echo $id_ref;
        ?>
" class="follow_unfollow">
    <?php 
$userFollows = getUserFollowing($id);
?>


    <div id="Container" style="margin-left: 250px;">
        <div id="alpha" class="container Mcenter clearfix transitions-enabled">
            <?php 
if (is_array($userFollows)) {
    ?>
                <?php 
    foreach ($userFollows as $userFollowsKey => $userFollowsValue) {
        ?>
                    <?php 
        $userDetails = userDetails($userFollowsValue->is_following);
        ?>
                    <?php 
        $pinCount = getAllPins($userFollowsValue->is_following);
        ?>

                    <div class="pin_item">

                        <!--Follow/un follow button -->
                        <?php 
        $id_ref = $userFollowsValue->is_following;
        ?>
                        <div id="follow_unfollow_<?php 
        echo $id_ref;
        ?>
" class="follow_unfollow">
                </div>
            </div>
        </div>
    </div>
</div>
   
    <div id="Container">
        <div id="alpha" class="container Mcenter clearfix transitions-enabled" style="position: relative; height: 390px; width: 1150px;">
            <?php 
if (is_array($searchUsers)) {
    ?>
                <?php 
    foreach ($searchUsers as $searchUsersKey => $searchUsersValue) {
        ?>
                    <?php 
        $userDetails = userDetails($searchUsersValue->id);
        ?>
                    <?php 
        $pinCount = getAllPins($searchUsersValue->id);
        ?>

                    <div class="pin_item">

                        <?php 
        $id_ref = $searchUsersValue->id;
        ?>
                        <div id="follow_unfollow_<?php 
        echo $id_ref;
        ?>
" class="follow_unfollow">
                        <?php 
        } else {
            ?>
                                                          <div class="cover_none"></div>
                                                          <ul class="cover-thumbs">
                                                            <li><span class="cover-thumbs-pic_none"></span></li>
                                                            <li><span class="cover-thumbs-pic_none"></span></li>
                                                            <li><span class="cover-thumbs-pic_none"></span></li>
                                                        </ul>
                                                     <?php 
        }
        ?>
                                                </a>
                                            <div class="clear"></div>
                                            <div class="edit_button">
                                                <?php 
        $userDetails = userDetails($value->user_id);
        ?>
                                                <span class="board_user">
                                                    <a  href="<?php 
        echo site_url('user/index/' . $value->user_id);
        ?>
"><img src="<?php 
        echo $userDetails['image'];
        ?>
" width="35px" height="35px"/></a>
                                               </span>
                                                <?php 
        if ($this->session->userdata('login_user_id') == $value->user_id) {
            ?>
                                                    <a href="<?php 
            echo site_url('board/edit/' . $value->id);
예제 #12
0
 /**
  * Function list all pins that comes under same type irrespective of user and board
  * @param  : $source
  * @author : Vishal
  * @since  : 26-04-2012
  * @return
  */
 function videos($id = false)
 {
     $data['title'] = 'Videos';
     $data['id'] = $id = $id ? $id : $this->session->userdata('loged_in_user');
     $data['userDetails'] = $userDetails = userDetails($data['id']);
     //logged user details from user id
     $this->load->view('videopins_view', $data);
 }
                    <?php 
$likeUsers = getLikeUsers($pinDetails->id, $limit = 10);
?>
                    <h3 id="likecount"><?php 
echo $likeUsers ? count($likeUsers) : '0';
?>
 Likes </h3>
                    <ul class="inside_like_style">
                        <?php 
if ($likeUsers) {
    ?>
                            <?php 
    foreach ($likeUsers as $key => $value) {
        ?>
                                <?php 
        $userDetails = userDetails($value->like_user_id);
        ?>
                                <li id='addlike_<?php 
        echo $value->like_user_id;
        ?>
'>
                                    <div class="inside_like_thumbs"><a href="<?php 
        echo site_url('user/index/' . $userDetails['userId']);
        ?>
"><img src="<?php 
        echo $userDetails['image'];
        ?>
" width="49px" height="49px" /></a></div>
                                </li>
                            <?php 
    }
예제 #14
0
    			Full Name  (Editable by Admin)
    				Displayed as header(i.e.<h1>) and page title in html header
    			//Contact Info (Editable by Admin)
    			//User Type (Editable by Admin)
    			DOES NOT EXISTUser Notes (Editable by Admin)
    		DONE Next/Previous navigation
    			DONE Next/previous links to present the detail view of the next/prev record. 
    		Done Link to return to list, rather than back button nav.
    		Add new user note functionality
    		<ADMIN> Edit user type
    			Add/remove faculty
    				Confirmation required
    			Grant/revoke admin rights to faculty
    				Confirmation required
    */
    userDetails($row, $result);
} else {
    echo "0 results";
}
?>
<br>
<br>
<a href=testdb2.php> Back to list</a>

<!--  -->




</html>
예제 #15
0
 /**
  * Function handle home and welcome page of a logged user
  * @param   :
  * @author  : Vishal
  * @since   : 01-03-2012
  * @return
  */
 function index()
 {
     /*
           $data['title']  = 'Welcome';
           $count = $this->board_model->getAllPins();
           $count =  count($count);
           $this->load->library('pagination');
           $userID =false;
           $order =false;
           $config['base_url'] = site_url().'test/getAllpins';
           $config['uri_segment']          = $this->uri->segment(3,2);
           $offset                         = $this->uri->segment(3,0);
           $data['offset'] = $offset;
     
           $config['total_rows'] = $count;
           $config['per_page'] = $limit = 30;
           $this->pagination->initialize($config);
           $row = $this->board_model->getAllPinsAjax($offset,$limit);
           $data['row'] = $row;
           //if a valid login
           if(($this->session->userdata('login_user_id')))
           {
           $fb_data                = $this->session->userdata('fb_data');
           $this->load->model('Facebook_model');
           $data                   = array('fb_data' => $fb_data);//facebook data
           $data['id']            = $this->session->userdata('login_user_id');//logged user id
           $data['userDetails']    = $userDetails = userDetails($data['id']);//logged user details from user id
           $data['row'] = $row;
           $this->load->view('welcome', $data);
           }
           //if invalid entry in db , call logout function by passing a paramter to set the invalid login message
           else{
           if($this->session->userdata('noentry_message'))
           {
           $data['invalid']     = $this->session->userdata('noentry_message');
           $this->session->unset_userdata('noentry_message');
           }
           $this->load->view('welcome', $data);
           } */
     //$count = $this->board_model->getAllPins();
     //$count =  count($count);
     //$this->load->library('pagination');
     $userID = false;
     $order = false;
     //$config['base_url'] = site_url().'test/getAllpins';
     //$config['uri_segment']          = $this->uri->segment(3,2);
     //$offset = $this->uri->segment(3, 0);
     $limit = $this->config->item('pin_load_limit');
     $page = $this->uri->segment(3, 1);
     $nextOffset = ($page - 1) * $limit;
     $nextPage = $page + 1;
     /* Script works only if limit is 20 */
     //        if ($this->uri->segment(3, 0)) {
     //            $nextOffset = (($offset - $limit) + $offset);
     //        } else {
     //            $nextOffset = 0;
     //        }
     //$config['total_rows'] = $count;
     //$config['per_page'] = $limit = 20;
     //$this->pagination->initialize($config);
     $sql = "SELECT *\n                    FROM\n                        pins";
     if ($userID) {
         $sql .= " WHERE\n                        user_id= {$userID} ";
     }
     if ($order) {
         $sql .= " ORDER BY\n                        ' {$order}'";
     } else {
         //$sql .= " ORDER BY
         // RAND()";
         $sql .= " ORDER BY time DESC";
     }
     $sql .= " LIMIT {$nextOffset},{$limit}";
     $query = $this->db->query($sql);
     if ($query->num_rows() > 0) {
         $row = $query->result();
     }
     if (!empty($row)) {
         $data['row'] = $row;
     } else {
         $data['row'] = false;
     }
     $data['title'] = 'Welcome';
     //if a valid login
     if ($this->session->userdata('login_user_id')) {
         $fb_data = $this->session->userdata('fb_data');
         $this->load->model('Facebook_model');
         $data = array('fb_data' => $fb_data);
         //facebook data
         $data['id'] = $this->session->userdata('login_user_id');
         //logged user id
         $data['userDetails'] = $userDetails = userDetails($data['id']);
         //logged user details from user id
         if (!empty($row)) {
             $data['row'] = $row;
         } else {
             $data['row'] = false;
         }
         $data['offset'] = $nextOffset;
         $data['page'] = $nextPage;
         $this->load->view('welcome', $data);
     } else {
         if ($this->session->userdata('noentry_message')) {
             $data['invalid'] = $this->session->userdata('noentry_message');
             $this->session->unset_userdata('noentry_message');
         }
         $data['offset'] = $nextOffset;
         $data['page'] = $nextPage;
         $this->load->view('welcome', $data);
     }
 }
 /**
  * Function to un follow all the boards of a given user
  * @since 15-05-2012
  * @author Vishal Vijayan
  * @param <Int> $id (user id)
  * @return object
  */
 function unFollowAll($id)
 {
     //get all board of that user
     $boards = getUserBoard($id);
     foreach ($boards as $key => $value) {
         $fetch = "DELETE \n                        FROM\n                            follow\n                        WHERE\n                            user_id = {$this->session->userdata('login_user_id')}\n                        AND\n                            is_following = {$value->user_id}\n                        AND\n                            is_following_board_id = {$value->id}";
         $result = $this->db->query($fetch);
         $userDetails = userDetails($value->user_id);
         $activity = array('user_id' => $this->session->userdata('login_user_id'), 'log' => "Un follows " . $userDetails['name'], 'type' => "follow", 'action_id' => $value->user_id);
     }
     activityList($activity);
 }
예제 #17
0
<?php

//uncomment sms code before running
require_once '../db.inc.php';
require 'function.php';
$uuid = $_REQUEST['uuid'];
$details = userDetails($uuid);
$userData = explode("_%_", $details);
//$userData[0] name
//$userData[1] number
$number = '91' . $userData[1];
$message = "Hello " . $userData[0] . "your bag has been loaded to the airplane";
$data = array('user' => "patakadeals", 'password' => "patakadeals", 'msisdn' => $number, 'sid' => "WEBSMS", 'msg' => $message, 'fl' => "0");
// list($header, $content) = sms(
// "http://www.smslane.com//vendorsms/pushsms.aspx", // the url to post to
// "http://www.facebook.com", // its your url
// $data
// );
예제 #18
0
 /**
  * Function to list all the user's following. [The people YOU are watching]
  * @param  : <Int> $id
  * @author : Vishal
  * @since  : 14-05-2012
  * @return
  */
 function following($id)
 {
     $data['title'] = 'Following';
     $data['id'] = $id;
     $data['id'] = $id = $id ? $id : $this->session->userdata('loged_in_user');
     $data['userDetails'] = $userDetails = userDetails($data['id']);
     //logged user details from user id
     $this->load->view('following_view', $data);
 }
예제 #19
0
 /**
  * Function save the details for a reported pin
  * @param  : $reportArray
  * @author : Vishal
  * @since  : 19-04-2012
  * @return : int
  */
 function reportPin()
 {
     $this->sitelogin->entryCheck();
     $reportArray = array();
     $reportArray['user_id'] = $userId = $this->session->userdata('login_user_id');
     $reportArray['pin_id'] = $pinId = $this->input->post('pinId');
     $reportArray['board_id'] = $boardId = $this->input->post('boardId');
     $reportArray['reason'] = $reason = $this->input->post('reason') . ($this->input->post('ReportPin') ? '-' . $this->input->post('ReportPin') : '');
     $return = $this->board_model->reportPin($reportArray);
     $userDetails = userDetails($userId);
     $pinDetails = getPinDetails($pinId);
     $owner = userDetails($pinDetails->user_id);
     /* Email */
     $this->load->library('email');
     $config['mailtype'] = 'html';
     $config['wordwrap'] = true;
     $this->email->initialize($config);
     $this->email->from('info@pinterestclone', 'Pinterest');
     $message = "Pin is reported from the user";
     $pinDetails = 'Reported by: ' . $userDetails['userId'] . '-' . $userDetails['name'] . ' pin id : ' . $pinId . ' Board id: ' . $boardId . ' Pin owner: ' . $owner['userId'] . '-' . $owner['name'];
     $msg = 'reason : ' . $reason . '<br/>' . $pinDetails;
     $message = $message . '<br/>' . $msg;
     $this->email->to($this->config->item('admin_email'));
     $this->email->subject('Pin is reported');
     $this->email->message($message);
     $this->email->send();
     echo json_encode($return);
 }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php 
if ($this->session->userdata('login_user_id')) {
    ?>
        <?php 
    $loggedUserDetails = userDetails();
    ?>
    <?php 
}
?>
    <title><?php 
echo isset($title) ? $title : 'Cubetboard ';
?>
</title>

    <!-- For facebook like button-og meta tags -->
    <?php 
if (isset($pinId) && isset($boardId)) {
    ?>
        <?php 
    $pinDetails = getPinDetails($pinId, $boardId);
    ?>
        <?php 
    if (!empty($pinDetails)) {
        ?>
            <meta property="og:title" content="<?php 
        echo $pinDetails->description;
        ?>
예제 #21
0
 function getAllPins()
 {
     //$count = $this->board_model->getAllPins();
     //$count =  count($count);
     //$this->load->library('pagination');
     $userID = 25;
     $order = false;
     //$config['base_url'] = site_url().'test/getAllpins';
     //$config['uri_segment']          = $this->uri->segment(3,2);
     $offset = $this->uri->segment(3, 0);
     //$config['total_rows'] = $count;
     //$config['per_page'] = $limit = 20;
     $limit = 20;
     $nextOffset = $offset + $limit;
     //$this->pagination->initialize($config);
     $sql = "SELECT *\n                    FROM\n                        pins";
     if ($userID) {
         $sql .= " WHERE\n                        user_id= {$userID} ";
     }
     if ($order) {
         $sql .= " ORDER BY\n                        ' {$order}'";
     } else {
         //$sql .= " ORDER BY
         // RAND()";
         $sql .= " ORDER BY id DESC";
     }
     $sql .= " LIMIT {$offset},{$limit}";
     $query = $this->db->query($sql);
     if ($query->num_rows() > 0) {
         $row = $query->result();
     }
     $data['row'] = $row;
     $data['title'] = 'Welcome';
     //if a valid login
     if ($this->session->userdata('login_user_id')) {
         $fb_data = $this->session->userdata('fb_data');
         $this->load->model('Facebook_model');
         $data = array('fb_data' => $fb_data);
         //facebook data
         $data['id'] = $this->session->userdata('login_user_id');
         //logged user id
         $data['userDetails'] = $userDetails = userDetails($data['id']);
         //logged user details from user id
         $data['row'] = $row;
         $data['offset'] = $nextOffset;
         $this->load->view('welcome_test', $data);
     } else {
         if ($this->session->userdata('noentry_message')) {
             $data['invalid'] = $this->session->userdata('noentry_message');
             $this->session->unset_userdata('noentry_message');
         }
         $data['offset'] = $nextOffset;
         $this->load->view('welcome_test', $data);
     }
 }
                ?>
</a>
                                    </p>
                                </div>

                                <?php 
                $commentBoxId = 'comments_box_' . $boardPinValue->id;
                ?>
                                <?php 
                if (!empty($comments)) {
                    ?>
                                    <?php 
                    foreach ($comments as $key => $cmt) {
                        ?>
                                        <?php 
                        $commentuser = userDetails($cmt->user_id);
                        ?>
                                        <div id="<?php 
                        echo $commentBoxId;
                        ?>
">
                                            <!-- Comment List -->
                                            <div class="convo_blk comments">
                                                <a href="<?php 
                        echo site_url('user/index/' . $cmt->user_id);
                        ?>
" class="convo_img">
                                                    <img src="<?php 
                        echo $commentuser['image'];
                        ?>
" alt="user" />
예제 #23
0
        if ($row['user_id'] < 10000) {
            if ($row['user_id'] % 2 == 1) {
                $temp = userDetails("male", $row['user_id']);
                if (isset($temp)) {
                    array_push($temp, $row["password"]);
                    array_push($users, $temp);
                }
            } else {
                $temp = userDetails("female", $row['user_id']);
                if (isset($temp)) {
                    array_push($temp, $row["password"]);
                    array_push($users, $temp);
                }
            }
        } else {
            $temp = userDetails("kids", $row['user_id']);
            if (isset($temp)) {
                array_push($temp, $row["password"]);
                array_push($users, $temp);
            }
        }
    }
}
$str = "Name,Email,Username/Mobile,Password,";
foreach ($users as $key => $user) {
    $str .= "\n";
    foreach ($user as $value) {
        $str .= $value . ",";
    }
}
//printf($str);