From 8046748b424f95a92ab599ecc973f57eb05246ce Mon Sep 17 00:00:00 2001 From: nicosomb Date: Mon, 15 Apr 2013 09:38:41 +0200 Subject: =?UTF-8?q?d=C3=A9coupage=20des=20vues=20dans=20plusieurs=20fichie?= =?UTF-8?q?rs=20tpl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/config.php | 10 ++++++++++ inc/functions.php | 28 ++++------------------------ 2 files changed, 14 insertions(+), 24 deletions(-) (limited to 'inc') diff --git a/inc/config.php b/inc/config.php index f9a4701e..6d8be9ee 100644 --- a/inc/config.php +++ b/inc/config.php @@ -13,4 +13,14 @@ include 'db.php'; include 'functions.php'; require_once 'Readability.php'; require_once 'Encoding.php'; +require_once 'rain.tpl.class.php'; + +$db = new db(DB_PATH); + +raintpl::$tpl_dir = './tpl/'; +raintpl::$cache_dir = './cache/'; +raintpl::$base_url = get_poche_url(); +raintpl::configure('path_replace', false); +raintpl::configure('debug', false); +$tpl = new raintpl(); ?> \ No newline at end of file diff --git a/inc/functions.php b/inc/functions.php index 0b9eb936..ffd400ef 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -3,7 +3,7 @@ /** * Permet de générer l'URL de poche pour le bookmarklet */ -function url() +function get_poche_url() { $protocol = "http"; if(isset($_SERVER['HTTPS'])) { @@ -15,29 +15,6 @@ function url() return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } -/** - * Génération de la page "vue d'un article" - */ -function generate_page($entry) -{ - raintpl::$tpl_dir = './tpl/'; - raintpl::$cache_dir = "./cache/"; - raintpl::$base_url = url(); - raintpl::configure( 'path_replace', false ); - raintpl::configure('debug', false); - - $tpl = new raintpl(); - - $tpl->assign("id", $entry['id']); - $tpl->assign("url", $entry['url']); - $tpl->assign("title", $entry['title']); - $tpl->assign("content", $entry['content']); - $tpl->assign("is_fav", $entry['is_fav']); - $tpl->assign("is_read", $entry['is_read']); - - $tpl->draw( "index"); -} - // function define to retrieve url content function get_external_file($url, $timeout) { @@ -111,6 +88,9 @@ function get_external_file($url, $timeout) } } +/** + * Préparation de l'URL avec récupération du contenu avant insertion en base + */ function prepare_url($url) { $parametres = array(); -- cgit v1.2.3