MyBB Community Forums

Full Version: Why are my views showing up near 100K?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here is a tutorial section I added.
http://metulburr.com/forumdisplay.php?fid=4

For example one of them is currently at 83,380 views. The site was just put up not a week ago. And obviously its bots. How can i restrict the views to members only? And can a set them back to 0 after doing so?
Right now, when I checked, there were only 17 guests... It's normall... I don't get what do you need?
This is a feature i would like to see added to MyBB - the option to restrict the counter to member views only. As it stands there's no way of saying who made those views.
Quote:It's normall... I don't get what do you need?
I want a way to restrict the views to members only. The forum we have in PhpBB only counts members views, not guest or bots. At this point ill have 365,000 views for some threads in one year, regardless of how many members there are. And only 1,000 of them might be real people. 

Quote:This is a feature i would like to see added to MyBB - the option to restrict the counter to member views only. As it stands there's no way of saying who made those views.


I know for sure the are bots or guest, not real users. There arent even that many users on our other forum we are moving from. I would think that should be a default base option in MyBB too. I guess based on your response, that there is none at all.
Interesting... let me look into doing this as a plugin.
(2016-09-12, 11:48 AM)Matt Wrote: [ -> ]Interesting... let me look into doing this as a plugin.

Thanks, the profileviews plugin does something similar, here's a function from there:

function profileviews_profile()
	{
		// include $uid and $db from the global scope
		global $uid, $db, $mybb;
		
		// put our own variable in the global scope
		global $profile_views;
		
		// get the views out the database for the $uid
		$query = $db->simple_select("users", "views", "uid=".(int)$uid);
		// check if any records were fetched from the table
		if($db->num_rows($query) === 1)
		{
			// the user exists and the views variable can be fetched
			$views = (int)$db->fetch_field($query,"views");
			
			// if the ownprofile setting isn't loaded set to (1) yes as default
			if(!isset($mybb->settings['profileviews_ownprofile']))
				{
					$mybb->settings['profileviews_ownprofile'] = 1;
				}
			
			// if the ownprofile setting isn't loaded set to (1) yes as default
			if(!isset($mybb->settings['profileviews_guest']))
				{
					$mybb->settings['profileviews_guest'] = 1;
				}
			
			// if the ownprofile setting is enabled go through anyway
			// otherwise check the uid
			if(
				($mybb->user['uid'] == 0 && $mybb->settings['profileviews_guest'] != 1) ||
				($mybb->user['uid'] == $uid && $mybb->settings['profileviews_ownprofile'] != 1)
			)
			{
			// do nothing
			}
			Else
			{
				// now we're going to increase it by one and save it to the database
				$views = $views + 1;
				$db->update_query("users", array('views' => $views), "uid=".(int)$uid);
			}
(2016-09-12, 11:48 AM)Matt Wrote: [ -> ]Interesting... let me look into doing this as a plugin.

Yes I noticed that you can bump your thread in a way by spamming F5 and give it like a 100 views.
It also sucks up bandwidth when dummies like me are doing this Toungue

It would be awesome if you made it available for MyProfile plugin too, for user profiles and all..  Someone could just give themselves a million views and DOS your site as a result.