diff options
-rwxr-xr-x | inc/functions.php | 4 | ||||
-rwxr-xr-x | readityourself.php | 22 |
2 files changed, 3 insertions, 23 deletions
diff --git a/inc/functions.php b/inc/functions.php index 9d321c67..6fa5a17a 100755 --- a/inc/functions.php +++ b/inc/functions.php | |||
@@ -1,6 +1,6 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | function url(){ | 3 | function url() { |
4 | $protocol = "http"; | 4 | $protocol = "http"; |
5 | if(isset($_SERVER['HTTPS'])) | 5 | if(isset($_SERVER['HTTPS'])) |
6 | if($_SERVER['HTTPS'] != "off") | 6 | if($_SERVER['HTTPS'] != "off") |
@@ -22,8 +22,6 @@ function generate_page($url,$title,$content) { | |||
22 | $tpl->assign( "title", $title); | 22 | $tpl->assign( "title", $title); |
23 | $tpl->assign( "content", $content); | 23 | $tpl->assign( "content", $content); |
24 | 24 | ||
25 | $tpl->assign( "version", VERSION); | ||
26 | |||
27 | $tpl->draw( "index"); // draw the template | 25 | $tpl->draw( "index"); // draw the template |
28 | } | 26 | } |
29 | 27 | ||
diff --git a/readityourself.php b/readityourself.php index 451b5878..588baeca 100755 --- a/readityourself.php +++ b/readityourself.php | |||
@@ -1,31 +1,14 @@ | |||
1 | <?php | 1 | <?php |
2 | |||
3 | define("VERSION", "0.0.3"); | ||
4 | |||
5 | header('Content-type:text/html; charset=utf-8'); | 2 | header('Content-type:text/html; charset=utf-8'); |
6 | // Set locale to French | ||
7 | setlocale(LC_ALL, 'fr_FR'); | ||
8 | 3 | ||
9 | // set timezone to Europe/Paris | 4 | setlocale(LC_ALL, 'fr_FR'); |
10 | date_default_timezone_set('Europe/Paris'); | 5 | date_default_timezone_set('Europe/Paris'); |
11 | 6 | ||
12 | // set charset to utf-8 important since all pages will be transform to utf-8 | ||
13 | header('Content-Type: text/html;charset=utf-8'); | ||
14 | |||
15 | // get readability library | ||
16 | require_once dirname(__FILE__).'/inc/Readability.php'; | 7 | require_once dirname(__FILE__).'/inc/Readability.php'; |
17 | |||
18 | // get Encoding library. | ||
19 | require_once dirname(__FILE__).'/inc/Encoding.php'; | 8 | require_once dirname(__FILE__).'/inc/Encoding.php'; |
20 | |||
21 | // appel de la libraire RainTPL. | ||
22 | require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; | 9 | require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; |
23 | |||
24 | include dirname(__FILE__).'/inc/functions.php'; | 10 | include dirname(__FILE__).'/inc/functions.php'; |
25 | 11 | ||
26 | // EXUCUTION CODE | ||
27 | |||
28 | |||
29 | if(isset($_GET['url']) && $_GET['url'] != null && trim($_GET['url']) != "") { | 12 | if(isset($_GET['url']) && $_GET['url'] != null && trim($_GET['url']) != "") { |
30 | // get url link | 13 | // get url link |
31 | if(strlen(trim($_GET['url'])) > 2048) { | 14 | if(strlen(trim($_GET['url'])) > 2048) { |
@@ -57,5 +40,4 @@ if(isset($_GET['url']) && $_GET['url'] != null && trim($_GET['url']) != "") { | |||
57 | echo "Error unable to get link : ".$url; | 40 | echo "Error unable to get link : ".$url; |
58 | } | 41 | } |
59 | } | 42 | } |
60 | } | 43 | } \ No newline at end of file |
61 | ?> \ No newline at end of file | ||