Ejemplo n.º 1
0
 /**
  * action product goal after buying
  * @return void 
  */
 public function action_goal()
 {
     if (!Auth::instance()->logged_in()) {
         $this->redirect(Route::get('oc-panel')->uri());
     }
     $user = Auth::instance()->get_user();
     $order = new Model_Order();
     $order->where('id_order', '=', $this->request->param('id'))->where('id_user', '=', $user->id_user)->limit(1)->find();
     if ($order->loaded()) {
         $product = $order->product;
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($product->category->name)->set_url(Route::url('list', array('category' => $product->category->seoname))));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($product->title)->set_url(Route::url('product', array('seotitle' => $product->seotitle, 'category' => $product->category->seoname))));
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Thanks')));
         $this->template->title = $product->title . ' - ' . $product->category->name;
         $this->template->meta_description = $product->description;
         $thanks_message = NULL;
         if (core::config('payment.thanks_page') != '') {
             $thanks_message = Model_Content::get_by_title(core::config('payment.thanks_page'));
         }
         $this->template->bind('content', $content);
         $this->template->content = View::factory('pages/product/goal', array('product' => $product, 'thanks_message' => $thanks_message, 'order' => $order, 'price_paid' => $order->amount));
     } else {
         Alert::set(Alert::INFO, __('Order not found.'));
         $this->redirect(Route::url('default'));
     }
 }
