Exemple #1
0
 /**
  * sends an email using our configs
  * @param  string/array $to       array(array('name'=>'chema','email'=>'chema@'),)
  * @param  [type] $to_name   [description]
  * @param  [type] $subject   [description]
  * @param  [type] $body      [description]
  * @param  [type] $reply     [description]
  * @param  [type] $replyName [description]
  * @param  [type] $file      [description]
  * @return boolean
  */
 public static function send($to, $to_name = '', $subject, $body, $reply, $replyName, $file = NULL)
 {
     require_once Kohana::find_file('vendor', 'php-mailer/phpmailer', 'php');
     $body = Text::bb2html($body, TRUE);
     //get the template from the html email boilerplate
     $body = View::factory('email', array('title' => $subject, 'content' => nl2br($body)))->render();
     $mail = new PHPMailer();
     $mail->CharSet = Kohana::$charset;
     if (core::config('email.smtp_active') == TRUE) {
         $mail->IsSMTP();
         //SMTP HOST config
         if (core::config('email.smtp_host') != "") {
             $mail->Host = core::config('email.smtp_host');
             // sets custom SMTP server
         }
         //SMTP PORT config
         if (core::config('email.smtp_port') != "") {
             $mail->Port = core::config('email.smtp_port');
             // set a custom SMTP port
         }
         //SMTP AUTH config
         if (core::config('email.smtp_auth') == TRUE) {
             $mail->SMTPAuth = TRUE;
             // enable SMTP authentication
             $mail->Username = core::config('email.smtp_user');
             // SMTP username
             $mail->Password = core::config('email.smtp_pass');
             // SMTP password
             if (core::config('email.smtp_ssl') == TRUE) {
                 $mail->SMTPSecure = "ssl";
                 // sets the prefix to the server
             }
         }
     }
     $mail->From = core::config('email.notify_email');
     $mail->FromName = "no-reply " . core::config('general.site_name');
     $mail->Subject = $subject;
     $mail->MsgHTML($body);
     if ($file !== NULL) {
         $mail->AddAttachment($file['tmp_name'], $file['name']);
     }
     $mail->AddReplyTo($reply, $replyName);
     //they answer here
     if (is_array($to)) {
         foreach ($to as $contact) {
             $mail->AddBCC($contact['email'], $contact['name']);
         }
     } else {
         $mail->AddAddress($to, $to_name);
     }
     $mail->IsHTML(TRUE);
     // send as HTML
     if (!$mail->Send()) {
         //to see if we return a message or a value bolean
         Alert::set(Alert::ALERT, "Mailer Error: " . $mail->ErrorInfo);
         return FALSE;
     } else {
         return TRUE;
     }
 }
    ?>
" width="30" height="30" style="width:30px;height:30px;" />
        </a>
        <div class="media-body">
            <h4 class="media-heading"><a href="<?php 
    echo Route::url('product-review', array('seotitle' => $review->product->seotitle, 'category' => $review->product->category->seoname));
    ?>
"><?php 
    echo Text::limit_chars(Text::bb2html($review->product->title, TRUE), 30, NULL, TRUE);
    ?>
</a><span class="label label-warning"><?php 
    echo $review->rate;
    ?>
</span></h4>
            <h5><?php 
    echo Text::limit_chars(Text::bb2html($review->description, TRUE), 30, NULL, TRUE);
    ?>
</h5>
            <hr style="margin:8px auto">
        </div>
    </div>
<?php 
}
?>
</ul>




        
Exemple #3
0
</span>
                <?if (empty($item['url_demo'])===FALSE):?>
                    <a class="btn btn-default btn-xs" target="_blank" href="<?php 
echo $item['url_demo'];
?>
">
                        <i class="glyphicon  glyphicon-eye-open"></i>
                            <?php 
echo __('Preview');
?>
                    </a>    
                <?endif?>
            </p>
            <p>
                <?php 
echo Text::bb2html($item['description']);
?>
            </p>
            <?if ( $item['price_offer']>0 AND strtotime($item['offer_valid'])>time()):?>
            <p>
                <a href="<?php 
echo $item['url_buy'];
?>
" class="btn btn-block btn-danger oe_button" data-toggle="modal" data-target="#marketModal"><?php 
echo __('Limited Offer!');
?>
 $<?php 
echo $item['price_offer'];
?>
</a>
                <a href="<?php 
                <span class="label label-info"><?php 
echo $hits;
?>
 <?php 
