aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinc/functions.php4
-rwxr-xr-xreadityourself.php22
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
3function url(){ 3function 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
3define("VERSION", "0.0.3");
4
5header('Content-type:text/html; charset=utf-8'); 2header('Content-type:text/html; charset=utf-8');
6// Set locale to French
7setlocale(LC_ALL, 'fr_FR');
8 3
9// set timezone to Europe/Paris 4setlocale(LC_ALL, 'fr_FR');
10date_default_timezone_set('Europe/Paris'); 5date_default_timezone_set('Europe/Paris');
11 6
12// set charset to utf-8 important since all pages will be transform to utf-8
13header('Content-Type: text/html;charset=utf-8');
14
15// get readability library
16require_once dirname(__FILE__).'/inc/Readability.php'; 7require_once dirname(__FILE__).'/inc/Readability.php';
17
18// get Encoding library.
19require_once dirname(__FILE__).'/inc/Encoding.php'; 8require_once dirname(__FILE__).'/inc/Encoding.php';
20
21// appel de la libraire RainTPL.
22require_once dirname(__FILE__).'/inc/rain.tpl.class.php'; 9require_once dirname(__FILE__).'/inc/rain.tpl.class.php';
23
24include dirname(__FILE__).'/inc/functions.php'; 10include dirname(__FILE__).'/inc/functions.php';
25 11
26// EXUCUTION CODE
27
28
29if(isset($_GET['url']) && $_GET['url'] != null && trim($_GET['url']) != "") { 12if(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