Profile Page Counter

Does anybody know anyway to set up a counter for how many times a persons profile page has been viewed? I see this on other sites and think this would be a cool feature to add to a persons profile page.

Quote · 15 Dec 2009

Will count visitors and members who look at a profile
(take backup before any change to be sure)



Will add Viewcount(Profile Views) on My Account -> below Member Info

1)

Run this sql statement
ALTER TABLE Profiles ADD Viewcount int(10) DEFAULT '0' NOT NULL;


2)
Add a new language streng: _Profile Views


3)
Open file profile.php and find this line(~ 50) // track profile views

add the new code, after track profile views code as I have done below


// track profile views
if ( $track_profile_view && $memberID && !$oProfile -> owner )
{
db_res( "DELETE FROM `ProfilesTrack` WHERE `Member` = {$memberID} AND `Profile` = $profileID", 0);
db_res( "INSERT INTO `ProfilesTrack` SET `Arrived` = NOW(), `Member` = {$memberID}, `Profile` = $profileID", 0);
}

//count profile views
if ( $track_profile_view && !$oProfile -> owner)
{
db_res( "UPDATE `Profiles` SET `Viewcount` = Viewcount+1 WHERE `ID` = $profileID", 0);
}



4)
Open file member.php and find this line(~ 322) <!--  Affiliate Program starts here -->

add the new code below, across this line


<!-- count profile views -->
<tr class=table>
<td valign=top align="left" class=control_panel_td_1><? echo _t( "_Profile Views" ); ?>:</td>
<td valign=top align="left" class=control_panel_td_2>
<?
echo $this->aMemberInfo['Viewcount'];
?>
</td>
</tr>


<!--  Affiliate Program starts here -->


5) Done



Will add Viewcount(Profile Views) on profile view page

1)
Run this sql statement (Don't do this if you already have done it above)


ALTER TABLE Profiles ADD Viewcount int(10) DEFAULT '0' NOT NULL;


2)
Admin/Builders/Pages Builder => Profile, Add a new HTML page as bellow:

Caption Lang Key: Profile Views
Visible for: Guest Member

SAVE


3)
Open phpMyAdmin, click on table PageCompose and browse
look at row Caption and find Profile Views (shall be the last insert id)
Edit ID where Caption = Profile Views as bellow:

Page: profile
Desc: PHP Block
Caption: Profile Views
Func: PHP
Content:

global $p_arr;
$Memb = (int)$p_arr['ID'];


$arr = db_arr("SELECT `Viewcount` FROM `Profiles` WHERE `ID` = '$Memb'");
$View = $arr['Viewcount'];

echo "
<table class=\"profile_info_block\" cellspacing=\"0\" cellpadding=\"1\">
<tr><td class=\"profile_info_label\">
";
echo _t( "_Profile Views" );
echo "
</td>
<td class=\"profile_info_value\">$View</td>

</tr></table>
";


SAVE


4)
Go back to Admin/Builders/Pages Builder => Profile and move a block a bit


5) Done

Quote · 16 Dec 2009

Will these changes work for 7.11?

Quote · 22 Apr 2013

I highly doubt it.

Quote · 22 Apr 2013

Anybody tried this in D7.1.1?

http://ModMyCMS.com --> Dolphin Hacks &Mods
Quote · 24 Apr 2013

code are changed

Profile View Counter

Quote · 24 Apr 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.