mise en place de la release 0.7

passage pour le trunk a la version PHP 5 (voir le fichier RELEASE.fr pourplus de renseignement sur la nouvelle version de developpement)
This commit is contained in:
Leblanc Simon 2009-08-14 02:08:58 +00:00
commit 3145e721c3
286 changed files with 1971 additions and 78266 deletions

View file

@ -0,0 +1,75 @@
<?php
/**
* Abstract class for i18n
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @abstract
* @package stripit
*/
abstract class AbstractLang
{
/**
* The locale of the class
* @var string
* @access protected
*/
protected $language = 'fr-FR';
protected $suivant = "Suivant";
protected $precedent = "Précedent";
protected $premier = "Premier";
protected $dernier = "Dernier";
protected $accueil = "Accueil";
protected $contact = "Contact";
protected $rss = "RSS";
protected $licence = "Licence";
protected $boutique = "Boutique";
protected $teeshirt = "(t-shirts & cadeaux)";
protected $propulse = "Propulsé par";
protected $descstrip = "logiciel libre de gestion de webcomics en SVG";
protected $source = "source (SVG)";
protected $source_rss = "Cliquez sur l'image pour le fichier source au format SVG.";
protected $see_also = "Voir aussi :";
protected $forum = "Forum";
protected $forum_new = "Nouveau";
protected $forum_view = "Voir le sujet";
protected $forum_error = "Impossible de lire les commentaires";
protected $comments = "Commentaires";
protected $wotd = "Dernier message du webmaster";
protected $gallery = "Galerie";
/**
* Overload the method __toString for show the locale of the class
* @access public
* @return string The locale of the class
*/
public function __toString() { return $this->language; }
/*
All getter for access to protected attributes
*/
public function getSuivant() { return $this->suivant; }
public function getPrecedent() { return $this->precedent; }
public function getPremier() { return $this->premier; }
public function getDernier() { return $this->dernier; }
public function getAccueil() { return $this->accueil; }
public function getContact() { return $this->contact; }
public function getRss() { return $this->rss; }
public function getLicence() { return $this->licence; }
public function getBoutique() { return $this->boutique; }
public function getTeeshirt() { return $this->teeshirt; }
public function getPropulse() { return $this->propulse; }
public function getDescstrip() { return $this->descstrip; }
public function getSource() { return $this->source; }
public function getSourceRss() { return $this->source_rss; }
public function getSeeAlso() { return $this->see_also; }
public function getForum() { return $this->forum; }
public function getForumNew() { return $this->forum_new; }
public function getForumView() { return $this->forum_view; }
public function getForumError() { return $this->forum_error; }
public function getComments() { return $this->comments; }
public function getWotd() { return $this->wotd; }
public function getGallery() { return $this->gallery; }
}

153
inc/class/cache.class.php Normal file
View file

@ -0,0 +1,153 @@
<?php
/**
* Class for manage the cache of SVG file
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
*/
class Cache
{
/**
* The filename which use for write the php array with the cache data
* @var string
* @access protected
* @static
*/
protected static $filename = null;
/**
* This variable contain the cache for not reload always the cache with an include
* @var array
* @access protected
* @static
*/
protected static $cache = null;
/**
* This function initialize, if neccesary, the filename with the configuration
*
* @access protected
* @static
*/
protected static function init()
{
if (self::$filename === null) {
self::$filename = Config::getCacheFolder().'/'.Config::getCacheFilename();
}
}
/**
* This method obtain the cache if neccesary and return it
*
* @access public
* @static
* @return array The cache of the SVG file
* @throws Exception If the cache isn't defined an exception is throwed
*/
public static function getCache()
{
self::init();
if (file_exists(self::$filename) === false) {
return array();
}
include self::$filename;
if (isset($cache) === false) {
throw new Exception('The cache isn\'t defined!');
}
self::$cache = $cache;
return $cache;
}
/**
* This method allow to generate the cache file with all data for SVG file
*
* @access public
* @static
* @throws Exception If the cache can't be write, an exception is throwed
* @todo When PHP 5.3 is ok in most hosting, use GlobIterator and not DirectoryIterator and don't do 2 foreach and ksort
*/
public static function setCache()
{
self::init();
$directory = new DirectoryIterator(Config::getStripFolder());
$file = array();
// get all svg file
foreach ($directory as $file) {
if ($file->isDot() === true || $file->isFile() === false) {
continue;
}
$extension = pathinfo($file->getPathname(), PATHINFO_EXTENSION);
if (strtolower($extension) !== 'svg') {
continue;
}
$files[$file->getBasename()] = $file->getMTime();
}
// We must use ksort for sort the array by filename (the DirectoryIterator have his self sort :-)), in PHP 5.3, we can use GlobIterator directly
ksort($files);
$cache = '<?php $cache = array(';
foreach ($files as $name => $time) {
$cache .= '"'.str_replace('"', '\"', $name).'" => '.$time.', ';
}
$cache .= ');';
// if file wrinting fail, throw an Exception
if (file_put_contents(self::$filename, $cache) === false) {
throw new Exception('Impossible to write in the cache file : "'.self::$filename.'"');
}
}
/**
* Return the last numeric key of the cache array
*
* @access public
* @static
* @return integer the last numeric key of the cache array
*/
public static function getLastId()
{
if (self::$cache === null) {
self::getCache();
}
return (count(self::$cache) - 1);
}
/**
* Return the strip with the numeric key of the cache
*
* @access public
* @static
* @return Strip The strip wanted
*/
public static function getStrip($id = 0)
{
$last_id = self::getLastId();
// if the id of strip isn't valid, return a new strip
if ($last_id === -1 || $id > $last_id) {
return new Strip();
}
$cache_iterator = new ArrayIterator(self::$cache);
$cache_iterator->seek($id);
return Strip::getCache($cache_iterator->key());
}
}

42
inc/class/cron.class.php Normal file
View file

@ -0,0 +1,42 @@
<?php
/**
* Class for manage the job scheduler
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
*/
class Cron
{
/**
* This method is use for check if you must launch the job
*
* @access public
* @static
*/
public static function exec()
{
$cache_file = Config::getCacheFolder().'/'.Config::getCacheFilename();
if (file_exists($cache_file) === false) {
self::launch();
} else {
$cache_mtime = filemtime($cache_file);
$cache_regenerate = time() - (Config::getCacheTime() * 60);
if ($cache_mtime < $cache_regenerate) {
self::launch();
}
}
}
/**
* This method launch the job
*
* @access protected
* @static
*/
protected static function launch()
{
Strip::createCache();
}
}