echo __('Hits');
?>
</span> 
            <?endif?>
        </div>    
    </div>

    <br/>

    <div>
         <?php 
echo Text::bb2html($ad->description, TRUE);
?>
         <?if (Valid::url($ad->website)):?>
         <p><a href="<?php 
echo $ad->website;
?>
" rel="nofollow" target="_blank">><?php 
echo $ad->website;
?>
</a></p>
         <?endif?>
     </div>

    <?if(core::config('payment.paypal_seller')==1 AND $ad->price != NULL AND $ad->price > 0):?>
        <?if(core::config('payment.stock')==0 OR ($ad->stock > 0 AND core::config('payment.stock')==1)):?>
            <?if (!Auth::instance()->logged_in()):?>
    <?php 
echo $content->title;
?>
</button>

<!-- Modal -->
<div class="modal fade" id="alternative_pay_modal" tabindex="-1" role="dialog" aria-labelledby="alternative_pay_modal" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel"><?php 
echo $content->title;
?>
</h4>
      </div>
      <div class="modal-body">
        <div class="text-description"><?php 
echo Text::bb2html($content->description, TRUE, FALSE);
?>
</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
echo __('OK');
?>
</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Exemple #6
0
            </div>
        </div>
    </div>
    <div class="col-md-9 span6">
    <?if(Auth::instance()->logged_in()):?>
        <?if(Auth::instance()->get_user()->id_role==Model_Role::ROLE_ADMIN):?>
            <a class="label label-warning pull-right" href="<?php 
echo Route::url('oc-panel', array('controller' => 'topic', 'action' => 'update', 'id' => $reply->id_post));
?>
">
                <i class="glyphicon icon-white icon-edit glyphicon-edit"></i>
            </a>
        <?endif?>
    <?endif?>
        <p><?php 
echo Text::bb2html($reply->description, TRUE);
?>
</p>
        <a  class="btn btn-xs btn-primary" href="#reply_form"><?php 
echo __('Reply');
?>
</a>
    </div>

<div class="clearfix"></div>
<div class="page-header"></div>
<?endforeach?>
<?php 
echo $pagination;
?>
Exemple #7
0
echo $post->user->name;
?>
</a>
    <div class="pull-right">
        <span class="label label-info"><?php 
echo Date::format($post->created, core::config('general.date_format'));
?>
</span>
    </div>    
</div>

<br/>

<div>
    <?php 
echo Text::bb2html($post->description, TRUE);
?>
</div>  

<div class="pull-right">
    <?php 
