Changeset 2222
- Timestamp:
- 05/06/10 17:31:55 (13 years ago)
- Location:
- plugins/shareOn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/shareOn/_define.php
r2218 r2222 17 17 /* Description*/ "Add some buttons to your posts to share them", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0.4. 1',19 /* Version */ '0.4.2.2', 20 20 /* Permissions */ 'content' 21 21 ); 22 /* date */ #2010050 522 /* date */ #20100506 23 23 ?> -
plugins/shareOn/inc/class.shareon.php
r2219 r2222 402 402 return 403 403 trim( 404 preg_replace(array('~\r\n|\r|\n~',"'"),array(' ',"\'"), 404 str_replace("'","\'", 405 preg_replace('~\r\n|\r|\n~',' ', 405 406 text::cutString( 406 407 html::escapeHTML( … … 408 409 html::clean( 409 410 $str 410 ))),180))) ;411 ))),180)))); 411 412 } 412 413 … … 475 476 public $name = 'Google Buzz'; 476 477 public $home = 'http://www.google.com/buzz/stuff'; 477 public $base = '<a href="http://www.google.com/buzz/post" class="google-buzz-button" title="Google Buzz" data-message="%TITLE " data-url="%URL%" data-locale="%LANG%" data-button-style="%STYLE%"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script>';478 public $base = '<a href="http://www.google.com/buzz/post" class="google-buzz-button" title="Google Buzz" data-message="%TITLE%%DESC%" data-url="%URL%" data-locale="%LANG%" data-button-style="%STYLE%"></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script>'; 478 479 public $size = array( 479 480 0 => array('style'=>'normal-count','width'=>51,'height'=>82), 480 481 1 => array('style'=>'small-count','width'=>159,'height'=>22) 481 482 ); 482 483 public function __construct($core) 484 { 485 parent::__construct($core); 483 public $encode = false; 484 public $_showdesc = false; 485 486 public function __construct($core) 487 { 488 parent::__construct($core); 489 $this->_showdesc = (string) $this->s->shareOn_button_gbuzz_showdesc; 490 } 491 492 public function moreSettingsForm() 493 { 494 return 495 '<p class="field"><label>'. 496 __('Add post description to message'). 497 form::checkbox(array('gbuzz_showdesc'),1,$this->_showdesc). 498 '</label></p>'; 499 } 500 501 public function moreSettingsSave() 502 { 503 if (isset($_POST['gbuzz_showdesc'])) { 504 $this->s->put('shareOn_button_gbuzz_showdesc',$_POST['gbuzz_showdesc'],'boolean'); 505 } 506 } 507 508 public function completeHTMLButton($base) 509 { 510 if (!$this->_showdesc) { 511 return str_replace('%DESC%','',$base); 512 } 513 514 global $core, $_ctx; 515 516 $desc = ''; 517 if ($_ctx->posts->post_excerpt != '') { 518 $desc = self::gbuzzClean($_ctx->posts->post_excerpt); 519 } 520 elseif ($_ctx->posts->post_content != '') { 521 $desc .= self::gbuzzClean($_ctx->posts->post_content,500); 522 } 523 524 return str_replace('%DESC%',' - '.$desc,$base); 525 } 526 527 protected static function gbuzzClean($str,$len=null) 528 { 529 $str = 530 trim( 531 preg_replace('~\r\n|\r|\n~',' ', 532 html::escapeHTML( 533 html::decodeEntities( 534 html::clean( 535 $str 536 ))))); 537 538 if ($len) { 539 return text::cutString($str,$len); 540 } 541 else { 542 return $str; 543 } 486 544 } 487 545 } -
plugins/shareOn/release.txt
r2218 r2222 1 0.4.2 20100506 2 * Added post sample to google buzz and fixed url 3 * Fixed Flattr description 4 1 5 0.4.1 20100505 2 6 * Added Google buzz button
Note: See TracChangeset
for help on using the changeset viewer.