76
inc/class/forum.class.php Normal file
View file

@ -0,0 +1,76 @@
<?php
/**
* Class for manage the forum integration
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
*/
class Forum
{
/**
* Return the word of the day
*
* @param Lang $lang The language object is use when the connection with forum isn't ok
* @access public
* @static
* @return string The word of the day or an error message if the connection with forum isn't ok
*/
public static function getWotd(Lang $lang)
{
$url = Config::getFluxbbForum().'/extern.php?action=new&show=1&fid='.Config::getFluxbbWotdId();
$text = file_get_contents($url);
if ($text === false) {
$text = $lang->getForumError();
} else {
$text = utf8_encode($text);
}
return $text;
}
/**
* Return the word of the day in RSS format
*
* @param Lang $lang The language object is use when the connection with forum isn't ok
* @access public
* @static
* @return string The word of the day or an error message if the connection with forum isn't ok
*/
public static function getWotdRss($lang)
{
$url = Config::getFluxbbForum().'/extern.php?action=new&show=1&type=last_rss&fid='.Config::getFluxbbWotdId();
$text = file_get_contents($url);
if ($text === false) {
$text = $lang->getForumError();
} else {
$text = utf8_encode($text);
}
return $text;
}
/**
* Return the comments for a strip
*
* @param Strip $strip The strip for which we want obtain the comments
* @param Lang $lang The language object is use when the connection with forum isn't ok
* @access public
* @static
* @return string The comments for the strip or an error message if the connection with forum isn't ok
*/
public static function getComments(Strip $strip, Lang $lang)
{
$url = Config::getFluxbbForum().'/extern.php?action=topic&ttitle='.urlencode($strip->getTitle()).'&max_subject_length='.Config::getFluxbbMaxLength();
$text = file_get_contents($url);
if ($text === false) {
$text = $lang->getForumError();
} else {
$text = utf8_encode($text);
}
return $text;
}
}

495
inc/class/strip.class.php Normal file
View file

