Changeset 1521
- Timestamp:
- 09/27/09 22:31:16 (14 years ago)
- Location:
- plugins/microBlog
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/microBlog/_define.php
r1391 r1521 17 17 /* Description*/ "Display and update your streamlifes all over the Web", 18 18 /* Author */ "Jeremie Patonnier", 19 /* Version */ '0. 2.2',19 /* Version */ '0.3', 20 20 /* Permissions */ 'usage,contentadmin' 21 21 ); 22 22 23 23 # CHANGELOG 24 # TODO Check login validity when adding a service 25 # TODO Add help page 26 # TODO Fix autosend note for planified post 24 27 25 # v. 0.2.2 28 # v. 0.3 29 # make behaviors PHP 5.3 ready 30 # Clear blog cache every 10 min (necessary for widget... need improvement) 31 # Add new post message customization in admin 32 33 34 # v. 0.2.2 rev 1391 26 35 # fixe install 27 36 -
plugins/microBlog/_prepend.php
r1359 r1521 39 39 //// Action sur le blog ///////////////////////////////////////////// 40 40 41 $core->addBehavior('publicPrepend', array(microBlogBehaviors::ini($core),'publicPrepend')); 42 41 43 $core->addBehavior('adminAfterPostCreate', array(microBlogBehaviors::ini($core),'afterPostCreate')); 42 44 $core->addBehavior('adminBeforePostUpdade',array(microBlogBehaviors::ini($core),'beforePostUpdate')); -
plugins/microBlog/inc/class.micro.blog.behaviors.php
r1359 r1521 80 80 } 81 81 82 /** 83 * Method that must be bind with the publicPrepend behavior 84 * 85 * @param dcBlog $blog 86 */ 87 public function publicPrepend(dcCore $core) 88 { 89 90 $oldDate = $core->blog->upddt; 91 $newDate = time(); 92 93 if($newDate - $oldDate > 600){ 94 $core->blog->triggerBlog(); 95 } 96 } 82 97 83 98 /** … … 87 102 * @param $post_id 88 103 */ 89 public function afterPostCreate( &$Post,$post_id)104 public function afterPostCreate(cursor $Post,$post_id) 90 105 { 91 106 if ($Post->post_status == 1) { 92 $this->pushNote($Post ->post_url);107 $this->pushNote($Post); 93 108 } 94 109 } … … 101 116 * @param $post_id 102 117 */ 103 public static function beforePostUpdate(&$Post,$post_id)118 public function beforePostUpdate(cursor $Post,$post_id) 104 119 { 105 120 $this->status[$post_id] = $Post->post_status; … … 113 128 * @param $post_id 114 129 */ 115 public function afterPostUpdate( &$Post,$post_id)130 public function afterPostUpdate(cursor $Post,$post_id) 116 131 { 117 132 $new = $Post->post_status; … … 119 134 120 135 if ($new == 1 && $new != $old){ 121 $this->pushNote($Post ->post_url);136 $this->pushNote($Post); 122 137 } 123 138 … … 131 146 * @param $post_url string 132 147 */ 133 private function pushNote( $post_url)148 private function pushNote(cursor $Post) 134 149 { 135 $txt = __('New Blog Post: ') 136 . $this->dc_core->blog->url 137 . $this->dc_core->url->getBase('publicpage') 138 . $post_url; 150 $txt = $this->micro_blog->getDefaultNote(); 151 $url = $this->dc_core->blog->url 152 . $this->dc_core->url->getBase('publicpage') 153 . $Post->post_url; 154 155 $txt = str_replace('%url%',$url,$txt); 156 $txt = str_replace('%title%',$Post->post_title,$txt); 139 157 140 158 $services = $this->micro_blog->getServicesList(); -
plugins/microBlog/inc/class.micro.blog.php
r1361 r1521 56 56 static private $sType = array(); 57 57 58 /** 59 * Default note use to send automatic note 60 * 61 * It's possible to use the following constants: 62 * %url% : URL of the blog post 63 * %title% : title of the blog post 64 * %blog% : name of the blog 65 * 66 * @var string 67 */ 68 static private $dNote = 'New blog post: %url%'; 69 58 70 59 71 //// METHODES PUBLICS /////////////////////////////////// … … 245 257 246 258 return self::$sAccess[$serviceId]; 259 } 260 261 public function setDefaultNote($note) 262 { 263 self::$dNote = (string)$note; 264 } 265 266 public function getDefaultNote() 267 { 268 return self::$dNote; 247 269 } 248 270 -
plugins/microBlog/index.php
r1374 r1521 194 194 else { 195 195 $_SESSION['mb_post_msg'][] = __('Services successfully updated'); 196 } 197 } 198 199 # ---------------------------------------------------- 200 # Paramétrage de la note par deffaut 201 if (isset($_POST['MB_defnote']) 202 && is_string($_POST['MB_defnote'])) 203 { 204 $old = $MicroBlog->getDefaultNote(); 205 206 if($old != $_POST['MB_defnote']) 207 { 208 $MicroBlog->setDefaultNote($_POST['MB_defnote']); 209 210 $_SESSION['mb_post_msg'][] = __('Default note updated'); 196 211 } 197 212 } … … 386 401 </fieldset> 387 402 403 <fieldset> 404 <legend><?php echo __('Default note'); ?></legend> 405 <p class="area"> 406 <?php echo form::textarea('MB_defnote', 15, 3, $MicroBlog->getDefaultNote()); ?> 407 </p> 408 </fieldset> 409 388 410 <p> 389 411 <?php echo $core->formNonce(); ?>
Note: See TracChangeset
for help on using the changeset viewer.