Changeset 3303
- Timestamp:
- 04/05/14 17:38:53 (9 years ago)
- Location:
- plugins/switchWelcome/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/switchWelcome/trunk/_define.php
r1624 r3303 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 if (!defined('DC_RC_PATH')) { 13 return null; 14 } 13 15 $this->registerModule( 14 16 /* Name */ "switchWelcome", 15 17 /* Description*/ "Welcome your visitors by a personnal message and help them to navigate", 16 18 /* Author */ "Tomtom (http://blog.zenstyle.fr)", 17 /* Version */ '0.2.3', 18 /* Permissions */ 'usage' 19 /* Version */ '0.2.4', 20 /* Properties */ 21 array( 22 'permissions' => 'usage', 23 'type' => 'plugin', 24 'dc_min' => '2.5', 25 'support' => 'http://lab.dotclear.org/wiki/plugin/switchWelcome', 26 'details' => 'http://plugins.dotaddict.org/dc2/details/switchWelcome' 27 ) 19 28 ); 20 21 ?> -
plugins/switchWelcome/trunk/_prepend.php
r1624 r3303 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 if (!defined('DC_RC_PATH')) { return; } 12 13 13 14 $__autoload['switchWelcome'] = dirname(__FILE__).'/inc/class.switch.welcome.php'; 14 15 15 16 require dirname(__FILE__).'/_widgets.php'; 16 17 ?> -
plugins/switchWelcome/trunk/_widgets.php
r1810 r3303 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 3 # This file is part of switchWelcome, a plugin for Dotclear. 4 # 4 # 5 5 # Copyright (c) 2009 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 # 7 # 8 8 # Licensed under the GPL version 2.0 license. 9 9 # A copy of this license is available in LICENSE file or at … … 22 22 $w->switchWelcome->setting('title',__('Title:'),__('Welcome!'),'text'); 23 23 $w->switchWelcome->setting('welcometext',__('Welcome text (use %1$s for visitor\'s name and %2$s for where he comes from):'),__('Hi %1$s from %2$s! Welcome on this blog!'),'textarea'); 24 $w->switchWelcome->setting('welcomesearchtext',__('Welcome text if search exists (use %1$s for keywords and %2$s for related posts\'s list):'),__('Do you search anything about %1$s? Check those related posts : %2$s'),'textarea'); 25 $w->switchWelcome->setting('homeonly',__('Home page only'),true,'check'); 24 $w->switchWelcome->setting('welcomesearchtext',__('Welcome text if search exists (use %1$s for keywords and %2$s for related posts\'s list):'),__('Do you search anything about %1$s? Check those related posts: %2$s'),'textarea'); 25 $w->switchWelcome->setting('homeonly',__('Display on:'),0,'combo', 26 array( 27 __('All pages') => 0, 28 __('Home page only') => 1, 29 __('Except on home page') => 2 30 ) 31 ); 32 $w->switchWelcome->setting('content_only',__('Content only'),0,'check'); 33 $w->switchWelcome->setting('class',__('CSS class:'),''); 26 34 } 27 35 28 36 public static function widget($w) 29 37 { 30 38 global $core; 31 39 32 if ($w->homeonly && $core->url->type != 'default') { 40 // Si nous sommes pas en page accueil et que c'est coché page accueil uniquement on fait rien 41 42 if (($w->homeonly == 1 && $core->url->type != 'default') || 43 ($w->homeonly == 2 && $core->url->type == 'default')) { 33 44 return; 34 45 } 35 46 36 47 if (switchWelcome::getHostReferer() === switchWelcome::getHostReferer($core->blog->url)) { 37 48 return; … … 39 50 40 51 $title = strlen($w->title) > 0 ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''; 41 52 42 53 $visitor = isset($_COOKIE['comment_info']) ? preg_split('#\n#',$_COOKIE['comment_info']) : array(__('visitor')); 43 54 44 $res = '< p>'.sprintf($w->welcometext,$visitor[0],switchWelcome::getHostRefererLink()).'</p>';45 55 $res = '<li>'.sprintf($w->welcometext,$visitor[0],switchWelcome::getHostRefererLink()).'</li>'; 56 46 57 if (count(switchWelcome::getSearchWords()) > 0) { 47 $res .= '< p>'.sprintf($w->welcomesearchtext,switchWelcome::getSearchWordsList(),switchWelcome::getRelatedPosts()).'</p>';58 $res .= '<li>'.sprintf($w->welcomesearchtext,switchWelcome::getSearchWordsList(),switchWelcome::getRelatedPosts()).'</li>'; 48 59 } 49 60 50 61 return 51 '<div id="switchwelcome">'.62 ($w->content_only ? '' : '<div class="switchwelcome'.($w->class ? ' '.html::escapeHTML($w->class) : '').'">'). 52 63 $title. 64 '<ul>'. 53 65 $res. 54 '</div>'; 66 '</ul>'. 67 ($w->content_only ? '' : '</div>'); 55 68 } 56 69 } 57 58 ?> -
plugins/switchWelcome/trunk/inc/class.switch.welcome.php
r1624 r3303 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 if (!defined('DC_RC_PATH')) {return;} 13 13 class switchWelcome 14 14 { … … 83 83 } 84 84 } 85 86 ?> -
plugins/switchWelcome/trunk/locales/fr/main.po
r1810 r3303 24 24 #: _widgets.php:23 25 25 msgid "Welcome text (use %1$s for visitor's name and %2$s for where he comes from):" 26 msgstr "Texte d'accueil (utilisez %1$s pour le nom du visiteur et %2$s pour sa provenance) 26 msgstr "Texte d'accueil (utilisez %1$s pour le nom du visiteur et %2$s pour sa provenance) :" 27 27 28 28 #: _widgets.php:23 … … 32 32 #: _widgets.php:24 33 33 msgid "Welcome text if search exists (use %1$s for keywords and %2$s for related posts's list):" 34 msgstr "Texte d'accueil si une recherche a été faite (utilisez %1$s pour les mots clés et %2$s pour la liste des billets en relation) 34 msgstr "Texte d'accueil si une recherche a été faite (utilisez %1$s pour les mots clés et %2$s pour la liste des billets en relation) :" 35 35 36 36 #: _widgets.php:24 37 msgid "Do you search anything about %1$s? Check those related posts 38 msgstr "Vous recherchez quelque chose en rapport avec %1$s ? Regardez parmi les articles en relation : %2$s"37 msgid "Do you search anything about %1$s? Check those related posts: %2$s" 38 msgstr "Vous recherchez quelque chose en rapport avec %1$s ? Regardez parmi les articles en relation : %2$s" 39 39 40 40 #: _widgets.php:38
Note: See TracChangeset
for help on using the changeset viewer.