Changeset 2466
- Timestamp:
- 07/09/10 20:37:44 (13 years ago)
- Location:
- plugins/twitterPost
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/twitterPost/_admin.php
r2451 r2466 1 1 <?php 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of TwitterPost. 4 # Copyright (c) 2009 Hadrien Lanneau. 5 # All rights reserved. 6 # 7 # Pixearch is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Pixearch is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Pixearch; if not, write to the Free Software 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 # 21 # http://alt-i.fr/pages/TwitterPost 22 # 23 # ***** END LICENSE BLOCK ***** 24 2 25 include_once(dirname(__FILE__) . '/inc/TwitterPost.class.php'); 3 26 $core->addBehavior( -
plugins/twitterPost/_define.php
r2451 r2466 1 1 <?php 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of TwitterPost. 4 # Copyright (c) 2009 Hadrien Lanneau. 5 # All rights reserved. 6 # 7 # Pixearch is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Pixearch is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Pixearch; if not, write to the Free Software 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 # 21 # http://alt-i.fr/pages/TwitterPost 22 # 23 # ***** END LICENSE BLOCK ***** 2 24 if (!defined('DC_RC_PATH')) { return; } 3 25 -
plugins/twitterPost/_install.php
r2451 r2466 1 1 <?php 2 # ***** BEGIN LICENSE BLOCK ***** 3 # This file is part of TwitterPost. 4 # Copyright (c) 2009 Hadrien Lanneau. 5 # All rights reserved. 6 # 7 # Pixearch is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Pixearch is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Pixearch; if not, write to the Free Software 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 # 21 # http://alt-i.fr/pages/TwitterPost 22 # 23 # ***** END LICENSE BLOCK ***** 2 24 if (!defined('DC_CONTEXT_ADMIN')) { return; } 3 25 $core->blog->settings->setNamespace('twitterpost'); -
plugins/twitterPost/inc/TwitterPost.class.php
r2451 r2466 19 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 # 21 # http:// www.alti.info/pages/TwitterPost21 # http://alt-i.fr/pages/TwitterPost 22 22 # 23 23 # ***** END LICENSE BLOCK ***** … … 68 68 69 69 $status = $core->blog->settings->twitterpost_status; 70 70 71 71 if (!empty($_POST['twitterpost_twit']) and 72 72 $_POST['twitterpost_twit'] and … … 179 179 $uri = '') 180 180 { 181 $c = new netHttp( 182 'alti.pro' 181 global $core; 182 $shortener = $core->blog->settings->twitterpost->twitterpost_shortener; 183 184 if (is_null($shortener)) 185 { 186 // Default 187 $shortener = 'http://alti.pro/api.php?longurl=%url%'; 188 } 189 190 $uri = str_replace( 191 '%url%', 192 $uri, 193 $shortener 183 194 ); 184 $c->get( 185 '/api.php', 186 array( 187 'longurl' => $uri 188 ) 189 ); 190 if ($c->getStatus() == '200') 195 196 $uri = netHttp::quickGet($uri); 197 198 if ($uri === false) 191 199 { 192 $uri = $c->getContent();200 throw new Exception('Shortener url is invalid.'); 193 201 } 202 194 203 return $uri; 195 204 } -
plugins/twitterPost/index.php
r2451 r2466 22 22 # 23 23 # ***** END LICENSE BLOCK ***** 24 24 25 $core->blog->settings->setNamespace('twitterpost'); 25 26 26 // Twitter 27 if ( !empty($_POST['twitterpost_username']))27 if (isset($_POST['twitterpost_username'])) 28 28 { 29 29 $username = $_POST['twitterpost_username']; … … 66 66 67 67 // Identica 68 if ( !empty($_POST['twitterpost_username_identica']))68 if (isset($_POST['twitterpost_username_identica'])) 69 69 { 70 70 $username_identica = $_POST['twitterpost_username_identica']; … … 96 96 } 97 97 98 // Tr.im 99 if (!empty($_POST['twitterpost_username_trim'])) 100 { 101 $username_trim = $_POST['twitterpost_username_trim']; 102 $password_trim = $_POST['twitterpost_password_trim']; 103 104 $core->blog->settings->put( 105 'twitterpost_username_trim', 106 $username_trim, 107 'string', 108 __('Tr.im login'), 109 true, 110 false 111 ); 112 $core->blog->settings->put( 113 'twitterpost_password_trim', 114 $password_trim, 115 'string', 116 __('Tr.im password'), 117 true, 118 false 119 ); 120 121 $msg = __('Configuration successfully updated'); 122 } 123 else 124 { 125 $username_trim = $core->blog->settings->twitterpost_username_trim; 126 $password_trim = $core->blog->settings->twitterpost_password_trim; 98 // Shortener 99 if (isset($_POST['twitterpost_shortener'])) 100 { 101 $shortener = $_POST['twitterpost_shortener']; 102 103 $core->blog->settings->put( 104 'twitterpost_shortener', 105 $shortener, 106 'string', 107 __('Shortener api url'), 108 true, 109 false 110 ); 111 112 $msg = __('Configuration successfully updated'); 113 } 114 else 115 { 116 $shortener = $core->blog->settings->twitterpost->twitterpost_shortener; 127 117 } 128 118 … … 145 135 else 146 136 { 147 $status = $core->blog->settings->twitterpost _status;137 $status = $core->blog->settings->twitterpost->twitterpost_status; 148 138 } 149 139 … … 232 222 </fieldset> 233 223 224 <fieldset> 225 <legend><?php echo __('Shortener'); ?></legend> 226 <p class="label"> 227 <label class="classic"> 228 <?php echo __('API :'); ?> 229 <?php echo form::field( 230 'twitterpost_shortener', 231 50, 232 null, 233 $shortener 234 ); ?> 235 </label> 236 </p> 237 <p> 238 <?php echo __('You can set your own shortener'); ?><br /> 239 <?php echo __('Exemple'); ?> "<em>http://alti.pro/api.php?longurl=%url%</em>" 240 </p> 241 </fieldset> 242 234 243 <input type="hidden" name="p" value="twitterPost" /> 235 244 <?php echo $core->formNonce(); ?> -
plugins/twitterPost/locales/en/admin.po
r2134 r2466 48 48 msgid "Twitter Post: Post must be published" 49 49 msgstr "Twitter Post : Post must be published." 50 51 msgid "You can set your own shortener" 52 msgstr "You can set your own shortener. Default is is.gd." 53 54 msgid "Example" 55 msgstr "Example" -
plugins/twitterPost/locales/fr/main.po
r2134 r2466 48 48 msgid "Twitter Post: Post must be published" 49 49 msgstr "Twitter Post : votre article doit être publié." 50 51 msgid "You can set your own shortener" 52 msgstr "Vous pouvez utiliser votre propre shortener. Par défaut, is.gd sera utilisé" 53 54 msgid "Example" 55 msgstr "Exemple"
Note: See TracChangeset
for help on using the changeset viewer.