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