@ -0,0 +1,495 @@
<?php
/**
* Class for manage the strip
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
*/
class Strip
{
/**
* The filename of the SVG strip
* @var string
* @access protected
*/
protected $filename = null;
/**
* The licence
* @var string
* @access protected
*/
protected $license = '';
/**
* The title
* @var string
* @access protected
*/
protected $title = '';
/**
* The author
* @var string
* @access protected
*/
protected $author = '';
/**
* The date of creation of the strip
* @var string
* @access protected
*/
protected $date = '';
/**
* The description of the strip
* @var string
* @access protected
*/
protected $description = '';
/**
* All the text contained in the SVG artwork and alternate text for image
* @var string
* @access protected
*/
protected $text = '';
/**
* The size in bytes of the SVG file
* @var integer
* @access protected
*/
protected $source_size = 0;
/**
* The constructor can be initialize and parse a SVG strip
*
* @param string $file The filename of the string (only filename, not the path)
* @param boolean $parse True if you want parse the SVG file, False else
* @access public
*/
public function __construct($file = null, $parse = false)
{
if ($file !== null) {
$this->init($file);
if ($parse === true) {
$this->parse();
}
}
}
/**
* Initialize the object with the filename
*
* @param string $file The filename of the string (only filename, not the path)
* @access protected
*/
protected function init($file)
{
$this->setFilename($file);
}
/**
* Parse the SVG file and call the setter of the object
*
* @access protected
* @todo look for resolv the problem with the namespace which change with Inkscape
*/
protected function parse()
{
$dom = new DOMDocument();
$dom->load(Config::getStripFolder().'/'.$this->getFilename());
// define the namespace use
$ns_cc = 'http://creativecommons.org/ns#';
$ns_oldcc = 'http://web.resource.org/cc/'; // Fucking inkscape, they change namespace in rev 20897, we must control the old if the new return null
$ns_dc = 'http://purl.org/dc/elements/1.1/';
$ns_rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
// The license
$license = $this->searchDomItem($dom, $ns_cc, 'license', true, $ns_rdf, 'resource');
if ($licence === null) {
$license = $this->searchDomItem($dom, $ns_oldcc, 'license', true, $ns_rdf, 'resource');
}
$this->setLicense($license);
// The title
$title = $this->searchDomItem($dom, $ns_dc, 'title', false, null, null, array($ns_cc => 'Work'));
if ($title === null) {
$title = $this->searchDomItem($dom, $ns_dc, 'title', false, null, null, array($ns_oldcc => 'Work'));
}
$this->setTitle($title);
// The author
$author = $this->searchDomItem($dom, $ns_dc, 'title', false, null, null, array($ns_cc => 'Agent', $ns_dc => 'creator'));
if ($author === null) {
$author = $this->searchDomItem($dom, $ns_dc, 'title', false, null, null, array($ns_oldcc => 'Agent', $ns_dc => 'creator'));
}
$this->setAuthor($author);
// The date
$date = $this->searchDomItem($dom, $ns_dc, 'date');
$this->setDate($date);
// The description
$description = $this->searchDomItem($dom, $ns_dc, 'description');
$this->setDescription($description);
// The text
$text = $this->searchDomItem($dom, '*', 'tspan');
$this->setText($text);
}
/**
* Create the cache for this strip
*
* @access protected
* @throws Exception If the Strip object isn't initalize an exception is throwed
* @throws Exception If the cache can't be writing an exception is throwed
*/
protected function setCache()
{
if ($this->filename === null) {
throw new Exception('This object isn\'t initialized!');
}
$cache = serialize($this);
if (file_put_contents(Config::getCacheFolder().'/'.$this->getFilename().'.php', $cache) === 0) {
throw new Exception('The cache file "'.Config::getCacheFolder.'/'.$this->getFilename().'.php" can\'t be writing');
}
}
/**
* Get the cache and return the Strip object cached
*
* @param string $file The filename of the strip (only the filename and not the path)
* @access public
* @static
* @throws Exception If the cache doesn't exist, an exception is throwed
* @return Strip The Strip object related with the cache
*/
public static function getCache($file)
{
$strip_tmp = new Strip($file);
$cache_file = Config::getCacheFolder().'/'.$strip_tmp->getFilename().'.php';
if (file_exists($cache_file) === false) {
throw new Exception('The cache for "'.$file.'" doesn\'t exist!');
}
$strip = file_get_contents($cache_file);
return unserialize($strip);
}
/**
* Create cache for one or all necessary strips
*
* @param string $file The filename of the strip for which we must regenerate cache or null if we must regenerate all cache file necessary
* @access public
* @static
*/
public static function createCache($file = null)
{
if ($file === null) {
// we must regenerate all SVG cache
$actual_cache = Cache::getCache();
Cache::setCache();
$new_cache = Cache::getCache();
$compare = array_diff($new_cache, $actual_cache);
foreach ($compare as $filename => $time) {
$strip = new Strip($filename, true);
$strip->setCache();
}
} else {
$strip = new Strip($file, true);
$strip->setCache();
}
}
/**
* Return the filename of the SVG
* @return string the filename of the SVG
* @access public
*/
public function getFilename() { return $this->filename; }
/**
* Return the license
* @return string the license
* @access public
*/
public function getLicense() { return $this->license; }
/**
* Return the title
* @return string the title
* @access public
*/
public function getTitle() { return $this->title; }
/**
* Return the author
* @return string the author
* @access public
*/
public function getAuthor() { return $this->author; }
/**
* Return the date of creation
* @param boolean $rfc True if you want the date in the RFC format, False if you want the date like in the SVG
* @return string the date of creation
* @access public
*/
public function getDate($rfc = false) { return ($rfc === true) ? date('r', strtotime($this->date)) : $this->date; }
/**
* Return the description
* @return string the description
* @access public
*/
public function getDescription() { return $this->description; }
/**
* Return the text
* @return string the text
* @access public
*/
public function getText() { return htmlentities($this->text, ENT_QUOTES, 'UTF-8'); }
/**
* Return the size of the SVG
* @return integer the size of the SVG
* @access public
*/
public function getSourceSize() { return $this->source_size; }
/**
* Return the path with filename of of the strip in PNG format
* @return string the path with filename of file of the strip in PNG format
* @access public
*/
public function getFilenamePng()
{
$filename = pathinfo(Config::getStripFolder().'/'.$this->getFilename(), PATHINFO_FILENAME);
return Config::getStripFolder().'/'.$filename.'.png';
}
/**
* Return the path with filename of file of the strip in SVG format
* @return string the path with filename of file of the strip in SVG format
* @access public
*/
public function getFilenameSrc()
{
return Config::getStripFolder().'/'.$this->getFilename();
}
/**
* Return the path with filename of thumbnail of the strip in PNG format
* @return string the path with filename of thumbnail of the strip in PNG format
* @access public
*/
public function getThumbSrc()
{
$original = $this->getFilenamePng();
$dest = Config::getThumbFolder().'/'.pathinfo(Config::getStripFolder().'/'.$this->getFilename(), PATHINFO_FILENAME).'.png';
if (createThumb($original, $dest) === true) {
return $dest;
} else {
return $original;
}
}
/**
* Setter for the filename
* @param string $file The filename
* @throws Exception If the file doesn't exist an exception is throwed
* @access public
*/
protected function setFilename($file)
{
if (file_exists(Config::getStripFolder().'/'.$file) === false) {
throw new Exception('The filename "'.$file.'" isn\'t a valid file!');
}
$this->filename = $file;
$this->setSourceSize();
}
/**
* Setter for the license
* @param string $file The license
* @access public
*/
public function setLicense($license)
{
if (is_string($license) === false) {
$license = (string) $license;
}
$this->license = $license;
}
/**
* Setter for the license
* @param string $file The license
* @access public
*/
protected function setTitle($title)
{
if (is_string($title) === false) {
$title = (string) $title;
}
$this->title = $title;
}
/**
* Setter for the author
* @param string $file The author
* @access public
*/
protected function setAuthor($author)
{
if (is_string($author) === false) {
$author = (string) $author;
}
$this->author = $author;
}
/**
* Setter for the date
* @param string $file The date
* @access public
*/
protected function setDate($date)
{
if (is_string($date) === false) {
$date = (string) $date;
}
$this->date = $date;
}
/**
* Setter for the description
* @param string $file The description
* @access public
*/
protected function setDescription($description)
{
if (is_string($description) === false) {
$description = (string) $description;
}
$this->description = $description;
}
/**
* Setter for the text
* @param string $file The text
* @access public
*/
protected function setText($text)
{
if (is_string($text) === false) {
$text = (string) $text;
}
$this->text = $text;
}
/**
* Setter for the source_size
* @access public
*/
protected function setSourceSize()
{
$this->source_size = filesize($this->getFilenameSrc());
}
/**
* Return the value search in the SVG
*
* @param DOMDocument $dom The DOMDocument object of the SVG
* @param string $namespace The namespace where you want search
* @param string $item The item search
* @param boolean $search_attribute True if you want the value of an attribute, False if you want the content
* @param string $attribute_namespace The namespace of the attribute where you want search
* @param string $attribute_name The attribute search
* @param array $parents The list (namespace and item) of the parent for get the value of only one item which exist more than one
* @access public
* @return string The value of your search (null if doesn't exist)
* @todo decompose this method to have one method by type of search
*/
protected function searchDomItem(DOMDocument $dom, $namespace, $item, $search_attribute = false, $attribute_namespace = null, $attribute_name = null, $parents = array())
{
$items = $dom->getElementsByTagNameNS($namespace, $item);
if ($items->length === 1) {
// there are only one element with $namespace and $item
$item = $items->item(0);
if ($search_attribute === false) {
// we want the content of node
return $item->textContent;
} else {
// we want the value of one attribute
$attributes = $item->attributes;
if ($attributes === null) {
return null;
}
$attr = $attributes->getNamedItemNS($attribute_namespace, $attribute_name);
return $attr->nodeValue;
}
} elseif ($items->length > 1) {
if (count($parents) === 0) {
// we want a return with all content of the elements
$return_value = '';
for ($i = 0; $i < $items->length; $i++) {
$return_value .= $items->item($i)->textContent.' ';
}
return $return_value;
} else {
// we want check the parent for return only the content of one element
for ($i = 0; $i < $items->length; $i++) {
$item = $items->item($i);
$parent = $item->parentNode;
foreach ($parents as $namespace => $local_name) {
if ($parent->namespaceURI !== $namespace || $parent->localName !== $local_name) {
continue 2;
}
$parent = $parent->parentNode;
}
return $item->textContent;
}
return null;
}
} else {
return null;
}
}
}

239
inc/config/config.php Normal file
View file

