That’s a good start... but the PageHitCounter module is essentially a back-end reporting tool. Are you recommending that I write a snippet that queries the page_hit_counter table?
I can do that... but I’m wondering what the MODx way of doing that is... normally I would write my own database handle and put it in a directory above the root (e.g. in /lib instead of /public_html) and do a SQL statement something like:
SELECT page_id FROM page_hit_counter ORDER BY page_count DESC LIMIT 10;
or if I were feeling really saucy, I’d do something like:
SELECT phc.page_id, sc.pagetitle FROM page_hit_counter phc INNER JOIN site_content sc ON phc.page_id=sc.id
WHERE sc.hidemenu='0' ORDER BY phc.page_count DESC LIMIT 10;
But this isn’t a good way to do it if I wanted to share this as a plugin with the community. Could someone point me at some example code where a snippet hits the database in a secure, quoted, prepared statement sort of way?
Thanks.