Browse Source

Use the old style tag cloud

pull/440/head
danpros 4 years ago
parent
commit
15a61242e4
7 changed files with 42 additions and 57 deletions
  1. +22
    -4
      system/includes/functions.php
  2. +4
    -10
      themes/blog/layout.html.php
  3. +4
    -11
      themes/clean/layout.html.php
  4. +4
    -10
      themes/logs/layout.html.php
  5. +0
    -3
      themes/readable/layout.html.php
  6. +4
    -10
      themes/twentyfifteen/layout.html.php
  7. +4
    -9
      themes/twentysixteen/layout.html.php

+ 22
- 4
system/includes/functions.php View File

@ -1465,11 +1465,29 @@ function tag_cloud($custom = null)
}
if(empty($custom)) {
echo '<ul class="taglist">';
foreach ($tag_collection as $tag => $count) {
echo '<li class="item"><a href="' . site_url() . 'tag/' . $tag . '">' . tag_i18n($tag) . '</a> <span class="count">(' . $count . ')</span></li>';
// Font sizes
$max_size = 22; // max font size in %
$min_size = 8; // min font size in %
// Get the largest and smallest array values
$max_qty = max(array_values($tag_collection));
$min_qty = min(array_values($tag_collection));
// Find the range of values
$spread = $max_qty - $min_qty;
if (0 == $spread) { // we don't want to divide by zero
$spread = 1;
}
echo '</ul>';
// Font-size increment
// this is the increase per tag quantity (times used)
$step = ($max_size - $min_size)/($spread);
foreach ($tag_collection as $tag => $count) {
$size = $min_size + (($count - $min_qty) * $step);
echo ' <a class="tag-cloud-link" href="'. site_url(). 'tag/'. $tag .'" style="font-size:'. $size .'pt;">'.tag_i18n($tag).'</a> ';
}
} else {
return $tag_collection;
}


+ 4
- 10
themes/blog/layout.html.php View File

@ -7,8 +7,6 @@
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<link href="//fonts.googleapis.com/css?family=Lato:300,400,300italic,400italic" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Crimson+Text:400,400italic" rel="stylesheet" type="text/css">
@ -172,15 +170,11 @@
</aside><!--//section-->
<aside class="category-list aside section">
<div class="section-inner">
<h2 class="heading"><?php echo i18n("Popular_tags");?></h2>
<h2 class="heading"><?php echo i18n("Tags");?></h2>
<div class="content">
<?php $i = 1; $tags = tag_cloud(true); arsort($tags); ?>
<ul>
<?php foreach ($tags as $tag => $count):?>
<li><a href="<?php echo site_url();?>tag/<?php echo $tag;?>"><?php echo tag_i18n($tag);?> (<?php echo $count;?>)</a></li>
<?php if ($i++ >= 5) break;?>
<?php endforeach;?>
</ul>
<div class="tagcloud">
<?php echo tag_cloud();?>
</div>
</div><!--//content-->
</div><!--//section-inner-->
</aside><!--//section-->


+ 4
- 11
themes/clean/layout.html.php View File

@ -7,9 +7,6 @@
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/>
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" />
<?php endif; ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@ -36,14 +33,10 @@
<div class="archive"><h3><?php echo i18n('Archives');?></h3><?php echo archive_list() ?></div>
<div class="category-list"><h3><?php echo i18n('Category');?></h3><?php echo category_list() ?></div>
<div class="tagcloud">
<h3>Popular Tags</h3>
<?php $i = 1; $tags = tag_cloud(true); arsort($tags); ?>
<ul>
<?php foreach ($tags as $tag => $count):?>
<li><a href="<?php echo site_url();?>tag/<?php echo $tag;?>"><?php echo tag_i18n($tag);?> (<?php echo $count;?>)</a></li>
<?php if ($i++ >= 5) break;?>
<?php endforeach;?>
</ul>
<h3>Tags</h3>
<div class="tag-cloud">
<?php echo tag_cloud();?>
</div>
</div>
<div class="copyright"><?php echo copyright() ?></div>
</aside>


+ 4
- 10
themes/logs/layout.html.php View File

@ -7,8 +7,6 @@
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/logs/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@ -79,14 +77,10 @@
<?php echo category_list() ?>
</div>
<div class="tagcloud">
<h3>Tags</h3>
<?php $i = 1; $tags = tag_cloud(true); arsort($tags); ?>
<ul>
<?php foreach ($tags as $tag => $count):?>
<li><a href="<?php echo site_url();?>tag/<?php echo $tag;?>"><?php echo tag_i18n($tag);?> (<?php echo $count;?>)</a></li>
<?php if ($i++ >= 5) break;?>
<?php endforeach;?>
</ul>
<h3><?php echo i18n('Tags');?></h3>
<div class="tag-cloud">
<?php echo tag_cloud();?>
</div>
</div>
</aside>
</div>


+ 0
- 3
themes/readable/layout.html.php View File

@ -7,9 +7,6 @@
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/readable/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" />
<?php endif; ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->


+ 4
- 10
themes/twentyfifteen/layout.html.php View File

@ -5,8 +5,6 @@
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<link rel="stylesheet" id="twentyfifteen-fonts-css" href="<?php echo site_url();?>themes/twentyfifteen/css/font.css" type="text/css" media="all">
<link rel="stylesheet" id="genericons-css" href="<?php echo site_url();?>themes/twentyfifteen/genericons/genericons.css" type="text/css" media="all">
<link rel="stylesheet" id="twentyfifteen-style-css" href="<?php echo site_url();?>themes/twentyfifteen/css/style_v2.css" type="text/css" media="all">
@ -101,14 +99,10 @@
<?php echo category_list() ?>
</aside>
<aside class="widget widget_meta">
<h2 class="widget-title"><?php echo i18n("Popular_tags");?></h2>
<?php $i = 1; $tags = tag_cloud(true); arsort($tags); ?>
<ul>
<?php foreach ($tags as $tag => $count):?>
<li><a class="more-link" href="<?php echo site_url();?>tag/<?php echo $tag;?>"><?php echo tag_i18n($tag);?> (<?php echo $count;?>)</a></li>
<?php if ($i++ >= 5) break;?>
<?php endforeach;?>
</ul>
<h2 class="widget-title"><?php echo i18n("Tags");?></h2>
<div class="tag-cloud">
<?php echo tag_cloud();?>
</div>
</aside>
</div>
</div>


+ 4
- 9
themes/twentysixteen/layout.html.php View File

@ -5,7 +5,6 @@
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php if (publisher()): ?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<link rel="stylesheet" id="twentysixteen-fonts-css" href="https://fonts.googleapis.com/css?family=Merriweather%3A400%2C700%2C900%2C400italic%2C700italic%2C900italic%7CMontserrat%3A400%2C700%7CInconsolata%3A400&#038;subset=latin%2Clatin-ext" type="text/css" media="all" />
<link rel="stylesheet" id="genericons-css" href="<?php echo site_url();?>themes/twentysixteen/genericons/genericons.css" type="text/css" media="all" />
<link rel="stylesheet" id="twentysixteen-style-css" href="<?php echo site_url();?>themes/twentysixteen/css/style.css" type="text/css" media="all" />
@ -110,14 +109,10 @@
</section>
<section id="popular-tags" class="widget widget_popular_tags">
<h2 class="widget-title"><?php echo i18n("Popular_tags");?></h2>
<?php $i = 1; $tags = tag_cloud(true); arsort($tags); ?>
<ul>
<?php foreach ($tags as $tag => $count):?>
<li><a class="more-link" href="<?php echo site_url();?>tag/<?php echo $tag;?>"><?php echo tag_i18n($tag);?> (<?php echo $count;?>)</a></li>
<?php if ($i++ >= 5) break;?>
<?php endforeach;?>
</ul>
<h2 class="widget-title"><?php echo i18n("Tags");?></h2>
<div class="tag-cloud">
<?php echo tag_cloud();?>
</div>
</section>
</aside><!-- .sidebar .widget-area -->


Loading…
Cancel
Save