@ -0,0 +1,239 @@
<?php
/**
* Class for manage the configuration
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
* @todo outsource the method to have only the attribute in this file (for more visibility), maybe with interface and abstract class ?
*/
class Config
{
/**
* Software version
* @var string
* @access protected
*/
protected static $version = '0.8b';
/**
* URL of the website
* @var string
* @access protected
*/
protected static $url = 'http://localhost/projects/stripit_php5';
/**
* Name of the index page
* @var string
* @access protected
*/
protected static $index = 'index.php';
/**
* Name of the gallery page
* @var string
* @access protected
*/
protected static $gallery = 'gallery.php';
/**
* Title of the website
* @var string
* @access protected
*/
protected static $title = 'Stripit PHP5';
/**
* Default language of the interface
* @var string
* @access protected
*/
protected static $language = 'fr-FR';
/**
* Short description - Is displayed as a subtitle
* @var string
* @access protected
*/
protected static $description = 'Ce serait mieux avec des strips libres !';
/**
* Webmaster's name
* @var string
* @access protected
*/
protected static $webmaster = 'inconnnu';
/**
* Webmaster's email
* @var string
* @access protected
*/
protected static $email = 'root@example.com';
/**
* Additional URL
* @var array
* @access protected
*/
protected static $see_also = array(
'Geekscottes' => 'http://www.nojhan.net/geekscottes',
);
/**
* Shop URL
* @var string
* @access protected
*/
protected static $shop = 'http://perdu.com';
/**
* The cache directory path
* @var string
* @access protected
*/
protected static $cache_folder = './cache';
/**
* The filename of cache for list of strip
* @var string
* @access protected
*/
protected static $cache_filename = 'cache.php';
/**
* The cache time before regenerated the new cache
* @var integer
* @access protected
*/
protected static $cache_time = 1440; // in minutes : 1440 = 1 day
/**
* HTML template folder
* @var string
* @access protected
*/
protected static $template_folder = './inc/tpl';
/**
* Name of HTML template
* @var string
* @access protected
*/
protected static $template_name = 'lego';
/**
* Name of RSS template
* @var string
* @access protected
*/
protected static $template_rss = 'rss';
/**
* Diretory path for the strips
* @var string
* @access protected
*/
protected static $strip_folder = './strips';
/**
* Number of thumbnails per gallery page
* @var integer
* @access protected
*/
protected static $thumbs_per_page = 5;
/**
* Size of the thumbnails
* @var integer
* @access protected
*/
protected static $thumb_size = 200;
/**
* Diretory path for the strips thumbnails
* @var string
* @access protected
*/
protected static $thumb_folder = './strips/th';
/**
* Use FluxBB integration ?
* @var boolean
* @access protected
*/
protected static $use_fluxbb = true;
/**
* FluxBB's forum ID to use for strips comment
* @var integer
* @access protected
*/
protected static $fluxbb_forum_id = 1;
/**
* FluxBB's forum ID to use for word of the day
* @var integer
* @access protected
*/
protected static $fluxbb_wotd_id = 2;
/**
* FluxBB's forum max length for the message
* @var integer
* @access protected
*/
protected static $fluxbb_max_length = 128;
/**
* Forum URL
* @var string
* @access protected
*/
protected static $fluxbb_forum = 'http://localhost/projects/fluxbb-1.2.21/upload';
/*
All getter for access to protected attributes
*/
public static function getVersion() { return self::$version; }
public static function getUrl() { return self::$url; }
public static function getIndex() { return self::$index; }
public static function getGallery() { return self::$gallery; }
public static function getTitle() { return self::$title; }
public static function getLanguage() { return self::$language; }
public static function getDescription() { return self::$description; }
public static function getWebmaster() { return self::$webmaster; }
public static function getEmail() { return self::$email; }
public static function getSeeAlso() { return self::$see_also; }
public static function getShop() { return self::$shop; }
public static function getUseCache() { return self::$use_cache; }
public static function getCacheFolder() { return self::$cache_folder; }
public static function getCacheFilename() { return self::$cache_filename; }
public static function getCacheTime() { return self::$cache_time; }
public static function getTemplateFolder() { return self::$template_folder; }
public static function getTemplateName() { return self::$template_name; }
public static function getTemplateRss() { return self::$template_rss; }
public static function getStripFolder() { return self::$strip_folder; }
public static function getThumbsPerPage() { return self::$thumbs_per_page; }
public static function getThumbSize() { return self::$thumb_size; }
public static function getThumbFolder() { return self::$thumb_folder; }
public static function getUseFluxbb() { return self::$use_fluxbb; }
public static function getFluxbbForumId() { return self::$fluxbb_forum_id; }
public static function getFluxbbWotdId() { return self::$fluxbb_wotd_id; }
public static function getFluxbbMaxLength() { return self::$fluxbb_max_length; }
public static function getFluxbbForum() { return self::$fluxbb_forum; }
}

194
inc/functions.php Normal file
View file

