<a class="deal_title text-blue "><?php echo $items['deal_title']; ?> </a> By <a href="#" class='timeline-user'><?php echo $items['full_name']; ?> </a> <span class="time pull-right"><i class="fa fa-clock-o"></i> <?php echo post_time(strtotime($items['date_created'])); ?> </span> </div> <div class="timeline-body clearfix"> <div class="col-md-8"><?php echo clickable_link($items['deal_summery']); ?> </div> <div class="col-md-4"> <?php foreach ($items['images'] as $Imgitems) { ?> <img class="img-responsive adds-image" src="<?php echo base_url() . "/adds_images/thumb/" . $Imgitems['IMG_ID'] . "_thumb" . $Imgitems['MIME']; ?> " /> <?php } ?> </div>
$row2 = mysql_fetch_assoc($result2); $uid = $row2['id']; echo "<a href=profiles/profile.php?id=" . $uid . "><img src=\"profiles/members/" . $uid . "/image01.jpg\" width=\"40\" class=\"CommentImg\" style=\"float:left;\" alt=\"\" /></a>"; ?> <label class="postedComments"> <?php echo clickable_link($rows['comments']); ?> </label> <br clear="all" /> <span style="margin-left:43px; color:#666666; font-size:11px"> <?php if ($days2 > 0) { echo date('F d Y', $rows['date_created']); } elseif ($days2 == 0 && $hours == 0 && $minutes == 0) { echo "few seconds ago"; } elseif ($days2 == 0 && $hours == 0) { echo $minutes . ' minutes ago'; } else { echo "few seconds ago"; } ?>
function clickable_link($text) { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); $ret = ' ' . $text; $ret = preg_replace("#(^|[\n ])([\\w]+?://[\\w\\#\$%&~/.\\-;:=,?@\\[\\]+]*)#is", "\\1<a href=\"\\2\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\\.[\\w\\#\$%&~/.\\-;:=,?@\\[\\]+]*)#is", "\\1<a href=\"http://\\2\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])([a-z0-9&\\-_.]+?)@([\\w\\-]+\\.([\\w\\-\\.]+\\.)*[\\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); $ret = preg_replace('/@(\\w+)/', '<a href="http://twitter.com/$1">@$1</a>', $ret); $ret = preg_replace('/\\s+#(\\w+)/', ' <a href="http://search.twitter.com/search?q=%23$1">#$1</a>', $ret); $ret = substr($ret, 1); return $ret; } if ($tweets != "") { $obj = json_decode($tweets); foreach ($obj as $var => $value) { echo "<li>" . clickable_link($obj[$var]->text) . "</li>"; } } else { echo "Twitter feed not available!"; } ?> <ul> </div> <span class="corners-bottom"><span></span></span> </div> <br/> <div class="wrapbg"> <span class="corners-top"><span></span></span> <div id="content"> <?php if ($isLoggedIn == 1) {
public function save_deal() { //saving deal details $data = array('DEAL_START_DATE' => makeSafe($this->input->post('start')), 'DEAL_END_DATE' => makeSafe($this->input->post('finish')), 'DEAL_TITLE' => makeSafe($this->input->post('deal_title')), 'DEAL_SUMMARY' => clickable_link($this->input->post('info')), 'COUNTRY_ID' => makeSafe($this->input->post('deal_country')), 'ZONE_ID' => makeSafe($this->input->post('deal_zones')), 'CATEGORY_ID' => makeSafe($this->input->post('category')), 'PRICE' => makeSafe($this->input->post('price')), 'USER_ID' => $this->session->userdata('id_user'), 'LONGITUDE' => '', 'LATITUDE' => ''); $this->db->insert('deal_details', $data); $max_deal_id = $this->db->insert_id(); $temp_file_name = temp_image_id(); $config['upload_path'] = './adds_images/actual'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '1000'; $config['overwrite'] = TRUE; $config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['file_name'] = $temp_file_name; $this->load->library('upload', $config); if (!$this->upload->do_upload()) { $dataRet['img_error'] = $this->upload->display_errors(); $dataRet['ImageUploaded'] = false; $dataRet['ImageDetails'] = ''; } else { $uploaded_data = $this->upload->data(); $dataRet['ImageUploaded'] = true; $mime = $uploaded_data['file_ext']; $data_image = array('DEAL_ID' => $max_deal_id, 'MIME' => $mime); $this->db->insert('deal_images', $data_image); $max_image_id = $this->db->insert_id(); $dataRet['image_id'] = $max_image_id; $dataRet['image_mime'] = $mime; rename("./adds_images/actual/" . $temp_file_name . $mime, "./adds_images/actual/" . $max_image_id . $mime); //creating the thumbnail $config['image_library'] = 'gd2'; $config['source_image'] = "./adds_images/actual/" . $max_image_id . $mime; $config['new_image'] = "./adds_images/thumb/" . $max_image_id . $mime; //$config['create_thumb'] = TRUE; $config['maintain_ratio'] = TRUE; $config['width'] = 350; $config['height'] = 350; $this->load->library('image_lib'); $this->image_lib->clear(); $this->image_lib->initialize($config); $this->image_lib->resize(); //watermark $this->image_lib->clear(); $configW['source_image'] = "./adds_images/actual/" . $max_image_id . $mime; $configW['new_image'] = "./adds_images/actual/" . $max_image_id . $mime; $configW['wm_text'] = 'DealGuru - Soumen Das'; $configW['wm_type'] = 'text'; $configW['wm_font_path'] = './system/fonts/texb.ttf'; $configW['wm_font_size'] = '16'; $configW['wm_font_color'] = 'ffffff'; $configW['wm_vrt_alignment'] = 'center'; $configW['wm_hor_alignment'] = 'center'; $configW['wm_padding'] = '20'; $this->image_lib->initialize($configW); $this->image_lib->watermark(); //end watermark } $dataRet['stat'] = true; $dataRet['full_name'] = $this->session->userdata('full_name'); $dataRet['user_image_url'] = $this->session->userdata('user_image_url'); $dataRet['stat'] = true; $dataRet['deal_details'] = $data; return $dataRet; }