thanks perfect top Add-On !@Lemminator go to Template Modifications (admin.php?template-modifications/) in Admin CP and disable to "Most Popular Tags" like this:
#2 I also have another problem.
Example:
The sidebar tag cloud shows tag "cool car"
when i click on it in the brower it takes me to the link is tags/cool%20car/
and it shows "The requested tag could not be found"
The correct link is tags/cool-car
I think it's a bug
SELECT tag_id, tag, tag_url FROM xf_tag as tag WHERE tag_id ORDER BY tag DESC
SELECT tag_id, tag, tag_url FROM xf_tag as tag WHERE tag_id ORDER BY use_count DESC
Try replacing the contents of that file with the below. The net result should be that the top X used tags will be shown using the same weighted font size as the XF tag search screen.Did I miss something ?
<?php
class Eagle_MostPopularTags_Model_MostPopularTags extends Xenforo_Model_User
{
public static function MostPopularTagsArray()
{
$db = XenForo_Application::get('db');
$MostPopularTags = array();
$options = XenForo_Application::get('options');
$limitforpopulartags = XenForo_Application::get('options')->MostPopularTagsCount;
if (XenForo_Application::get('options')->MostPopularTagsEnableAddon)
{
$MostPopularTagsArray = $db->fetchAll($db->limit("
SELECT tag, tag_id, tag_url, use_count
FROM xf_tag as tag
WHERE tag_id
ORDER BY use_count DESC", $limitforpopulartags));
sort($MostPopularTagsArray);
foreach($MostPopularTagsArray as $tag)
{
$hrefx = XenForo_Link::buildPublicLink('tags', $tag);
if ($tag['use_count'] > 7) { $tag['use_count'] = 7; }
$MostPopularTags[] = array("tags" => $tag['use_count'], "tag_url" => $tag['tag_url'], "title" => $tag['tag'], "href" => $hrefx);
}
return $MostPopularTags;
}
}
}
After my last post I also played a bit around with the code to get a real MostPopularTags add-on as this add-on currently shows only the last tags without weighting.Just remember though that if all of your top X used tags are used the same amount of times then they'll all be the same size in the results (in other words, if your top 25 used tags were all used 5 times then all 25 tags will be the same exact size). If you end up with a lot of tags that all have more than 7 uses then they'll also end up all being the same size (since there are only 7 font sizes defined currently for the tags).
<?php
class Eagle_MostPopularTags_Model_MostPopularTags extends Xenforo_Model_User
{
public static function MostPopularTagsArray()
{
$db = XenForo_Application::get('db');
$MostPopularTags = array();
$options = XenForo_Application::get('options');
$limitforpopulartags = XenForo_Application::get('options')->MostPopularTagsCount;
if (XenForo_Application::get('options')->MostPopularTagsEnableAddon)
{
$tags = $db->fetchAll($db->limit("
SELECT tag_id, tag, tag_url, use_count
FROM xf_tag as tag
WHERE tag_id
ORDER BY use_count DESC", $limitforpopulartags));
shuffle($tags);
$uses = XenForo_Application::arrayColumn($tags, 'use_count');
$min = min($uses);
$max = max($uses);
$levels = 7;
$levelSize = ($max - $min) / $levels;
if ($min == $max)
{
$middle = ceil($levels / 2);
foreach ($tags AS $id => $tag)
{
$tags[$id]['level'] = $middle;
}
}
else
{
foreach ($tags AS $id => $tag)
{
$diffFromMin = $tag['use_count'] - $min;
if (!$diffFromMin)
{
$level = 1;
}
else
{
$level = ceil($diffFromMin / $levelSize);
}
$tags[$id]['level'] = $level;
}
}
foreach($tags as $tag)
{
$hrefx = XenForo_Link::buildPublicLink('tags', $tag);
$MostPopularTags[] = array("tags" => $tag['level'], "tag_url" => $tag['tag_url'], "title" => $tag['tag'], "href" => $hrefx);
}
return $MostPopularTags;
}
}
}
I don't think that really solves the issue since if all X tags returned in the query have the same use_count then they'll still end up the same size, same result as before.It also solves your problem with the 7 font sizes.
Yes, THAT's right. If ALL have the same use_count than ALL have the same weight. Like every single Dollar is worth a Dollar, the first one in a row of 10 isn't worth more or lessI don't think that really solves the issue since if all X tags returned in the query have the same use_count then they'll still end up the same size, same result as before.
Thats (partially) not correct.The problem isn't with this sidebar add-on, the tag CSS definitions themselves in XF 1.5 only have 7 size definitions that might be displayed in the Tags search screen. This add-on is using the same CSS definitions and is mimicking how XF itself would display the weighted tags.
We use essential cookies to make this site work, and optional cookies to enhance your experience.