diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/config.php | 10 | ||||
-rwxr-xr-x | inc/functions.php | 28 |
2 files changed, 14 insertions, 24 deletions
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'; | |||
13 | include 'functions.php'; | 13 | include 'functions.php'; |
14 | require_once 'Readability.php'; | 14 | require_once 'Readability.php'; |
15 | require_once 'Encoding.php'; | 15 | require_once 'Encoding.php'; |
16 | require_once 'rain.tpl.class.php'; | ||
17 | |||
18 | $db = new db(DB_PATH); | ||
19 | |||
20 | raintpl::$tpl_dir = './tpl/'; | ||
21 | raintpl::$cache_dir = './cache/'; | ||
22 | raintpl::$base_url = get_poche_url(); | ||
23 | raintpl::configure('path_replace', false); | ||
24 | raintpl::configure('debug', false); | ||
25 | $tpl = new raintpl(); | ||
16 | ?> \ No newline at end of file | 26 | ?> \ 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 @@ | |||
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 | */ |
6 | function url() | 6 | function 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 | */ | ||
21 | function 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 |
42 | function get_external_file($url, $timeout) | 19 | function 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 | */ | ||
114 | function prepare_url($url) | 94 | function prepare_url($url) |
115 | { | 95 | { |
116 | $parametres = array(); | 96 | $parametres = array(); |