public function public_profile($username) { $redis_function = new Redisfunctions(); $record = $redis_function->get_user_profile_data($username); if (!empty($record)) { $page_title = $record["user_fullname"]; $input_arr = array(base_url() => 'Home', '#' => $page_title); $breadcrumbs = get_breadcrumbs($input_arr); $data["record"] = $record; $data["breadcrumbs"] = $breadcrumbs; $data["page_title"] = $page_title; $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME'); $this->template->write_view("content", "pages/user/public-profile", $data); $this->template->render(); } else { display_404_page(); } }
public function delete_conversation($other_username) { if (isset($this->session->userdata["user_id"])) { $redis_functions = new Redisfunctions(); $user_id = $this->session->userdata["user_id"]; $me_username = $this->session->userdata["user_username"]; $other_user_records = $redis_functions->get_user_profile_data($other_username); if (!empty($other_user_records)) { $other_user_id = $other_user_records['user_id']; $model = new Common_model(); $sql = 'SELECT message_id FROM ' . TABLE_MESSAGES . ' WHERE ((message_user_from=' . $other_user_id . ' AND message_user_to=' . $user_id . ') OR (message_user_to=' . $other_user_id . ' AND message_user_from=' . $user_id . '))'; $chat_records = $model->query($sql); if (!empty($chat_records)) { $message_id_arr = array(); foreach ($chat_records as $chat_value) { $message_id_arr[] = $chat_value['message_id']; } $redis_functions->set_deleted_message_ids($me_username, $message_id_arr); $this->session->set_flashdata('success', 'Your conversation with ' . stripslashes($other_user_records['user_fullname']) . ' marked as deleted'); } } else { $this->session->set_flashdata('error', 'An error occurred. Please try again later.'); } redirect(base_url('my-chats')); } else { display_404_page(); } }
<?php $redis_functions = new Redisfunctions(); $my_profile = $redis_functions->get_user_profile_data($this->session->userdata['user_username']); ?> <style> .chat-l-div,.chat-r-div{height: calc(100%);display: inline-block;width: 100%;vertical-align: top;} .chat-l-div{max-width: 35%;height: 585px;overflow: auto;background: #fff;} .chat-r-div{max-width: 64%;} .input-message-div textarea{resize: none;width: 100%;border: 1px #e1e1e1 solid;box-shadow: 1px 1px 2px 0px rgba(50, 50, 50, 0.11);border-radius: 3px;font-size: 13px;padding: 5px 10px;} .input-message-div{width: 100%;display: inline-flex;margin-top: 30px;} .h-liked-row{display: inline-block;width: 100%;} .send-msg-btn{width: 50px;padding: 20px;} .chat-log{height: 390px;overflow: auto;margin-top: 20px;} .h-liked-comment,.h-liked-item-l{margin: 0;} .chat-l-div .h-liked-item-i{padding: 5px;} .h-liked-item-i.active, .chat-l-div .h-liked-item-i:hover{background-color: #eae8e8;} .h-liked-price a{color: #ff7200;text-decoration: none;} .h-liked-comment{font-size: 10px;} .unread{background-color: #ff7200 !important;} .unread .h-liked-price, .unread .h-liked-comment{color:#FFFFFF;} </style> <!-- main-cont --> <div class="main-cont"> <div class="body-wrapper" itemscope itemtype="http://schema.org/Event"> <div class="wrapper-padding"> <div class="page-head"> <div class="page-title" itemprop="name"><?php echo $page_title;
public function trips_joined_by_me($view_type = 'list', $page = 1) { $redis_functions = new Redisfunctions(); $username = $this->session->userdata['user_username']; $user_profile_data = $redis_functions->get_user_profile_data($username); $trips_joined = $user_profile_data['trips_joined']; $post_records = array(); if (!empty($trips_joined)) { foreach ($trips_joined as $value) { if ($value->post_published == '1') { $post_records[] = $redis_functions->get_trip_details($value->post_url_key); } } } $page_title = 'Trips I\'ve joined'; $input_arr = array(base_url() => 'Home', '#' => $page_title); $breadcrumbs = get_breadcrumbs($input_arr); $data["post_records"] = $post_records; $data["view_type"] = $view_type; $data["page"] = $page; $data["breadcrumbs"] = $breadcrumbs; $data["page_title"] = $page_title; $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME'); $this->template->write_view("content", "pages/trip/listing/list-page", $data); $this->template->render(); }
<?php $redis_functions = new Redisfunctions(); $post_owner_records = $redis_functions->get_user_profile_data($post_details['post_user_username']); $post_title = stripslashes($post_details['post_title']); $post_description = stripslashes($post_details['post_description']); $post_primary_image = base_url(getImage($post_details['post_primary_image'])); $post_url = getTripUrl($post_details['post_url_key']); $post_total_cost = get_currency_symbol($post_details['post_currency']) . $post_details['post_total_cost']; $post_start_end_date_string = '--'; if (!empty($post_details['post_start_date']) && !empty($post_details['post_end_date'])) { $post_date_format = 'd M Y'; $post_start_end_date_string = date($post_date_format, strtotime($post_details['post_start_date'])) . ' - ' . date($post_date_format, strtotime($post_details['post_end_date'])); } $post_total_days = number_format($post_details['post_total_days']); //prd($post_details); $post_region_cities = array(); if (!empty($post_details['post_regions'])) { foreach ($post_details['post_regions'] as $region_key => $region_value) { if (!in_array($region_value->pr_source_city, $post_region_cities)) { $post_region_cities[] = $region_value->pr_source_city; } } } ?> <!-- main-cont --> <div class="main-cont"> <div class="body-wrapper"> <div class="wrapper-padding"> <div class="page-head">
public function get_joined_trips($username) { $output_arr = array(); $redis_functions = new Redisfunctions(); $user_profile_data = $redis_functions->get_user_profile_data($username); if (!empty($user_profile_data)) { $user_id = $user_profile_data['user_id']; $sql = 'SELECT p.post_url_key, p.post_published, p.post_status FROM ' . TABLE_POSTS . ' as p left join ' . TABLE_POST_TRAVELERS . ' as pt on pt.pt_post_id = p.post_id WHERE pt_traveler_user_id = ' . $user_id . ' AND p.post_user_id != ' . $user_id . ' GROUP BY p.post_id'; $output_arr = $this->db->query($sql)->result_array(); } return $output_arr; }