if ($previous->loaded()) {
    ?>
        <a class="btn btn-success" href="<?php 
    echo Route::url('blog', array('seotitle' => $previous->seotitle));
    ?>
" title="<?php 
    echo $previous->title;
    ?>
">
        <i class="glyphicon glyphicon-backward glyphicon"></i> <?php 
Exemple #8
0
<?php

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

<div class="page-header">
    <h1><?php 
echo $faq->title;
?>
</h1>
</div>

<div class="text-description">
	<?php 
echo Text::bb2html($faq->description, TRUE, FALSE);
?>
</div><!-- /well -->

<?php 
echo $disqus;
Exemple #9
0
<?php

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

<div class="page-header">
    <h1><?php 
echo $page->title;
?>
</h1>
</div>

<div class="well">
	<?php 
echo Text::bb2html($page->description, TRUE);
?>
</div><!-- /well -->
Exemple #10
0
    ?>
        <?php 
    $current_plan = FALSE;
    if ($subscription !== FALSE and $subscription->plan->id_plan == $plan->id_plan) {
        $current_plan = TRUE;
    }
    ?>
        <div class="col-md-4">
            <div class="well">
                <h3><b><?php 
    echo $plan->name;
    ?>
</b></h3>
                <hr>
                <p><?php 
    echo Text::bb2html($plan->description, TRUE);
    ?>
</p>
                <hr>
                <p>
                    <?php 
    if ($plan->days == 0 and $plan->price > 0) {
        ?>
                        <?php 
        echo _e('Pay once');
        ?>
                    <?php 
    } elseif ($plan->days == 365) {
        ?>
                        <?php 
        echo _e('Yearly');
Exemple #11
0
 /**
  * @dataProvider provider_bb2html_advanced
  */
 public function test_bb2html_advanced($bbcode, $html)
 {
     $this->assertEquals(Text::bb2html($bbcode, TRUE), $html);
 }
Exemple #12
0
defined('SYSPATH') or die('No direct script access.');
?>

<div class="pad_10tb">
	<div class="container">
		<div class="row">
			<div class="col-xs-12">
				<div class="page-header">
					<h3><?php 
echo $forum->name;
?>
</h3>
					<div class="pad_5tb">
						<small><?php 
echo Text::bb2html($forum->description, TRUE);
?>
</small>
					</div>
				</div>

				<form action="<?php 
echo Route::URL('forum-home');
?>
" method="get">
					<div class="input-group">
						<input type="text" class="form-control" id="task-table-filter" placeholder="<?php 
echo __('Search');
?>
" type="search" value="<?php 
echo core::get('search');
Exemple #13
0
 /**
  * confirm payment for order
  *
  * @param string    $id_order [unique indentifier of order]
  * @param string    $txn_id id of the transaction depending on provider
  */
 public function confirm_payment($paymethod = 'paypal', $txn_id = NULL, $pay_date = NULL, $amount = NULL, $currency = NULL)
 {
     // update orders
     if ($this->loaded()) {
         $product = $this->product;
         $user = $this->user;
         $this->status = self::STATUS_PAID;
         $this->pay_date = $pay_date === NULL ? Date::unix2mysql() : $pay_date;
         $this->paymethod = $paymethod;
         $this->txn_id = $txn_id;
         if ($product->support_days > 0) {
             $this->support_date = Date::unix2mysql(Date::mysql2unix($this->pay_date) + $product->support_days * 24 * 60 * 60);
         }
         if ($amount !== NULL) {
             $this->amount = $amount;
         }
         if ($currency !== NULL) {
             $this->currency = $currency;
         }
         try {
             $this->save();
         } catch (Exception $e) {
             throw HTTP_Exception::factory(500, $e->getMessage());
         }
         //if saved delete coupon from session and -- number of coupons.
         Model_Coupon::sale($this->coupon);
         //add affiliate commision
         Model_Affiliate::sale($this, $product);
         //generate licenses
         $licenses = Model_License::generate($user, $this, $product);
         $license = '';
         //loop all the licenses to an string
         if (count($licenses) > 0) {
             $license = '\\n\\n==== ' . __('Your Licenses') . ' ====';
             foreach ($licenses as $l) {
                 $license .= '\\n' . $l->license;
             }
         }
         //download link
         $download = '';
         if ($product->has_file() == TRUE) {
             $dwnl_link = $user->ql('oc-panel', array('controller' => 'profile', 'action' => 'download', 'id' => $this->id_order));
             $download = '\\n\\n==== ' . __('Download') . ' ====\\n<a href="' . $dwnl_link . '">' . $dwnl_link . '</a>';
         }
         //theres an expire? 0 = unlimited
         $expire = '';
         $expire_hours = Core::config('product.download_hours');
         $expire_times = Core::config('product.download_times');
         if (($expire_hours > 0 or $expire_times > 0) and $product->has_file() == TRUE) {
             if ($expire_hours > 0 and $expire_times > 0) {
                 $expire = sprintf(__('Your download expires in %u hours and can be downloaded %u times.'), $expire_hours, $expire_times);
             } elseif ($expire_hours > 0) {
                 $expire = sprintf(__('Your download expires in %u hours.'), $expire_hours);
             } elseif ($expire_times > 0) {
                 $expire = sprintf(__('Can be downloaded %u times.'), $expire_times);
             }
             $expire = '\\n' . $expire;
         }
         //param for sale email
         $params = array('[DATE]' => $this->pay_date, '[ORDER.ID]' => $this->id_order, '[USER.NAME]' => $user->name, '[USER.EMAIL]' => $user->email, '[PRODUCT.TITLE]' => $product->title, '[PRODUCT.PRICE]' => i18n::format_currency($this->amount, $this->currency), '[PRODUCT.NOTES]' => Text::bb2html($product->email_purchase_notes, TRUE, FALSE, FALSE), '[DOWNLOAD]' => $download, '[EXPIRE]' => $expire, '[LICENSE]' => $license);
         //send email with order details download link and product notes
         $user->email('new-sale', $params);
         //notify to seller
         if (core::config('email.new_sale_notify')) {
             Email::send(core::config('email.notify_email'), '', 'New Sale! ' . $product->title, 'New Sale! ' . $product->title, core::config('email.notify_email'), '');
         }
         return TRUE;
     }
     return FALSE;
 }
                            <?php 
                for ($i = 0; $i < round($review->rate, 1); $i++) {
                    ?>
                                <span class="glyphicon glyphicon-star"></span>
                            <?php 
                }
                ?>
                        </div>
                        <?php 
            }
            ?>
                        </ul>
                    </div>
                    <div class="col-xs-12 col-sm-12 col-md-12 span6">
                        <p><?php 
            echo Text::bb2html($review->description, TRUE);
            ?>
</p>                        
                        <!-- <span class="plus"><a href="#" title="Lorem ipsum"><i class="glyphicon glyphicon-plus"></i></a></span> -->
                    </div>
                    <span class="clearfix borda"></span>
                </div>
            </div>
        </article>
        <hgroup class="mb20 mt20"></hgroup>
        <?php 
        }
        ?>

    <?php 
    } elseif (count($reviews) == 0) {
Exemple #15
0
 /**
  * This function will upgrade configs  
  */
 public function action_16()
 {
     //subscriber field
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` ADD `subscriber` tinyint(1) NOT NULL DEFAULT '1'")->execute();
     } catch (exception $e) {
     }
     //updating contents replacing . for _
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle=REPLACE(seotitle,'.','-') WHERE type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='affiliate-commission' WHERE seotitle='affiliatecommission' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='new-ticket' WHERE seotitle='newticket' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='review-product' WHERE seotitle='reviewproduct' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='assign-agent' WHERE seotitle='assignagent' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='contact-admin' WHERE seotitle='contactadmin' AND type='email'")->execute();
     } catch (exception $e) {
     }
     //end updating emails
     //ip_address from float to bigint
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` CHANGE last_ip last_ip BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "visits` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "posts` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "licenses` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "downloads` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "tickets` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "reviews` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "affiliates` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     //crontab table
     try {
         DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS `" . self::$db_prefix . "crontab` (\n                    `id_crontab` int(10) unsigned NOT NULL AUTO_INCREMENT,\n                      `name` varchar(50) NOT NULL,\n                      `period` varchar(50) NOT NULL,\n                      `callback` varchar(140) NOT NULL,\n                      `params` varchar(255) DEFAULT NULL,\n                      `description` varchar(255) DEFAULT NULL,\n                      `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n                      `date_started` datetime  DEFAULT NULL,\n                      `date_finished` datetime  DEFAULT NULL,\n                      `date_next` datetime  DEFAULT NULL,\n                      `times_executed`  bigint DEFAULT '0',\n                      `output` varchar(50) DEFAULT NULL,\n                      `running` tinyint(1) NOT NULL DEFAULT '0',\n                      `active` tinyint(1) NOT NULL DEFAULT '1',\n                      PRIMARY KEY (`id_crontab`),\n                      UNIQUE KEY `" . self::$db_prefix . "crontab_UK_name` (`name`)\n                  ) ENGINE=MyISAM;")->execute();
     } catch (exception $e) {
     }
     //crontabs
     try {
         DB::query(Database::UPDATE, "INSERT INTO `" . self::$db_prefix . "crontab` (`name`, `period`, `callback`, `params`, `description`, `active`) VALUES\n                                    ('Sitemap', '* 3 * * *', 'Sitemap::generate', NULL, 'Regenerates the sitemap everyday at 3am',1),\n                                    ('Clean Cache', '* 5 * * *', 'Core::delete_cache', NULL, 'Once day force to flush all the cache.', 1),\n                                    ('Optimize DB', '* 4 1 * *', 'Core::optimize_db', NULL, 'once a month we optimize the DB', 1);")->execute();
     } catch (exception $e) {
     }
     //delete old sitemap config
     try {
         DB::query(Database::DELETE, "DELETE FROM " . self::$db_prefix . "config WHERE (config_key='expires' OR config_key='on_post') AND  group_name='sitemap'")->execute();
     } catch (exception $e) {
     }
     //categories description to HTML
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "categories` CHANGE  `description`  `description` TEXT NULL DEFAULT NULL;")->execute();
     } catch (exception $e) {
     }
     $categories = new Model_Category();
     $categories = $categories->find_all();
     foreach ($categories as $category) {
         $category->description = Text::bb2html($category->description, TRUE, FALSE);
         try {
             $category->save();
         } catch (Exception $e) {
         }
     }
     //content description to HTML
     $contents = new Model_Content();
     $contents = $contents->find_all();
     foreach ($contents as $content) {
         $content->description = Text::bb2html($content->description, TRUE, FALSE);
         try {
             $content->save();
         } catch (Exception $e) {
         }
     }
     //blog description to HTML
     $posts = new Model_Post();
     $posts = $posts->where('id_forum', 'IS', NULL)->find_all();
     foreach ($posts as $post) {
         $post->description = Text::bb2html($post->description, TRUE, FALSE);
         try {
             $post->save();
         } catch (Exception $e) {
         }
     }
     //User description About
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users`  ADD  `description` TEXT NULL DEFAUlT NULL AFTER  `password` ")->execute();
     } catch (exception $e) {
     }
     $configs = array(array('config_key' => 'banned_words_replacement', 'group_name' => 'general', 'config_value' => 'xxx'), array('config_key' => 'banned_words', 'group_name' => 'general', 'config_value' => ''), array('config_key' => 'authorize_sandbox', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'authorize_login', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'authorize_key', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'elastic_active', 'group_name' => 'email', 'config_value' => 0), array('config_key' => 'elastic_username', 'group_name' => 'email', 'config_value' => ''), array('config_key' => 'elastic_password', 'group_name' => 'email', 'config_value' => ''), array('config_key' => 'disallowbots', 'group_name' => 'general', 'config_value' => 0), array('config_key' => 'count_visits', 'group_name' => 'product', 'config_value' => 1));
     // returns TRUE if some config is saved
     $return_conf = Model_Config::config_array($configs);
 }
Exemple #16
0
 /**
  * This function will upgrade DB that didn't existed in versions prior to 2.2.0
  */
 public function action_220()
 {
     //updating contents replacing . for _
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle=REPLACE(seotitle,'.','-') WHERE type='email'")->execute();
     } catch (exception $e) {
     }
     //cleaning emails not in use
     try {
         DB::query(Database::DELETE, "DELETE FROM " . self::$db_prefix . "content WHERE seotitle='user.new' AND type='email'")->execute();
     } catch (exception $e) {
     }
     //updating contents bad names
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='ads-sold' WHERE seotitle='adssold' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='out-of-stock' WHERE seotitle='outofstock' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='ads-purchased' WHERE seotitle='adspurchased' AND type='email'")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='ads-purchased' WHERE seotitle='adspurchased' AND type='email'")->execute();
     } catch (exception $e) {
     }
     //end updating emails
     //order transaction
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "orders` ADD  `txn_id` VARCHAR( 255 ) NULL DEFAULT NULL")->execute();
     } catch (exception $e) {
     }
     //ip_address from float to bigint
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` CHANGE last_ip last_ip BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "visits` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "ads` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "posts` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
     } catch (exception $e) {
     }
     //crontab table
     try {
         DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS `" . self::$db_prefix . "crontab` (\n                    `id_crontab` int(10) unsigned NOT NULL AUTO_INCREMENT,\n                      `name` varchar(50) NOT NULL,\n                      `period` varchar(50) NOT NULL,\n                      `callback` varchar(140) NOT NULL,\n                      `params` varchar(255) DEFAULT NULL,\n                      `description` varchar(255) DEFAULT NULL,\n                      `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n                      `date_started` datetime  DEFAULT NULL,\n                      `date_finished` datetime  DEFAULT NULL,\n                      `date_next` datetime  DEFAULT NULL,\n                      `times_executed`  bigint DEFAULT '0',\n                      `output` varchar(50) DEFAULT NULL,\n                      `running` tinyint(1) NOT NULL DEFAULT '0',\n                      `active` tinyint(1) NOT NULL DEFAULT '1',\n                      PRIMARY KEY (`id_crontab`),\n                      UNIQUE KEY `" . self::$db_prefix . "crontab_UK_name` (`name`)\n                  ) ENGINE=MyISAM;")->execute();
     } catch (exception $e) {
     }
     //crontabs
     try {
         DB::query(Database::UPDATE, "INSERT INTO `" . self::$db_prefix . "crontab` (`name`, `period`, `callback`, `params`, `description`, `active`) VALUES\n                                    ('Sitemap', '00 3 * * *', 'Sitemap::generate', NULL, 'Regenerates the sitemap everyday at 3am',1),\n                                    ('Clean Cache', '00 5 * * *', 'Core::delete_cache', NULL, 'Once day force to flush all the cache.', 1),\n                                    ('Optimize DB', '00 4 1 * *', 'Core::optimize_db', NULL, 'once a month we optimize the DB', 1),\n                                    ('Unpaid Orders', '00 7 * * *', 'Cron_Ad::unpaid', NULL, 'Notify by email unpaid orders 2 days after was created', 1),\n                                    ('Expired Featured Ad', '00 8 * * *', 'Cron_Ad::expired_featured', NULL, 'Notify by email of expired featured ad', 1),\n                                    ('Expired Ad', '00 9 * * *', 'Cron_Ad::expired', NULL, 'Notify by email of expired ad', 1);")->execute();
     } catch (exception $e) {
     }
     //delete old sitemap config
     try {
         DB::query(Database::DELETE, "DELETE FROM " . self::$db_prefix . "config WHERE (config_key='expires' OR config_key='on_post') AND  group_name='sitemap'")->execute();
     } catch (exception $e) {
     }
     //categories description to HTML
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "categories` CHANGE  `description`  `description` TEXT NULL DEFAULT NULL;")->execute();
     } catch (exception $e) {
     }
     $categories = new Model_Category();
     $categories = $categories->find_all();
     foreach ($categories as $category) {
         $category->description = Text::bb2html($category->description, TRUE, FALSE);
         try {
             $category->save();
         } catch (Exception $e) {
         }
     }
     //locations description to HTML
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "locations` CHANGE  `description`  `description` TEXT NULL DEFAULT NULL;")->execute();
     } catch (exception $e) {
     }
     $locations = new Model_Location();
     $locations = $locations->find_all();
     foreach ($locations as $location) {
         $location->description = Text::bb2html($location->description, TRUE, FALSE);
         try {
             $location->save();
         } catch (Exception $e) {
         }
     }
     //content description to HTML
     $contents = new Model_Content();
     $contents = $contents->find_all();
     foreach ($contents as $content) {
         $content->description = Text::bb2html($content->description, TRUE, FALSE);
         try {
             $content->save();
         } catch (Exception $e) {
         }
     }
     //blog description to HTML
     $posts = new Model_Post();
     $posts = $posts->where('id_forum', 'IS', NULL)->find_all();
     foreach ($posts as $post) {
         $post->description = Text::bb2html($post->description, TRUE, FALSE);
         try {
             $post->save();
         } catch (Exception $e) {
         }
     }
     //Reviews
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users` ADD `rate` FLOAT( 4, 2 ) NULL DEFAULT NULL ;")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "ads` ADD `rate` FLOAT( 4, 2 ) NULL DEFAULT NULL ;")->execute();
     } catch (exception $e) {
     }
     try {
         DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS " . self::$db_prefix . "reviews (\n                id_review int(10) unsigned NOT NULL AUTO_INCREMENT,\n                id_user int(10) unsigned NOT NULL,\n                id_ad int(10) unsigned NOT NULL,\n                rate int(2) unsigned NOT NULL DEFAULT '0',\n                description varchar(1000) NOT NULL,\n                created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n                ip_address float DEFAULT NULL,\n                status tinyint(1) NOT NULL DEFAULT '0',\n                PRIMARY KEY (id_review) USING BTREE,\n                KEY " . self::$db_prefix . "reviews_IK_id_user (id_user),\n                KEY " . self::$db_prefix . "reviews_IK_id_ad (id_ad)\n                ) ENGINE=MyISAM;")->execute();
     } catch (Exception $e) {
     }
     //User description About
     try {
         DB::query(Database::UPDATE, "ALTER TABLE  `" . self::$db_prefix . "users`  ADD  `description` TEXT NULL DEFAUlT NULL AFTER  `password` ")->execute();
     } catch (exception $e) {
     }
     //Favorites table
     try {
         DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS " . self::$db_prefix . "favorites (\n                                        id_favorite int(10) unsigned NOT NULL AUTO_INCREMENT,\n                                        id_user int(10) unsigned NOT NULL,\n                                        id_ad int(10) unsigned NOT NULL,\n                                        created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n                                        PRIMARY KEY (id_favorite) USING BTREE,\n                                        KEY " . self::$db_prefix . "favorites_IK_id_user_AND_id_ad (id_user,id_ad)\n                                        ) ENGINE=MyISAM;")->execute();
     } catch (Exception $e) {
     }
     //new mails
     $contents = array(array('order' => 0, 'title' => 'Receipt for [ORDER.DESC] #[ORDER.ID]', 'seotitle' => 'new-order', 'description' => "Hello [USER.NAME],Thanks for buying [ORDER.DESC].\n\nPlease complete the payment here [URL.CHECKOUT]", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => 0, 'title' => 'Your ad [AD.NAME] has expired', 'seotitle' => 'ad-expired', 'description' => "Hello [USER.NAME],Your ad [AD.NAME] has expired \n\nPlease check your ad here [URL.EDITAD]", 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'), array('order' => '0', 'title' => 'New review for [AD.TITLE] [RATE]', 'seotitle' => 'ad-review', 'description' => '[URL.QL]\\n\\n[RATE]\\n\\n[DESCRIPTION]', 'from_email' => core::config('email.notify_email'), 'type' => 'email', 'status' => '1'));
     Model_Content::content_array($contents);
     //new configs...
     $configs = array(array('config_key' => 'bitpay_apikey', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'paymill_private', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'paymill_public', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'stripe_public', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'stripe_private', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'stripe_address', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'alternative', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'authorize_sandbox', 'group_name' => 'payment', 'config_value' => '0'), array('config_key' => 'authorize_login', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'authorize_key', 'group_name' => 'payment', 'config_value' => ''), array('config_key' => 'elastic_active', 'group_name' => 'email', 'config_value' => 0), array('config_key' => 'elastic_username', 'group_name' => 'email', 'config_value' => ''), array('config_key' => 'elastic_password', 'group_name' => 'email', 'config_value' => ''), array('config_key' => 'reviews', 'group_name' => 'advertisement', 'config_value' => '0'), array('config_key' => 'reviews_paid', 'group_name' => 'advertisement', 'config_value' => '0'));
     Model_Config::config_array($configs);
     //delete old files from 323, no need they need to update manually
     // File::delete(APPPATH.'ko323');
     // File::delete(APPPATH.'classes/image/');
     // //delete modules since now they are part of module common
     // File::delete(MODPATH.'pagination');
     // File::delete(MODPATH.'breadcrumbs');
     // File::delete(MODPATH.'formmanager');
     // File::delete(MODPATH.'mysqli');
     //assign new group_name to configs
     try {
         DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "config SET group_name='advertisement' WHERE config_key = 'advertisements_per_page' OR config_key = 'feed_elements' OR config_key = 'map_elements' OR config_key = 'sort_by'")->execute();
     } catch (exception $e) {
     }
     DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle=REPLACE(seotitle,'.','-') WHERE type='email'")->execute();
 }