Ejemplo n.º 2
0
 /**
  *
  * Display single faq
  * @throws HTTP_Exception_404
  */
 public function action_view($seotitle)
 {
     $faq = Model_Content::get_by_title($seotitle, 'help');
     if ($faq->loaded()) {
         Breadcrumbs::add(Breadcrumb::factory()->set_title($faq->title));
         $this->template->title = $faq->title . ' - ' . __(' Frequently Asked Questions - FAQ');
         $this->template->meta_description = $faq->description . ' - ' . __(' Frequently Asked Questions - FAQ');
         $this->template->bind('content', $content);
         if ($faq->status == 1 and strlen(core::config('general.faq_disqus')) > 0) {
             $disqus = View::factory('pages/disqus', array('disqus' => core::config('general.faq_disqus')));
         } else {
             $disqus = '';
         }
         $this->template->content = View::factory('pages/faq/single', array('faq' => $faq, 'disqus' => $disqus));
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
Ejemplo n.º 3
0
 /**
  *
  * Display single page
  * @throws HTTP_Exception_404
  */
 public function action_view()
 {
     $seotitle = $this->request->param('seotitle', NULL);
     if ($seotitle !== NULL) {
         $page = Model_Content::get_by_title($seotitle);
         if ($page->loaded()) {
             Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
             Breadcrumbs::add(Breadcrumb::factory()->set_title($page->title));
             $this->template->title = $page->title;
             $this->template->meta_description = $page->description;
             $this->template->bind('content', $content);
             $this->template->content = View::factory('page', array('page' => $page));
         } else {
             //throw 404
             throw HTTP_Exception::factory(404, __('Page not found'));
         }
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
Ejemplo n.º 4
0
 /**
  * renders a modal with alternative paymethod instructions
  * @return string 
  */
 public function alternative_pay_button()
 {
     if ($this->loaded()) {
         if (core::config('payment.alternative') != '') {
             $content = Model_Content::get_by_title(core::config('payment.alternative'));
             return View::factory('pages/alternative_payment', array('content' => $content))->render();
         }
     }
     return FALSE;
 }
Ejemplo n.º 5
0
 /**
  * sends an email using content from model_content
  * @param  string $to        
  * @param  string $to_name   
  * @param  string $from      
  * @param  string $from_name 
  * @param  string $content   seotitle from Model_Content
  * @param  array $replace   key value to replace at subject and body
  * @param  array $file      file to attach to email
  * @return boolean            s
  */
 public static function content($to, $to_name = '', $from = NULL, $from_name = NULL, $content, $replace, $file = NULL)
 {
     $email = Model_Content::get_by_title($content, 'email');
     //content found
     if ($email->loaded()) {
         if ($replace === NULL) {
             $replace = array();
         }
         if ($from === NULL) {
             $from = $email->from_email;
         }
         if ($from_name === NULL) {
             $from_name = core::config('general.site_name');
         }
         if (isset($file) and self::is_valid_file($file)) {
             $file_upload = $file;
         } else {
             $file_upload = NULL;
         }
         //adding extra replaces
         $replace += array('[SITE.NAME]' => core::config('general.site_name'), '[SITE.URL]' => core::config('general.base_url'), '[USER.NAME]' => $to_name);
         if (!is_array($to)) {
             $replace += array('[USER.EMAIL]' => $to);
         }
         //adding anchor tags to any [URL.* match
         foreach ($replace as $key => $value) {
             if (strpos($key, '[URL.') === 0 or $key == '[SITE.URL]' and $value != '') {
                 $replace[$key] = '<a href="' . $value . '">' . parse_url($value, PHP_URL_HOST) . '</a>';
             }
         }
         $subject = str_replace(array_keys($replace), array_values($replace), $email->title);
         $body = str_replace(array_keys($replace), array_values($replace), $email->description);
         return Email::send($to, $to_name, $subject, $body, $from, $from_name, $file_upload);
     } else {
         return FALSE;
     }
 }
Ejemplo n.º 6
0
 /**
  * thanks for publish
  * @return [type] [description]
  */
 public function action_thanks()
 {
     $ad = new Model_Ad($this->request->param('id'));
     if ($ad->loaded()) {
         $page = Model_Content::get_by_title(Core::config('advertisement.thanks_page'));
         //template header
         $this->template->title = $page->loaded() ? $page->title : __('Thanks');
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($ad->title)->set_url(Route::url('ad', array('category' => $ad->category->seoname, 'seotitle' => $ad->seotitle))));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($this->template->title));
         $this->template->bind('content', $content);
         $this->template->content = View::factory('pages/ad/thanks', array('ad' => $ad, 'page' => $page));
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
Ejemplo n.º 7
0
<?php

defined('SYSPATH') or die('No direct script access.');
if (!isset($_COOKIE['accept_terms']) and core::config('general.alert_terms') != '') {
    ?>
<div id="accept_terms_modal" class="modal fade" data-backdrop="static">
	<?php 
    $content = Model_Content::get_by_title(core::config('general.alert_terms'));
    ?>
	<div class="modal-dialog">
	    <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" onclick='location.href="http://www.google.com"' aria-hidden="true">&times;</button>
				<h1><?php 
    echo $content->title;
    ?>
</h1>
			</div>
			<div class="modal-body">
				<div class="text-description"><?php 
    echo Text::bb2html($content->description, TRUE, FALSE);
    ?>
</div>
			</div>
			<div class="modal-footer">
				<a name="decline_terms" class="btn btn-default" onclick='location.href="http://www.google.com"' ><?php 
    echo __('No');
    ?>
</a>
				<a name="accept_terms" class="btn btn-success" onclick='setCookie("accept_terms",1,10000)' data-dismiss="modal" aria-hidden="true"><?php 
    echo __('I accept');
Ejemplo n.º 8
0
<?php

defined('SYSPATH') or die('No direct script access.');
?>

<?php 
if (core::config('general.contact_page') != '') {
    ?>
	<?php 
    $content = Model_Content::get_by_title(core::config('general.contact_page'));
    ?>
	<div class="page-header">
		<h1><?php 
    echo $content->title;
    ?>
</h1>
	</div>
	<?php 
    echo $content->description;
    ?>
	<br>
<?php 
} else {
    ?>
	<div class="page-header">
		<h1><?php 
    echo __('Contact Us');
    ?>
</h1>
	</div>
<?php 
Ejemplo n.º 9
0
    @media screen and (min-width: 768px) {
      /* Remove the bottom border on the jumbotron for visual effect */
      .jumbotron {
        border-bottom: 0;
      }
    }
    </style>

    <div class="container">

      <div class="jumbotron">
        <?php 
if (core::config('general.private_site_page') != '') {
    ?>
      <?php 
    $content = Model_Content::get_by_title(core::config('general.private_site_page'));
    ?>
      <div class="page-header">
        <h1><?php 
    echo $content->title;
    ?>
</h1>
      </div>
      <div class="text-description"><?php 
    echo $content->description;
    ?>
</div>
      <br>
    <?php 
} else {
    ?>