Example #1
0
 public function index()
 {
     //$profiler = new Profiler;
     if (isset($_GET['emailtest'])) {
         $this->emailtest();
         die;
     }
     if (isset($_GET['database'])) {
         $this->alterDatabase();
     }
     if (isset($_GET['cronjob'])) {
         $this->cronjob();
         die;
     }
     @session_start();
     //     $lan = (@$_GET['l']<>'en') ? "es" : 'en';
     if (@$_GET['l'] != '') {
         $_SESSION['lan'] = @$_GET['l'] != 'en' ? array("es_ES", 'España') : array("en_US", 'USA');
     }
     if (@$_SESSION['lan'] != "") {
         Kohana::config_set("locale.language", $_SESSION['lan']);
     }
     $lang = new Translate();
     $lang->currency();
     $defaultobj = "category";
     $defaultact = "index";
     $module = $this->uri->segment("index") != '' ? $this->uri->segment("index") : $defaultobj;
     $action = $this->uri->segment($module) != '' ? $this->uri->segment($module) : $defaultact;
     $module = ucfirst($lang->word->{$module});
     $lib = new $module();
     $action = @$lang->word->{$action};
     $this->template->widget = $lib->GetWidgets();
     if (method_exists($lib, $action) === FALSE) {
         $lib = new $module();
         $lib->{$defaultact}();
     } else {
         $lib->{$action}();
     }
     $table_page = new fpp_page_Model();
     $header = $table_page->db2cls(46);
     $footer = $table_page->db2cls(47);
     $meta_description = $table_page->db2cls(48);
     $tr_content_page = Basic::TransVar("content_page");
     $this->template->header = strip_tags($header->{$tr_content_page});
     $this->template->footer = $footer->{$tr_content_page};
     $this->template->meta_description = strip_tags($meta_description->{$tr_content_page});
     //Executes Action's
     $this->template->title = $this->uri->segment() == '' ? 'floreria Rosabel | florerias peru | floreria | enviar flores peru' : Kohana::config("core.title_page") . $lib->GetTitle();
     $this->template->content = $lib->GetContent();
     $this->template->keywords = $lib->GetKeywords() != '' ? $lib->GetKeywords() : 'enviar flores peru, florerías en lima, florerias en lima, envio de flores a peru,florerías,florerias lima, florerias en Lima,floreria lima, Florerias de Lima, Flores domicilio Lima, Florerias en San Isidro, envio de flores a lima, envio de flores en peru,floreria amor y amistad,flores dia de las madres,arreglos florales, floreria san borja peru, florerias en trujillo, florerias en arequipa, floreria los olivos, florerias unidas,envio de flores lima, delivery flores lima, envio flores, floreria san isidro, arreglos flores, rosas, orquideas, giraloes, tulipanes, delivery flowers, send flowers lima, roses, flower shop lima';
     if (request::is_ajax()) {
         $this->auto_render = FALSE;
         echo $lib->GetContent();
     }
 }
Example #2
0
 public static function getUrlById($id, $view_name = true)
 {
     $cache = Cache::instance();
     $tprefix = Basic::TransVar('t');
     $uid = $tprefix . 'page__getUrlById__' . $id;
     $url = $cache->get($uid);
     if (!$url) {
         $id = (int) $id;
         $orm = new stdClass();
         $table = new fpp_page_Model();
         $orm = $table->db2cls($id);
         $tr_title_page = Basic::TransVar("title_page");
         $tr_content_page = Basic::TransVar("content_page");
         $title = $orm->{$tr_title_page};
         $titleurl = Basic::urlizar($orm->{$tr_title_page});
         $url = html::anchor(url::base() . "page/{$id}/{$titleurl}", $view_name ? $title : "");
         $cache->set($uid, $url, array(), 3600);
     }
     return $url;
 }