aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/functions.php')
-rwxr-xr-xinc/functions.php28
1 files changed, 4 insertions, 24 deletions
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 @@
3/** 3/**
4 * Permet de générer l'URL de poche pour le bookmarklet 4 * Permet de générer l'URL de poche pour le bookmarklet
5 */ 5 */
6function url() 6function get_poche_url()
7{ 7{
8 $protocol = "http"; 8 $protocol = "http";
9 if(isset($_SERVER['HTTPS'])) { 9 if(isset($_SERVER['HTTPS'])) {
@@ -15,29 +15,6 @@ function url()
15 return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 15 return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
16} 16}
17 17
18/**
19 * Génération de la page "vue d'un article"
20 */
21function generate_page($entry)
22{
23 raintpl::$tpl_dir = './tpl/';
24 raintpl::$cache_dir = "./cache/";
25 raintpl::$base_url = url();
26 raintpl::configure( 'path_replace', false );
27 raintpl::configure('debug', false);
28
29 $tpl = new raintpl();
30
31 $tpl->assign("id", $entry['id']);
32 $tpl->assign("url", $entry['url']);
33 $tpl->assign("title", $entry['title']);
34 $tpl->assign("content", $entry['content']);
35 $tpl->assign("is_fav", $entry['is_fav']);
36 $tpl->assign("is_read", $entry['is_read']);
37
38 $tpl->draw( "index");
39}
40
41// function define to retrieve url content 18// function define to retrieve url content
42function get_external_file($url, $timeout) 19function get_external_file($url, $timeout)
43{ 20{
@@ -111,6 +88,9 @@ function get_external_file($url, $timeout)
111 } 88 }
112} 89}
113 90
91/**
92 * Préparation de l'URL avec récupération du contenu avant insertion en base
93 */
114function prepare_url($url) 94function prepare_url($url)
115{ 95{
116 $parametres = array(); 96 $parametres = array();