Jump to content


Photo
- - - - -

idea for news + rss


8 replies to this topic

#1 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 07 November 2013 - 03:42 PM

since rss feed code i got from Max works like a charm

i just got an idea

if there's a similar mod that publish latest news into rss so we can use it to auto post and tweet


  • 0

#2 MaxD

MaxD

    Administrator

  • Administrators
  • 740 posts

Posted 09 November 2013 - 03:55 PM

Maybe there is some modification of fido-x news that does this. But I havn't met one


  • 0

#3 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 09 November 2013 - 07:19 PM

http://www.opencart....ilter_license=0

 

still learn how this mod make the rss feed.

i wonder if i can make a feed for news based from this mod

if we can make feed for news that would be great

the rss feed for news can be used for auto post and tweet at facebook with http://twitterfeed.com or similar services :D

gotta find which code does the grabbing data from database and code to make feeds and apply it to news

sounds simple but hard to be done by a dummy like me

lol

this first code is surely how to make the subscribe button

i edit it a little to change the icon

<!--
  Copyright (C) 2012 Tri Le <trile7 at gmail dot com>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>
-->

<modification>
  <id>latest, featured, and special products rss feed</id>
  <version>0.2</version>
  <vqmver>2.1.7</vqmver>
  <author>Tri Le trile7 at gmail dot com</author>

  <file name="catalog/view/theme/*/template/module/featured.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=featured' title='Subscribe to Featured Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/latest.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=latest' title='Subscribe to Latest Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/special.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=special' title='Subscribe to Special Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/bestseller.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=bestseller' title='Subscribe to Bestseller Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

the rest of this one is still mystery XD

how to call the data for news based on this code

  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">protected function index</search>
      <add><![CDATA[
        $rss = isset($this->request->get["rss"]) ? $this->request->get["rss"] : "";
        if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller") {
          $this->load->model("catalog/product");
          $this->load->model("localisation/currency");
          $this->load->model("tool/image");
          $this->data["products"] = array();

          $limit = 20;
          $image_width = 100;
          $image_height = 100;
          $currency = $this->currency->getCode();

          if ($rss=="latest") {
            $data = array("sort"  => "p.date_modified", "order" => "DESC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProducts($data);
          }
          elseif ($rss=="featured") {
            $featured_products = explode(",", $this->config->get("featured_product"));
            $featured_products = array_slice($featured_products, 0, $limit);
            foreach ($featured_products as $product_id) $products[] = $this->model_catalog_product->getProduct($product_id);
          }
          elseif ($rss=="special") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProductSpecials($data);
          }
          elseif ($rss=="bestseller") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getBestSellerProducts($limit);
          }

          $output = "<?xml version='1.0' encoding='UTF-8' ?>";
          $output .= "<rss version='2.0'>";
          $output .= "<channel>";
          $output .= "<title><![CDATA[" . $this->config->get("config_name") . " - $rss products]]]]><![CDATA[></title>";
          $output .= "<description><![CDATA[" . $this->config->get("config_meta_description") . "]]]]><![CDATA[></description>";
          $output .= "<link><![CDATA[" . HTTP_SERVER . "]]]]><![CDATA[></link>";
          foreach ($products as $product) {
            $title = $product["name"];
            $link = HTTP_SERVER . "?route=product/product&product_id=$product[product_id]";
            $price = $this->config->get("config_customer_price") ? false : $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"], $this->config->get("config_tax")));
            $special = ((float)$product["special"]) ? $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"], $this->config->get("config_tax"))) : false;
            $image_url = $this->model_tool_image->resize($product["image"], $image_width, $image_height);
            $description = "";
            if ($price) $description .= ($special) ? "<p><strong><span style='color:red; text-decoration:line-through;'>$price</span> $special</strong></p>" : "<p><strong>$price</strong></p>";
            if ($image_url) $description .= "<p><a href='$link'><img src='$image_url' alt=''></a></p>";
            if ($product["description"]) $description .= html_entity_decode($product["description"]);

            if ($rss!="special" || $special) {
              $output .= "<item>";
              $output .= "<title><![CDATA[$title]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$link]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$description]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$link]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($product["date_added"])) . "</pubDate>";
              $output .= "</item>";
            }
          }
          $output .= "</channel>";
          $output .= "</rss>";

          header("Content-Type: application/rss+xml");
          echo "$output";
          die();
        }
      ]]></add>
    </operation>
  </file>

