DISQUS

hitormiss.org: Weighted Categories

  • Oerjan · 4 years ago
    Hello.
    I don't want to use the categories-list, I want to show the list by keywords like you have on your site. Is it something that can be a simply changed in the code I insert in the page.
    Or maybe is going to be a another plugin? Let me know! I must apologize for my bad english, have a nice day.

    //Örjan




    (thinking of this code)
  • elaine · 4 years ago
    Same for me, same for me... I want keywords !! ;o)
  • ylek · 4 years ago
    gracias por este plugin :-)

    lo instalé y funciona a la perfección
  • Andrés · 4 years ago
    Hello, it wanted to know if this plug ins runs under wp 1,2, because I made the installation, but does not show anything, the page is in target.
  • eAk · 4 years ago
    there is a bug in that script

    the link for the latest categoriy listet is not correct :|
  • Robin · 4 years ago
    Might be a bug in wordpress, I don't see anything in the plugin to explain this. I'll keep investigating.
  • Robin · 4 years ago
    Should have waited a moment before commenting. I found a fix adding a single line in weighted_categories():
    $cats = explode("\n", $cats);
    array_pop($cats); // this line !
    foreach ($cats as $cat)
  • Heatsink · 4 years ago
    I don't have an archives.php file...

    can you be more specific about how to use this script?

    Thanks
  • elaine · 4 years ago
    Any intention to convert the weighted-categories plugin into a weighted-keyword one?¿ Maybe to use along with the Wp-tags one?¿
  • richard · 4 years ago
    Great little plugin! Bravo!
  • task · 4 years ago
    hi, grate plugin!

    i don't know why is not working here: http://wearemad.weblogs.us/livearchives/

    in the category space, it wrongs add the link... eny idea!? :(
  • Charles · 4 years ago
    Is there any code I can add so that only categories with a certain number of posts will show up with the plugin?
  • Reevo · 4 years ago
    Hi

    I've been using this little plugin for quite a while and have never had a problem with it under 1.5. However, I've just added a new category and it won't display. Instead of using the standard http://www.ektopia.co.uk/ektopia/archives/categ... URL it shows http://www.ektopia.co.uk/ektopia/weighted-categ... but ONLY for that particular category and therefore points to a 404.

    Any idea what might be going on?? Cheers
  • Rodolpho Arruda · 4 years ago
    eAk,

    I have corrected the code. Now it works fine for me:




    The only thing I had to do actually was to adjust tag font size to make the whole thing fit my sidebar. Check it out http://rodolphoarruda.pro.br/blog/
  • Graham · 4 years ago
    I've been trying to get this to work, but I've hit a slight snag. The links generated point to /archives/categoryname instead of /category/categoryname.

    My test WP install is at http://tin-men.net/wordpress

    Cheers!
  • ryan · 4 years ago
    How do you do this without a list style? I just want a square block of words like in Flickr...I'm sure this is ridiculously easy...Thanks for the great plugin...
  • fkeegan · 4 years ago
    Thanks for the plug-in: I'm hoping for the same tweak as Ryan i.e. a flickry block of links. Best /FK
  • Robert de Bruin · 4 years ago
    Nice plugin, I use it in conjunction with the cat2tag plugin which works very well. However it also generates hugh amounts of catagories. So I've changed your code slightly to show only the top x ($number) of catagories. As so:
    /* Sort on counts */
    arsort( $counts );

    /* Only keep top $number */
    $i=count( $counts )-$number;

    for($j=1;$j
  • Robert de Bruin · 4 years ago
    Second half ...
    for($j=1;$j
  • Robert de Bruin · 4 years ago
    for($j=1;$j
  • Robert de Bruin · 4 years ago
    Sorry 'bout that ... seems the & wasn't converted correctly ...
    /* Sort on counts */
    arsort( $counts );

    /* Only keep top $number */
    $i=count( $counts )-$number;

    for($j=1;$j&=$i;$j++)
    {
    array_pop( $counts );
    }

    /* Sort alphabeticly again (case insensitive) */
    uksort($counts, "strnatcasecmp");
  • Reevo · 4 years ago
    Got mine working in the end, just upgraded from 1.5 to 1.5.2 and it started working again! Great plugin by the way :-)
  • Maxime Dupuis · 4 years ago
    Howdy,

    I've played around with your plug-in and added some features :
    - Display the categories with different opacities (more posts = less transparents) and you can define a minimum opacity
    - Display the categories with different colors

    For the latter, you specify 2 colors (in #xxxxxx or #xxx format), the first will determine the color of your category that has less posts will have and the second will determine the color of your category that has more posts. You also specify the number of color your palette will have.

    Okay, so I know my english sucks (especially at 4 a.m.) but go check my website @ http://www.autre-chose.org

    I'll clean the code in a few days and will make the plugin available for download.
  • Martin Fitzpatrick · 4 years ago
    Hey fella,
    Nice plugin which finished off my website nicely http://www.diretribe.com however, there are a couple of bugs in the maths that thought I should let you know about.

    When calculating the spread/step values the variables are the wrong way around, the correct ways should be as follows:

    $mincount=min($counts);
    $spread = max($counts) - min($counts);
    if ($spread
    Note, you need the $mincount for later when outputting as followed:

    ($smallest + ($fontstep * ($count-$mincount)))

    By doing it this way the values of the font-sizes will always fall withn your range set in min/max (before that it didn't seem to).

    An example:

    font_spread: 10-20
    count_spread: 1-3
    count_min: 1

    font_step = font_spread/count_spread = 10/2 = 5

    e.g. where count = 2
    5*(count-count_min)+minimum_font = 5*(2-1)+10 = 15

    Compared to:

    font_step=count_spread/font_spread = 2/10 = 0.2

    e.g. where count=2
    minimum_font+(count/font_step)=10+(2/0.2)=10=20

    As you can see in the second example (using the current maths in the plugin) a half-way value is hitting the maximum. Hope that helps - if you need any help let me know.

    Folowing Maxime Dupuis example above I've also knocked it into providing transparency & so on. Lovely. Thanks again for a great plugin.
  • Maxime Dupuis · 4 years ago
    I love what you did... I mean, the random CSS positionning with the transparency is so cool... except that some categories are sometimes inaccessible because under another. You should keep positions into an bi-dimensionnal array so categories must be X pixels from another (for both top and left positions). But other than that, great job ! I love your wordpress template too!
  • Joseph · 4 years ago
    Can someone PLEASE!! post a 100% "WORKING!" WORDPRESS Version on this Tag script and also EXACT instructions such as which php file to include function call and step-for-step directions.
    I have been many days going on weeks scouring this internet thru Google and all i ever find are people posting comments on nothing but one error after another, and i have personally downloaded many of these only to have them show nothing but errors myself and also never do any of you coders ever draw up step for step instructions.
  • Anonymous · 4 years ago
    I'd agree. Pretty poor in the clarity department for those who might now speak 100% nerd code. I mean, people who develop these plugins do it so that others use them, right? Even if they might be someone who isn't a certified programmer (ie. a designer). At any rate; I found success with Heat Map in case anyone notices. They have slightly better documentation ... at least it's apparent, instead of reading through all these comments.
  • Daniel · 4 years ago
    You should add rel=\"tag\" in the print for the links.
  • Ramin · 3 years ago
    How do I make only top 10 or 15 categories to display?
  • steve · 3 years ago
    ramin i noticed on ur website u display only the top 15 or so categories could you tell me how u did that
  • Alan · 3 years ago
    This is an excellent plugin. I have it working with WP2.0.1 and K2 beta2r163. Thank you so much. Maybe it's me, but I think this on the homepage is a great 'flavour' for the content the site holds, so I'm delighted to now have yummy K2 and your weighted comments. Brilliant!
  • Harshblogger · 3 years ago
    Has anyone noticed that the last link on the list is always incorrect? Even on the hitormiss.org site. Any fix?
  • Zak Grenat · 3 years ago
    Look at the output of list_cats() - it include a newline at the end of the output, which then messes up the first foreach loop.

    Change:
    $cats = list_cats(1, 'all', 'name', 'asc', '', 0, 0, 1, 1, 0, 1, 1, 0, 1, '', '', $exclude, 0);
    to
    $cats = trim(list_cats(1, 'all', 'name', 'asc', '', 0, 0, 1, 1, 0, 1, 1, 0, 1, '', '', $exclude, 0));

    ... and all will be well.
  • Zak Greant · 3 years ago
    Here is a cleaned up version of the code - Matt, feel free to use as you see fit. Cheers! --zak

    function weighted_categories($smallest=10, $largest=48, $unit="pt", $exclude='') {
    $all_cats = trim(list_cats(1, 'all', 'name', 'asc', '', 0, 0, 1, 1, 0, 1, 1, 0, 1, '', '', $exclude, 0));

    foreach (explode("\n", $all_cats) as $cat) {
    preg_match('{a href="([^"]+)".+?>(.*) ?\((\d+)\)}', $cat, $matches);
    list(,$url, $name, $count) = $matches;
    printf('%s'."\n", $url, $count, abs($count) != 1 ? 'entries' : 'entry', $count, $name);
    $counts[$count] = 1;
    }

    $counts = array_keys($counts);
    $step = (max($counts) - min($counts)) / ($largest - $smallest);

    echo '';
    foreach($counts as $count){
    echo ".tcloud-$count {font-size: " . ($smallest + ($step * $count)) . $unit . " }\n";
    }
    echo '';
    }
  • Zak Greant · 3 years ago
    I have further hacked up the plugin - vist http://zak.greant.com/2006/02/23/category-cloud... to grab a copy.
  • Riley Dutton · 3 years ago
    Hey, just wanted to say that I'm using tihs plug on my site! Thanks a lot!

    http://www.the-tempest.net
  • Harshblogger · 3 years ago
    Thank you Zak. Your fix did the trick. It's funny... looks like Matt hasn't even noticed it it.
  • Jason · 3 years ago
    Great plugin! Would it be possible to give it the ability to only display a certain number of top catagories? I'd really like to go crazy with "tagging" my posts, but I don't want a lot of catagories with only one or two entries taking up space on my sidebar. It would be nice to tell the plugin to only show the top 25 catagories, etc.

    Thanks nonetheless!
  • Samuel · 3 years ago
    I had the same problem with the last category not working, and Zak's fix worked like a charm. Thanks!

    Beyond that, this is a really great plug-in. Simple, fast, and effective - exactly what I was looking for.
  • Mark Jongkind · 3 years ago
    I had some troubles with this plugin, but now it works fine!
    You wrote:

    "In the file where you want to display the weighted list of categories (ex. archives.php), insert the following code:

    "

    But it that doesn't works in my blog.

    I've changed
    to -->

    So I add the letters "php" between
  • Garrett Wilkin · 3 years ago
    I love this plugin! I just put it on my blog!

    I added it to the sidebar.php file for the fasttrack theme because that theme doesn't use archive.php
  • Lawsy · 3 years ago
    Great plugin, got it in my footer. Works like a charm. One request, could this be implemented for the monthly archives, and if so how would I go about doing that?
  • ResuX · 3 years ago
    Beau boulot, ce plugin fonctionne très bien chez moi :-)
    Good job.
  • nerds · 3 years ago
    this is an amazing plugin, but, have you noticed the performance hits for blogs with large amounts of categories? it's almost to bring down apache.
  • paskal · 3 years ago
    hello... i got this plugin not working on my blog.... it keep print this code, not execute it...




    someone pls help me!!11`~~!!!
  • cyberico · 3 years ago
    hi: does not work after installed:

    Warning: Cannot modify header information - headers already sent by


    pls help me
  • Joe · 3 years ago
    I've just installed it - great work, excellent little plugin, thanks! :) now if only I can get my stylesheets working properly ;)
  • Joe · 3 years ago
    PS - for people who can't get it to work, change
  • Joe · 3 years ago
    oops - change the top line from
    -less than- -question mark-
    to
    -less than- -question mark- -php-
    with no spaces!
  • Sam · 3 years ago
    Hey guys, thanks for all the dialogue and fixes. But with everything said, for a newbie like me, I am completely lost. Could anyone just write a quick rundown of the steps I have to follow to install the plugin the proper way in my wordpress blog? I would love to use this. Thanks
  • craig buchanan · 3 years ago
    it would be great to have this functionality packaged as a widget.
  • craig buchanan · 3 years ago
    i packaged your code as a widget. email me at cra ig. buch anan at cogniza dot com for the code.

    btw, where which CSS did you alter? the style.css?
  • Jonathan · 2 years ago
    Great plugin, I really love it.

    Any way you can port this to Wordpress 2.1 that was released a few hours ago?
  • craig buchanan · 2 years ago
    here's a link to the widget: http://www.cogniza.com/blog/?p=93
  • curdaneta · 2 years ago
    Agee with Jonathan, will be cool to port this plugin to Wordpress 2.1
    I'm looking forward for this...
  • Jerry · 2 years ago
    Here's another vote for an update. Since they broke list_cats() it's not working, and I have no clue how to modify the plugin to get it working with the new wp_list_categories().
  • francesco mapelli · 2 years ago
    hi!
    I wrote an updated version that works for wordpress 2.1.
    It hase some new features and better wordpress integration (i.e. option page), it's called Category Cloud :)
  • francesco mapelli · 2 years ago
    it stripped the address... here it is: http://www.mapelli.info/wordpress/category-cloud-10
  • auschick · 2 years ago
    I'm using this in WP 2.0.x and it works great except that parent categories with sub-cats in them, aren't linking properly. All the sub-cats link, but the parent category does this: mywebsite.com/the-category-name instead of mywebsite.com/categories/the-category-name. What do I need to do to fix?
  • Scudfish · 2 years ago
    I'm on WP 2.1.2 using 'whiteasmilk' and I just can't get it to work. :-( Any chance for an update?

    In any case - thanks for sharing!

    SF