Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbPress Top 100 April 2009 Update

_ck_, I looked into some things about regionality and I don’t think you’ll be able to get it much better than it is, unless you do as you mentioned, with the whois. Even then, it’s not going to be accurate 100%, since sometimes a server is in the US, but it runs a Brazillian site, etc. (And I’m still pissed at Google, a year later, from when I was in Japan and I went to google.com and it kicked me to google.jp, based on my IP, and ignoring everything else like the fact that my browser info showed I used English. At the time, I couldn’t get it to show the link to ‘Google in English’ and I was stuck in Japanese for a while.) Regions and localization are things that seem like a really good idea, but there’s no way to make it perfect, since you can never tell when someone’s abroad :/

I like how you replaced “sticky” with a nifty little icon.

Thanks! That was my first ‘hack’ for bbPress and I slapped this in my functions.php

// This sets sticky label as an image
remove_filter('bb_topic_labels', 'bb_sticky_label', 20);
function my_sticky_label( $label ) {
global $topic;
if (is_front()) {
if ( '2' === $topic->topic_sticky ) {
return sprintf(__('<img src="/images/sticky.png" alt="[sticky]" /> %s'), $label);
}
} else {
if ( '1' === $topic->topic_sticky || '2' === $topic->topic_sticky ) {
return sprintf(__('<img src="/images/sticky.png" alt="[sticky]" /> %s'), $label);
}
}
return $label;
}
add_filter('bb_topic_labels', 'my_sticky_label', 20);

Skip to toolbar