@ -0,0 +1,194 @@
<?php
/**
* This file contains the main functions
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
*/
/**
* Overload the autoload for don't use the require or include in the main PHP file
*
* @param string $class_name The name of the class to load
*/
function __autoload($class_name)
{
if ($class_name === 'Config') {
require_once dirname(__FILE__).'/config/config.php';
} else {
require_once dirname(__FILE__).'/class/'.strtolower($class_name).'.class.php';
}
}
/**
* Return the Lang object initialized the language wanted
* If the language wanted doesn't exist, we use the default language
*
* @param string $culture The i18n code of the language
* @return Lang the Lang object initialized the language wanted
*/
function getLang($culture)
{
$filename = dirname(__FILE__).'/lang/'.$culture.'.php';
if (file_exists($filename) === false) {
$filename = dirname(__FILE__).'/lang/'.Config::getLanguage().'.php';
}
require_once $filename;
return new Lang();
}
/**
* Return an array with all navigation link
*
* @param integer $id The id of the actual strip
* @param integer $last The last id of the strip cache
* @param Lang $lang The Lang object use for the actual user
* @return array An array with the navigation link : array(first, last, previous, next, gallery)
*/
function getNavigation($id, $last, Lang $lang)
{
$url = Config::getUrl().'/'.Config::getIndex().'?id=';
$nav_lang = '';
if (isset($_GET['lang'])) {
$nav_lang = '&lang='.$lang;
}
$return[0] = $url.'0'.$nav_lang;
$return[1] = $url.$last.$nav_lang;
if ($id != 0) {
$return[2] = $url.($id - 1).$nav_lang;
} else {
$return[2] = $url.'0'.$nav_lang;
}
if ($id != $last) {
$return[3] = $url.($id + 1).$nav_lang;
} else {
$return[3] = $url.$last.$nav_lang;
}
$return[4] = Config::getUrl().'/'.Config::getGallery().'?page='.floor($id / Config::getThumbsPerPage()).'&limit='.Config::getThumbsPerPage().$nav_lang;
return $return;
}
/**
* Return an array with all navigation link
*
* @param integer $page The actual page number of the gallery
* @param integer $last_page The last page of the gallery
* @param integer $limit The number of strip in one page
* @param Lang $lang The Lang object use for the actual user
* @return array An array with the navigation link : array(first, last, previous, next)
*/
function getNavigationGallery($page, $last_page, $limit, Lang $lang)
{
$url = Config::getUrl().'/'.Config::getGallery().'?limit='.$limit.'&page=';
$nav_lang = '';
if (isset($_GET['lang'])) {
$nav_lang = '&lang='.$lang;
}
$return[0] = $url.'0'.$nav_lang;
$return[1] = $url.$last_page.$nav_lang;
if ($page != 0) {
$return[2] = $url.($page - 1).$nav_lang;
} else {
$return[2] = $url.'0'.$nav_lang;
}
if ($page != $last_page) {
$return[3] = $url.($page + 1).$nav_lang;
} else {
$return[3] = $url.$last_page.$nav_lang;
}
return $return;
}
/**
* This function check if a directory exist or create it
*
* @param string $dir The directory path to check
* @return boolean True if the directory exist, False if the directory doesn't exist and fail to create
*/
function checkDirAndCreate($dir)
{
if (is_dir($dir) === false) {
// create the directory
return mkdir($dir, '0777', true);
}
return true;
}
/**
* This function create, if necessary, an thumbnail of a strip
*
* @param string $src The original path of strip
* @param string $dest The thumbnail path of strip
* @throws Exception If the folder for the thumbnail doesn't exist, an exception is throwed
* @return boolean True if the thumbnail is created, False else
*/
function createThumb($src, $dest)
{
// check if the thumb exist
if (file_exists($dest) === true) {
$original_time = filemtime($src);
$thumbnail_time = filemtime($dest);
// if the thumb is created after the original, it's ok
if ($original_time < $thumbnail_time) {
return true;
}
}
// check if the directory for thumbnail exist or create it
if (checkDirAndCreate(Config::getThumbFolder()) === false) {
throw new Exception('Impossible to create thumbs folder : "'.Config::getThumbFolder().'"');
}
// calculate the width and height of thumbnail
$width = Config::getThumbSize();
$size = getimagesize($src);
if ($size[0] > $width) {
$rapport = $size[0] / $width;
$height = $size[1] / $rapport;
} else {
$width = $size[0];
$height = $size[1];
}
$img_src = imagecreatefrompng($src);
$img_dst = imagecreatetruecolor($width, $height);
// Preserve alpha transparency : thank crash <http://www.php.net/manual/fr/function.imagecopyresampled.php#85038>
imagecolortransparent($img_dst, imagecolorallocate($img_dst, 0, 0, 0));
imagealphablending($img_dst, false);
imagesavealpha($img_dst, true);
$res = imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
if (!$res) {
return false;
}
$res = imagepng($img_dst, $dest);
if (!$res) {
return false;
}
return true;
}

44
inc/lang/en-EN.php Normal file
View file

@ -0,0 +1,44 @@
<?php
/**
* The class for the english language
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
* @see AbstractLang
*/
class Lang extends AbstractLang
{
/**
* We initialize the attributes of the abstract class with the good language
*
* @access public
*/
public function __construct()
{
$this->language = 'en-EN';
$this->suivant = "Next";
$this->precedent = "Previous";
$this->premier = "First";
$this->dernier = "Last";
$this->accueil = "Index";
$this->contact = "Contact";
$this->rss = "RSS";
$this->licence = "License";
$this->boutique = "Shop";
$this->teeshirt = "(t-shirts & gifts)";
$this->propulse = "Powered by";
$this->descstrip = "free software for SVG webcomics management";
$this->source = "source (SVG)";
$this->source_rss = "Click on the image for the source file in the SVG format.";
$this->see_also = "See also:";
$this->forum = "Forum";
$this->forum_new = "New";
$this->forum_view = "Show the topic";
$this->forum_error = "Cannot read comments";
$this->comments = "Comments";
$this->wotd = "Word of the day";
$this->gallery = "Gallery";
}
}

44
inc/lang/fr-FR.php Normal file
View file

@ -0,0 +1,44 @@
<?php
/**
* The class for the french language
*
* @license http://www.gnu.org/licenses/gpl.html GPL
* @copyright 2009 Johann Dréo, Simon Leblanc
* @package stripit
* @see AbstractLang
*/
class Lang extends AbstractLang
{
/**
* We initialize the attributes of the abstract class with the good language
*
* @access public
*/
public function __construct()
{
$this->language = 'fr-FR';
$this->suivant = "Suivant";
$this->precedent = "Précedent";
$this->premier = "Premier";
$this->dernier = "Dernier";
$this->accueil = "Accueil";
$this->contact = "Contact";
$this->rss = "RSS";
$this->licence = "Licence";
$this->boutique = "Boutique";
$this->teeshirt = "(t-shirts & cadeaux)";
$this->propulse = "Propulsé par";
$this->descstrip = "logiciel libre de gestion de webcomics en SVG";
$this->source = "source (SVG)";
$this->source_rss = "Cliquez sur l'image pour le fichier source au format SVG.";
$this->see_also = "Voir aussi :";
$this->forum = "Forum";
$this->forum_new = "Nouveau";
$this->forum_view = "Voir le sujet";
$this->forum_error = "Impossible de lire les commentaires";
$this->comments = "Commentaires";
$this->wotd = "Dernier message du webmaster";
$this->gallery = "Galerie";
}
}

126
inc/tpl/functions.js Normal file
View file

