MyBB Community Forums

Full Version: Set display for number of views of thread to not include author views ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On the thread table view it shows Thread/Author, Replies, Views, Rating, Last Post [asc].

The number of views include views by the author... how to make the number amount not include views by the author ?
Open ./showthread.php and find;
	else
	{
		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
	}
and Change it to the following;
	elseif ($mybb->user['username'] != $thread['username'])
	{
		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
	}
(2011-04-25, 05:33 AM)Yaldaram Wrote: [ -> ]Open ./showthread.php and find;
	else
	{
		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
	}
and Change it to the following;
	elseif ($mybb->user['username'] != $thread['username'])
	{
		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
	}

Looks like it worked fine !
Thank you for the info !



Thanks.
Looks like when uploaded new files for 1.6.3 upgrade, lost code and now not working.
Will be checking after get upgrade problem solved.
(2011-04-26, 10:15 PM)akm Wrote: [ -> ]Looks like when uploaded new files for 1.6.3 upgrade, lost code and now not working.
Will be checking after get upgrade problem solved.

Somehow 1.6.2 got upgraded to 1.6.3... subject of another post.
But in the process the /showthread.php changes got changed back to the original.
Now when change to...

VALUES('{$tid}')");
}

elseif ($mybb‐>user['username'] != $thread['username'])
{
$db‐>shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}


++$thread['views'];

am getting...

Parse error: syntax error, unexpected '[' in /home/akmblogo/public_html/forum/showthread.php on line 618

...at forum when click on thread.

Suggestions ?
(2011-04-26, 10:15 PM)akm Wrote: [ -> ]Looks like when uploaded new files for 1.6.3 upgrade, lost code and now not working.
Tried it again, after getting some help with the MyBB upgrade process, and no error message, but also your suggested code was gone and forum was counting admin views.
Re-entered your suggested code, after upgrading 1.6.2 > 1.6.3, and now is working.
Guess it, showthread.php, gets overwritten when upgrade MyBB ?
Yes, probably.
Thanks for followup.
No problem, will just keep reminder in forum maintenance notes.
Thanks again for the help and the solution !
Thanks.