</modification>

this one is surely the format of the feed if i'm not mistaken

              $output .= "<item>";
              $output .= "<title><![CDATA[$title]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$link]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$description]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$link]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($product["date_added"])) . "</pubDate>";
              $output .= "</item>";

the last one is the one that shout the feed

          header("Content-Type: application/rss+xml");
          echo "$output";
          die();
        }
      ]]></add>
    </operation>
  </file>

</modification>

still confused with

$this->load->

$this->data

and everything with $this does

 

difference of

$output =

and
$output .=

 

$xyz = is surely declaring something that's called xyz which will be used next

 

whoah so many of them still confusing

maybe i can become "confucius"ed

lol

 

wish me luck XD


  • 0

#4 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 13 November 2013 - 12:22 AM

yay since i'm not done with this and still strugling i found a nice module

pavblog is nice since it has rss feed in it when i try it's demo

and it's freeeeeeeeee

yay

thanks to pavblog

just download it and wanna try it

hope it works well

 

update:

ouch still buggy :(


Edited by Ivan Pramono Susanto, 13 November 2013 - 01:54 AM.

  • 0

#5 MaxD

MaxD

    Administrator

  • Administrators
  • 740 posts

Posted 13 November 2013 - 01:03 PM

Let me know when pavblog will become a nice replacement for OpenShop news module.

 

All $this-> ... things are simple refs to "global" objects (like request, session and so on). I don't know why Daniel decided to stuff them into controller object.

 

$a += 3; is equal to $a = $a + 3; 

$a .= "x"; is equal to $a = $a . "x";

 

Dot (.) is strings concantenation operand at PHP. "a" . "b" = "ab"


  • 1

#6 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 13 November 2013 - 01:30 PM

thanks for the tutorial

 

got a pavblog modified to russian and it works but i cannot read them >.<

i can create category with it but i haven't test it further since translation problem >.<

i think i got it from https://github.com/1...e-pav-blog-news and http://opencartforum...остей-pav-blog/

 

lots of free nice thing in http://opencartforum.ru

but not everything compatible >.< such as easy checkout it's great but i cannot make it work

then again it's language barrier >.< i cannot ask them >.<


Edited by Ivan Pramono Susanto, 13 November 2013 - 01:34 PM.

  • 0

#7 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 14 November 2013 - 06:07 AM

modification of rss still stuck on how to get news data >.<
button prepared

some still unknown because don't know how to get news data

function prepared but still some are mark unknown

XD

<!--
  Copyright (C) 2012 Tri Le <trile7 at gmail dot com>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>
-->

<modification>
  <id>latest, featured, and special products rss feed</id>
  <version>0.2</version>
  <vqmver>2.1.7</vqmver>
  <author>Tri Le trile7 at gmail dot com</author>

  <file name="catalog/view/theme/*/template/module/featured.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=featured' title='Subscribe to Featured Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/latest.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=latest' title='Subscribe to Latest Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/news.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $customtitle; ?>]]></search>
      <add><![CDATA[<?php echo "$customtitle <a href='".HTTP_SERVER."?rss=news' title='Subscribe to News'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>
  
  <file name="catalog/view/theme/*/template/module/special.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=special' title='Subscribe to Special Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/bestseller.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=bestseller' title='Subscribe to Bestseller Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">protected function index</search>
      <add><![CDATA[
        $rss = isset($this->request->get["rss"]) ? $this->request->get["rss"] : "";
        if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller" || $rss=="news") {
          $this->load->model("catalog/product");
          $this->load->model("localisation/currency");
          $this->load->model("tool/image");
          $this->data["products"] = array();

          $limit = 20;
          $image_width = 100;
          $image_height = 100;
          $currency = $this->currency->getCode();

          if ($rss=="latest") {
            $data = array("sort"  => "p.date_modified", "order" => "DESC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProducts($data);
          }
          elseif ($rss=="featured") {
            $featured_products = explode(",", $this->config->get("featured_product"));
            $featured_products = array_slice($featured_products, 0, $limit);
            foreach ($featured_products as $product_id) $products[] = $this->model_catalog_product->getProduct($product_id);
          }
          elseif ($rss=="special") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProductSpecials($data);
          }
          elseif ($rss=="bestseller") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getBestSellerProducts($limit);
          }
		  elseif ($rss=="news") {
		    $data = array("sort" => "date_added", "order" => "DESC", "start" => 0, "limit" => $limit);
			$news = $this->unknown;
		  }

          $output = "<?xml version='1.0' encoding='UTF-8' ?>";
          $output .= "<rss version='2.0'>";
          $output .= "<channel>";
          $output .= "<title><![CDATA[" . $this->config->get("config_name") . " - $rss update]]]]><![CDATA[></title>";
          $output .= "<description><![CDATA[" . $this->config->get("config_meta_description") . "]]]]><![CDATA[></description>";
          $output .= "<link><![CDATA[" . HTTP_SERVER . "]]]]><![CDATA[></link>";
		  if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller") {
		  foreach ($products as $product) {
            $title = $product["name"];
            $link = HTTP_SERVER . "?route=product/product&product_id=$product[product_id]";
            $price = $this->config->get("config_customer_price") ? false : $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"], $this->config->get("config_tax")));
            $special = ((float)$product["special"]) ? $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"], $this->config->get("config_tax"))) : false;
            $image_url = $this->model_tool_image->resize($product["image"], $image_width, $image_height);
            $description = "";
            if ($price) $description .= ($special) ? "<p><strong><span style='color:red; text-decoration:line-through;'>$price</span> $special</strong></p>" : "<p><strong>$price</strong></p>";
            if ($image_url) $description .= "<p><a href='$link'><img src='$image_url' alt=''></a></p>";
            if ($product["description"]) $description .= html_entity_decode($product["description"]);

            if ($rss!="special" || $special) {
              $output .= "<item>";
              $output .= "<title><![CDATA[$title]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$link]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$description]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$link]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($product["date_modified"])) . "</pubDate>";
              $output .= "</item>";
            }
          }
          $output .= "</channel>";
          $output .= "</rss>";

          header("Content-Type: application/rss+xml");
          echo "$output";
          die();
        }
		else if ($rss=="news") { 
		foreach ($news as $news) {
		  $show_headline = unknown;
		  $newslink = HTTP_SERVER . "?route=information/news&news_id=$news[news_id]";;
		  $news_story = unknown;
		      $output .= "<item>";
              $output .= "<title><![CDATA[$show_headline]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$newslink]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$news_story]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$newslink]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($news["date_added"])) . "</pubDate>";
              $output .= "</item>";
		}
		$output .= "</channel>";
        $output .= "</rss>";

        header("Content-Type: application/rss+xml");
        echo "$output";
        die();
		}
		}
      ]]></add>
    </operation>
  </file>

