Changeset 3730:5c45a5df9a59 for plugins/tags/tags.php
- Timestamp:
- 03/08/18 17:58:39 (8 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
plugins/tags/tags.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/tags/tags.php
r3057 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_CONTEXT_ADMIN')) { return;}12 if (!defined('DC_CONTEXT_ADMIN')) {return;} 13 13 14 14 ?> … … 16 16 <head> 17 17 <title><?php echo __('Tags'); ?></title> 18 <?php echo dcPage::cssLoad(dcPage::getPF('tags/style.css')); ?>18 <?php echo dcPage::cssLoad(dcPage::getPF('tags/style.css')); ?> 19 19 </head> 20 20 … … 22 22 <?php 23 23 echo dcPage::breadcrumb( 24 array(25 html::escapeHTML($core->blog->name) => '',26 __('Tags')=> ''27 )).28 dcPage::notices();24 array( 25 html::escapeHTML($core->blog->name) => '', 26 __('Tags') => '' 27 )) . 28 dcPage::notices(); 29 29 ?> 30 30 … … 33 33 $tags = $core->meta->getMetadata(array('meta_type' => 'tag')); 34 34 $tags = $core->meta->computeMetaStats($tags); 35 $tags->sort('meta_id_lower', 'asc');35 $tags->sort('meta_id_lower', 'asc'); 36 36 37 37 $last_letter = null; 38 $cols = array('',''); 39 $col = 0; 40 while ($tags->fetch()) 41 { 42 $letter = mb_strtoupper(mb_substr($tags->meta_id_lower,0,1)); 38 $cols = array('', ''); 39 $col = 0; 40 while ($tags->fetch()) { 41 $letter = mb_strtoupper(mb_substr($tags->meta_id_lower, 0, 1)); 43 42 44 if ($last_letter != $letter) {45 if ($tags->index() >= round($tags->count()/2)) {46 $col = 1;47 }48 $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>'.$letter.'</span></td></tr>';49 }43 if ($last_letter != $letter) { 44 if ($tags->index() >= round($tags->count() / 2)) { 45 $col = 1; 46 } 47 $cols[$col] .= '<tr class="tagLetter"><td colspan="2"><span>' . $letter . '</span></td></tr>'; 48 } 50 49 51 $cols[$col] .=52 '<tr class="line">'.53 '<td class="maximal"><a href="'.$p_url.54 '&m=tag_posts&tag='.rawurlencode($tags->meta_id).'">'.$tags->meta_id.'</a></td>'.55 '<td class="nowrap"><strong>'.$tags->count.'</strong> '.56 (($tags->count==1) ? __('entry') : __('entries')).'</td>'.57 '</tr>';50 $cols[$col] .= 51 '<tr class="line">' . 52 '<td class="maximal"><a href="' . $p_url . 53 '&m=tag_posts&tag=' . rawurlencode($tags->meta_id) . '">' . $tags->meta_id . '</a></td>' . 54 '<td class="nowrap"><strong>' . $tags->count . '</strong> ' . 55 (($tags->count == 1) ? __('entry') : __('entries')) . '</td>' . 56 '</tr>'; 58 57 59 $last_letter = $letter;58 $last_letter = $letter; 60 59 } 61 60 62 61 $table = '<div class="col"><table class="tags">%s</table></div>'; 63 62 64 if ($cols[0]) 65 { 66 echo '<div class="two-cols">'; 67 printf($table,$cols[0]); 68 if ($cols[1]) { 69 printf($table,$cols[1]); 70 } 71 echo '</div>'; 72 } 73 else 74 { 75 echo '<p>'.__('No tags on this blog.').'</p>'; 63 if ($cols[0]) { 64 echo '<div class="two-cols">'; 65 printf($table, $cols[0]); 66 if ($cols[1]) { 67 printf($table, $cols[1]); 68 } 69 echo '</div>'; 70 } else { 71 echo '<p>' . __('No tags on this blog.') . '</p>'; 76 72 } 77 73
Note: See TracChangeset
for help on using the changeset viewer.
