Posted by Robert Castelo on April 30, 2006 at 11:14pm
Jump to:
| Project: | Hall of Fame |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | syscrusher |
| Status: | needs review |
Issue Summary
Hi,
great module. I tweaked it a bit to not show 'Not Available' and 'Access Denied' pages, which were always the most 'popular'.
$sql = "SELECT n.nid, n.title, c.totalcount FROM {node} n left join {node_counter} c on n.nid=c.nid where n.status=1 and n.moderate=0 and n.created>=" . $intervals[$interval] . " and c.totalcount>1 and title not like '%page not found%' and title not like '%Not Available%' and title not like '%Access Denied%' order by c.totalcount desc, n.created desc limit " . $popular_limit;Note that this has been added:
and title not like '%Not Available%' and title not like '%Access Denied%'
Comments
#1
Good idea. I do have one small concern, though. What if there is a story such as "City says beer not available on Sunday any more" or some similar title? I could see a story like that being popular for readership, but it would (if I read your SQL correctly) still match your filter.
What would you think about filtering out these title strings only if the node type is "page"? Do most Drupal users create "page" nodes for ordinary content? I know that I personally use "page" only for special notices like the ones you mention, but I don't want to necessarily assume everyone works that way.
Or maybe I should add a filter that is admin-settable?
Scott
#2
Yes, that's true.
The best solution would be to use variable_get() to find out which page is the access denied and Not Available pages and than skip that when displaying results.
#3
Good thought. I'll see about getting that into the next release of the code.
Scott