Changeset 198063
- Timestamp:
- 01/25/2010 09:24:28 PM (16 years ago)
- Location:
- author-avatars/trunk
- Files:
-
- 6 edited
-
js/tinymce.popup.js (modified) (1 diff)
-
lib/AuthorAvatarsEditorButton.class.php (modified) (1 diff)
-
lib/AuthorAvatarsForm.class.php (modified) (2 diffs)
-
lib/AuthorAvatarsShortcode.class.php (modified) (1 diff)
-
lib/AuthorAvatarsWidget.class.php (modified) (3 diffs)
-
lib/UserList.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
author-avatars/trunk/js/tinymce.popup.js
r129076 r198063 107 107 } 108 108 109 // min post count 110 var min_post_count = jQuery("#min_post_count").val() || ""; 111 if (min_post_count.length > 0) { 112 tagtext += " min_post_count=" + min_post_count; 113 } 114 109 115 // order 110 116 var order = jQuery("#order").val() || ""; -
author-avatars/trunk/lib/AuthorAvatarsEditorButton.class.php
r122277 r198063 124 124 $adv_left .= $form->renderFieldSortDirection('asc'); 125 125 $adv_left .= $form->renderFieldLimit(); 126 $adv_left .= $form->renderFieldMinPostCount(); 126 127 $adv_left .= $form->renderFieldHiddenUsers(); 127 128 -
author-avatars/trunk/lib/AuthorAvatarsForm.class.php
r129082 r198063 272 272 $html .= '<br />'; 273 273 $html .= $this->renderFieldLimit($display_values['limit'], $name_base .'[limit]'); 274 $html .= '<br />'; 275 $html .= $this->renderFieldMinPostCount($display_values['min_post_count'], $name_base .'[min_post_count]'); 274 276 $html .= '<br />'; 275 277 $html .= $this->renderFieldAvatarSize($display_values['avatar_size'], $name_base . '[avatar_size]'); … … 393 395 return '<p>'. FormHelper::input('text', $name, $value, $attributes) .'</p>'; 394 396 } 397 398 399 /** 400 * Renders the "min_post_count" input field 401 * 402 * @param string $value the field value 403 * @param string $name the field name 404 * @return string 405 */ 406 function renderFieldMinPostCount($value='', $name='min_post_count') { 407 $attributes = array( 408 'id' => $this->_getFieldId($name), 409 'label' => __('Required minimum number of posts', 'author-avatars') . ': ', 410 'size' => '5' 411 ); 412 $name = $this->_getFieldName($name); 413 return '<p>'. FormHelper::input('text', $name, $value, $attributes) .'</p>'; 414 } 395 415 396 416 /** -
author-avatars/trunk/lib/AuthorAvatarsShortcode.class.php
r114302 r198063 101 101 if ($limit > 0) $userlist->limit = $limit; 102 102 } 103 104 // min. number of posts 105 if (!empty($atts['min_post_count'])) { 106 $min_post_count = intval($atts['min_post_count']); 107 if ($min_post_count > 0) $userlist->min_post_count = min_post_count; 108 } 103 109 104 110 // display order -
author-avatars/trunk/lib/AuthorAvatarsWidget.class.php
r122277 r198063 24 24 'avatar_size' => '', 25 25 'limit' => '', 26 'min_post_count' => '', 26 27 'order' => 'display_name', 27 28 'sort_direction' => 'asc', … … 104 105 $userlist->avatar_size = $instance['display']['avatar_size']; 105 106 $userlist->limit = $instance['display']['limit']; 107 $userlist->min_post_count = $instance['display']['min_post_count']; 106 108 $userlist->order = $instance['display']['order']; 107 109 $userlist->sort_direction = $instance['display']['sort_direction']; … … 180 182 $adv_left .= $form->renderFieldSortDirection($instance['display']['sort_direction'], 'display][sort_direction'); 181 183 $adv_left .= $form->renderFieldLimit($instance['display']['limit'], 'display][limit'); 184 $adv_left .= $form->renderFieldMinPostCount($instance['display']['min_post_count'], 'display][min_post_count'); 182 185 $adv_left .= $form->renderFieldHiddenUsers($instance['hiddenusers']); 183 186 -
author-avatars/trunk/lib/UserList.class.php
r129082 r198063 51 51 */ 52 52 var $limit = 0; 53 54 /** 55 * Minimum number of posts which a user needs to have in order to be shown in the listing 56 */ 57 var $min_post_count = 0; 53 58 54 59 /** … … 339 344 $add = false; 340 345 } 346 347 // Remove users with zero posts 348 if ( 349 // if the flag is set to remove respective users 350 $this->min_post_count > 0 && 351 // and they have zero posts 352 $this->get_user_postcount($user->user_id) < $this->min_post_count ) { 353 // do not add this user 354 $add = false; 355 } 341 356 342 357 if ($add === true) {
Note: See TracChangeset
for help on using the changeset viewer.