Changeset 1215005
- Timestamp:
- 08/07/2015 05:42:05 PM (11 years ago)
- Location:
- post-index/trunk
- Files:
-
- 3 edited
-
php/postsummary.php (modified) (4 diffs)
-
post-index.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-index/trunk/php/postsummary.php
r1202863 r1215005 176 176 } 177 177 178 function printOut($maxColumns = 1, $showLetter = true )178 function printOut($maxColumns = 1, $showLetter = true, $showList = true) 179 179 { 180 180 if(is_null($this->items)) … … 188 188 echo '<h2>'.$subCategory.'</h2>'."\n"; 189 189 // Parse Subcategory 190 $this->printItem($item, $this->itemCount[$subCategory], $subCategory, $maxColumns, $showLetter, 'h3');190 $this->printItem($item, $this->itemCount[$subCategory], $subCategory, $maxColumns, $showLetter, $showList, 'h3'); 191 191 } 192 192 } 193 193 else { 194 $this->printItem($this->items, $this->itemCount, $this->category, $maxColumns, $showLetter );194 $this->printItem($this->items, $this->itemCount, $this->category, $maxColumns, $showLetter, $showList); 195 195 } 196 196 … … 203 203 * @param int $maxColumns determines the amount of columns 204 204 */ 205 function printItem($item, $itemCount, $categoryName, $maxColumns, $showLetter, $ headerTag = 'h2') {205 function printItem($item, $itemCount, $categoryName, $maxColumns, $showLetter, $showList, $headerTag = 'h2') { 206 206 echo '<p>'; 207 207 $categoryId = uniqid(); … … 219 219 echo '<hr />'; 220 220 } 221 222 if($itemCount > 0) 223 { 224 echo '<p>' . __('Jump to', 'post-index') . ' '; 225 226 $groups = array_keys($item); 227 $countOfGroups = count($groups); 228 229 for($i = 0; $i < $countOfGroups; $i++) { 230 echo '<a href="#letter_' . $categoryId . '_' . $groups[$i] . '">' . $groups[$i] . '</a>'; 231 if($i < ($countOfGroups-1)) { 232 echo ','; 233 } 234 echo ' '; 235 } 236 237 echo '</p>' . "\n"; 221 222 if ($itemCount > 0) { 223 if ($showList) { 224 echo '<p>' . __('Jump to', 'post-index') . ' '; 225 226 $groups = array_keys($item); 227 $countOfGroups = count($groups); 228 229 for ($i = 0; $i < $countOfGroups; $i++) { 230 echo '<a href="#letter_' . $categoryId . '_' . $groups[$i] . '">' . $groups[$i] . '</a>'; 231 if ($i < ($countOfGroups - 1)) { 232 echo ','; 233 } 234 echo ' '; 235 } 236 237 echo '</p>' . "\n"; 238 } 238 239 239 240 $itemCountPerGroup = 2; // used for the calculation of items per column. -
post-index/trunk/post-index.php
r1202863 r1215005 71 71 , 'columns' => 1 72 72 , 'show_letter' => true 73 , 'show_list' => true 73 74 , 'groupby_cf' => null 74 75 ) … … 78 79 79 80 $show_letter = filter_var($show_letter, FILTER_VALIDATE_BOOLEAN); 81 $show_list = filter_var($show_list, FILTER_VALIDATE_BOOLEAN); 80 82 81 83 if(empty($post_type) && empty($category)) { … … 87 89 ob_start(); 88 90 $ps->parse($category, $groupby, $groupby_cf, $categoryslug, $post_type); 89 $ps->printOut($columns, $show_letter );91 $ps->printOut($columns, $show_letter, $show_list); 90 92 91 93 $content = ob_get_contents(); -
post-index/trunk/readme.txt
r1202863 r1215005 70 70 * **columns**: The amount of columns. Default is 1. 71 71 * **show_letter**: If set to false, the grouping letter will not be generated. 72 * **show_list**: If set to false, the "Jump to" list will not be generated. 72 73 * **groupby_cf**: If defined, the custom field value will be used for grouping and sorting instead of the blog posts title. 73 74 … … 90 91 91 92 * Added: Use any custom field value to group your index with. Just specify it in the shortcode like `[post_index groupby_cf='Author']`. It does work together with grouping by subcategory and the default firstLetter grouping. 93 * Added: New Parameter show_list to explicitly hiding the "Jump to" list. Contributed by billthefarmer. (Usage: `[post_index show_list=false]`) 92 94 93 95 = 0.7.4 = 94 96 95 * Added: Dutch translation. Thanks toaadje93.96 * Added: Portuguese translation. Thanks toluisapietrobon.97 * Added: Dutch translation. Contributed by aadje93. 98 * Added: Portuguese translation. Contributed by luisapietrobon. 97 99 * Added: Parameter show_letter to explicitly hide the grouping letter. (Usage: `[post_index show_letter=false]`) 98 100 * Fixed: On PHP configurations having error_reporting set to include E_NOTICE, saving pages ended up with a warning page.
Note: See TracChangeset
for help on using the changeset viewer.