HOWTO: Hide view counts for non owners

joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Sat, 2013-10-05 17:58

In case anyone needs a quick hack to hide view counts for non owners:

in modules/info/helpers/info_theme.php
around line 23:
replace
if ($item->view_count) {
with
if ($item->view_count && (identity::active_user()->id == $item->owner->id)) {

more advanced version so behaviour can be tuned by config:
if ($item->view_count && (!module::get_var("info", "show_view_count_for_owners_only") || (identity::active_user()->id == $item->owner->id) )) {
Note: this last one requires the matching DB changes as well.

Enjoy!

Dog Photos | Gallery2 Themes Demo