@ -0,0 +1,126 @@
var actual_id = 0;
/**
* Create an Ajax instance
*
* @return XMLHttpRequest Object The XMLHttpRequest object
*/
function instance_ajax()
{
var xhr;
try {
xhr = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
try {
xhr = new ActiveXObject('Microsoft.XMLHTTP');
} catch (e2) {
try {
xhr = new XMLHttpRequest();
} catch (e3) {
xhr = false;
}
}
}
return xhr;
}
function getStrip(link)
{
var xhr = instance_ajax();
var page = link.href + '&ajax=1';
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
var docXml, item, nb_item, i, id, value, select, icone;
docXml = xhr.responseXML.documentElement;
item = docXml.getElementsByTagName('item');
nb_item = item.length;
for(i = 0; i < nb_item; i++){
// image url
id = item[i].getAttribute('id');
value = getNodeValue(item[i]);
switch (id) {
case 'png':
document.getElementById('strip').src = value;
break;
case 'text':
document.getElementById('strip').alt = value;
break;
case 'title':
document.getElementById('title').innerHTML = '&laquo;&nbsp;' + value + '&nbsp;&raquo;';
break;
case 'description':
document.getElementById('description').innerHTML = value;
break;
case 'comments':
document.getElementById('comments').innerHTML = value;
break;
case 'author':
document.getElementById('author').innerHTML = '&copy; ' + value;
break;
case 'date':
document.getElementById('date').innerHTML = value;
break;
case 'license':
document.getElementById('link_license').innerHTML = value;
document.getElementById('link_license').href = value;
break;
case 'source':
document.getElementById('link_source').href = value;
break;
case 'navfirst':
document.getElementById('t_navfirst').href = value;
document.getElementById('b_navfirst').href = value;
break;
case 'navprev':
document.getElementById('t_navprev').href = value;
document.getElementById('b_navprev').href = value;
break;
case 'navnext':
document.getElementById('t_navnext').href = value;
document.getElementById('b_navnext').href = value;
break;
case 'navlast':
document.getElementById('t_navlast').href = value;
document.getElementById('b_navlast').href = value;
break;
case 'navgallery':
document.getElementById('t_navgallery').href = value;
document.getElementById('b_navgallery').href = value;
break;
case 'nav_forum_post':
document.getElementById('nav_forum_post').href = value;
break;
case 'nav_forum_view':
document.getElementById('nav_forum_view').href = value;
break;
}
}
}
}
xhr.open('GET', page, true);
xhr.send(null);
}
/**
* Fonction permettant de ©cupèrer la valeur d'un noeud XML quelque soit le navigateur
*
* @param DOM Object node Le noeud sur lequel on travaille
*/
function getNodeValue(node)
{
var return_value = null;
return_value = node.textContent;
if(return_value == undefined){
// On a à faire à un IE, donc on fait le boulot de Microsoft : on le debugge
return_value = node.firstChild.nodeValue;
}
return return_value;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

92
inc/tpl/lego/gallery.html Normal file
View file

@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title><?php echo $config->getTitle() ?></title>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" />
<meta name=" robot" content="follow, index, all" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.php" />
<link rel="alternate" type="application/rss+xml" title="RSS: 10 items" href="rss.php?limit=10" />
<link rel="stylesheet" type="text/css" href="<?php echo $config->getTemplateFolder() ?>/<?php echo $config->getTemplateName() ?>/style.css" />
<link rel="icon" type="image/png" href="favicon.png" />
</head>
<body>
<!-- HEAD -->
<div id="head">
<span id="title_block" class="head_block">
<h1 id="site_title"><?php echo $config->getTitle() ?></h1>
<p id="site_desc"><?php echo $config->getDescription() ?></p>
<span id="site_wotd">
<p id="wotd_title"><?php echo $lang->getWotd() ?>:</p>
<ul id="wotd_text"><?php echo $wotd ?></ul>
</span>
</span>
<span id="site_block" class="head_block">
<ul id="site_map">
<li><a href=".."><?php echo $lang->getAccueil() ?></a></li>
<li><a href="<?php echo $config->getFluxbbForum() ?>"><?php echo $lang->getForum() ?></a></li>
<li><a href="<?php echo $config->getShop() ?>"><?php echo $lang->getBoutique() ?></a></li>
<li><a href="mailto:<?php echo $config->getEmail() ?>"><?php echo $lang->getContact() ?></a></li>
</ul>
</span>
<div id="feed_block" class="head_block">
<ul id="feed_list">
<li><a class="feed" id="feed_main" href="rss.php"><?php echo $lang->getRss() ?></a></li>
<li><a class="feed" href="rss.php?limit=10">10</a></li>
</ul>
</div>
</div>
<!-- NAV -->
<ul class="nav_bar" id="nav_top">
<li><a id="navfirst" href="<?php echo $nav_first ?>"><?php echo $lang->getPremier() ?></a></li>
<li><a id="navprev" href="<?php echo $nav_prev ?>"><?php echo $lang->getPrecedent() ?></a></li>
<li><a id="navnext" href="<?php echo $nav_next ?>"><?php echo $lang->getSuivant() ?></a></li>
<li><a id="navlast" href="<?php echo $nav_last ?>"><?php echo $lang->getDernier() ?></a></li>
</ul>
<!-- STRIP -->
<div id="strip_block">
<?php foreach ($list as $id => $strip) { ?>
<div class="shadow">
<a href="<?php echo $nav_img.$id ?>">
<img class="stripbox" src="<?php echo $strip->getThumbSrc() ?>" title="<?php echo $strip->getTitle() ?>" style="width:<?php echo $config->getThumbSize() ?>px;" />
</a>
</div>
<?php } ?>
</div>
<!-- NAV -->
<ul class="nav_bar" id="nav_bottom">
<li><a id="navfirst" href="<?php echo $nav_first ?>"><?php echo $lang->getPremier() ?></a></li>
<li><a id="navprev" href="<?php echo $nav_prev ?>"><?php echo $lang->getPrecedent() ?></a></li>
<li><a id="navnext" href="<?php echo $nav_next ?>"><?php echo $lang->getSuivant() ?></a></li>
<li><a id="navlast" href="<?php echo $nav_last ?>"><?php echo $lang->getDernier() ?></a></li>
</ul>
<!-- FOOT -->
<div id="foot">
<p><?php echo $lang->getSeeAlso() ?>
<ul id="link_bar">
<?php foreach ($config->getSeeAlso() as $name => $url) { ?>
<li><a href="<?php echo $url ?>"><?php echo $name ?></a></li>
<?php } ?>
</ul>
</p>
<p><?php echo $lang->getPropulse() ?> <a href="http://stripit.sourceforge.net/">Strip-it</a>, <?php echo $lang->getDescstrip() ?> (<?php echo $config->getVersion() ?>).</p>
</div>
</body>
</html>

207
inc/tpl/lego/style.css Normal file
View file

@ -0,0 +1,207 @@
html {
margin:0px;
padding:0px;
}
body {
background-color:black;
margin:0px;
padding:0px;
}
a {
color:white;
font-weight:bold;
}
a:hover {
}
.spacer {
clear:right;
}
/* HEAD */
#head {
}
.head_block {
float:left;
height:113px;
padding:0.5em;
margin:0 1% 0 0.5%;
-moz-border-radius:10px;
background-position:bottom left;
}
#title_block {
width:60%;
background-image:url("design/gradient_blue.png");
background-color:#5276dd;
}
#site_block {
text-align:center;
width:15%;
background-color:#9652dd;
background-image:url("design/gradient_purple.png");
background-color:#9052dd;
vertical-align:middle;
}
#site_wotd {
text-align:right;
color:white;
position:absolute;
top:1em;
right:40%;
font-size:small;
}
#wotd_title {
font-style:italic;
}
ul#wotd_text {
list-style:none;
}
ul#site_map {
list-style:none;
padding:0px;
margin-top:20px;
}
#feed_block {
text-align:center;
width:15%;
background-image:url("design/gradient_orange.png");
background-color:#ff8400;
}
#feed_list {
background-image:url("design/rss_big.png");
background-repeat:no-repeat;
background-position:right bottom;
padding-right:95px;
padding-top:45px;
margin:0px;
list-style:none;
}
ul#feed_list>li {
margin:0px;
}
h1#site_title {
color:white;
}
#site_desc {
color:white;
font-size:small;
}
/* NAV */
ul.nav_bar {
list-style:none;
text-align:center;
padding-top:170px;
margin-bottom:10px;
}
ul.nav_bar>li {
display:inline;
margin-left:5px;
margin-bottom:0px;
padding:10px;
background-image:url("design/gradient_gray_small_2.png");
background-position:bottom;
}
#nav_bottom {
margin:0px;
margin-top:10px;
padding:0px;
}
ul#nav_bottom>li {
background-image:url("design/gradient_gray_small.png");
background-position:top;
}
/* STRIP */
#strip_block {
background-color:white;
-moz-border-radius:20px;
width: 900px;
margin-left: auto;
margin-right: auto;
margin-top:0px;
text-align:center;
padding:10px;
}
img#strip {
border:thin solid black;
background-color:white;
margin-top:1em;
margin-bottom:1em;
}
.sub_block {
text-align:left;
-moz-border-radius:10px;
margin:10px;
padding:10px;
width:400px;
}
#meta_block {
}
#info_block {
background-color:#5276dd;
color:white;
}
#info_plus_block {
background-color:#5276dd;
color:white;
font-size:small;
}
#comments_block {
background-color:#99aeeb;
}
.stripbox {
}
/* FOOT */
#foot {
background-image:url("design/gradient_gray.png");
background-color:black;
background-position:bottom;
color:white;
text-align:center;
padding:0.2em;
margin:1%;
}
ul#link_bar {
list-style:none;
}
ul#link_bar>li {
display:inline;
margin-left:1em;
}

