From e7d737af1bd0479d0f065962cdf6506749b5d775 Mon Sep 17 00:00:00 2001 From: Leblanc Simon Date: Wed, 20 Jan 2010 02:30:45 +0000 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20du=20bug=20#2930921=20:=20le?= =?UTF-8?q?=20titre=20de=20la=20page=20n'=C3=A9tait=20pas=20mis=20=C3=A0?= =?UTF-8?q?=20jour=20avec=20l'AJAX=20Ajout=20de=20la=20fonctionnalit=C3=A9?= =?UTF-8?q?=20#2930930=20:=20l'url=20permanente=20du=20strip=20est=20maint?= =?UTF-8?q?enant=20indiqu=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/class/abstractlang.class.php | 2 ++ inc/functions.php | 19 +++++++++++++++++++ inc/lang/en-EN.php | 1 + inc/lang/fr-FR.php | 1 + inc/tpl/default/template.html | 1 + inc/tpl/functions.js | 4 ++++ inc/tpl/lego/template.html | 1 + inc/tpl/stripit.xml | 1 + index.php | 1 + 9 files changed, 31 insertions(+) diff --git a/inc/class/abstractlang.class.php b/inc/class/abstractlang.class.php index 6dab91f..f1b56c4 100644 --- a/inc/class/abstractlang.class.php +++ b/inc/class/abstractlang.class.php @@ -25,6 +25,7 @@ abstract class AbstractLang protected $contact = "Contact"; protected $rss = "RSS"; protected $licence = "Licence"; + protected $permanent_link = "Lien permanent"; protected $boutique = "Boutique"; protected $teeshirt = "(t-shirts & cadeaux)"; protected $propulse = "Propulsé par"; @@ -58,6 +59,7 @@ abstract class AbstractLang public function getContact() { return $this->contact; } public function getRss() { return $this->rss; } public function getLicence() { return $this->licence; } + public function getPermanentLink() { return $this->permanent_link; } public function getBoutique() { return $this->boutique; } public function getTeeshirt() { return $this->teeshirt; } public function getPropulse() { return $this->propulse; } diff --git a/inc/functions.php b/inc/functions.php index 05ab0e4..bf3fe49 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -81,6 +81,25 @@ function getNavigation($id, $last, Lang $lang) } +/** + * Return the permanent link for the strip + * + * @param integer $id The id of the actual strip + * @param Lang $lang The Lang object use for the actual user + * @return string The permanent link for the actual strip + */ +function getPermanentLink($id, Lang $lang) +{ + $url = Config::getUrl().'/'.Config::getIndex().'?id='; + $nav_lang = ''; + if (isset($_GET['lang'])) { + $nav_lang = '&lang='.$lang; + } + + return $url.$id.$nav_lang; +} + + /** * Return an array with all navigation link * diff --git a/inc/lang/en-EN.php b/inc/lang/en-EN.php index c95eaf7..5539ca4 100644 --- a/inc/lang/en-EN.php +++ b/inc/lang/en-EN.php @@ -26,6 +26,7 @@ class Lang extends AbstractLang $this->contact = "Contact"; $this->rss = "RSS"; $this->licence = "License"; + $this->permanent_link = "Permanent link"; $this->boutique = "Shop"; $this->teeshirt = "(t-shirts & gifts)"; $this->propulse = "Powered by"; diff --git a/inc/lang/fr-FR.php b/inc/lang/fr-FR.php index a82ec80..ae440d6 100644 --- a/inc/lang/fr-FR.php +++ b/inc/lang/fr-FR.php @@ -26,6 +26,7 @@ class Lang extends AbstractLang $this->contact = "Contact"; $this->rss = "RSS"; $this->licence = "Licence"; + $this->permanent_link = "Lien permanent"; $this->boutique = "Boutique"; $this->teeshirt = "(t-shirts & cadeaux)"; $this->propulse = "Propulsé par"; diff --git a/inc/tpl/default/template.html b/inc/tpl/default/template.html index caed472..1c6589f 100644 --- a/inc/tpl/default/template.html +++ b/inc/tpl/default/template.html @@ -45,6 +45,7 @@

getDescription() ?>

© getAuthor() ?> : getDate() ?> : getSource() ?>

getLicence() ?> : getLicense() ?>

+

getPermanentLink() ?> :

diff --git a/inc/tpl/functions.js b/inc/tpl/functions.js index bcb777b..8a199f6 100644 --- a/inc/tpl/functions.js +++ b/inc/tpl/functions.js @@ -52,6 +52,7 @@ function getStrip(link) break; case 'title': if (idExist('title')) document.getElementById('title').innerHTML = '« ' + value + ' »'; + document.title = value; break; case 'description': if (idExist('description')) document.getElementById('description').innerHTML = value; @@ -100,6 +101,9 @@ function getStrip(link) case 'nav_forum_view': if (idExist('nav_forum_view')) document.getElementById('nav_forum_view').href = value; break; + case 'permanent': + if (idExist('permanent')) document.getElementById('permanent').innerHTML = value; + break; } } } diff --git a/inc/tpl/lego/template.html b/inc/tpl/lego/template.html index 6bc2717..2f12c77 100644 --- a/inc/tpl/lego/template.html +++ b/inc/tpl/lego/template.html @@ -85,6 +85,7 @@

getDate() ?>

getSource() ?>

getLicence() ?> : getLicense() ?>

+

getPermanentLink() ?> :

diff --git a/inc/tpl/stripit.xml b/inc/tpl/stripit.xml index 2e3993a..9efb6a4 100644 --- a/inc/tpl/stripit.xml +++ b/inc/tpl/stripit.xml @@ -16,4 +16,5 @@ ]]> ]]> ]]> + ]]> \ No newline at end of file diff --git a/index.php b/index.php index 7d45681..1ca950f 100644 --- a/index.php +++ b/index.php @@ -55,6 +55,7 @@ $lang = getLang($lang); list($nav_first, $nav_last, $nav_prev, $nav_next, $nav_gallery) = getNavigation($id, $last, $lang); $nav_forum_post = Config::getFluxbbForum().'/post.php?ttitle='.urlencode($strip->getTitle()).'&fid='.Config::getFluxbbForumId(); $nav_forum_view = Config::getFluxbbForum().'/redirect_stripit.php?ttitle='.urlencode($strip->getTitle()); +$permanent_link = htmlentities(getPermanentLink($id, $lang)); // If necessary, obtain the forum data $comments = '';