I've been very happily using this for the last couple of years, except $A['hits'] isn't actually available in lib-story.php at this point (I don't think) so what I did was:
Text Formatted Code
if( $_CONF['hideviewscount'] != 1 && $story->DisplayElements('hits') > 150 && !empty($bodytext) ) {
So that worked fine, except I just noticed that stories over 1000 hits were not showing. I eventually realised that
Text Formatted Code
DisplayElements('hits')
returns a formatted string with a comma in it, so 1000 is 1,000. So the operator treats it as two numbers, 1 and 000. So the logic returned is that 1 is not > 150, so the hits are not displayed. I demonstrated it to myself by setting hits for a story (in the database) to 151,000 and the views number was once again being displayed. 151 is > 150.
I thought ok, I need to get at the original unformatted hits or remove the comma. I couldn't see simply how to do the former so I did the latter, with an inelegant fix:
Text Formatted Code
if( $_CONF['hideviewscount'] != 1 && str_replace(',', '', $story->DisplayElements('hits')) > 150 && !empty($bodytext) ) {
so it strips out the comma and the result is compared with 150.
But this assumes the user has commas to separate 1000s. That's all we offer on our site, but who knows one day.
Digging around I could see that $story is an instance of a class and it has $_hits in it, but it's a private member and I have no idea how to get at it. I don't want to stuff around with changing your classes, customisations like this are already a hassle to maintan. So I'll probably stick with what I've got unless there is a very simple fix? I guess I could query the database (by copying other examples) to populate $A as required for the original suggestion.