PHP Classes

File: contents/themes/simplecolor/model/rss.php

Recommend this page to a friend!
  Packages of Minh Tien   Noblesse CMS   contents/themes/simplecolor/model/rss.php   Download  
File: contents/themes/simplecolor/model/rss.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Noblesse CMS
Content management system with custom plugins
Author: By
Last change:
Date: 11 years ago
Size: 852 bytes
 

 

Contents

Class file image Download
<?php

function listRss()
{
    header("Content-Type: application/xml; charset=UTF-8");

    $location=Url::rss();

    if($match=Uri::match('^(.*?)$'))
    {
        $location=ROOT_URL.$match[1];

        $reLocation=base64_encode($location);

        if($loadData=Cache::loadKey($reLocation,60))
        {
            $loadData=json_decode($loadData,true);

            return $loadData;
        }

    }

    $inputData=array(
        'limitShow'=>15,
        'limitPage'=>0
        );


    if($match=Uri::match('\/page\/(\d+)'))
    {
        $inputData['limitPage']=$match[1];
    }
    if($match=Uri::match('\/category\/(\d+)'))
    {
        $id=$match[1];
        $inputData['where']="where catid='$id'";
    }

    if($match=Uri::match('rss\/products'))
    {
        $loadData=Products::get($inputData);
    }
    else
    {
        $loadData=Post::get($inputData);
    }

    $reLocation=base64_encode($location);

    Cache::saveKey($reLocation,json_encode($loadData));

    return $loadData;
}

?>