defined('BASEPATH') OR exit('No direct script access allowed'); class Index extends CI_Controller { public function __construct() { parent::__construct(); $this->output->set_header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); $this->output->set_header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); $this->output->set_header("Cache-Control: post-check=0, pre-check=0", false); $this->output->set_header("Pragma: no-cache"); $this->load->model('fronts'); $this->load->helper('url'); $this->load->helper('miscellaneous'); $this->load->helper(array('miscellaneous','managesubdomain','admincategory')); $this->load->library('session'); $this->load->helper('captcha'); $SubDomainName=extract_subdomains($_SERVER['HTTP_HOST']); validateDomain($SubDomainName); } public function index() { //die('xff'); $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']="Buzzing Start From Us! | " .site_title() ; $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['topstories'] = $this->fronts->topstories(); $data['mostshared'] = $this->fronts->mostshared(); $data['posts'] = $this->fronts->all_posts(); $data['total_posts'] = $this->fronts->count_all_posts(); $data['pub'] = $this->session->userdata('uid'); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/index'); $this->load->view('CandyreaderFront/common/footer'); } public function category($cid) { if($this->fronts->count_category($cid)){ $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $cat_name = $this->fronts->get_cat_name($cid); $cat_id = $this->fronts->get_cat_id($cid); $data['META']['TITLE']=$this->fronts->get_cat_metaTitle($cid) ; $data['story_detail']='1'; if($_POST['sortby']=='') { $sortby=0; }else{ $sortby=$_POST['sortby']; } //echo $data['sortby']=$sortby; die; $data['cat_stories'] = $this->fronts->cat_story($cid,$sortby); $data['ChildCategroy'] = $this->fronts->cat_child_by_URlID($cid); $data['categories'] = $this->fronts->all_categories(); $data['title'] = $cat_name; $data['cat_id'] = $cat_id; $data['topcategories'] = $this->fronts->top_categories(); $data['total_posts'] = $this->fronts->count_all_cat_posts(1); if($this->session->userdata('USER_TYPE')=='publiser') { $data['p_type'] = 'GetLinkcategory'; }else{ $data['p_type'] = 'category'; } $data['sortby'] = $sortby; $data['pub'] = $this->session->userdata('uid'); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); if($user_data['uid']=='013333333333333333') { $this->load->view('CandyreaderFront/Updatecategory'); } else if($this->session->userdata('USER_TYPE')=='publiser') { $this->load->view('CandyreaderFront/categoryGetLink'); } else{ $this->load->view('CandyreaderFront/category');} $this->load->view('CandyreaderFront/common/footer'); }else{ $this->page_404(); } } public function activation($token) { if(isset($token) && !empty($token)){ if($this->fronts->activation($token)){ $data['act_msg'] = 'Successfully activated'; }else{ $data['err_msg'] = 'Not found'; } $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['META']['TITLE']=' Activation | ' .site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['title'] = ' Activation | ' .site_title(); $data['topcategories'] = $this->fronts->top_categories(); $data['total_posts'] = $this->fronts->count_all_cat_posts(1); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/activation'); $this->load->view('CandyreaderFront/common/footer'); } } public function search() { $val = $this->input->get('q',TRUE); $res = $this->fronts->search($val); if($res['total']>0){ $data['title'] = 'We found '.$res['total'].' result for: " '.$val.' "'; }else{ $data['title'] = 'SEARCH RESULT NOT FOUND'; } $total = $res['total']; unset($res['total']); $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; //$cat_name = $this->fronts->get_cat_name($cid); $data['META']['TITLE']='Search | ' .site_title(); $data['story_detail']='1'; $data['cat_stories'] = $res; $data['categories'] = $this->fronts->all_categories(); //$data['title'] = 'Search'; $data['topcategories'] = $this->fronts->top_categories(); $data['total_posts'] = $total; $data['search'] = $val; $data['p_type'] = 'search'; $data['s_val'] = $val; $data['pub'] = $this->session->userdata('pub'); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/category'); $this->load->view('CandyreaderFront/common/footer'); } public function reset_password($token){ if(isset($token) && !empty($token)){ $tokenval = explode(':',$token); $email = $tokenval[0]; $uid = $tokenval[1]; $addtime = 30 * 60; $rtime = base64_decode($tokenval[2])+$addtime; if($this->fronts->forgot_check_email($uid,$email)){ if($rtime>time()){ if(NULL != $this->input->post('pass',TRUE)){ extract($this->input->post(NULL,TRUE)); if($pass==$cpass){ if($this->fronts->update_reset_password($email,md5($pass))){ $data['form_msg'] = 'You have successfully changed your password'; } else{ $data['form_error'] = 'Opps failed...something went wrong'; } }else{ $data['form_error'] = 'Password did not match'; } } } else{ $data['err_msg'] = 'Token expired'; } $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['META']['TITLE']='| Reset password | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['title'] = 'Reset Password'; $data['topcategories'] = $this->fronts->top_categories(); $data['total_posts'] = $this->fronts->count_all_cat_posts(1); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/reset_password'); $this->load->view('CandyreaderFront/common/footer'); } } } public function contact() { $msg = ''; if(NULL != $this->input->post('cemail')){ $inputCaptcha = strtoupper($this->input->post('captcha')); $sessCaptcha = strtoupper($this->session->userdata('captchaCode')); if($inputCaptcha == $sessCaptcha){ extract($this->input->post(NULL,TRUE)); $this->load->library('email'); $this->email->initialize(array('mailtype'=>'html')); $this->email->from('contact@zeppfeed.com', 'contact@zeppfeed.com'); //$this->email->to('support@zeppfeed.com'); $this->email->to('contact@zeppfeed.com'); $this->email->subject('hi thanks for the subscription.'); $message = '

Zeppfeed Contact Form

'; $message.='

Name : '.$cname.'

'; $message.='

Phone : '.$cphone.'

'; $message.='

Email : '.$cemail.'

'; $message.='

Message : '.$cmessage.'

'; //$this->email->message($message); // Create email headers $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: ' . "\r\n"; $headers .= 'Cc: contact@zeppfeed.com' . "\r\n"; if(mail('contact@zeppfeed.com', 'Zeppfeed Contact Form', $message, $headers)){ $msg = '
× Thank you for contacting us. We will get back to you soon.
'; }else{ $msg = '
× Oops failed...
'; } }else{ $msg = '
× Sorry, the code you entered was invalid. Please try again.
'; } } //captcha $original_string = array_merge(range(0,9), range('a','z'), range('A', 'Z')); $original_string = implode("", $original_string); $captchaword = substr(str_shuffle($original_string), 0, 6); $config = array( 'word' => $captchaword, 'img_path' => 'captcha_images/', 'img_url' => base_url().'captcha_images/', 'img_width' => '150', //'font_path' => FCPATH . 'captcha/font/captcha4.ttf', 'img_height' => 50, 'word_length' => 6, 'font_size' => 25 ); $captcha = create_captcha($config); // print_r($captcha); // Unset previous captcha and store new captcha word $this->session->unset_userdata('captchaCode'); $this->session->set_userdata('captchaCode',$captcha['word']); // Send captcha image to view $data['captchaImg'] = $captcha['image']; //captcha $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['msg']=$msg; $data['META']['TITLE']='Contact Us | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/contact'); $this->load->view('CandyreaderFront/common/footer'); } public function refresh(){ // Captcha configuration //echo base_url(); exit(); $original_string = array_merge(range(0,9), range('a','z'), range('A', 'Z')); $original_string = implode("", $original_string); $captchaword = substr(str_shuffle($original_string), 0, 6); $config = array( 'word' => $captchaword, 'img_path' => 'captcha_images/', 'img_url' => base_url().'captcha_images/', 'img_width' => '150', //'font_path' => FCPATH . 'captcha/font/captcha4.ttf', 'img_height' => 50, 'word_length' => 6, 'font_size' => 25 ); $captcha = create_captcha($config); // print_r($captcha); // Unset previous captcha and store new captcha word $this->session->unset_userdata('captchaCode'); $this->session->set_userdata('captchaCode',$captcha['word']); // Display captcha image echo $captcha['image']; } public function about() { $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']='About Us | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/abouts'); $this->load->view('CandyreaderFront/common/footer'); } public function earnwithus(){ $msg=''; if(NULL != $this->input->post('add_earn')){ extract($this->input->post(NULL)); $data_array = array('cname'=>$cname,'cemail'=>$cemail,'traffic_source'=>$traffic_source,'traffic_estimated'=>$traffic_estimated); if($this->fronts->add_earn($data_array)){ $msg.= '
×Success Yor request successfully submitted.
'; }else{ $msg.= '
×Oops failed....Please try again
'; } } $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['msg']=$msg; $data['META']['TITLE']='EARN WITH US | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/earnwithus'); $this->load->view('CandyreaderFront/common/footer'); } public function privacyPolicy() { $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']='Privacy Policy | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/privacyPolicy'); $this->load->view('CandyreaderFront/common/footer'); } public function terms() { $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']='Terms & Condition | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/terms'); $this->load->view('CandyreaderFront/common/footer'); } public function sitemap() { $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']='Sitemap | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/sitemap'); $this->load->view('CandyreaderFront/common/footer'); } public function page_404() { $this->output->set_status_header('404'); $user_data['uid'] = $this->session->userdata('uid'); $user_data['username'] = $this->session->userdata('username'); $data['user_data'] = !empty($user_data['uid'])?$user_data:''; $data['story_detail']='1'; $data['META']['TITLE']='404 Not found | '.site_title(); $data['categories'] = $this->fronts->all_categories(); $data['topcategories'] = $this->fronts->top_categories(); $data['addsFrontCode'] = $res = $this->fronts->getFrontAdds(); $this->load->view('CandyreaderFront/common/header',$data); $this->load->view('CandyreaderFront/page_404'); $this->load->view('CandyreaderFront/common/footer'); } public function logout() { $this->session->sess_destroy(); redirect($_SERVER['HTTP_REFERER']); } }