Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Full name  >  x64 Feeds Generator  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: This is an example using file database
Class: x64 Feeds Generator
Generate cached XML feeds using templates
Author: By
Last change: Added a missing $path var
Date: 8 years ago
Size: 670 bytes
 

Contents

Class file image Download
<?php
require_once("x64_feeds.php");

$use_cachetrue;
//Cache expire is in seconds
$cache_expire=20*60;
$query_type="path";
$path='example1.php';
$title="x64 Feeds Generator Example #1";

$q=$_SERVER['QUERY_STRING'];
$format='';

if(
$query_type=='path')
{
    
$format=substr($q,0,strlen($q)-4);
}
else
{
    if(isset(
$_GET["format"]))
    
$format=$_GET["format"];
}

if(
strstr($format,"."))
die(
'ERROR: Invalid Query');

$feeds_g=new x64_feeds("example_db.php");
$check=$feeds_g->init($format);
$feeds_g->set_data($title);
$feeds_g->setup_generator(10,$path,$query_type,$use_cache,$cache_expire);

if(!
$check)
die(
'ERROR: Invalid/Unknow Format');

$feeds_g->auto_process();

?>