120
inc/tpl/lego/template.html Normal file
View file

@ -0,0 +1,120 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title><?php echo $config->getTitle() ?> - <?php echo $strip->getTitle() ?></title>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" />
<meta name=" robot" content="follow, index, all" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.php" />
<link rel="alternate" type="application/rss+xml" title="RSS: 10 items" href="rss.php?limit=10" />
<link rel="stylesheet" type="text/css" href="<?php echo $config->getTemplateFolder() ?>/<?php echo $config->getTemplateName() ?>/style.css" />
<link rel="icon" type="image/png" href="favicon.png" />
<script type="text/javascript" src="<?php echo $config->getTemplateFolder() ?>/functions.js"></script>
<script type="text/javascript">
actual_id = <?php echo $id ?>;
</script>
</head>
<body>
<!-- HEAD -->
<div id="head">
<span id="title_block" class="head_block">
<h1 id="site_title"><?php echo $config->getTitle() ?></h1>
<p id="site_desc"><?php echo $config->getDescription() ?></p>
<span id="site_wotd">
<p id="wotd_title"><?php echo $lang->getWotd() ?>:</p>
<ul id="wotd_text"><?php echo $wotd ?></ul>
</span>
</span>
<span id="site_block" class="head_block">
<ul id="site_map">
<li><a href=".."><?php echo $lang->getAccueil() ?></a></li>
<li><a href="<?php echo $config->getFluxbbForum() ?>"><?php echo $lang->getForum() ?></a></li>
<li><a href="<?php echo $config->getShop() ?>"><?php echo $lang->getBoutique() ?></a></li>
<li><a href="mailto:<?php echo $config->getEmail() ?>"><?php echo $lang->getContact() ?></a></li>
</ul>
</span>
<div id="feed_block" class="head_block">
<ul id="feed_list">
<li><a class="feed" id="feed_main" href="rss.php"><?php echo $lang->getRss() ?></a></li>
<li><a class="feed" href="rss.php?limit=10">10</a></li>
</ul>
</div>
</div>
<!-- NAV -->
<ul class="nav_bar" id="nav_top">
<li><a id="t_navfirst" href="<?php echo $nav_first ?>" onclick="getStrip(this); return false;"><?php echo $lang->getPremier() ?></a></li>
<li><a id="t_navprev" href="<?php echo $nav_prev ?>" onclick="getStrip(this); return false;"><?php echo $lang->getPrecedent() ?></a></li>
<li><a id="t_navnext" href="<?php echo $nav_next ?>" onclick="getStrip(this); return false;"><?php echo $lang->getSuivant() ?></a></li>
<li><a id="t_navlast" href="<?php echo $nav_last ?>" onclick="getStrip(this); return false;"><?php echo $lang->getDernier() ?></a></li>
<li><a id="t_navgallery" href="<?php echo $nav_gallery ?>"><?php echo $lang->getGallery() ?></a></li>
</ul>
<!-- STRIP -->
<div id="strip_block">
<img id="strip" class="content" src="<?php echo $strip->getFilenamePng() ?>" alt="<?php echo $strip->getText() ?>" />
<table id="meta_block" cellpadding="0" cellspacing="20">
<tr>
<td id="info_block" class="sub_block">
<h2 id="title">&laquo;&nbsp;<?php echo $strip->getTitle() ?>&nbsp;&raquo;</h2>
<p id="description"><?php echo $strip->getDescription() ?></p>
</td>
<td rowspan="2" id="comments_block" class="sub_block" valign="top">
<?php echo $lang->getComments() ?> :
<ul id="comments">
<?php echo $comments ?>
</ul>
<a id="nav_forum_post" href="<?php echo $nav_forum_post ?>"><?php echo $lang->getForumNew() ?></a>&nbsp;|&nbsp;
<a id="nav_forum_view" href="<?php echo $nav_forum_view ?>"><?php echo $lang->getForumView() ?></a>
</td>
</tr>
<tr>
<td id="info_plus_block" class="sub_block">
<p id="author">&copy; <?php echo $strip->getAuthor() ?></p>
<p id="date"><?php echo $strip->getDate() ?></p>
<p id="source"><a id="link_source" href="<?php echo $strip->getFilenameSrc() ?>"><?php echo $lang->getSource() ?></a></p>
<p id="license"><?php echo $lang->getLicence() ?> : <a id="link_license" href="<?php echo $strip->getLicense() ?>"><?php echo $strip->getLicense() ?></a></p>
</td>
</tr>
</table>
</div>
<!-- NAV -->
<ul class="nav_bar" id="nav_bottom">
<li><a id="b_navfirst" href="<?php echo $nav_first ?>" onclick="getStrip(this); return false;"><?php echo $lang->getPremier() ?></a></li>
<li><a id="b_navprev" href="<?php echo $nav_prev ?>" onclick="getStrip(this); return false;"><?php echo $lang->getPrecedent() ?></a></li>
<li><a id="b_navnext" href="<?php echo $nav_next ?>" onclick="getStrip(this); return false;"><?php echo $lang->getSuivant() ?></a></li>
<li><a id="b_navlast" href="<?php echo $nav_last ?>" onclick="getStrip(this); return false;"><?php echo $lang->getDernier() ?></a></li>
<li><a id="b_navgallery" href="<?php echo $nav_gallery ?>"><?php echo $lang->getGallery() ?></a></li>
</ul>
<!-- FOOT -->
<div id="foot">
<p><?php echo $lang->getSeeAlso() ?>
<ul id="link_bar">
<?php foreach ($config->getSeeAlso() as $name => $url) { ?>
<li><a href="<?php echo $url ?>"><?php echo $name ?></a></li>
<?php } ?>
</ul>
</p>
<p><?php echo $lang->getPropulse() ?> <a href="http://stripit.sourceforge.net/">Strip-it</a>, <?php echo $lang->getDescstrip() ?> (<?php echo $config->getVersion() ?>).</p>
</div>
</body>
</html>