</modification> 

tested without error so far >.<

but the most importand and difficult things still missing and remain "unknown"

got to pray harder XD

if this mod is successful it will be a nice addition to openshop


Edited by Ivan Pramono Susanto, 14 November 2013 - 06:52 AM.

  • 0

#8 Ivan Pramono Susanto

Ivan Pramono Susanto

    Advanced Member

  • Members
  • PipPipPip
  • 141 posts

Posted 14 November 2013 - 07:39 AM

latest trial with news extension from http://www.opencart....ilter_license=0

this vqmod xml is working now thanks to GOD for gimmie a revelation and Max for gimmie some hint although i don't understand well $this function but at least it gimmie an idea XD

thank GOD thank GOD

praise the LORD

don't sell this vqmod please

feel free to modify but don't sell it please

because i'm poor and cannot afford premium script >.<

<!--
  Copyright (C) 2012 Tri Le <trile7 at gmail dot com>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>
-->

<modification>
  <id>latest, featured, and special products rss feed + news rss</id>
  <version>0.2a</version>
  <vqmver>2.1.7</vqmver>
  <author>Tri Le trile7 at gmail dot com + MaxD for mod date + bonboncat with GOD help</author>

  <file name="catalog/view/theme/*/template/module/featured.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=featured' title='Subscribe to Featured Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/latest.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=latest' title='Subscribe to Latest Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/news.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $customtitle; ?>]]></search>
      <add><![CDATA[<?php echo "$customtitle <a href='".HTTP_SERVER."?rss=news' title='Subscribe to News'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>
  
  <file name="catalog/view/theme/*/template/module/special.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=special' title='Subscribe to Special Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/view/theme/*/template/module/bestseller.tpl">
    <operation>
      <search position="replace"><![CDATA[<?php echo $heading_title; ?>]]></search>
      <add><![CDATA[<?php echo "$heading_title <a href='".HTTP_SERVER."?rss=bestseller' title='Subscribe to Bestseller Products'><img src='/image/data/rss-icon.png' alt='Subscribe' /></a>"; ?>]]></add>
    </operation>
  </file>

  <file name="catalog/controller/common/header.php">
    <operation>
      <search position="after">protected function index</search>
      <add><![CDATA[
        $rss = isset($this->request->get["rss"]) ? $this->request->get["rss"] : "";
        if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller" || $rss=="news") {
          $this->load->model("catalog/product");
          $this->load->model("localisation/currency");
          $this->load->model("tool/image");
          $this->data["products"] = array();
 $this->load->model("catalog/news");
 $this->data["news"] = array ();

          $limit = 20;
          $image_width = 100;
          $image_height = 100;
          $currency = $this->currency->getCode();

          if ($rss=="latest") {
            $data = array("sort"  => "p.date_modified", "order" => "DESC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProducts($data);
          }
          elseif ($rss=="featured") {
            $featured_products = explode(",", $this->config->get("featured_product"));
            $featured_products = array_slice($featured_products, 0, $limit);
            foreach ($featured_products as $product_id) $products[] = $this->model_catalog_product->getProduct($product_id);
          }
          elseif ($rss=="special") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getProductSpecials($data);
          }
          elseif ($rss=="bestseller") {
            $data = array("sort"  => "pd.name", "order" => "ASC", "start" => 0, "limit" => $limit);
            $products = $this->model_catalog_product->getBestSellerProducts($limit);
          }
 elseif ($rss=="news") {
   $data = array("sort" => "date_added", "order" => "DESC", "start" => 0, "limit" => $limit);
$news = $this->model_catalog_news->getNews();
 }

          $output = "<?xml version='1.0' encoding='UTF-8' ?>";
          $output .= "<rss version='2.0'>";
          $output .= "<channel>";
          $output .= "<title><![CDATA[" . $this->config->get("config_name") . " - $rss update]]]]><![CDATA[></title>";
          $output .= "<description><![CDATA[" . $this->config->get("config_meta_description") . "]]]]><![CDATA[></description>";
          $output .= "<link><![CDATA[" . HTTP_SERVER . "]]]]><![CDATA[></link>";
 if ($rss=="latest" || $rss=="featured" || $rss=="special" || $rss=="bestseller") {
 foreach ($products as $product) {
            $title = $product["name"];
            $link = HTTP_SERVER . "?route=product/product&product_id=$product[product_id]";
            $price = $this->config->get("config_customer_price") ? false : $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"], $this->config->get("config_tax")));
            $special = ((float)$product["special"]) ? $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"], $this->config->get("config_tax"))) : false;
            $image_url = $this->model_tool_image->resize($product["image"], $image_width, $image_height);
            $description = "";
            if ($price) $description .= ($special) ? "<p><strong><span style='color:red; text-decoration:line-through;'>$price</span> $special</strong></p>" : "<p><strong>$price</strong></p>";
            if ($image_url) $description .= "<p><a href='$link'><img src='$image_url' alt=''></a></p>";
            if ($product["description"]) $description .= html_entity_decode($product["description"]);

            if ($rss!="special" || $special) {
              $output .= "<item>";
              $output .= "<title><![CDATA[$title]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$link]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$description]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$link]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($product["date_modified"])) . "</pubDate>";
              $output .= "</item>";
            }
          }
          $output .= "</channel>";
          $output .= "</rss>";

          header("Content-Type: application/rss+xml");
          echo "$output";
          die();
        }
else if ($rss=="news") { 
foreach ($news as $news) {
 $show_headline = $news["title"];
 $newslink = HTTP_SERVER . "?route=information/news&news_id=$news[news_id]";;
 $news_image = $this->model_tool_image->resize($news["image"], $image_width, $image_height);
 $news_story = html_entity_decode($news["description"]);
  if ($news_image) $news_story .= "<p><a href='$newslink'><img src='$news_image' alt=''></a></p>";
     $output .= "<item>";
              $output .= "<title><![CDATA[$show_headline]]]]><![CDATA[></title>";
              $output .= "<link><![CDATA[$newslink]]]]><![CDATA[></link>";
              $output .= "<description><![CDATA[$news_story]]]]><![CDATA[></description>";
              $output .= "<guid><![CDATA[$newslink]]]]><![CDATA[></guid>";
              $output .= "<pubDate>" . date("D, d M Y H:i:s O", strtotime($news["date_added"])) . "</pubDate>";
              $output .= "</item>";
}
$output .= "</channel>";
        $output .= "</rss>";

        header("Content-Type: application/rss+xml");
        echo "$output";
        die();
}
}
      ]]></add>
    </operation>
  </file>

</modification>

case close

news + rss buttons completed

don't need pav blog unless i need category for news/blow

this solution is better since i got rss button in front as well

 

*added bonus*

use this sitemap generator

http://www.opencart....=sitemap&page=2

edit admin/model/tool/generate_sitemap.php and seo_url.php to add news sitemap

and viola

the greatest news mod i have XD

thank you so much Max


Edited by Ivan Pramono Susanto, 15 November 2013 - 01:58 AM.

  • 0

#9 yangping55

yangping55

    Advanced Member

  • Members
  • PipPipPip
  • 93 posts

Posted 19 October 2017 - 03:47 AM

ugg boots   pandora charms sale   hermes outlet   canada goose jackets   ugg outlet online   canada goose outlet   coach outlet   ugg boots on sale   michael kors outlet   ugg boots   ugg outlet   nmd adidas   cheap mlb jerseys   nike outlet online   pandora outlet   jordan shoes   nike cortez   pandora charms   cheap jordan shoes   moncler jackets   canada goose outlet   ray ban sunglasses   canada goose coats   ugg boots   nmd adidas   ralph lauren outlet   ugg outlet   hermes handbags   superdry uk   ray ban sunglasses   coach outlet   uggs on sale   ray ban sunglasses   coach outlet store   michael kors outlet   valentino shoes   ugg sale   polo ralph lauren   canada goose   canada goose outlet   uggs on sale   ralph lauren outlet online   adidas outlet   adidas yeezy   north face outlet   nike shoes for men   coach outlet store online   ugg boots   ralph lauren uk   ugg australia   adidas shoes   air max 2017   coach handbags   michael kors outlet   burberry outlet store   oakley sunglasses   louis vuitton outlet   moncler outlet   ugg outlet   salvatore ferragamo   canada goose outlet   polo ralph lauren   longchamp handbags   adidas yeezy   coach outlet   ugg outlet   ralph lauren outlet   coach factory outlet   coach outlet   canada goose jackets   ralph lauren outlet online   ralph lauren uk   kate spade   coach outlet   moncler coats   burberry   pandora charms   oakley sunglasses   canada goose outlet   cheap uggs   tory burch outlet store   coach factory outlet   mulberry uk   cheap uggs   ugg uk   michael kors handbags   ugg outlet   kate spade bags   polo ralph lauren outlet   ugg outlet   michael kors factory outlet   adidas yeezy boost   hermes bags   mulberry outlet   coach outlet store   superdry   christian louboutin   ralph lauren uk   ugg boots   uggs canada   adidas nmd   ugg boots   yeezy boost   toms outlet   yeezy 350 boost   ralph lauren outlet   ugg outlet   michael kors outlet   air jordan shoes   canada goose clothing   coach outlet   ralph lauren outlet   coach factory outlet   ugg outlet store   cheap oakley sunglasses   michael kors outlet online   michael kors outlet   canada goose clothing   coach factory outlet   moncler jackets   birkenstock sandals   ugg outlet   fred perry polo   adidas shoes   cheap ray ban sunglasses   pandora jewelry   canada goose   cat boots   cheap ray ban sunglasses   pandora jewelry   coach factory outlet   pandora jewelry   ugg boots   yeezy boost 350   cheap jordans   coach bags   hermes handbags   coach outlet   michael kors outlet store   cheap jordans   james harden shoes   ralph lauren sale clearance   cheap jerseys from china   canada goose jackets   ugg outlet   pandora charms sale clearance   adidas superstar   pandora jewelry   air jordans   michael kors handbags   moncler   moncler jackets   moncler jackets   jordan retro 11   ugg boots   mlb jerseys cheap   coach outlet   cheap jerseys   canada goose coats   ugg boots   ugg ustralia   moncler outlet   coach factorty outlet   michael kors outlet clearance   michael kors handbags   nike store   canada goose jackets   canada goose outlet   moncler jackets   canada goose sale   michael kors outlet   cheap uggs   pandora jewelry   adidas nmd   polo ralph lauren   michael kors handbags   coach factory outlet   ralph lauren outlet   ferragamo outlet   pandora uk   harden vol 1   canadian goose   cheap mlb jerseys   burberry sale   mbt shoes   coach outlet   ray ban sunglasses   ugg boots canada   moncler outlet   coach canada   louis vuitton   oakley sunglasses   nike outlet   polo ralph lauren outlet   canada goose sale   louboutin shoes   polo ralph lauren outlet online   cheap ray bans   cheap jordans   yeezy boost   adidas outlet   michael kors outlet   cheap jordans   tory burch outlet   louis vuitton outlet store   north face outlet online   pandora outlet   canada goose jackets   adidas superstar   cheap uggs   ugg outlet   ugg outlet   coach factory outlet   nike shoes   michael kors canada   michael kors outlet clearance   ugg outlet store   coach outlet   ugg ustralia   coach factory outlet   ray ban sunglasses discount   cheap jordans for sale   toms shoes   nmd shoes   ugg boots   michael kors outlet   uggs clearance   louis vuitton outlet online   jordans   burberry outlet   cheap nfl jerseys   kate spade handbag   toms outlet   uggs   ralph lauren uk   polo ralph lauren outlet online   moncler outlet   yeezy boost   toms shoes outlet   columbia sportswear   canada goose outlet   coach outlet   nike outlet store   coach factorty outlet   jordan shoes   toms outlet   pandora charms sale   christian louboutin outlet   adidas yeezy boost   michael kors canada   pandora charms   adidas yeezy   timberland boots   canada goose   ugg sandals   canada goose sale   ugg boots on sale   rayban   coach factory outlet   oakley sunglasses   louis vuitton outlet   coach factory outlet   longchamp uk   canada goose outlet   canada goose coats   canada goose sale   ugg   ugg outlet store   tory burch outlet   adidas shoes   cheap uggs   longchamp uk   ralph lauren outlet   mulberry bags   coach outlet online   ralph lauren sale clearance   ray ban sunglasses   christian louboutin outlet   coach factory outlet   polo ralph lauren outlet online   kate spade outlet   adidas shoes   canada goose jackets   air jordan shoes   michael kors outlet   mbt shoes   uggs outlet   louis vuitton outlet store   christian louboutin   adidas outlet   jordan retro   ugg outlet   coach outlet   ralph lauren outlet   coach outlet   cheap jordans   polo ralph lauren   ugg boots for women   canada goose sale   nike air max   north face outlet   coach factory outlet   fred perry   christian louboutin   michael kors outlet   moncler   canada goose outlet   michael kors outlet store   burberry outlet canada   canada goose uk   coach outlet store   nike shoes   discount ray ban sunglasses   toms shoes   polo ralph lauren outlet online   cheap uggs   ray ban sunglasses discount   canada goose jackets   ugg boots   valentino shoes outlet   polo ralph lauren outlet online   pandora charms sale clearance   ugg outlet   louis vuitton outlet   discount oakley sunglasses   hermes birkin   fitflops sale   red bottoms   ultra boost   coach outlet   red bottom shoes   ugg boots   coach outlet   air jordans   salvatore ferragamo shoes   hermes handbags   coach outlet   hermens bags   uggs clearance   red bottoms shoes   cheap ray ban sunglasses   cheap jordans   nfl jerseys wholesale   burberry outlet   longchamp outlet   louboutin shoes   coach outlet store   birkenstock sandals   michael kors outlet   pandora outlet   michael kors outlet   coach outlet   cheap ray bans   ugg sandals   ferragamo shoes   canada goose   michael kors outlet clearance   polo outlet   pandora jewelry   canada goose jackets   coach factory outlet   michael kors outlet store   ugg australia   ugg slippers   canada goose jackets   air max 2018   ugg sale   canada goose   ugg outlet   nike huarache   coach outlet   christian louboutin outlet   burberry outlet   gucci outlet   louis vuitton outlet   polo outlet   nike shoes   coach outlet   canada goose jackets   cheap ugg boots   nike air max   longchamp handbags   pandora jewelry outlet   kate spade outlet   burberry outlet   coach outlet store online clearances   michael kors uk   ugg shoes   the north face   cheap ray ban sunglasses   ugg shoes   michael kors outlet   coach factory outlet   kate spade outlet store   mulberry handbags   ray ban sunglasses   canada goose outlet   polo ralph lauren outlet online   michael kors outlet online   cheap ugg boots   louboutin shoes   cheap jordans free shipping   ugg boots   ray ban sunglasses   moncler outlet   pandora   michael kors handbags   coach outlet store   birkenstocks   moncler uk   north face jackets   birkenstocks   coach outlet online   moncler jackets outlet   coach outlet   ugg outlet   burberry outlet   north face jackets   canada goose jackets   ugg boots   coach factory outlet online   canada goose outlet   moncler outlet   louis vuitton factory outlet   timberland outlet   adidas nmd   ralph lauren outlet   canada goose outlet   coach factory outlet   fitflops   christian louboutin outlet   longchamp bags   coach outlet   doudoune moncler   adidas yeezy   supreme clothing   pandora charms   coach factory outlet online   ugg boots outlet   uggs   louis vuitton outlet online   kate spade handbags   nike outlet   uggs outlet   ugg outlet   coach canada   coach outlet   kate spade 2017.10.19yangping
  • 0



Reply to this topic



  



 

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Community Skin by Fredson Nunes Junior