Exemple #17
0
<ul class="nav nav-tabs mb-30">
	  	<li class="active">
	  		<a href="#description" data-toggle="tab"><?php 
echo __('Description');
?>
</a>	
	  	</li>
	  	<li><a href="#details" data-toggle="tab"><?php 
echo __('Details');
?>
</a></li>
	</ul>
	<div class="tab-content">
		<div class="tab-pane active" id="description">
			<?php 
echo Text::bb2html($product->description, TRUE);
?>
		</div>
		<div class="tab-pane" id="details">
			<?php 
if (core::config('product.number_of_orders')) {
    ?>
				<p><span class="glyphicon glyphicon-shopping-cart"></span> <?php 
    echo $number_orders;
    ?>
</p>
			<?php 
}
?>

            <?php 
        echo Route::url('profile', array('seoname' => $message->from->seoname));
        ?>
"><?php 
        echo $message->from->name;
        ?>
</a></strong>
							<?php 
    } else {
        ?>
								<strong>You:</strong>
							<?php 
    }
    ?>
							<br>
							<?php 
    echo Text::bb2html($message->message, TRUE);
    ?>
						
							<?php 
    if ($message->price > 0) {
        ?>
								<p>
									<strong><?php 
        echo __('Price');
        ?>
</strong>: <?php 
        echo i18n::money_format($message->price);
        ?>
								</p>
							<?php 
    }
Exemple #19
0
<?php

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

	<div class="well" id="recomentadion">

		<?php 
if ($category !== NULL) {
    ?>
            <p><?php 
    echo Text::bb2html($category->description, TRUE);
    ?>
</p> 
            <i class="glyphicon glyphicon-pencil"></i> 
                <a title="<?php 
    echo __('New Advertisement');
    ?>
" href="<?php 
    echo Route::url('post_new');
    ?>
?category=<?php 
    echo $category->seoname;
    ?>
">
                    <?php 
    echo __('Publish new advertisement');
    ?>
</a>
        <?php