mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 20:16:22 +05:30
Limit tagcloud
Allowing to set the tagcloud number
This commit is contained in:
parent
19b1202003
commit
e702617cc4
21 changed files with 234 additions and 2 deletions
|
|
@ -81,6 +81,9 @@ recent.count = "5"
|
|||
; Popular posts
|
||||
popular.count = "5"
|
||||
|
||||
; Tagcloud
|
||||
tagcloud.count = "40"
|
||||
|
||||
; Teaser type: set "trimmed" or "full".
|
||||
teaser.type = "full"
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
["site.url","timezone","date.format","language","blog.title","blog.tagline","blog.description","blog.copyright","permalink.type","static.frontpage","blog.enable","social.twitter","social.facebook","breadcrumb.home","comment.system","fb.appid","fb.num","fb.color","disqus.shortname","google.wmt.id","google.analytics.id","google.gtag.id","google.reCaptcha","google.reCaptcha.public","google.reCaptcha.private","posts.perpage","category.perpage","tag.perpage","archive.perpage","search.perpage","profile.perpage","type.perpage","json.count","category.info","related.count","recent.count","popular.count","teaser.type","read.more","teaser.char","description.char","rss.count","rss.char","views.counter","sitemap.priority.base","sitemap.priority.post","sitemap.priority.static","sitemap.priority.category","sitemap.priority.tag","sitemap.priority.archiveDay","sitemap.priority.archiveMonth","sitemap.priority.archiveYear","sitemap.priority.author","sitemap.priority.type","prerelease","cache.expiration","cache.off","generation.time","cache.timestamp","views.root","views.layout"]
|
||||
["site.url","timezone","date.format","language","blog.title","blog.tagline","blog.description","blog.copyright","permalink.type","static.frontpage","blog.enable","social.twitter","social.facebook","breadcrumb.home","comment.system","fb.appid","fb.num","fb.color","disqus.shortname","google.wmt.id","google.analytics.id","google.gtag.id","google.reCaptcha","google.reCaptcha.public","google.reCaptcha.private","posts.perpage","category.perpage","tag.perpage","archive.perpage","search.perpage","profile.perpage","type.perpage","json.count","category.info","related.count","recent.count","popular.count","tagcloud.count","teaser.type","read.more","teaser.char","description.char","rss.count","rss.char","views.counter","sitemap.priority.base","sitemap.priority.post","sitemap.priority.static","sitemap.priority.category","sitemap.priority.tag","sitemap.priority.archiveDay","sitemap.priority.archiveMonth","sitemap.priority.archiveYear","sitemap.priority.author","sitemap.priority.type","prerelease","cache.expiration","cache.off","generation.time","cache.timestamp","views.root","views.layout"]
|
||||
|
|
@ -258,3 +258,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Beiträge von"
|
|||
Pages="Seiten"
|
||||
Menu="Menüs"
|
||||
Popular="Zugriffe"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -268,3 +268,5 @@ Author_Description="Just another HTMLy user"
|
|||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = TagCloud at most
|
||||
|
|
|
|||
|
|
@ -255,3 +255,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Halaman"
|
||||
Menu="Menu"
|
||||
Popular="Populer"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -257,3 +257,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -269,3 +269,5 @@ Author_Description="Еще один пользователь HTMLy"
|
|||
;404-search
|
||||
Search_results_not_found="По вашему запросу ничего не найдено!"
|
||||
No_search_results="Безрезультатно"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -274,3 +274,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -256,3 +256,17 @@ Posts_by="Posts by"
|
|||
Pages="Pages"
|
||||
Menu="Menu"
|
||||
Popular="Popular"
|
||||
;Errors
|
||||
User_Error="User field is required"
|
||||
Pass_Error="Password field is required"
|
||||
Token_Error="CSRF Token not correct"
|
||||
Captcha_Error="reCaptcha not correct"
|
||||
Invalid_Error="ERROR: Invalid username or password"
|
||||
;Profile
|
||||
Post_by_author="Posts by this author"
|
||||
Author_Description="Just another HTMLy user"
|
||||
;404-search
|
||||
Search_results_not_found="Search results not found!"
|
||||
No_search_results="No search results"
|
||||
;TagCloud
|
||||
Tagcloud_widget_at_most = "TagCloud at most"
|
||||
|
|
|
|||
|
|
@ -51,6 +51,12 @@
|
|||
<input type="number" name="-config-popular.count" class="form-control" id="popular.count" value="<?php echo config('popular.count');?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="tagcloud.count" class="col-sm-2 col-form-label"><?php echo i18n('Tagcloud_widget_at_most');?></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number" name="-config-tagcloud.count" class="form-control" id="tagcloud.count" value="<?php echo config('tagcloud.count');?>">
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h4><?php echo i18n('Comments');?></h4>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -1459,6 +1459,11 @@ function tag_cloud($custom = null)
|
|||
$posts = get_post_unsorted();
|
||||
$tags = array();
|
||||
|
||||
$tagcloud_count = config('tagcloud.count');
|
||||
if(empty($tagcloud_count)) {
|
||||
$tagcloud_count = 40;
|
||||
}
|
||||
|
||||
if (!empty($posts)) {
|
||||
|
||||
if (!file_exists($filename)) {
|
||||
|
|
@ -1497,7 +1502,11 @@ function tag_cloud($custom = null)
|
|||
// this is the increase per tag quantity (times used)
|
||||
$step = ($max_size - $min_size)/($spread);
|
||||
|
||||
foreach ($tag_collection as $tag => $count) {
|
||||
|
||||
arsort($tag_collection);
|
||||
$sliced_tags = array_slice($tag_collection, 0, $tagcloud_count, true);
|
||||
ksort($sliced_tags);
|
||||
foreach ($sliced_tags 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> ';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue