public function overwriteForm($return, $returnfull) { $return = parent::overwriteForm($return, $returnfull); $p = new Page(); $p->default_read_coloms = "ID,post_title"; $arrPage = $p->getWhere("post_status = 'publish'"); $arrNe = array(); foreach ($arrPage as $pp) { $arrNe[$pp->ID] = $pp->ID . " - " . $pp->post_title; } $return['carousel_photo'] = new \Leap\View\InputFoto("foto", "carousel_photo", $this->carousel_photo); $return['carousel_active'] = new Leap\View\InputSelect($this->arrayYesNO, "carousel_active", "carousel_active", $this->carousel_active); // $return['news_text'] = new Leap\View\InputTextArea("news_text", "news_text", $this->news_text); $return['carousel_description'] = new Leap\View\InputText("hidden", "carousel_description", "carousel_description", $this->carousel_description); $return['carousel_page_id'] = new Leap\View\InputSelect($arrNe, "carousel_page_id", "carousel_page_id", $this->carousel_page_id); //comment di set di page // $return['news_comment_allow'] = new Leap\View\InputText("hidden", "news_comment_allow", "news_comment_allow", $this->news_comment_allow); return $return; }
public function overwriteForm($return, $returnfull) { $return = parent::overwriteForm($return, $returnfull); if (isset($this->news_status_array[$this->news_status])) { $var = $this->news_status_array[$this->news_status]; } else { $var = ""; } $return['news_image'] = new \Leap\View\InputFoto("news_image", "news_image", $this->news_image); $return['news_status'] = new Leap\View\InputSelect($this->news_status_array, "news_status", "news_status", $this->news_status); $return['news_text'] = new Leap\View\InputTextArea("news_text", "news_text", $this->news_text); $p = new Page(); $p->default_read_coloms = "ID,post_title"; $arrPage = $p->getWhere("post_status = 'publish'"); $arrNe = array(); foreach ($arrPage as $pp) { $arrNe[$pp->ID] = $pp->ID . " - " . $pp->post_title; } $return['news_comment_allow'] = new Leap\View\InputText("hidden", "news_comment_allow", "news_comment_allow", $this->news_comment_allow); $return['news_text'] = new Leap\View\InputText("hidden", "news_text", "news_text", $this->news_text); $return['news_page_id'] = new Leap\View\InputSelect($arrNe, "news_page_id", "news_page_id", $this->news_page_id); return $return; }
public function searchMe() { $s = isset($_GET['s']) ? addslashes($_GET['s']) : die('please insert search text'); $loc = isset($_GET['loc']) ? addslashes($_GET['loc']) : die('please define location'); //$mode = isset($_GET['mode'])?addslashes($_GET['mode']):die('no mode'); // if($mode<1)die("mode hrs integer"); // $s = isset($_GET['s'])?addslashes($_GET['s']):""; $halaman = isset($_GET['p']) ? addslashes($_GET['p']) : 1; $limit = 2; $begin = ($halaman - 1) * $limit; $searchText = ""; if ($s != "") { $searchText = " AND ( post_title LIKE '%{$s}%' OR post_content LIKE '%{$s}%')"; } $page = new Page(); $whereClause = "post_status = 'publish' {$searchText}"; $arrPage = $page->getWhere($whereClause . " ORDER BY post_modified DESC LIMIT {$begin},{$limit}"); $jml = $page->getJumlah($whereClause); $mode = 0; //$pc = new PageContainer(); //$pc->getByID($mode); $gw = new GalleryWeb(); ?> <h1 class="tbsh1" style="margin-bottom:20px; background-color: #efefef; padding: 10px; color: #000;"> Pages <div style="float: right; width: 200px; display: none;"> <div class="input-group"> <input id="seachtext" type="text" value="<?php echo $s; ?> " class="form-control" placeholder="search "> <span class="input-group-btn"> <button onclick="document.location='<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s='+$('#seachtext').val();" class="btn btn-default" type="button"> <i class="glyphicon glyphicon-search"></i> </button> </span> <script> $("#seachtext").keyup(function(){ if (event.keyCode == 13) { //on enter var slc = $('#seachtext').val(); $('#<?php echo $loc; ?> ').load('<?php echo _SPPATH; ?> PageWeb/search?s='+$('#seachtext').val()); } }); </script> </div><!-- /input-group --> </div> </h1> <style> .post-title{ font-size: 18px !important; color:#333 !important; font-weight: bold; } .post-title a{ color:#555 !important; } </style> <?php foreach ($arrPage as $num => $p) { ?> <div class="post-preview"> <div class="col-md-12"> <div style="padding-left:10px;"> <div class="post-meta"><?php echo indonesian_date($p->post_modified); ?> </div> <div class="post-title"> <a href="<?php echo _SPPATH; ?> page?id=<?php echo $p->ID; ?> "> <?php echo stripslashes($p->post_title); ?> </a> </div> <div class="post-subtitle"> <?php echo substr(stripslashes(strip_tags($p->post_content)), 0, 100); ?> <?php if (strlen($p->post_content) > 100) { ?> ... <?php } ?> <br> <a href="<?php echo _SPPATH; ?> page?id=<?php echo $p->ID; ?> "> <?php echo Lang::t('read more'); ?> </a> </div> </div> </div> <div class="clearfix"></div> </div> <?php if ($num < count($arrPage) - 1) { ?> <hr> <?php } ?> <style> .post-meta{ font-size: 14px; padding-top: 0; margin-top: 0; } .post-title{ margin-bottom: 0; margin-top: 0; padding: 0; } .post-subtitle{ padding-top: 10px; } .buttonefi{ margin: 0 auto; text-align: center; font-weight: bold; cursor: pointer; background-color: #dedede; border-radius: 5px; padding: 10px; margin: 10px; } .buttonefi:hover{ background-color: #efefef; } </style> <?php } $jmlpage = ceil($jml / $limit); ?> <nav> <ul class="pagination"> <?php if ($halaman > 1) { ?> <li><a onclick="$('#<?php echo $loc; ?> ').load('<?php echo _SPPATH; ?> PageWeb/search?loc=<?php echo $loc; ?> &s=<?php echo $s; ?> &p=<?php echo $halaman - 1; ?> ');" > <span aria-hidden="true">«</span><span class="sr-only">Previous</span> </a> </li> <?php } ?> <?php //ambil 3 bh terdekat // $mulai = $halaman - 2; $akhir = $halaman + 2; //echo $mulai.$akhir; $min = max($mulai, 1); $max = min($akhir, $jmlpage); //echo "<br> max :".$max; //echo "<br> min :".$min; for ($x = $min; $x <= $max; $x++) { ?> <li <?php if ($x == $halaman) { ?> class="active"<?php } ?> > <a onclick="$('#<?php echo $loc; ?> ').load('<?php echo _SPPATH; ?> PageWeb/search?loc=<?php echo $loc; ?> &s=<?php echo $s; ?> &p=<?php echo $x; ?> ');" > <?php echo $x; ?> </a> </li> <?php } ?> <?php if ($jml > $begin + $limit) { ?> <li> <a onclick="$('#<?php echo $loc; ?> ').load('<?php echo _SPPATH; ?> PageWeb/search?loc=<?php echo $loc; ?> &s=<?php echo $s; ?> &p=<?php echo $halaman + 1; ?> ');" > <span aria-hidden="true">»</span><span class="sr-only">Next</span> </a> </li> <?php } ?> </ul> </nav> <!-- <h4><?php echo $jml; ?> results in <?php echo $jmlpage; ?> pages</h4> --> <?php }
public static function portalIndex() { $mode = isset($_GET['mode']) ? addslashes($_GET['mode']) : die('no mode'); if ($mode < 1) { die("mode hrs integer"); } /* * LOAD page con, cek apakah bisa ini sub atau main con */ $a = NewsChannel::myChannels(); //pr($a); foreach ($a as $chn) { $str = " page_channel_id = '{$chn}' "; $imp[] = $str; } $wherechannel = implode("OR", $imp); $wherechannel = "(" . $wherechannel . ")"; $pc = new PageContainer(); $pc->getByID($mode); $gw = new GalleryWeb(); if ($pc->container_parent_id == 0) { //self::subconMenu($mode); $class = "col-md-7 col-md-offset-1"; $yangdipakai = "post_gallery_id"; } else { $pc2 = new PageContainer(); $pc2->getByID($pc->container_parent_id); $breadcrumbs = "<a href='" . _SPPATH . "pagecontainer?mode=" . $pc2->container_id . "'>" . $pc2->container_name . "</a> / <a href='" . _SPPATH . "pagecontainer?mode=" . $pc->container_id . "'>" . $pc->container_name . "</a>"; $class = "col-md-8 col-md-offset-2"; $yangdipakai = "post_subcon_id"; } $s = isset($_GET['s']) ? addslashes($_GET['s']) : ""; $halaman = isset($_GET['p']) ? addslashes($_GET['p']) : 1; $limit = 10; $begin = ($halaman - 1) * $limit; $searchText = ""; if ($s != "") { $searchText = " AND ( post_title LIKE '%{$s}%' OR post_content LIKE '%{$s}%')"; } $page = new Page(); $whereClause = "{$yangdipakai} = '{$mode}' AND post_status = 'publish' AND {$wherechannel} {$searchText}"; $arrPage = $page->getWhere($whereClause . " ORDER BY post_modified DESC LIMIT {$begin},{$limit}"); $jml = $page->getJumlah($whereClause); if (count($arrPage) == 0) { ?> <h3><?php echo Lang::t('No Page on this category yet'); ?> </h3> <?php return ""; } ?> <div class="<?php echo $class; ?> "> <?php echo $breadcrumbs; ?> <h1 class="tbsh1" style="margin-bottom:20px;"> <div style="float: right; width: 200px;"> <div class="input-group"> <input id="seachtext" type="text" value="<?php echo $s; ?> " class="form-control" placeholder="search <?php echo $pc->container_name; ?> "> <span class="input-group-btn"> <button onclick="document.location='<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s='+$('#seachtext').val();" class="btn btn-default" type="button"> <i class="glyphicon glyphicon-search"></i> </button> </span> <script> $("#seachtext").keyup(function(){ if (event.keyCode == 13) { //on enter var slc = $('#seachtext').val(); document.location='<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s='+$('#seachtext').val(); } }); </script> </div><!-- /input-group --> </div> <?php echo $pc->container_name; ?> </h1> <style> .post-title{ font-size: 18px !important; color:#333 !important; font-weight: bold; } .post-title a{ color:#555 !important; } </style> <?php foreach ($arrPage as $num => $p) { ?> <div class="post-preview"> <div class="col-md-4"> <img class="img-responsive" src="<?php echo _SPPATH . $gw->uploadURL . $p->post_image; ?> "> </div> <div class="col-md-8"> <div style="padding-left:10px;"> <div class="post-meta"><?php echo indonesian_date($p->post_modified); ?> </div> <div class="post-title"> <a href="<?php echo _SPPATH; ?> page?id=<?php echo $p->ID; ?> "> <?php echo stripslashes($p->post_title); ?> </a> </div> <div class="post-subtitle"> <?php echo substr(stripslashes(strip_tags($p->post_content)), 0, 100); ?> <?php if (strlen($p->post_content) > 100) { ?> ... <?php } ?> <br> <a href="<?php echo _SPPATH; ?> page?id=<?php echo $p->ID; ?> "> <?php echo Lang::t('read more'); ?> </a> </div> </div> </div> <div class="clearfix"></div> </div> <?php if ($num < count($arrPage) - 1) { ?> <hr> <?php } ?> <style> .post-meta{ font-size: 14px; padding-top: 0; margin-top: 0; } .post-title{ margin-bottom: 0; margin-top: 0; padding: 0; } .post-subtitle{ padding-top: 10px; } .buttonefi{ margin: 0 auto; text-align: center; font-weight: bold; cursor: pointer; background-color: #dedede; border-radius: 5px; padding: 10px; margin: 10px; } .buttonefi:hover{ background-color: #efefef; } </style> <?php } $jmlpage = ceil($jml / $limit); ?> <nav> <ul class="pagination"> <?php if ($halaman > 1) { ?> <li><a href="<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s=<?php echo $s; ?> &p=<?php echo $halaman - 1; ?> "><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li> <?php } ?> <?php //ambil 3 bh terdekat // $mulai = $halaman - 2; $akhir = $halaman + 2; //echo $mulai.$akhir; $min = max($mulai, 1); $max = min($akhir, $jmlpage); //echo "<br> max :".$max; //echo "<br> min :".$min; for ($x = $min; $x <= $max; $x++) { ?> <li <?php if ($x == $halaman) { ?> class="active"<?php } ?> ><a href="<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s=<?php echo $s; ?> &p=<?php echo $x; ?> "><?php echo $x; ?> </a></li> <?php } ?> <?php if ($jml > $begin + $limit) { ?> <li><a href="<?php echo _SPPATH; ?> pagecontainer?mode=<?php echo $mode; ?> &s=<?php echo $s; ?> &p=<?php echo $halaman + 1; ?> "><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li> <?php } ?> </ul> </nav> <h4><?php echo $jml; ?> results in <?php echo $jmlpage; ?> pages</h4> </div><?php if ($pc->container_parent_id == 0) { self::subconMenu($mode); //$class = "col-md-7"; } }
function enquiry() { ?> <div class="container attop" > <div class="col-md-8 col-md-offset-2"> <div class="appear_logo_pages"> <a href="<?php echo _SPPATH; ?> "> <img src="<?php echo _SPPATH; ?> images/appear-icontext.png" > </a> </div> <?php $page = new Page(); $arrPages = $page->getWhere("post_gallery_id = 1 AND post_status = 'publish' ORDER BY ID ASC"); ?> <div class="panel-group" id="accordion"> <?php foreach ($arrPages as $num => $page) { ?> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $num; ?> "> <?php echo stripslashes($page->post_title); ?> </a> </h4> </div> <div id="collapse<?php echo $num; ?> " class="panel-collapse collapse <?php if ($num == 0) { echo 'in'; } ?> "> <div class="panel-body"> <?php echo stripslashes($page->post_content); ?> </div> </div> </div> <?php } ?> </div> </div> </div> <?php }
public function id($args) { // pr($args); /* * begin the calculation */ $url = addslashes($_GET['jurusan']); // echo $url; global $activeLang; // pr($activeLang); $langtext = ""; if (count($activeLang) > 0) { $sl = Lang::getLang(); $langtext = "AND post_lang = '{$sl}'"; } // echo $langtext; $pg = new Page(); $arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish' {$langtext}"); $pg = $arrPage[0]; //pr($arrPage); if ($pg->post_url == "") { $pg = new Page(); $arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish'"); if (count($arrPage) > 0) { $pg = $arrPage[0]; if ($pg->post_link == "" || $pg->post_link == '0') { ?> <div class="alert alert-warning language_disclaimer" role="alert"> <?php echo Efiwebsetting::getData('Language_Disclaimer'); ?> </div> <?php } } else { Redirect::p404(); } } // Redirect::p404(); //die('die'); //pr($pg); $page = $pg; // isi semua meta tag dan title $this->isiMeta($pg); $json = ""; if ($pg->post_attachments != "") { $json = json_decode(stripslashes($pg->post_attachments)); } //pr($json); if ($pg->post_attachment_order == "") { $pa = \Efiwebsetting::getData('PageAttachment'); } else { $pa = $pg->post_attachment_order; } $exp = explode(",", $pa); $dimatikan_animasi_header = 1; foreach ($exp as $p) { if ($p == "Page") { if ($pg->post_link != "" && $pg->post_link != '0') { $_SESSION['pageObj'] = $page; //kalau ada link $arrSp = Registor::getFeatureStartPage(); list($cname, $fname) = $arrSp[$pg->post_link]; $new = new $cname(); $new->{$fname}(); } else { $arr['page'] = $page; $arr['dimatikan_animasi_header'] = $dimatikan_animasi_header; $layout_id = "Page_id"; $file = Layout::getFile($layout_id); Mold::theme("Pages/" . $layout_id . "/" . $file, $arr); } } else { if (array_key_exists($p, $json) && $json->{$p} > 0) { $paralax = new $p(); $paralax->viewme($json->{$p}, "Page", $page->ID); if (contains($p, array("Parallax", "Carousel"))) { $dimatikan_animasi_header = 0; } } } } // // //cek Parallax plg atas // if(array_key_exists("ParallaxModel",$json) && $json->ParallaxModel>0){ // $paralax = new ParallaxModel(); // $paralax->viewme($json->ParallaxModel); // $dimatikan_animasi_header = 0; // } // // //cek carousel // if(array_key_exists("GalleryCarousel__view",$json) && $json->GalleryCarousel__view>0){ // $cr = new GalleryCarousel(); // $cr->viewme($json->GalleryCarousel__view); // $dimatikan_animasi_header = 0; // } // // // // if(array_key_exists("Gallery__view",$json)&&$json->Gallery__view>0){ // // $cr = new Gallery(); // $cr->viewme($json->Gallery__view); // // } // if(array_key_exists("CalendarWeb__view",$json)&&$json->CalendarWeb__view>0){ // // $cr = new CalendarModel(); // $cr->viewme($json->CalendarWeb__view); // // } // if(array_key_exists("CalendarWeb__viewtype",$json)&&$json->CalendarWeb__viewtype>0){ // // $cr = new CalendarTypeModel(); // $cr->viewme($json->CalendarWeb__viewtype); // // } // if(array_key_exists("PageComment__loadcomment",$json)&&$json->PageComment__loadcomment>0){ // // $cr = new PageComment(); // $cr->viewme($json->PageComment__loadcomment,$pg->ID); // // } }
public static function printAll($org_id) { $page = new Page(); $arrPage = $page->getWhere("post_gallery_id = '{$org_id}' AND post_status = 'publish'"); //pr($arrPage); //echo "halo"; foreach ($arrPage as $p) { $p->printMe(); } }