Simple Profile views

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
mary_contrary
Registered User
Posts: 7
Joined: Thu Aug 13, 2009 9:09 pm

Re: Simple Profile views

Post by mary_contrary »

It worked. Thank you very much Platinum. :)
Arrapare
Registered User
Posts: 7
Joined: Fri Dec 05, 2008 11:07 am

Re: Simple Profile views

Post by Arrapare »

Hi, I tried to install this but it didn't work. So I went back to restore the backup I took before trying this mod and whenever I look at a profile or the online list, I get this at the top of the page.
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3760: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3762: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
Would you have any tips you could share so I can remove this?
platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: Simple Profile views

Post by platinum_2007 »

Arrapare wrote:Hi, I tried to install this but it didn't work. So I went back to restore the backup I took before trying this mod and whenever I look at a profile or the online list, I get this at the top of the page.
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3760: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3762: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3763: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /language/en/memberlist.php:1)
Would you have any tips you could share so I can remove this?
You should never use notepad to edit .php files. You will have to replace language/en/memberlist.php with a fresh file, download a program like notepad++ and then do the edit again.
Arrapare
Registered User
Posts: 7
Joined: Fri Dec 05, 2008 11:07 am

Re: Simple Profile views

Post by Arrapare »

Thank-you. I'll give that a try.
User avatar
waxxie
Registered User
Posts: 119
Joined: Fri Oct 16, 2009 5:21 pm

Re: Simple Profile views

Post by waxxie »

Fantastic mod!

I only have one issue with it, and that is that some people (members) have no morals.
They will refresh their profile a million times to gain views.

in order to combat this i've made a slight tweak to the increment query in memberlist.php

Code: Select all

FIND:
		$sql = 'UPDATE '.USERS_TABLE.' 
		SET profile_views = profile_views + 1 
		WHERE user_id='.$user_id;
		$result = $db->sql_query($sql);
			$template->assign_vars(array(
			
			'VIEWS'			=> $member['profile_views'],
			));

REPLACE WITH:
		if($user->data['user_id']!=$user_id && $user->data['user_id']!=ANONYMOUS){
			$sql = 'UPDATE '.USERS_TABLE.' 
			SET profile_views = profile_views + 1 
			WHERE user_id='.$user_id;
			$result = $db->sql_query($sql);
				$template->assign_vars(array(
				
				'VIEWS'			=> $member['profile_views'],
				));
		}else{
			$sql = 'SELECT profile_views FROM '.USERS_TABLE.' 
			WHERE user_id='.$user_id;
			$result = $db->sql_query($sql);
				$template->assign_vars(array(
				'VIEWS'			=> $member['profile_views'],
				));
		}
To increment views other members must be logged in and viewing the users profile
rodo200
Registered User
Posts: 1
Joined: Mon Jan 25, 2010 5:33 pm

Re: Simple Profile views

Post by rodo200 »

Hi all.

I want to know what is this:

SQL

Code: Select all

ALTER TABLE phpbb_users ADD profile_views varchar(255) NOT NULL DEFAULT '0'
Pny
Registered User
Posts: 18
Joined: Wed Mar 18, 2009 7:19 pm

Re: Simple Profile views

Post by Pny »

Nice MOD. How do I add this counter to be viewed also in the UCP?
Locked

Return to “[3.0.x] MOD Database Releases”