/** * generates HTML for apy buton * @param Model_Order $order * @return string */ public static function button(Model_Order $order) { if (Core::config('payment.mercadopago_client_id') != '' and Core::config('payment.mercadopago_client_secret') != '' and Theme::get('premium') == 1) { // Include Mercadopago library require Kohana::find_file('vendor/mercadopago', 'mercadopago'); // Create an instance with your MercadoPago credentials (CLIENT_ID and CLIENT_SECRET): $mp = new MP(core::config('payment.mercadopago_client_id'), core::config('payment.mercadopago_client_secret')); $preference_data = array("items" => array(array("id" => $order->id_order, "title" => $order->product->title, "currency_id" => $order->currency, "picture_url" => $order->product->get_first_image(), "description" => Text::limit_chars(Text::removebbcode($order->product->description), 30, NULL, TRUE), "category_id" => $order->product->category->name, "quantity" => 1, "unit_price" => self::money_format($order->amount))), "payer" => array("name" => Auth::instance()->get_user()->name, "email" => Auth::instance()->get_user()->email), "back_urls" => array("success" => Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')), "failure" => Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order))), "auto_return" => "approved", "notification_url" => Route::url('default', array('controller' => 'mercadopago', 'action' => 'ipn', 'id' => $order->id_order)), "expires" => false); $preference = $mp->create_preference($preference_data); $link = $preference["response"]["init_point"]; return View::factory('pages/mercadopago/button', array('link' => $link)); } return ''; }
public function action_blog() { $this->auto_render = FALSE; $info = array('title' => 'RSS Blog ' . Core::config('general.site_name'), 'pubDate' => date("D, d M Y H:i:s T"), 'description' => __('Latest post published'), 'generator' => 'Open Classifieds'); $items = array(); $posts = new Model_Post(); $posts = $posts->where('status', '=', 1)->order_by('created', 'desc')->limit(Core::config('general.feed_elements'))->cached()->find_all(); foreach ($posts as $post) { $url = Route::url('blog', array('seotitle' => $post->seotitle)); $items[] = array('title' => preg_replace('/&(?!\\w+;)/', '&', $post->title), 'link' => $url, 'pubDate' => Date::mysql2unix($post->created), 'description' => Text::removebbcode(preg_replace('/&(?!\\w+;)/', '&', $post->description))); } $xml = Feed::create($info, $items); $this->response->headers('Content-type', 'text/xml'); $this->response->body($xml); }
public function action_forum() { $this->auto_render = FALSE; $info = array('title' => 'RSS Forum ' . Core::config('general.site_name'), 'pubDate' => date("r"), 'description' => __('Latest post published'), 'generator' => 'Open Classifieds'); $items = array(); $topics = new Model_Topic(); if (Model_Forum::current()->loaded()) { $topics->where('id_forum', '=', Model_Forum::current()->id_forum); } else { $topics->where('id_forum', '!=', NULL); } //any forum $topics = $topics->where('status', '=', Model_Topic::STATUS_ACTIVE)->where('id_post_parent', 'IS', NULL)->order_by('created', 'desc')->limit(Core::config('advertisement.feed_elements'))->cached()->find_all(); foreach ($topics as $topic) { $url = Route::url('forum-topic', array('seotitle' => $topic->seotitle, 'forum' => $topic->forum->seoname)); $items[] = array('title' => htmlspecialchars($topic->title, ENT_QUOTES), 'link' => $url, 'pubDate' => Date::mysql2unix($topic->created), 'description' => htmlspecialchars(Text::removebbcode($topic->description), ENT_QUOTES), 'guid' => $url); } $xml = Feed::create($info, $items); $this->response->headers('Content-type', 'text/xml'); $this->response->body($xml); }
?> </a></li> <?php } ?> <?php } ?> </ul> </li> <?php } ?> <li><p class="navbar-text"><?php echo Text::limit_chars(Text::removebbcode($product->description), 45, NULL, TRUE); ?> </p></li> </ul> <div class="btn-group navbar-right btn-header-group"> <?php if (core::config('product.demo_resize') == TRUE) { ?> <a class="btn btn-default btn-sm mobile-btn" title="Mobile" href="#"> <span class="fa fa-mobile fa-2x"></span> </a> <a class="btn btn-default btn-sm tablet-btn" title="Tablet" href="#"> <span class="fa fa-tablet fa-2x"></span> </a> <a class="btn btn-default btn-sm desktop-btn" title="Desktop full width" href="#">
if ($ad->get_first_image() !== NULL) { ?> <img src="<?php echo Core::imagefly($ad->get_first_image(), 100, 100); ?> " style="float:left; width:100px; margin-right:10px; margin-bottom:6px;"><?php } ?> <a target="_blank" style="text-decoration:none; margin-bottom:15px; color:#4272db;" href="<?php echo Route::url('ad', array('category' => $ad->category, 'seotitle' => $ad->seotitle)); ?> "><?php echo htmlentities($ad->title, ENT_QUOTES); ?> </a><br><br><?php echo htmlentities(Text::limit_chars(Text::removenl(Text::removebbcode($ad->description)), 255, NULL, TRUE), ENT_QUOTES); ?> </p></div>', <?php } else { ?> html: '<div style="overflow: visible; cursor: default; clear: both; position: relative; background-color: rgb(255, 255, 255); border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; padding: 6px 0; width: 100%; height: auto;"><p style="margin:0;"><a target="_blank" style="text-decoration:none; margin-bottom:15px; color:#4272db;" href="<?php echo Route::url('ad', array('category' => $ad->category->seoname, 'seotitle' => $ad->seotitle)); ?> "><?php echo htmlentities($ad->title, ENT_QUOTES); ?> </a></p></div>', <?php } ?>
?> "> <?php } ?> </a> <div class="caption"> <h5><a href="<?php echo Route::url('product', array('category' => $product->category->seoname, 'seotitle' => $product->seotitle)); ?> "><?php echo substr(Text::removebbcode($product->title), 0, 30); ?> </a></h5> <p><?php echo substr(Text::removebbcode($product->description), 0, 30); ?> </p> <a class="btn btn-success" href="<?php echo Route::url('product', array('seotitle' => $product->seotitle, 'category' => $product->category->seoname)); ?> "> <?php if ($product->final_price() > 0) { ?> <?php echo $product->formated_price(); ?> <?php } elseif (!empty($product->file_name)) { ?>
<div class="panel panel-default"> <div class="panel-heading"> <h4><a title="<?php echo HTML::chars($faq->title); ?> " href="<?php echo Route::url('faq', array('seotitle' => $faq->seotitle)); ?> "> <?php echo $faq->title; ?> </a></h4> </div> <div class="panel-body"> <?php echo Text::limit_chars(Text::removebbcode($faq->description), 400, NULL, TRUE); ?> </div> <div class="panel-footer text-right"> <a class="btn btn-default" title="<?php echo HTML::chars($faq->title); ?> " href="<?php echo Route::url('faq', array('seotitle' => $faq->seotitle)); ?> "><?php echo __('Read more'); ?> .</a> </div> </div>
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="<?php echo Core::config('payment.stripe_public'); ?> " data-label="<?php echo __('Pay with Card'); ?> " data-name="<?php echo Model_Order::product_desc($order->id_product); ?> " data-description="<?php echo Text::limit_chars(Text::removebbcode($order->description), 30, NULL, TRUE); ?> " <?if (Auth::instance()->logged_in()):?> data-email="<?php echo Auth::instance()->get_user()->email; ?> " <?endif?> data-amount="<?php echo StripeKO::money_format($order->amount); ?> " data-currency="<?php echo $order->currency; ?>
?> " href="<?php echo Route::url('blog', array('seotitle' => $post->seotitle)); ?> "> <?php echo $post->title; ?> </a> </h2> <?php echo Date::format($post->created, core::config('general.date_format')); ?> <p><?php echo substr(Text::removebbcode($post->description), 0, 255); ?> </p> <a title="<?php echo $post->seotitle; ?> " href="<?php echo Route::url('blog', array('seotitle' => $post->seotitle)); ?> "><i class="glyphicon glyphicon-share"></i><?php echo __('Read more'); ?> </a> <?php if ($user !== NULL && $user->id_role == 10) {
"> <?php } ?> </a> <div class="caption"> <h5><a href="<?php echo Route::url('ad', array('controller' => 'ad', 'category' => $ad->category->seoname, 'seotitle' => $ad->seotitle)); ?> "><?php echo $ad->title; ?> </a></h5> <p ><?php echo substr(Text::removebbcode($ad->description), 0, 30); ?> </p> </div> </div> </div> <?php } ?> </div> </div> <div class='well row'> <h3><?php echo __("Categories");
<?php } ?> <h4><a href="<?php echo Route::url('ad', array('controller' => 'ad', 'category' => $ads->category->seoname, 'seotitle' => $ads->seotitle)); ?> "><?php echo $ads->title; ?> </a></h4> <p><strong><?php echo __('Description'); ?> : </strong><?php echo Text::removebbcode($ads->description); ?> <p> <p><b><?php echo __('Publish Date'); ?> :</b> <?php echo Date::format($ads->published, core::config('general.date_format')); ?> <p> <?php $visitor = Auth::instance()->get_user(); ?> <?php
short-text"> <div class="col-md-2 pull-left"> <div class="pull-left"> <span class="text-muted"><?php echo $reply->user->name; ?> </span><br> <span class="text-muted"><?php echo $reply->created; ?> </span> </div> </div> <div class="col-md-9 col-sm-9 col-xs-9 "> <p><?php echo Text::limit_chars(Text::removebbcode($reply->description, TRUE), 100, NULL, TRUE); ?> </p> </div> </div> <div class="<?php echo HTML::chars($reply->user->name) . '_' . $reply->id_ticket; ?> user-infos long-text " > <div class="col-md-2"> <img class="ticket_image img-circle" src="<?php echo $reply->user->get_profile_image(); ?> " style="max-width:120px; max-height:120px;"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 p-0"> <span class="text-muted"><?php
/** * API that return the products. * Allows api/products/<category_optional>?order1=rate&sort=asc&order2=version&sort=desc * @return [type] [description] */ public function action_products() { $this->auto_render = FALSE; $sort_allowed = array('asc', 'desc'); $order_allowed = array('id_category', 'created', 'updated', 'price', 'title', 'rate'); $order1 = Core::get('order1'); //default value if (!in_array($order1, $order_allowed) or $order1 === NULL) { $order1 = 'id_category'; } $sort1 = Core::get('sort1'); //default value if (!in_array($sort1, $sort_allowed) or $sort1 === NULL) { $sort1 = 'asc'; } $order2 = Core::get('order2'); //default value if (!in_array($order2, $order_allowed) or $order2 === NULL) { $order2 = 'price'; } $sort2 = Core::get('sort2'); //default value if (!in_array($sort2, $sort_allowed) or $sort2 === NULL) { $sort2 = 'asc'; } $items = array(); //products filtered $products = new Model_Product(); $products = $products->where('status', '=', Model_Product::STATUS_ACTIVE)->order_by($order1, $sort1)->order_by($order2, $sort2); //filter by category $seo_category = $this->request->param('id'); if ($seo_category !== NULL) { $category = new Model_Category(); $category->where('seoname', '=', $seo_category)->limit(1)->find(); if ($category->loaded()) { $products->where('id_category', '=', $category->id_category); } } $products = $products->cached()->find_all(); $i = 0; foreach ($products as $p) { $url = Route::url('product', array('seotitle' => $p->seotitle, 'category' => $p->category->seoname)); $urlmin = Route::url('product-minimal', array('seotitle' => $p->seotitle, 'category' => $p->category->seoname)); $in_offer = Date::mysql2unix($p->offer_valid) > time() ? TRUE : FALSE; $items[] = array('id_product' => $p->id_product, 'order' => $i, 'title' => $p->title, 'seoname' => $p->seotitle, 'skins' => $p->skins, 'url_more' => $url, 'url_buy' => $url, 'url_demo' => !empty($p->url_demo) ? Route::url('product-demo', array('seotitle' => $p->seotitle, 'category' => $p->category->seoname)) : '', 'url_screenshot' => URL::base() . $p->get_first_image('image'), 'type' => $p->category->seoname, 'price' => $p->price, 'currency' => $p->currency, 'price_offer' => $in_offer === TRUE ? $p->price_offer : NULL, 'offer_valid' => $in_offer === TRUE ? $p->offer_valid : NULL, 'rate' => $p->rate, 'created' => $p->created, 'updated' => $p->updated, 'version' => $p->version, 'description' => Text::removebbcode(preg_replace('/&(?!\\w+;)/', '&', $p->description))); $i++; } $this->response->headers('Content-type', 'application/javascript'); $this->response->body(json_encode($items)); }
if ($ad->id_location and core::request('sort') == 'distance' and Model_User::get_userlatlng()) { ?> <span> - <i class="glyphicon glyphicon-map-marker"></i> <?php echo i18n::format_measurement($ad->distance); ?> away</span> <?php } ?> </p> <?php if (core::config('advertisement.description') != FALSE) { ?> <p class="ad_desc"><?php echo core::cookie('list/grid') == 1 ? Text::limit_chars(Text::removebbcode($ad->description), 255, NULL, TRUE) : Text::limit_chars(Text::removebbcode($ad->description), 30, NULL, TRUE); ?> </p> <?php } ?> </div> </div> <div class="ad_buttons"> <?php if ($user !== NULL and ($user->id_role == Model_Role::ROLE_ADMIN or $user->id_role == Model_Role::ROLE_MODERATOR)) { ?> <span class="ad_options"> <a class="btn btn-warning" data-toggle="modal" data-dismiss="modal" href="<?php echo Route::url('oc-panel', array('controller' => 'myads', 'action' => 'index'));
public function action_profile() { $this->auto_render = FALSE; $xml = 'FALSE'; $seoname = $this->request->param('seoname', NULL); if ($seoname !== NULL) { $user = new Model_User(); $user->where('seoname', '=', $seoname)->where('status', '=', Model_User::STATUS_ACTIVE)->limit(1)->cached()->find(); if ($user->loaded()) { $info = array('title' => 'RSS ' . htmlspecialchars($user->name, ENT_QUOTES), 'pubDate' => date("r"), 'description' => htmlspecialchars($user->name . ' - ' . $user->description, ENT_QUOTES), 'generator' => 'Yclas', 'link' => Route::url('profile', array('seoname' => $seoname))); $items = array(); //last ads, you can modify this value at: advertisement.feed_elements $ads = new Model_Ad(); $ads->where('status', '=', Model_Ad::STATUS_PUBLISHED)->where('id_user', '=', $user->id_user)->order_by('published', 'desc')->limit(Core::config('advertisement.feed_elements')); $ads = $ads->cached()->find_all(); foreach ($ads as $a) { $url = Route::url('ad', array('category' => $a->category->seoname, 'seotitle' => $a->seotitle)); $item = array('title' => htmlspecialchars($a->title, ENT_QUOTES), 'link' => $url, 'pubDate' => Date::mysql2unix($a->published), 'description' => htmlspecialchars(Text::removebbcode($a->description), ENT_QUOTES), 'guid' => $url); if ($a->get_first_image() !== NULL) { $item['description'] = '<img src="' . $a->get_first_image() . '" />' . $item['description']; } $items[] = $item; } $xml = Feed::create($info, $items); } } $this->response->headers('Content-type', 'text/xml'); $this->response->body($xml); }
?> <li class="price"><?php echo __('Price'); ?> : <b><?php echo i18n::money_format($ad->price); ?> </b></li> <?php } ?> </ul> <p><?php echo Text::limit_chars(Text::removebbcode($ad->description), 255, NULL, TRUE); ?> </p> <a title="<?php echo HTML::chars($ad->seotitle); ?> " href="<?php echo Route::url('ad', array('controller' => 'ad', 'category' => $ad->category->seoname, 'seotitle' => $ad->seotitle)); ?> "><i class="glyphicon glyphicon-share"></i><?php echo __('Read more'); ?> </a> <?php if ($user !== NULL && $user->id_role == Model_Role::ROLE_ADMIN) {
?> "> <?php } ?> </a> <div class="caption"> <h4><a href="<?php echo Route::url('product', array('seotitle' => $product->seotitle, 'category' => $product->category->seoname)); ?> "><?php echo substr($product->title, 0, 30); ?> </a></h4> <p><?php echo Text::limit_chars(Text::removebbcode($product->description), core::cookie('list/grid') == 1 ? 255 : 30, NULL, TRUE); ?> </p> <a class="btn btn-success" href="<?php echo Route::url('product', array('seotitle' => $product->seotitle, 'category' => $product->category->seoname)); ?> "> <span class="fa fa-shopping-cart"></span> <?php if ($product->final_price() > 0) { ?> <?php echo __('Buy Now'); ?> <?php echo $product->formated_price();
<tbody> <?php foreach ($tickets as $ticket) { ?> <tr class="<?php echo $ticket->status == Model_Ticket::STATUS_CLOSED ? 'danger' : ''; ?> <?php echo $ticket->status == Model_Ticket::STATUS_HOLD ? 'warning' : ''; ?> <?php echo $ticket->status == Model_Ticket::STATUS_READ ? 'success' : ''; ?> "> <td><span class="ww"><?php echo $ticket->title != '' ? $ticket->title : Text::limit_chars(Text::removebbcode($ticket->description), 45, NULL, TRUE); ?> </span></td> <td><?php echo $ticket->created; ?> </td> <td><?php echo empty($ticket->read_date) ? __('None') : $ticket->read_date; ?> </td> <td><?php echo !$ticket->agent->loaded() ? __('None') : $ticket->agent->name; ?> </td> <td><span class="label <?php