0.3
parent
6d917510b1
commit
98df6c99bf
|
@ -0,0 +1,61 @@
|
|||
comListe 0.3 - 03-03-2015 - Pierre Van Glabeke
|
||||
===========================================================
|
||||
* correction localisation
|
||||
* ajout info sur widget
|
||||
|
||||
comListe 0.2 - 19-12-2014 - Pierre Van Glabeke
|
||||
===========================================================
|
||||
* compatibilité dc2.7
|
||||
* suppression dossier .settings + fichiers .buildpath et .project
|
||||
* modification tpl
|
||||
* modification localisation
|
||||
* modification icône
|
||||
|
||||
comListe 0.1.9 - 2013-10-13 - Pierre Van Glabeke
|
||||
===========================================================
|
||||
* compatibilité dc2.6
|
||||
|
||||
comListe 0.1.8 - 2009-07-20
|
||||
===========================================================
|
||||
* correction sur le calcul du nombre de commentaires
|
||||
|
||||
comListe 0.1.7 - 2009-07-20
|
||||
===========================================================
|
||||
* mise à niveau pour la compatibilité Dotclear 2.2
|
||||
* mise à niveau pour la compatibilité php 5.3.0
|
||||
* Ticket #272 : coquille anglais corrigée
|
||||
* Ticket #271 : texte localisé corrigé dans les templates
|
||||
* mise à niveau de la licence de l'extension
|
||||
|
||||
comListe 0.1.6 - 2009-10-07
|
||||
===========================================================
|
||||
* correction d'une erreur dans la pagination
|
||||
* utilisation du plugin translater pour la traduction
|
||||
|
||||
comListe 0.1.5
|
||||
* correction des termes de la licence
|
||||
* mise aux normes structurelles de Dotclear des fichiers
|
||||
* Ticket #132 : ajout du titre du post dans le template par défaut
|
||||
|
||||
comListe 0.1.4
|
||||
* creation de templates personnalisés dans le repertoire adapt-themes
|
||||
* remplacement de la méthode de traduction
|
||||
|
||||
comListe 0.1.3
|
||||
* correction du template comListe.html
|
||||
|
||||
comListe 0.1.2
|
||||
* suppression du fichier _install.php pour supprimer le bug d'affichage dans la partie admin
|
||||
|
||||
comListe 0.1.1
|
||||
* ajout de l'initialisation des paramètres par défaut
|
||||
* ajout de l'aide dans la partie admin
|
||||
* ajout d'une icone pour la partie admin
|
||||
|
||||
comListe 0.1.0
|
||||
* mise aux normes de codage dotclear
|
||||
* nettoyage du code
|
||||
* ajout de la pagination
|
||||
* creation de la partie publique
|
||||
* creation du widget
|
||||
* creation de la partie admin
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
#--- icon.png issue du pack mini_icons_2 offertes par Brandspankingnew
|
||||
#--- http://www.brandspankingnew.net
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) { return; }
|
||||
|
||||
$_menu['Blog']->addItem(__('List of comments'),'plugin.php?p=comListe','index.php?pf=comListe/icon.png',
|
||||
preg_match('/plugin.php\?p=comListe(&.*)?$/',$_SERVER['REQUEST_URI']),
|
||||
$core->auth->check('admin',$core->blog->id));
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) { return; }
|
||||
|
||||
$this->registerModule(
|
||||
/* Name */ "ComListe",
|
||||
/* Description*/ "Display a list of all comments and trackbacks of a blog in a public page",
|
||||
/* Author */ "Benoit de Marne, Pierre Van Glabeke",
|
||||
/* Version */ '0.3',
|
||||
/* Properties */
|
||||
array(
|
||||
'permissions' => 'admin',
|
||||
'type' => 'plugin',
|
||||
'dc_min' => '2.7',
|
||||
'support' => 'http://lab.dotclear.org/wiki/plugin/comListe/fr',
|
||||
'details' => 'http://plugins.dotaddict.org/dc2/details/comListe'
|
||||
)
|
||||
);
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) { return; }
|
||||
|
||||
require dirname(__FILE__).'/_widgets.php';
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) { return; }
|
||||
|
||||
require_once dirname(__FILE__).'/inc/class.dc.comListe.php';
|
||||
|
||||
$core->url->register('comListe','comListe','^comListe(?:/(.+))?$',array('urlcomListe','comListe'));
|
||||
|
||||
$core->tpl->addValue('ComListeURL',array('tplComListe','comListeURL'));
|
||||
$core->tpl->addValue('ComListePageTitle',array('tplComListe','comListePageTitle'));
|
||||
$core->tpl->addValue('ComListeNbComments',array('tplComListe','comListeNbComments'));
|
||||
$core->tpl->addValue('ComListeNbCommentsPerPage',array('tplComListe','comListeNbCommentsPerPage'));
|
||||
$core->tpl->addBlock('ComListeCommentsEntries',array('tplComListe','comListeCommentsEntries'));
|
||||
$core->tpl->addValue('ComListePaginationLinks',array('tplComListe','comListePaginationLinks'));
|
||||
$core->tpl->addValue('ComListeOpenPostTitle',array('tplComListe','comListeOpenPostTitle'));
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_RC_PATH')) { return; }
|
||||
|
||||
$core->addBehavior('initWidgets',array('comListeWidgets','initWidgets'));
|
||||
|
||||
class comListeWidgets
|
||||
{
|
||||
public static function initWidgets($w)
|
||||
{
|
||||
$w->create('comListe',__('ComListe'),array('tplComListe','comListeWidget'),
|
||||
null,
|
||||
__('List of comments'));
|
||||
$w->comListe->setting('title',__('Title:'),__('ComListe'));
|
||||
$w->comListe->setting('link_title',__('Link title:'),__('List of comments'));
|
||||
$w->comListe->setting('homeonly',__('Display on:'),0,'combo',
|
||||
array(
|
||||
__('All pages') => 0,
|
||||
__('Home page only') => 1,
|
||||
__('Except on home page') => 2
|
||||
)
|
||||
);
|
||||
$w->comListe->setting('content_only',__('Content only'),0,'check');
|
||||
$w->comListe->setting('class',__('CSS class:'),'');
|
||||
$w->comListe->setting('offline',__('Offline'),0,'check');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
|
||||
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
|
||||
|
||||
<title>{{tpl:ComListePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
|
||||
<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
|
||||
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
|
||||
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:ComListePageTitle}} - {{tpl:BlogName encode_html="1"}}" />
|
||||
<meta name="dc.language" content="{{tpl:BlogLanguage}}" />
|
||||
<meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
<meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="dc.type" content="text" />
|
||||
<meta name="dc.format" content="text/html" />
|
||||
|
||||
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
|
||||
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
|
||||
|
||||
{{tpl:include src="_head.html"}}
|
||||
</head>
|
||||
|
||||
<body class="dc-comliste">
|
||||
<div id="container">
|
||||
{{tpl:include src="_top.html"}}
|
||||
|
||||
<div id="main">
|
||||
<div class="col01">
|
||||
|
||||
<h2>{{tpl:ComListePageTitle encode_html="1"}}</h2>
|
||||
|
||||
<div class="content-inner">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<tpl:ComListeCommentsEntries>
|
||||
<tpl:CommentsHeader>
|
||||
<dl>
|
||||
</tpl:CommentsHeader>
|
||||
<dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
|
||||
{{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
|
||||
{{tpl:lang by}} {{tpl:CommentAuthorLink}}
|
||||
<br />({{tpl:lang source}}: {{tpl:CommentEntryTitle}})
|
||||
</dt>
|
||||
<dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
|
||||
{{tpl:CommentContent}}
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}">{{tpl:ComListeOpenPostTitle}} ...</a>
|
||||
<br /><br />
|
||||
<!-- # --BEHAVIOR-- publicCommentAfterContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
|
||||
</dd>
|
||||
<tpl:CommentsFooter>
|
||||
</dl>
|
||||
</tpl:CommentsFooter>
|
||||
</tpl:ComListeCommentsEntries>
|
||||
|
||||
</div> <!-- End #post -->
|
||||
|
||||
<p class="pagination">
|
||||
{{tpl:ComListePaginationLinks}}
|
||||
</p>
|
||||
<p class="post-info">
|
||||
{{tpl:lang Number of comments per page}} :: {{tpl:ComListeNbCommentsPerPage}}<br />
|
||||
{{tpl:lang Current page}} :: {{tpl:ComListeCurrentPage}}
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<div class="recent-posts">
|
||||
{{tpl:Widgets type="extra"}}
|
||||
|
||||
</div>
|
||||
<div class="postit-bottom"></div>
|
||||
<div class="categories-upper"></div>
|
||||
|
||||
{{tpl:Widgets type="nav"}}
|
||||
|
||||
|
||||
<div class="categories-btm"></div>
|
||||
|
||||
<div class="side-meta"></div>
|
||||
</div>
|
||||
<br style="clear: both;" />
|
||||
</div>
|
||||
|
||||
{{tpl:include src="_footer.html"}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
|
||||
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
|
||||
|
||||
<title>{{tpl:ComListePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
|
||||
<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
|
||||
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
|
||||
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:ComListePageTitle}} - {{tpl:BlogName encode_html="1"}}" />
|
||||
<meta name="dc.language" content="{{tpl:BlogLanguage}}" />
|
||||
<meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
<meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="dc.type" content="text" />
|
||||
<meta name="dc.format" content="text/html" />
|
||||
|
||||
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
|
||||
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
|
||||
|
||||
{{tpl:include src="_head.html"}}
|
||||
</head>
|
||||
|
||||
<body class="dc-comliste">
|
||||
<div id="page">
|
||||
{{tpl:include src="_top.html"}}
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
|
||||
<div class="grid">
|
||||
<!-- # lead -->
|
||||
<div id="lead" class="grid-l">
|
||||
<h2>{{tpl:ComListePageTitle encode_html="1"}}</h2>
|
||||
</div>
|
||||
|
||||
<!-- # meta -->
|
||||
<div id="meta" class="grid-s">
|
||||
{{tpl:include src="inc_meta.html"}}
|
||||
</div>
|
||||
|
||||
<div class="grid-l">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<tpl:ComListeCommentsEntries>
|
||||
<tpl:CommentsHeader>
|
||||
<dl>
|
||||
</tpl:CommentsHeader>
|
||||
<dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
|
||||
{{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
|
||||
{{tpl:lang by}} {{tpl:CommentAuthorLink}}
|
||||
<br />({{tpl:lang source}}: {{tpl:CommentEntryTitle}})
|
||||
</dt>
|
||||
<dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
|
||||
{{tpl:CommentContent}}
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}">{{tpl:ComListeOpenPostTitle}} ...</a>
|
||||
<br /><br />
|
||||
<!-- # --BEHAVIOR-- publicCommentAfterContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
|
||||
</dd>
|
||||
<tpl:CommentsFooter>
|
||||
</dl>
|
||||
</tpl:CommentsFooter>
|
||||
</tpl:ComListeCommentsEntries>
|
||||
|
||||
|
||||
</div> <!-- End #post -->
|
||||
<p class="pagination">
|
||||
{{tpl:ComListePaginationLinks}}
|
||||
</p>
|
||||
<p class="post-info">
|
||||
{{tpl:lang Number of comments per page}} :: {{tpl:ComListeNbCommentsPerPage}}<br />
|
||||
{{tpl:lang Current page}} :: {{tpl:ComListeCurrentPage}}
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- # extra -->
|
||||
<div id="extra" class="grid-s widgets">
|
||||
{{tpl:include src="inc_extra.html"}}
|
||||
{{tpl:Widgets type="nav"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- End #wrapper -->
|
||||
|
||||
{{tpl:include src="_footer.html"}}
|
||||
</div> <!-- End #page -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{tpl:BlogLanguage}}" lang="{{tpl:BlogLanguage}}">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
|
||||
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
|
||||
|
||||
<title>{{tpl:ComListePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}</title>
|
||||
<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
|
||||
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
|
||||
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:ComListePageTitle}} - {{tpl:BlogName encode_html="1"}}" />
|
||||
<meta name="dc.language" content="{{tpl:BlogLanguage}}" />
|
||||
<meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
<meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="dc.type" content="text" />
|
||||
<meta name="dc.format" content="text/html" />
|
||||
|
||||
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
|
||||
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
|
||||
|
||||
{{tpl:include src="_head.html"}}
|
||||
</head>
|
||||
|
||||
<body class="dc-comliste">
|
||||
<div id="body">
|
||||
{{tpl:include src="_top.html"}}
|
||||
|
||||
<div id="page" class="{{tpl:Freshy2LayoutClass}}">
|
||||
<div class="container">
|
||||
<div id="frame">
|
||||
<div id="content">
|
||||
|
||||
<h2>{{tpl:ComListePageTitle encode_html="1"}}</h2>
|
||||
<div class="post">
|
||||
|
||||
<tpl:ComListeCommentsEntries>
|
||||
<tpl:CommentsHeader>
|
||||
<dl>
|
||||
</tpl:CommentsHeader>
|
||||
<dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
|
||||
{{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}}
|
||||
{{tpl:lang by}} {{tpl:CommentAuthorLink}}
|
||||
<br />({{tpl:lang source}}: {{tpl:CommentEntryTitle}})
|
||||
</dt>
|
||||
<dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
|
||||
{{tpl:CommentContent}}
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}">{{tpl:ComListeOpenPostTitle}} ...</a>
|
||||
<br /><br />
|
||||
<!-- # --BEHAVIOR-- publicCommentAfterContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
|
||||
</dd>
|
||||
<tpl:CommentsFooter>
|
||||
</dl>
|
||||
</tpl:CommentsFooter>
|
||||
</tpl:ComListeCommentsEntries>
|
||||
|
||||
</div> <!-- End #post -->
|
||||
|
||||
<p class="pagination">
|
||||
{{tpl:ComListePaginationLinks}}
|
||||
</p>
|
||||
<p class="post-info">
|
||||
{{tpl:lang Number of comments per page}} :: {{tpl:ComListeNbCommentsPerPage}}<br />
|
||||
{{tpl:lang Current page}} :: {{tpl:ComListeCurrentPage}}
|
||||
</p>
|
||||
|
||||
</div> <!-- End #content -->
|
||||
|
||||
{{tpl:include src="_sidebar.html"}}
|
||||
</div> <!-- End #frame -->
|
||||
</div> <!-- End #container -->
|
||||
</div> <!-- End #page -->
|
||||
|
||||
{{tpl:include src="_footer.html"}}
|
||||
</div> <!-- End #body -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,66 @@
|
|||
{{tpl:extends parent="__layout.html"}}
|
||||
|
||||
<tpl:Block name="head-title">
|
||||
<title>{{tpl:ComListePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
|
||||
</tpl:Block>
|
||||
|
||||
<tpl:Block name="meta-robots">
|
||||
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
|
||||
</tpl:Block>
|
||||
|
||||
<tpl:Block name="dc-entry">
|
||||
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:ComListePageTitle}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
|
||||
<meta property="dc.language" content="{{tpl:BlogLanguage}}" />
|
||||
</tpl:Block>
|
||||
|
||||
<tpl:Block name="head-linkrel">
|
||||
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
|
||||
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
|
||||
</tpl:Block>
|
||||
|
||||
<tpl:Block name="body-tag"><body class="dc-comliste"></tpl:Block>
|
||||
|
||||
<tpl:Block name="main-content">
|
||||
<div id="content-info">
|
||||
<h2>{{tpl:ComListePageTitle encode_html="1"}}</h2>
|
||||
</div>
|
||||
|
||||
<div class="post-feedback">
|
||||
<div class="feedback__comments" id="comments">
|
||||
<tpl:ComListeCommentsEntries>
|
||||
<tpl:CommentsHeader>
|
||||
<ul class="comments-list">
|
||||
</tpl:CommentsHeader>
|
||||
<li id="c{{tpl:CommentID}}" class="comment {{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<p class="comment-info"><a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}</a>
|
||||
{{tpl:lang From}} {{tpl:CommentAuthorLink}} - {{tpl:CommentDate format="%d"}}/{{tpl:CommentDate format="%m"}}/{{tpl:CommentDate format="%Y"}}, {{tpl:CommentTime}}
|
||||
<br />({{tpl:lang source:}} <a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}">{{tpl:CommentEntryTitle}}</a>)
|
||||
</p>
|
||||
<div class="comment-content">
|
||||
<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
|
||||
|
||||
{{tpl:CommentContent}}
|
||||
|
||||
<!-- # --BEHAVIOR-- publicCommentAfterContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<tpl:CommentsFooter>
|
||||
</ul>
|
||||
</tpl:CommentsFooter>
|
||||
</tpl:ComListeCommentsEntries>
|
||||
|
||||
<p class="pagination">
|
||||
{{tpl:ComListePaginationLinks}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="post-info">
|
||||
{{tpl:lang Number of comments per page:}} {{tpl:ComListeNbCommentsPerPage}}<br />
|
||||
{{tpl:lang Number of comments:}} {{tpl:ComListeNbComments}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</tpl:Block>
|
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{tpl:BlogLanguage}}">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX,NOARCHIVE"}}" />
|
||||
|
||||
<title>{{tpl:ComListePageTitle encode_html="1"}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf></title>
|
||||
<meta name="copyright" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="author" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
<meta name="date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
|
||||
|
||||
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
|
||||
<meta name="dc.title" lang="{{tpl:BlogLanguage}}" content="{{tpl:ComListePageTitle}} - {{tpl:BlogName encode_html="1"}}<tpl:PaginationIf start="0"> - {{tpl:lang page}} {{tpl:PaginationCurrent}}</tpl:PaginationIf>" />
|
||||
<meta name="dc.language" content="{{tpl:BlogLanguage}}" />
|
||||
<meta name="dc.publisher" content="{{tpl:BlogEditor encode_html="1"}}" />
|
||||
<meta name="dc.rights" content="{{tpl:BlogCopyrightNotice encode_html="1"}}" />
|
||||
<meta name="dc.date" content="{{tpl:BlogUpdateDate iso8601="1"}}" />
|
||||
<meta name="dc.type" content="text" />
|
||||
<meta name="dc.format" content="text/html" />
|
||||
|
||||
<link rel="top" href="{{tpl:BlogURL}}" title="{{tpl:lang Home}}" />
|
||||
<link rel="contents" title="{{tpl:lang Archives}}" href="{{tpl:BlogArchiveURL}}" />
|
||||
|
||||
{{tpl:include src="_head.html"}}
|
||||
</head>
|
||||
|
||||
<body class="dc-comliste">
|
||||
<div id="page">
|
||||
{{tpl:include src="_top.html"}}
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<div id="main" role="main">
|
||||
<div id="content">
|
||||
<div id="content-info">
|
||||
<h2>{{tpl:ComListePageTitle encode_html="1"}}</h2>
|
||||
</div>
|
||||
<div class="content-inner">
|
||||
<div id="comments">
|
||||
<tpl:ComListeCommentsEntries>
|
||||
<tpl:CommentsHeader>
|
||||
<dl>
|
||||
</tpl:CommentsHeader>
|
||||
<dt id="c{{tpl:CommentID}}" class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}" class="comment-number">{{tpl:CommentOrderNumber}}.</a>
|
||||
{{tpl:lang On}} {{tpl:CommentDate}}, {{tpl:CommentTime}},
|
||||
{{tpl:lang by}} {{tpl:CommentAuthorLink}}
|
||||
<br />({{tpl:lang source:}} <a href="{{tpl:CommentPostURL}}#c{{tpl:CommentID}}">{{tpl:CommentEntryTitle}}</a>)
|
||||
</dt>
|
||||
<dd class="{{tpl:CommentIfMe}} {{tpl:CommentIfOdd}} {{tpl:CommentIfFirst}}">
|
||||
<!-- # --BEHAVIOR-- publicCommentBeforeContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentBeforeContent"}}
|
||||
{{tpl:CommentContent}}
|
||||
<!-- # --BEHAVIOR-- publicCommentAfterContent -->
|
||||
{{tpl:SysBehavior behavior="publicCommentAfterContent"}}
|
||||
</dd>
|
||||
<tpl:CommentsFooter>
|
||||
</dl>
|
||||
</tpl:CommentsFooter>
|
||||
</tpl:ComListeCommentsEntries>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pagination">
|
||||
{{tpl:ComListePaginationLinks}}
|
||||
</p>
|
||||
|
||||
<p class="post-info">
|
||||
{{tpl:lang Number of comments per page:}} {{tpl:ComListeNbCommentsPerPage}}<br />
|
||||
{{tpl:lang Number of comments:}} {{tpl:ComListeNbComments}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sidebar" role="complementary">
|
||||
<div id="blognav">
|
||||
{{tpl:Widgets type="nav"}}
|
||||
</div> <!-- End #blognav -->
|
||||
|
||||
<div id="blogextra">
|
||||
{{tpl:Widgets type="extra"}}
|
||||
</div> <!-- End #blogextra -->
|
||||
</div>
|
||||
|
||||
</div> <!-- End #wrapper -->
|
||||
|
||||
{{tpl:include src="_footer.html"}}
|
||||
</div> <!-- End #page -->
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,342 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
if (!defined('DC_RC_PATH')) {return;}
|
||||
|
||||
class urlcomListe extends dcUrlHandlers
|
||||
{
|
||||
/**
|
||||
* Traitement de l'URL
|
||||
* Open the template
|
||||
*/
|
||||
public static function comListe($args)
|
||||
{
|
||||
global $_ctx,$core;
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
$blog_settings =& $core->blog->settings->comListe;
|
||||
} else {
|
||||
$blog_settings =& $core->blog->settings;
|
||||
}
|
||||
|
||||
// definition de la page courante
|
||||
if ($args == '') {
|
||||
$GLOBALS['_page_number'] = (integer) 1;
|
||||
} else {
|
||||
$current = self::getPageNumber($args);
|
||||
if ($current) {
|
||||
$GLOBALS['_page_number'] = (integer) $current;
|
||||
}
|
||||
}
|
||||
// definition du nombre de commentaires par page
|
||||
$_ctx->nb_comment_per_page=$blog_settings->comliste_nb_comments_per_page;
|
||||
|
||||
// ouverture de la page html
|
||||
$tplset = $core->themes->moduleInfo($core->blog->settings->system->theme,'tplset');
|
||||
if (!empty($tplset) && is_dir(dirname(__FILE__).'/../default-templates/'.$tplset)) {
|
||||
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/../default-templates/'.$tplset);
|
||||
} else {
|
||||
$core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/../default-templates/'.DC_DEFAULT_TPLSET);
|
||||
}
|
||||
self::serveDocument('comListe.html');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
class tplComListe
|
||||
{
|
||||
public $html_prev = '«prev.';
|
||||
public $html_next = 'next»';
|
||||
|
||||
/* ComListeURL --------------------------------------- */
|
||||
public static function comListeURL($attr)
|
||||
{
|
||||
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
||||
return '<?php echo '.sprintf($f,'$core->blog->url.$core->url->getBase("comListe")').'; ?>';
|
||||
}
|
||||
|
||||
/* ComListePageTitle --------------------------------------- */
|
||||
public static function comListePageTitle($attr)
|
||||
{
|
||||
global $core;
|
||||
$f = $GLOBALS['core']->tpl->getFilters($attr);
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
return '<?php echo '.sprintf($f,'$core->blog->settings->comListe->comliste_page_title').'; ?>';
|
||||
} else {
|
||||
return '<?php echo '.sprintf($f,'$core->blog->settings->comliste_page_title').'; ?>';
|
||||
}
|
||||
}
|
||||
|
||||
/* ComListeNbCommentsPerPage --------------------------------------- */
|
||||
public static function comListeNbCommentsPerPage($attr)
|
||||
{
|
||||
global $_ctx, $core;
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
$nb_comments_per_page = $_ctx->nb_comment_per_page=$core->blog->settings->comListe->comliste_nb_comments_per_page;
|
||||
} else {
|
||||
$nb_comments_per_page = $_ctx->nb_comment_per_page=$core->blog->settings->comliste_nb_comments_per_page;
|
||||
}
|
||||
return ''.html::escapeHTML($nb_comments_per_page).'';
|
||||
}
|
||||
|
||||
/* comListeNbComments --------------------------------------- */
|
||||
public static function comListeNbComments($attr)
|
||||
{
|
||||
// __('Number of comments')
|
||||
global $_ctx, $core;
|
||||
|
||||
if(empty($params)) {
|
||||
$_ctx->pagination = $core->blog->getComments(null,true);
|
||||
} else {
|
||||
$_ctx->pagination = $core->blog->getComments($params,true);
|
||||
unset($params);
|
||||
}
|
||||
|
||||
if ($_ctx->exists("pagination")) {
|
||||
$nb_comments = $_ctx->pagination->f(0);
|
||||
}
|
||||
return ''.html::escapeHTML($nb_comments).'';
|
||||
}
|
||||
|
||||
/* ComListeCommentsEntries --------------------------------------- */
|
||||
public static function comListeCommentsEntries($attr,$content)
|
||||
{
|
||||
global $_ctx, $core;
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
$blog_settings =& $core->blog->settings->comListe;
|
||||
} else {
|
||||
$blog_settings =& $core->blog->settings;
|
||||
}
|
||||
|
||||
$p =
|
||||
"if (\$_ctx->posts !== null) { ".
|
||||
"\$params['post_id'] = \$_ctx->posts->post_id; ".
|
||||
"\$core->blog->withoutPassword(false);\n".
|
||||
"}\n";
|
||||
|
||||
if (empty($attr['with_pings'])) {
|
||||
$p .= "\$params['comment_trackback'] = false;\n";
|
||||
}
|
||||
|
||||
$lastn = 0;
|
||||
if (isset($attr['lastn'])) {
|
||||
$lastn = abs((integer) $attr['lastn'])+0;
|
||||
}
|
||||
|
||||
if ($lastn > 0) {
|
||||
$p .= "\$params['limit'] = ".$lastn.";\n";
|
||||
} else {
|
||||
$p .= "if (\$_ctx->nb_comment_per_page !== null) { \$params['limit'] = \$_ctx->nb_comment_per_page; }\n";
|
||||
}
|
||||
|
||||
if (isset($GLOBALS["_page_number"])) {
|
||||
$_page_number = $GLOBALS["_page_number"];
|
||||
$p .= "\$params['limit'] = array(((\$_page_number-1)*\$params['limit']),\$params['limit']);\n";
|
||||
} else {
|
||||
$_page_number = 1;
|
||||
$p .= "\$params['limit'] = array(0, \$params['limit']);\n";
|
||||
}
|
||||
|
||||
if (empty($attr['no_context']))
|
||||
{
|
||||
$p .=
|
||||
'if ($_ctx->exists("categories")) { '.
|
||||
"\$params['cat_id'] = \$_ctx->categories->cat_id; ".
|
||||
"}\n";
|
||||
|
||||
$p .=
|
||||
'if ($_ctx->exists("langs")) { '.
|
||||
"\$params['sql'] = \"AND P.post_lang = '\".\$core->blog->con->escape(\$_ctx->langs->post_lang).\"' \"; ".
|
||||
"}\n";
|
||||
}
|
||||
|
||||
// Sens de tri issu des paramètres du plugin
|
||||
$order = $blog_settings->comliste_comments_order;
|
||||
if (isset($attr['order']) && preg_match('/^(desc|asc)$/i',$attr['order'])) {
|
||||
$order = $attr['order'];
|
||||
}
|
||||
|
||||
$p .= "\$params['order'] = 'comment_dt ".$order."';\n";
|
||||
|
||||
if (isset($attr['no_content']) && $attr['no_content']) {
|
||||
$p .= "\$params['no_content'] = true;\n";
|
||||
}
|
||||
|
||||
$res = "<?php\n";
|
||||
$res .= $p;
|
||||
$res .= '$_ctx->comments = $core->blog->getComments($params); unset($params);'."\n";
|
||||
$res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n";
|
||||
|
||||
if (!empty($attr['with_pings'])) {
|
||||
$res .= '$_ctx->pings = $_ctx->comments;'."\n";
|
||||
}
|
||||
|
||||
$res .= "?>\n";
|
||||
|
||||
$res .=
|
||||
'<?php while ($_ctx->comments->fetch()) : ?>'.$content.'<?php endwhile; $_ctx->comments = null; ?>';
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/* ComListePaginationLinks --------------------------------------- */
|
||||
/* Reprise et adaptation de la fonction PaginationLinks du plugin advancedPagination-1.9 */
|
||||
public static function comListePaginationLinks($attr)
|
||||
{
|
||||
global $_ctx, $core;
|
||||
|
||||
$p = '<?php
|
||||
|
||||
function comListeMakePageLink($pageNumber, $linkText) {
|
||||
if (isset($GLOBALS["_page_number"])) {
|
||||
$current = $GLOBALS["_page_number"];
|
||||
} else {
|
||||
$current = 0;
|
||||
}
|
||||
if ($pageNumber != $current) {
|
||||
$args = $_SERVER["URL_REQUEST_PART"];
|
||||
$args = preg_replace("#(^|/)page/([0-9]+)$#","",$args);
|
||||
$url = $GLOBALS["core"]->blog->url.$args;
|
||||
|
||||
if ($pageNumber > 1) {
|
||||
$url = preg_replace("#/$#","",$url);
|
||||
$url .= "/page/".$pageNumber;
|
||||
}
|
||||
|
||||
if (!empty($_GET["q"])) {
|
||||
$s = strpos($url,"?") !== false ? "&" : "?";
|
||||
$url .= $s."q=".rawurlencode($_GET["q"]);
|
||||
}
|
||||
|
||||
return "<a href=\"".$url."\">".$linkText."</a> ";
|
||||
} else {
|
||||
return $linkText." ";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($GLOBALS["_page_number"])) {
|
||||
$current = $GLOBALS["_page_number"];
|
||||
} else {
|
||||
$current = 1;
|
||||
}
|
||||
|
||||
if(empty($params)) {
|
||||
$_ctx->pagination = $core->blog->getComments(null,true);
|
||||
} else {
|
||||
$_ctx->pagination = $core->blog->getComments($params,true);
|
||||
unset($params);
|
||||
}
|
||||
|
||||
if ($_ctx->exists("pagination")) {
|
||||
$nb_comments = $_ctx->pagination->f(0);
|
||||
}
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,\'2.2-alpha\',\'>=\')) {
|
||||
$blog_settings =& $core->blog->settings->comListe;
|
||||
} else {
|
||||
$blog_settings =& $core->blog->settings;
|
||||
}
|
||||
|
||||
$nb_per_page = abs((integer) $blog_settings->comliste_nb_comments_per_page);
|
||||
$nb_pages = ceil($nb_comments/$nb_per_page);
|
||||
$nb_max_pages = 10;
|
||||
$nb_sequence = 2*3+1;
|
||||
$quick_distance = 10;
|
||||
|
||||
echo "Pages : ";
|
||||
if($nb_pages <= $nb_max_pages) {
|
||||
/* less or equal than 10 pages, simple links */
|
||||
for ($i = 1; $i <= $nb_pages; $i++) {
|
||||
echo comListeMakePageLink($i,$i);
|
||||
}
|
||||
} else {
|
||||
/* more than 10 pages, smart links */
|
||||
echo comListeMakePageLink(1,1);
|
||||
$min_page = max($current - ($nb_sequence - 1) / 2, 2);
|
||||
$max_page = min($current + ($nb_sequence - 1) / 2, $nb_pages - 1);
|
||||
if ($min_page > 2) {
|
||||
echo "...";
|
||||
echo " ";
|
||||
}
|
||||
|
||||
for ($i = $min_page; $i <= $max_page ; $i++) {
|
||||
echo comListeMakePageLink($i,$i);
|
||||
}
|
||||
|
||||
if ($max_page < $nb_pages - 1) {
|
||||
echo "...";
|
||||
echo " ";
|
||||
}
|
||||
echo comListeMakePageLink($nb_pages,$nb_pages);
|
||||
|
||||
/* quick navigation links */
|
||||
if($current >= 1 + $quick_distance) {
|
||||
echo " ";
|
||||
echo comListeMakePageLink($current - $quick_distance, "<<");
|
||||
}
|
||||
|
||||
if($current <= $nb_pages - $quick_distance) {
|
||||
echo " ";
|
||||
echo comListeMakePageLink($current + $quick_distance, ">> ");
|
||||
}
|
||||
}
|
||||
?>';
|
||||
|
||||
return $p;
|
||||
}
|
||||
|
||||
/* ComListeOpenPostTitle --------------------------------------- */
|
||||
public static function comListeOpenPostTitle($attr)
|
||||
{
|
||||
return __('open post');
|
||||
}
|
||||
|
||||
# Widget function
|
||||
public static function comListeWidget($w)
|
||||
{
|
||||
global $core;
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
$blog_settings =& $core->blog->settings->comListe;
|
||||
} else {
|
||||
$blog_settings =& $core->blog->settings;
|
||||
}
|
||||
|
||||
if ($w->offline)
|
||||
return;
|
||||
|
||||
if (($w->homeonly == 1 && $core->url->type != 'default') ||
|
||||
($w->homeonly == 2 && $core->url->type == 'default')) {
|
||||
return;
|
||||
}
|
||||
if (!$blog_settings->comliste_enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
$res =
|
||||
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '').
|
||||
'<p><a href="'.$core->blog->url.$core->url->getBase('comListe').'">'.
|
||||
($w->link_title ? html::escapeHTML($w->link_title) : __('List of comments')).
|
||||
'</a></p>';
|
||||
|
||||
return $w->renderDiv($w->content_only,'comliste '.$w->class,'',$res);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) { exit; }
|
||||
|
||||
$page_title = __('List of comments');
|
||||
|
||||
# Settings compatibility test
|
||||
if (version_compare(DC_VERSION,'2.2-alpha','>=')) {
|
||||
$core->blog->settings->addNamespace('comListe');
|
||||
$blog_settings =& $core->blog->settings->comListe;
|
||||
$system_settings = $core->blog->settings->system;
|
||||
} else {
|
||||
$core->blog->settings->setNamespace('comListe');
|
||||
$blog_settings =& $core->blog->settings;
|
||||
$system_settings =& $core->blog->settings;
|
||||
}
|
||||
|
||||
// initilisation des variables
|
||||
$action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : null;
|
||||
|
||||
// Setting default parameters if missing configuration
|
||||
if (is_null($blog_settings->comliste_enable)) {
|
||||
try {
|
||||
$blog_settings->put('comliste_enable',false,'boolean','Enable comListe');
|
||||
$core->blog->triggerBlog();
|
||||
http::redirect(http::getSelfURI());
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Getting current parameters
|
||||
$comliste_enable = (boolean)$blog_settings->comliste_enable;
|
||||
$comliste_page_title = $blog_settings->comliste_page_title;
|
||||
$comliste_nb_comments_per_page = $blog_settings->comliste_nb_comments_per_page;
|
||||
$comliste_comments_order = $blog_settings->comliste_comments_order;
|
||||
|
||||
if ($comliste_page_title === null) {
|
||||
$comliste_page_title = __('List of comments');
|
||||
}
|
||||
if ($comliste_nb_comments_per_page === null) {
|
||||
$comliste_nb_comments_per_page = 10;
|
||||
}
|
||||
if ($comliste_comments_order === null) {
|
||||
$comliste_comments_order = 'desc';
|
||||
}
|
||||
|
||||
// Saving new configuration
|
||||
if ($action == 'saveconfig')
|
||||
{
|
||||
try {
|
||||
|
||||
// Enable plugin
|
||||
$comliste_enable = (empty($_POST['comliste_enable']))?false:true;
|
||||
|
||||
// Title page
|
||||
$comliste_page_title = $_POST['comliste_page_title'];
|
||||
if (empty($_POST['comliste_page_title'])) {
|
||||
throw new Exception(__('No page title.'));
|
||||
}
|
||||
|
||||
// Number of comments per page
|
||||
$comliste_nb_comments_per_page = !empty($_POST['comliste_nb_comments_per_page'])?$_POST['comliste_nb_comments_per_page']:$comliste_nb_comments_per_page;
|
||||
|
||||
// Order
|
||||
$comliste_comments_order = !empty($_POST['comliste_comments_order'])?$_POST['comliste_comments_order']:$comliste_comments_order;
|
||||
|
||||
// Insert settings values
|
||||
$blog_settings->put('comliste_enable',$comliste_enable,'boolean','Enable comListe');
|
||||
$blog_settings->put('comliste_page_title',$comliste_page_title,'string','Title page');
|
||||
$blog_settings->put('comliste_nb_comments_per_page',$comliste_nb_comments_per_page,'integer','Number of comments per page');
|
||||
$blog_settings->put('comliste_comments_order',$comliste_comments_order,'string','Comments order');
|
||||
|
||||
$core->blog->triggerBlog();
|
||||
|
||||
http::redirect($p_url.'&saveconfig=1');
|
||||
|
||||
} catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- Creating HTML page -->
|
||||
<html>
|
||||
|
||||
<!-- header -->
|
||||
<head>
|
||||
<title><?php echo $page_title; ?></title>
|
||||
</head>
|
||||
|
||||
<!-- body -->
|
||||
<body>
|
||||
|
||||
<?php
|
||||
echo dcPage::breadcrumb(
|
||||
array(
|
||||
html::escapeHTML($core->blog->name) => '',
|
||||
'<span class="page-title">'.$page_title.'</span>' => ''
|
||||
));
|
||||
|
||||
if (!empty($_GET['saveconfig'])) {
|
||||
dcPage::success(__('Settings have been successfully updated.'));
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$order_combo = array(__('Ascending') => 'asc',
|
||||
__('Descending') => 'desc' );
|
||||
|
||||
// comListe plugin configuration
|
||||
if ($core->auth->check('admin',$core->blog->id))
|
||||
{
|
||||
echo
|
||||
'<form method="post" action="plugin.php">'.
|
||||
'<div class="fieldset"><h4>'. __('Plugin activation').'</h4>'.
|
||||
'<p class="field">'.
|
||||
'<label class="classic" for="comliste_enable">'.
|
||||
form::checkbox('comliste_enable', 1, $comliste_enable).
|
||||
__('Enable comListe').'</label></p>'.
|
||||
'</div>'.
|
||||
'<div class="fieldset"><h4>'. __('General options').'</h4>'.
|
||||
'<p><label class="classic">'. __('Title page').' : '.
|
||||
form::field('comliste_page_title', 30,256, $comliste_page_title).
|
||||
'</label></p>'.
|
||||
'<p><label class=" classic">'. __('Number of comments per page:').' '.
|
||||
form::field('comliste_nb_comments_per_page', 4, 4, $comliste_nb_comments_per_page).
|
||||
'</label></p>'.
|
||||
'<p><label class=" classic">'. __('Comments order').' : '.
|
||||
form::combo('comliste_comments_order', $order_combo, $comliste_comments_order).
|
||||
'</label></p>'.
|
||||
'</div>'.
|
||||
'<p><input type="submit" value="'.__('Save').'" onclick="affinfo(\''.__('Save').'\')" /> '.
|
||||
$core->formNonce().
|
||||
form::hidden(array('action'),'saveconfig').
|
||||
form::hidden(array('p'),'comListe').'</p>'.
|
||||
'</form>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php dcPage::helpBlock('comListe');?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>comListe</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<p>This plugin displays a list of comments and trackbacks in the public part of your blog.</p>
|
||||
|
||||
<h4>Plugin configuration</h4>
|
||||
<dl>
|
||||
<dt>Activate the plugin</dt>
|
||||
<dd>Check this box to activate the plugin.</dd>
|
||||
|
||||
<dt>General Options</dt>
|
||||
<dd><ul>
|
||||
<li><strong>Page Title</strong> : definition of title.</li>
|
||||
<li><strong>Number of comments per page</strong> : choose the number of comments to display per page.</li>
|
||||
<li><strong>Sort order</strong> : choose the sort order for displaying the list of comments.</li>
|
||||
</ul></dd>
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!isset($__resources['help']['comListe'])) {
|
||||
$__resources['help']['comListe'] = dirname(__FILE__).'/help/comListe.html';
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>comListe</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<p>Ce plugin permet d'afficher la liste des commentaires et rétroliens dans la partie publique de votre blog.</p>
|
||||
|
||||
<h4>Configuration du plugin</h4>
|
||||
<dl>
|
||||
<dt>Activation du plugin</dt>
|
||||
<dd>Cocher cette case pour activer le plugin.</dd>
|
||||
|
||||
<dt>Options générales</dt>
|
||||
<dd><ul>
|
||||
<li><strong>Titre de la page</strong> : définition du titre.</li>
|
||||
<li><strong>Nombre de commentaires par page</strong> : choisissez le nombre de commentaires à afficher par page.</li>
|
||||
<li><strong>Sens de tri</strong> : choisissez l'ordre de tri pour l'affichage de la liste des commentaires.</li>
|
||||
</ul></dd>
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,78 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Project-Id-Version: comListe 0.2\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2014-12-18T09:16:42+00:00\n"
|
||||
"Last-Translator: Pierre Van Glabeke\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: _admin.php:18
|
||||
#: _widgets.php:22
|
||||
#: index.php:99
|
||||
#: index.php:111
|
||||
msgid "ComListe"
|
||||
msgstr "ComListe"
|
||||
|
||||
#: _widgets.php:21
|
||||
#: _widgets.php:23
|
||||
#: inc/class.dc.comListe.php:321
|
||||
#: index.php:48
|
||||
msgid "List of comments"
|
||||
msgstr "Liste des commentaires"
|
||||
|
||||
#: inc/class.dc.comListe.php:91
|
||||
msgid "Number of comments:"
|
||||
msgstr "Nombres de commentaires :"
|
||||
|
||||
#: inc/class.dc.comListe.php:295
|
||||
msgid "open post"
|
||||
msgstr "ouvrir le billet"
|
||||
|
||||
#: index.php:68
|
||||
msgid "No page title."
|
||||
msgstr "Pas de titre de page."
|
||||
|
||||
#: index.php:123
|
||||
msgid "Plugin activation"
|
||||
msgstr "Activation du plugin"
|
||||
|
||||
#: index.php:126
|
||||
msgid "Enable comListe"
|
||||
msgstr "Activer comListe"
|
||||
|
||||
#: index.php:128
|
||||
msgid "General options"
|
||||
msgstr "Options générales"
|
||||
|
||||
#: index.php:129
|
||||
msgid "Title page"
|
||||
msgstr "Titre de la page"
|
||||
|
||||
#: index.php:132
|
||||
msgid "Number of comments per page:"
|
||||
msgstr "Nombre de commentaires par page :"
|
||||
|
||||
#: index.php:135
|
||||
msgid "Comments order"
|
||||
msgstr "Sens de tri pour les commentaires"
|
||||
|
||||
msgid "Display a list of all comments and trackbacks of a blog in a public page"
|
||||
msgstr "Afficher la liste de tous les commentaires et rétroliens d'un blog dans une page publique"
|
||||
|
||||
msgid "Save configuration successful"
|
||||
msgstr "Sauvegarde de la configuration réussie"
|
||||
|
||||
msgid "Message:"
|
||||
msgstr "Message :"
|
||||
|
||||
msgid "Setting have been successfully updated."
|
||||
msgstr "Configuration mise à jour avec succès."
|
||||
|
||||
msgid "Current page"
|
||||
msgstr "Page courante"
|
||||
|
||||
msgid "source:"
|
||||
msgstr "source :"
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
# -- BEGIN LICENSE BLOCK ----------------------------------
|
||||
# This file is part of comListe, a plugin for Dotclear.
|
||||
#
|
||||
# Copyright (c) 2008-2015 Benoit de Marne
|
||||
# benoit.de.marne@gmail.com
|
||||
#
|
||||
# Licensed under the GPL version 2.0 license.
|
||||
# A copy of this license is available in LICENSE file or at
|
||||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
# -- END LICENSE BLOCK ------------------------------------
|
||||
|
||||
if (!isset($__resources['help']['comListe'])) {
|
||||
$__resources['help']['comListe'] = dirname(__FILE__).'/help/comListe.html';
|
||||
}
|
Loading…
Reference in New Issue