Changeset 2230 for plugins/doTwit
- Timestamp:
- 05/08/10 16:18:51 (13 years ago)
- Location:
- plugins/doTwit
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/doTwit/_admin.php
r2158 r2230 1 1 <?php 2 # -- BEGIN LICENSE BLOCK ----------------------------------3 # This file is part of Dotwit, a plugin for Dotclear.4 # 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of doTwit, a plugin for Dotclear. 4 # 5 5 # Copyright (c) 2007 Valentin VAN MEEUWEN 6 6 # <adresse email> 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 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 # -- END LICENSE BLOCK ------------------------------------11 # ***** END LICENSE BLOCK ***** 12 12 13 $core->addBehavior('initWidgets',array('doTwitBehaviors','initWidgets')); 13 if (!defined('DC_CONTEXT_ADMIN')) { return; } 14 14 15 class doTwitBehaviors 16 { 17 public static function initWidgets(&$widgets) 18 { 19 $widgets->create('dotwit',__('DoTwit'),array('DoTwit','dotwitWidget')); 20 $widgets->dotwit->setting('title',__('Titre (facultatif):'),''); 21 $widgets->dotwit->setting('idTwitter',__('Identifiant Twitter :'),''); 22 $widgets->dotwit->setting('pwdTwitter',__('Mot de passe Twitter :'),''); 23 $widgets->dotwit->setting('limit',__('Nombre de twit à afficher :'),1); 24 $widgets->dotwit->setting('homeonly',__('Home page only'),1,'check'); 25 $widgets->dotwit->setting('timeline_friends',__('Timeline amis (Timeline perso par défaut)'),1,'check'); 26 $widgets->dotwit->setting('display_timeout',__('Affichage du temps écoulé'),1,'check'); 27 $widgets->dotwit->setting('display_profil_image',__('Affichage des profils image'),1,'check'); 28 } 29 } 30 15 l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); 16 17 require dirname(__FILE__).'/_widgets.php'; 31 18 ?> -
plugins/doTwit/_define.php
r2158 r2230 1 1 <?php 2 # -- BEGIN LICENSE BLOCK ----------------------------------3 # This file is part of Dotwit, a plugin for Dotclear.4 # 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of doTwit, a plugin for Dotclear. 4 # 5 5 # Copyright (c) 2007 Valentin VAN MEEUWEN 6 6 # <adresse email> 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 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 # -- END LICENSE BLOCK ------------------------------------ 11 # ***** END LICENSE BLOCK ***** 12 if (!defined('DC_RC_PATH')) { return; } 12 13 13 14 $this->registerModule( 14 'DoTwit',15 'Twitter for DotClear 2',16 'Valentin VAN MEEUWEN - Exilius.net',17 '1.2',18 'admin'15 /* Name */ "doTwit", 16 /* Description*/ "Twitter for DotClear 2", 17 /* Author */ "Valentin VAN MEEUWEN (Exilius.net), Pierre Van Glabeke (weeeb.fr)", 18 /* Version */ '1.3', 19 /* Permissions */ 'admin' 19 20 ); 20 21 ?> -
plugins/doTwit/_install.php
r2158 r2230 1 1 <?php 2 # -- BEGIN LICENSE BLOCK ----------------------------------3 # This file is part of Dotwit, a plugin for Dotclear.4 # 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of doTwit, a plugin for Dotclear. 4 # 5 5 # Copyright (c) 2007 Valentin VAN MEEUWEN 6 6 # <adresse email> 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 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 # -- END LICENSE BLOCK ------------------------------------11 # ***** END LICENSE BLOCK ***** 12 12 13 13 # On lit la version du plugin … … 25 25 26 26 # La procédure d'installation commence vraiment là 27 $core->setVersion(' DoTwit',$m_version);27 $core->setVersion('doTwit',$m_version); 28 28 ?> -
plugins/doTwit/_public.php
r2158 r2230 1 1 <?php 2 # -- BEGIN LICENSE BLOCK ----------------------------------3 # This file is part of Dotwit, a plugin for Dotclear.4 # 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of doTwit, a plugin for Dotclear. 4 # 5 5 # Copyright (c) 2007 Valentin VAN MEEUWEN 6 6 # <adresse email> 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 10 10 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 # -- END LICENSE BLOCK ------------------------------------ 11 # ***** END LICENSE BLOCK ***** 12 13 if (!defined('DC_RC_PATH')) { return; } 14 15 require dirname(__FILE__).'/_widgets.php'; 12 16 13 17 class doTwit … … 68 72 $res = 69 73 '<div class="doTwit">'. 70 ($w->title ? '<h2><a href="http://twitter.com/'.$w->idTwit er.'">'.$w->title.'</a></h2>' : '').74 ($w->title ? '<h2><a href="http://twitter.com/'.$w->idTwitter.'">'.$w->title.'</a></h2>' : ''). 71 75 '<ul>'; 72 76 … … 75 79 if( count($xml->status) == 0 ) 76 80 { 77 $res .= ' Données indisponible sur Twitter !';81 $res .= '<p>'.__('Data inalienable on Twitter!').'</p>'; 78 82 return $res; 79 83 } 80 84 81 foreach($xml->status as $elm) { 82 85 foreach($xml->status as $elm) { 86 87 $search = array( 88 'url' => "/(http|mailto|news|ftp|https):\/\/(([-A-z0-9\/.?_=#@+%&:~])*)/", 89 'reply' =>"/@([A-Za-z0-9-_]+)/", 90 'hashtag' => "/#([A-z0-9-_]+)/" 91 ); 92 $replace = array( 93 'url' => "<span class=\"doTwitlink\"><a href=\"$1://$2\" onclick=\"window.open(this.href); return false;\">$1://$2</a></span>", 94 'reply' =>"<span class=\"doTwitreply\"><a href=\"http://twitter.com/$1\" onclick=\"window.open(this.href); return false;\">@$1</a></span>", 95 'hashtag' => "<span class=\"doTwithashtag\"><a href=\"http://search.twitter.com/search?q=%23$1\">#$1</a></span>" 96 ); 83 97 $twi['id'][$nb] = (int) $elm->id; 84 $twi['desc'][$nb] = eregi_replace("(http|mailto|news|ftp|https)://(([-éa-z0-9\/\.\?_=#@:~])*)", "<a href=\"\\1://\\2\" target=\"_blank\" style=\"color:blue;\">\\1://\\2</a>",$elm->text);98 $twi['desc'][$nb] = preg_replace($search, $replace, $elm->text); 85 99 $twi['screen_name'][$nb] = (string) $elm->user->screen_name; 86 100 $twi['name'][$nb] = (string) $elm->user->name; … … 90 104 if( $w->display_timeout) { 91 105 $twi['time'][$nb] = ((int) strtotime($elm->created_at)); 92 $twi['date'][$nb] = date('d/m/ YH\hi', $twi['time'][$nb]);93 $twi['desc'][$nb] .= ' < a href="http://twitter.com/'.$twi['screen_name'][$nb].'/statuses/'.$twi['id'][$nb].'" target="_blank">depuis '. $twi['date'][$nb].'</a>';106 $twi['date'][$nb] = date('d/m/y H\hi', $twi['time'][$nb]); 107 $twi['desc'][$nb] .= ' <br /><span class="doTwitstatut"><a href="http://twitter.com/'.$twi['screen_name'][$nb].'/statuses/'.$elm->id.'" onclick="window.open(this.href); return false;">'.__('on').' '. $twi['date'][$nb].'</a></span>'; 94 108 95 109 } … … 104 118 105 119 if( $w->display_profil_image && $twi['img'][$i] != '' ) { 106 $res .= '<li class=" img" style="background: none;padding-left:2px;border-bottom: 1px solid silver;">';107 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" target="_blank" style="font-weight:bold;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">';108 $res .= '<img src="'.$twi['img'][$i].'" alt="'.$twi['name'][$i].'" style="float:left;margin-right:3px;margin-bottom:2px;border:1px solid silver;"/>';120 $res .= '<li class="doTwitavatar">'; 121 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" onclick="window.open(this.href); return false;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">'; 122 $res .= '<img src="'.$twi['img'][$i].'" alt="'.$twi['name'][$i].'" />'; 109 123 $res .= '</a>'; 110 $res .= '<div style="word-wrap: break-word;padding-left:30px;">';111 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" target="_blank" style="font-weight:bold;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">';124 $res .= '<div class="doTwittxt">'; 125 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" onclick="window.open(this.href); return false;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">'; 112 126 $res .= $twi['screen_name'][$i].'</a> '; 113 127 $res .= $twi['desc'][$i].'</div>'; 114 $res .= '<div style="clear:both;height:1px;"> </div></li>';128 $res .= '<div class="doTwitclear"> </div></li>'; 115 129 }else { 116 $res .= '<li style="border-bottom: 1px solid silver;">';117 $res .= '<div style="word-wrap: break-word;">';118 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" target="_blank" style="font-weight:bold;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">';130 $res .= '<li class="doTwitnoavatar">'; 131 $res .= '<div class="doTwittxt">'; 132 $res .= '<a href="http://twitter.com/'.$twi['screen_name'][$i].'" onclick="window.open(this.href); return false;" title="'.$twi['name'][$i].' ('.$twi['location'][$i].')">'; 119 133 $res .= $twi['screen_name'][$i]; 120 134 $res .= '</a> '.$twi['desc'][$i].'</div>';
Note: See TracChangeset
for help on using the changeset viewer.