47
inc/tpl/rss/template.rss Normal file
View file

@ -0,0 +1,47 @@
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<atom:link href="<?php echo $config->getUrl() ?>/rss.php" rel="self" type="application/rss+xml" />
<title><![CDATA[<?php echo $config->getTitle() ?>]]></title>
<link><?php echo $config->getUrl() ?></link>
<ttl>1440</ttl>
<description><![CDATA[<?php echo $config->getDescription() ?>]]></description>
<language><?php echo $lang ?></language>
<generator>http://stripit.sourceforge.net</generator>
<image>
<url><?php echo $config->getUrl() ?>/favicon.png</url>
<title><![CDATA[<?php echo $config->getTitle() ?>]]></title>
<link><?php echo $config->getUrl() ?></link>
</image>
<managingEditor><![CDATA[<?php echo $config->getEmail() ?> (<?php echo $config->getWebmaster() ?>)]]></managingEditor>
<webMaster><![CDATA[<?php echo $config->getEmail() ?> (<?php echo $config->getWebmaster() ?>)]]></webMaster>
<copyright><![CDATA[Copyright <?php echo $config->getWebmaster() ?>]]></copyright>
<docs>http://cyber.law.harvard.edu/rss/</docs>
<?php echo $wotd ?>
<?php foreach ($list as $id => $strip) { ?>
<item>
<title><![CDATA[<?php echo $strip->getTitle() ?>]]></title>
<link><?php echo $nav_img.$id ?></link>
<guid isPermaLink="true"><?php echo $config->getUrl().'/'.$strip->getFilenameSrc() ?></guid>
<enclosure url="<?php echo $config->getUrl().'/'.$strip->getFilenameSrc() ?>" type="image/svg+xml" length="<?php echo $strip->getSourceSize() ?>" />
<pubDate><?php echo $strip->getDate(true) ?></pubDate>
<author><![CDATA[<?php echo $strip->getAuthor() ?>]]></author>
<description><![CDATA[
<a title="<?php echo $lang->getSourceRss() ?>" href="<?php echo $nav_img.$id ?>">
<img src="<?php echo $config->getUrl().'/'.$strip->getFilenamePng() ?>" alt="<?php echo $strip->getText() ?>" />
</a>
<p><?php echo $strip->getdescription() ?><p>
<p><?php echo $lang->getlicence() ?> : <a href="<?php echo $strip->getLicense() ?>"><?php echo $strip->getLicense() ?></a><p>
<a href="<?php echo $config->getFluxbbForum() ?>"><?php echo $lang->getForum() ?></a>
<a href="<?php echo $config->getShop() ?>"><?php echo $lang->getBoutique() ?></a>
]]></description>
</item>
<?php } ?>
</channel>
</rss>

19
inc/tpl/stripit.xml Normal file
View file

@ -0,0 +1,19 @@
<?php echo '<?xml version="1.0"?>' ?>
<root>
<item id="png"><![CDATA[<?php echo $strip->getFilenamePng() ?>]]></item>
<item id="text"><![CDATA[<?php echo $strip->getText() ?>]]></item>
<item id="title"><![CDATA[<?php echo $strip->getTitle() ?>]]></item>
<item id="description"><![CDATA[<?php echo $strip->getDescription() ?>]]></item>
<item id="comments"><![CDATA[<?php echo $comments ?>]]></item>
<item id="author"><![CDATA[<?php echo $strip->getAuthor() ?>]]></item>
<item id="date"><![CDATA[<?php echo $strip->getDate() ?>]]></item>
<item id="license"><![CDATA[<?php echo $strip->getLicense() ?>]]></item>
<item id="source"><![CDATA[<?php echo $strip->getFilenameSrc() ?>]]></item>
<item id="navfirst"><![CDATA[<?php echo $nav_first ?>]]></item>
<item id="navprev"><![CDATA[<?php echo $nav_prev ?>]]></item>
<item id="navnext"><![CDATA[<?php echo $nav_next ?>]]></item>
<item id="navlast"><![CDATA[<?php echo $nav_last ?>]]></item>
<item id="navgallery"><![CDATA[<?php echo $nav_gallery ?>]]></item>
<item id="nav_forum_post"><![CDATA[<?php echo $nav_forum_post ?>]]></item>
<item id="nav_forum_view"><![CDATA[<?php echo $nav_forum_view ?>]]></item>
</root>