getContentsByTags('staticpage','aboutchiz',1); $smarty->assign('aboutchiz',$aboutchiz); $personalprofile = $articles->getContentsByTags('staticpage','personalprofile',1); $smarty->assign('personalprofile',$personalprofile); $biography = $articles->getContentsByTags('staticpage','biography',1); $smarty->assign('biography',$biography); $features = $articles->getContentsByTags('news','features',4); $smarty->assign('features',$features); $latest = $articles->getContentsBySection('news',4); $smarty->assign('latest',$latest); } elseif($section == 'gallery') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Photo Gallery"; $template = "inside_pages_gallery.tpl"; $latest = $articles->getContentsBySection('news',5); $smarty->assign('latest',$latest); $photos = $articles->getPhotoList(6); $smarty->assign('photos',$photos); $photos_action = $articles->getPhotoList(6, 'chizinaction'); $smarty->assign('photos_action',$photos_action); } elseif($section == 'comments_message') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Views and Comments"; $template = "inside_comments_message.tpl"; $content_id = $_GET['id']; $smarty->assign('content_id',$content_id); $type = $_GET['type']; $smarty->assign('type',$type); //RDO 050509 (begin) require_once(DOC_ROOT.'/jurisdiction.php'); if ($content_id == null && $type == null) $smarty->assign('xajaxscript', $xajax->printJavascript('./xajax')); else $smarty->assign('xajaxscript', $xajax->printJavascript('../../xajax')); require_once(DOC_ROOT.'/classes.amellar/class.JurisdictionManager.php'); $jurisdiction = new JurisdictionManager(); $regionnames = $jurisdiction->getRegions(); $regioncodes = array_keys($regionnames); $smarty->assign('regions', $regionnames); //RDO 050509 (end) if($_POST) //should convert to xajax? { //$name = $_POST['comment_name']; //RDO 050609 commented //RDO 050609 (begin) $lname = @$_POST['comment_lname']; $fname = @$_POST['comment_fname']; //RDO 050609 (end) //RDO 050609 (begin) //$region = @$_POST['commentsregion']; $region = @$_SESSION['commentsregion']; if ($region == null || $region == '') $region = -1; //$province = @$_POST['commentsprov']; $province = @$_SESSION['commentsprov']; if ($province == null || $province == '') $province = -1; //$city = @$_POST['commentscity']; $city = @$_SESSION['commentscity']; if ($city == null || $city == '') $city = -1; //RDO 050609 (end) $address = $_POST['comment_add']; $email = $_POST['comment_email']; $mobile = $_POST['comment_mobile']; $message = $_POST['comment_message']; $content_id = $_POST['content_id']; $type = $_POST['type']; //if(($name== '') || ($address== '') || ($email== '') || ($message== '')) //RDO 050609 commented if(($lname== '') || ($fname== '') || ($address== '') || ($email== '') || ($message== '') || ($region == -1) || ($province == -1) || ($city == -1) ) //RDO 050609 { //if($name== '') $notify = "Name field is required"; //RDO 050609 commented //RDO 050609 (begin) if ($lname == '') $notify = "Last Name field required"; elseif ($fname == '') $notify = "First Name field required"; elseif ($region == -1) $notify = "Region field is required"; elseif ($province == -1) $notify = "Province field is required"; elseif ($city == -1) $notify = "City/Municipality field is required"; //RDO 050609 (end) elseif($address== '') $notify = "Address field is required"; elseif($email== '') $notify = "Email Address field is required"; elseif($message== '') $notify = "Message field is required"; else $notify = "All Fields with * are required"; //$smarty->assign('name',$name); //RDO 050609 commented //RDO 050609 (begin) $smarty->assign('lname', $lname); $smarty->assign('fname', $fname); if ($region != -1) { $smarty->assign('vregion', $region); $provinces = $jurisdiction->getProvinces($region); $smarty->assign('provinces', $provinces); } if ($province != -1) { $smarty->assign('vprovince', $province); $cities = $jurisdiction->getCities($province); $smarty->assign('cities', $cities); } if ($city != -1) { $smarty->assign('vcity', $city); } //RDO 050609 (end) $smarty->assign('address',$address); $smarty->assign('email',$email); $smarty->assign('message',$message); } else { //$data = array( //RDO 050609 commented $commentsdata = array( //RDO 050609 'article_id' => $content_id, 'type' => $type, //'name' => $name, //RDO 050609 commented 'name' => $fname.' '.$lname, //RDO 050609 'home_add' => $address, 'email_add' => $email, 'mobile_no' => $mobile, 'message' => $message, 'status' => "0", 'date' => date('Y:m:d H:i:s') ); //RDO 050609 (begin) $registrantdata = array( 'lname' => trim(strtoupper(mysql_escape_string($lname))), 'fname' => trim(strtoupper(mysql_escape_string($fname))), 'region' => $region, 'province' => $province, 'city' => $city, 'address' => mysql_escape_string($address), 'email' => mysql_escape_string($email) ); //RDO 050609 (end) $comments = new Comments(); //RDO 050509 opens new connection //$comments->insert_comments($data); //RDO 050609 commented $comments->insert_comments($commentsdata, $registrantdata); //RDO 050609 $comments->dbClose(); //RDO 050509 resets connection to default $notify = "Successfully sent."; } $smarty->assign('notify',$notify); } $jurisdiction->dbClose(); //RDO 050509 } /*elseif($section == 'comments_register') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Comment Registration"; $template = "inside_comments_register.tpl"; }*/ elseif($section == 'comments') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Views and Comments"; $template = "inside_comments.tpl"; $type = $_GET['type']; $stories = $articles->getContentTitles(); //RDO 050509 get list of all content titles $comments = new Comments(); //RDO 050509 opens new connection if($type) { $smarty->assign('comments', $comments->getComments($type, 4, 0, $stories)); //RDO 050509 //$comments = $articles->getComments($type,4); //RDO 050509 commented //$smarty->assign('comments',$comments); //RDO 050509 commented $template = "inside_comments_detailed.tpl"; } else { //RDO 050509 (begin) require_once(DOC_ROOT.'/jurisdiction.php'); $smarty->assign('xajaxscript', $xajax->printJavascript('./xajax')); // RDO 051309 (begin) automatic insert email //index.php?section=comments&email=reymond81@yahoo.com //will obfuscate email address later $email = @$_GET['email']; if ($email != null || trim($email) != '') $smarty->assign('email', $email); // RDO 051309 (end) automatic insert email require_once(DOC_ROOT.'/classes.amellar/class.JurisdictionManager.php'); $jurisdiction = new JurisdictionManager(); $regionnames = $jurisdiction->getRegions(); $regioncodes = array_keys($regionnames); $smarty->assign('regions', $regionnames); //RDO 050509 (end) //$quote = $articles->getComments('quote',1); //RDO 050509 commented $quote = $comments->getComments('quote',1); //RDO 050509 $smarty->assign('quote',$quote); //$story = $articles->getComments('story',1); //RDO 050509 commented $story = $comments->getComments('story',1, 0, $stories); //RDO 050509 $smarty->assign('story',$story); //$other = $articles->getComments('other',1); //RDO 050509 commented $other = $comments->getComments('other',1); //RDO 050509 $smarty->assign('other',$other); $jurisdiction->dbClose(); //RDO 050509 } $comments->dbClose(); //RDO 050509 resets connection to default } elseif($section == 'chizincongress') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Chiz in Congress"; $template = "inside_chiz_in_congress.tpl"; $chizincongress = $articles->getContentsByTags('staticpage','chizincongress',1); $smarty->assign('chizincongress',$chizincongress); $otherrep = $articles->getContentsByTags('staticpage','otherrepresentations',1); $smarty->assign('otherrep',$otherrep); $accomplishments = $articles->getContentsByTags('staticpage','accomplishments',1); $smarty->assign('accomplishments',$accomplishments); $housebills = $articles->getContentsByTags('staticpage','housebills',1); $smarty->assign('housebills',$housebills); $features = $articles->getContentsByTags('news','features',4); $smarty->assign('features',$features); $latest = $articles->getContentsBySection('news',4); $smarty->assign('latest',$latest); } elseif($section == 'insidereleases') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Chiz in Congress"; $template = "inside_pages_releases.tpl"; } elseif($section == 'video') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Chiz in Congress"; $template = "inside_pages_video.tpl"; $id = $_GET['id']; $videoDetails = $articles->getVideo($id); $smarty->assign('videoDetails',$videoDetails); $videos = $articles->getVideoList(4,'chiz',$id); $smarty->assign('videos',$videos); } elseif($section == 'mediaroom') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Media Room"; $template = "inside_media_room.tpl"; $id = $_GET['id']; $article_content = $articles->getContentsByTags('news','mainmediaroom',1); if($id) { $page = $_GET['page']; $link_title = $_GET['title']; } else { $id = $article_content[0]['id']; $link_title = $article_content[0]['link_title']; } $content = html_entity_decode($article_content[0]['main_content']); $content2 = explode("",$content); if(count($content2) > 1) { if($page == 0) $page = 1; $paging = "PAGE : "; for($a =0; $a $b "; } $content3 = $content2[$page-1]; $article_content[0]['main_content'] = $content3; } //$smarty->assign('articles',$article_content); $smarty->assign('paging',$paging); $smarty->assign('media',$article_content); $videos = $articles->getVideoList(3,'chiz'); $smarty->assign('videos',$videos); $features = $articles->getContentsByTags('news','features',4); $smarty->assign('features',$features); $latest = $articles->getContentsBySection('news',4); $smarty->assign('latest',$latest); } elseif($section == 'teamchiz') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Team Chiz"; $template = "inside_team_chiz.tpl"; $teamchiz = $articles->getContentsByTags('staticpage','teamchiz',1); $smarty->assign('teamchiz',$teamchiz); } elseif($section == 'blog') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Chiz Blogs"; $template = "inside_chiz_blogs.tpl"; $id = $_GET['id']; $article_content = $articles->getArticleDetails($id); $tags = $article_content[0]['keywords']; $related = $articles->getRelated($tags ,5 ,$id); $latest = $articles->getContentsBySection('blog',5); $page = $_GET['page']; $link_title = $_GET['title']; $content = html_entity_decode($article_content[0]['main_content']); $content2 = explode("",$content); if(count($content2) > 1) { if($page == 0) $page = 1; $paging = "PAGE : "; for($a =0; $a $b "; } $content3 = $content2[$page-1]; $article_content[0]['main_content'] = $content3; } $smarty->assign('articles',$article_content); $smarty->assign('paging',$paging); $smarty->assign('related',$related); $smarty->assign('latest',$latest); } elseif($section == 'chizblogs') { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Chiz Blogs"; $template = "inside_chiz_blogs.tpl"; $id = $_GET['id']; $article_content = $articles->getContentsBySection('blog',1); if($id) { $page = $_GET['page']; $link_title = $_GET['title']; } else { $id = $article_content[0]['id']; $link_title = $article_content[0]['link_title']; } $tags = $article_content[0]['keywords']; $related = $articles->getRelated($tags ,5 ,$id); $latest = $articles->getContentsBySection('blog',5); $content = html_entity_decode($article_content[0]['main_content']); $content2 = explode("",$content); if(count($content2) > 1) { if($page == 0) $page = 1; $paging = "PAGE : "; for($a =0; $a $b "; } $content3 = $content2[$page-1]; $article_content[0]['main_content'] = $content3; } $smarty->assign('articles',$article_content); $smarty->assign('paging',$paging); $smarty->assign('related',$related); $smarty->assign('latest',$latest); } elseif($section == 'story') { $template = "story_details.tpl"; $id = $_GET['id']; $page = $_GET['page']; $link_title = $_GET['title']; $article_content = $articles->getArticleDetails($id); $content = html_entity_decode($article_content[0]['main_content']); $content2 = explode("",$content); $tags = $article_content[0]['keywords']; $related = $articles->getRelated($tags ,5 ,$id); $latest = $articles->getContentsBySection('news',5); if(count($content2) > 1) { if($page == 0) $page = 1; $paging = "PAGE : "; for($a =0; $a $b "; } $content3 = $content2[$page-1]; $article_content[0]['main_content'] = $content3; } $smarty->assign('latest',$latest); $smarty->assign('related',$related); $smarty->assign('articles',$article_content); $smarty->assign('paging',$paging); // for sorsogon page $smarty->assign('static_id',$id); $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - ".$article_content[0]['title']; } else { $var = "chizescudero dot com - Official Website of Sen. Chiz Escudero - Home"; $template = "index_main_v2.tpl"; $latestrelease = $articles->getContentsByTags('news','mainnews',1); $smarty->assign('latestrelease',$latestrelease); $chizblog = $articles->getContentsBySection('blog',1); $smarty->assign('chizblog',$chizblog); $speeches = $articles->getContentsByTags('news','speech',1); $smarty->assign('speeches',$speeches); $senateagenda = $articles->getContentsByTags('staticpage','senateagenda',1); $smarty->assign('senateagenda',$senateagenda); $sorsogon = $articles->getContentsByTags('staticpage','sorsogon',1); $smarty->assign('sorsogon',$sorsogon); $videos = $articles->getVideoList(1,'mainvideo',$id); $smarty->assign('videos',$videos); } $smarty->assign('web_root', WEB_ROOT); $smarty->assign('title',$var); $smarty->display($template); ?>