[TH] Profile Views [Deleted]

Works fine on 1.5

BUT: Why does every Profile Visit trigger a new profile history entry in the admin CP? We have profiles with 10k+ visits..
 
I purchased and installed the add-on yesterday.
The "Profile views" line below the "Trophy points" was visible after installation, but the counter didn't increase.
I clicked about 20 member profiles but nothing happend. All profile view counters at 0, no entries in the database table "adprofileviews_user_views".

It took me some hours to find out that the user permission "Can View Profile Views" does not do what it says ^^
Activated or not, the member is able to see the profile views. But as long as it's not activated the profile views will not be counted !
As a quick fix this permission option should be renamed to something like "Count profile views".
But I would prefer to have all profile views counted and to use this option to enable/disable the visibility of profile views for certain user groups.

And a suggestion for a possible future version of this add-on:
same styling for the "Last x visitors" like it's used for the follower blocks.
Currently it looks a bit out of place.
upload_2015-9-16_11-14-49.webp

This is how it should like:
upload_2015-9-16_11-15-39.webp
 
Found another bug:
if a member visits his own profile, he's also counted and shown as a visitor.
Additionally, there will never be a second record of a visitor, although the cool down period is over.
Mayby caused by
PHP:
if ($visitor['user_id'] != $response->params['user']['user_id'] && !$lastView || $lastView['view_date'] < ($xenOptions->adprofileviews_cooldownPeriod * 3600))
in library\Audentio\ProfileViews\Proxy\XenForo\ControllerPublic\Member.php
This will always be "false", because the view_date is a UNIX timestamp and will never be smaller than x hours cool down period * 3600 ;)
PHP:
if ($visitor['user_id'] != $response->params['user']['user_id'] && !$lastView || $lastView['view_date'] < ((XenForo_Application::$time - $xenOptions->adprofileviews_cooldownPeriod * 3600)))
... should fix this, but will show more bugs:
now we may have several records for a visitor-user combination, if a visitor comes back to a profile page after cool down period.
The function 'getLastVisitorsForUser' in library\Audentio\ProfileViews\Model\ProfileView.php returns all x users, who visited a members profile page. And because there is no 'ORDER BY pView.view_date' in the query, the FIRST x users will be returned, not the last.

It's also possible that a visitor is listed more than one time. Tried to solve this with 'GROUP BY pView.visitor_id' but then the 'ORDER BY pView.view_date' doesn't work anymore :(
upload_2015-9-20_14-15-32.webp

A 'ORDER BY pView.view_date LIMIT 1' is also missing in the function 'getLastViewForUserByVisitor'.
That's why '$lastView['view_date']', comming from
'$lastView = $this->_getProfileViewModel()->getLastViewForUserByVisitor($response->params['user']['user_id'], $visitor['user_id']);'
is always the first visit of a visitor an a members page. If this first visit is older than actual time minus cool down period, every following visit will be counted because the if-clause will be always 'true'.
 
It took me some hours to find out that the user permission "Can View Profile Views" does not do what it says ^^
Activated or not, the member is able to see the profile views. But as long as it's not activated the profile views will not be counted !

Ah yes, this is definitely a bug. On a side note, while it let them 'see' it, it wouldn't have ever let them see the actual value. It would have just been a zero. Either way, this has been fixed.

And a suggestion for a possible future version of this add-on:
same styling for the "Last x visitors" like it's used for the follower blocks.
Currently it looks a bit out of place.

I've made some tweaks to this, also removed the extra number as it was somewhat out of place, and made it show the number it was displaying in the phrase.

in library\Audentio\ProfileViews\Proxy\XenForo\ControllerPublic\Member.php
This will always be "false", because the view_date is a UNIX timestamp and will never be smaller than x hours cool down period * 3600 ;)

Oops! Good catch. I've also tweaked this conditional and wrapped the
!$lastView || $lastView['view_date'] < ($xenOptions->adprofileviews_cooldownPeriod * 3600 in another set of parenthesis

A 'ORDER BY pView.view_date LIMIT 1' is also missing in the function 'getLastViewForUserByVisitor'.

This has been fixed as well :) Expect a release in just a few minutes.

Jake
 
This would be worth purchasing, if a new feature was implemented --

LinkedIn drives traffic back to their site by periodically (one a week, from what I can tell) sending their members an e-mail stating "X number of people have looked at your profile this week! Click here to see who & update your profile"

This drives traffic back to their site, and also forces to people to keep their profiles relatively tidy.

Any chance of that becoming a reality? The critical parameters that admins should be able to adjust are the frequency of the email (weekly, monthly, etc), and the minimum threshold # of profile views in a time period to trigger it.

(I realize that I may have just described a totally new plugin, but... :) )
 
Oops! Good catch. I've also tweaked this conditional and wrapped the
!$lastView || $lastView['view_date'] < ($xenOptions->adprofileviews_cooldownPeriod * 3600 in another set of parenthesis
Nice, but still no actual time included to calculate the difference between last and current visit.

Let's assume, I visited a profile page Sep 01st, 8am UTC (timestamp: 1441094400) and the cool down period is set with 12 hours.
With the current code ( (!$lastView || $lastView['view_date'] < ($xenOptions->adprofileviews_cooldownPeriod * 3600)) ) it would be:
(!$lastView || 1441094400 < (12 * 3600))
12 * 3600 = 43200 <-- far, far away from 1441094400 ;)
A second profile visit will never be counted.

Unfortunatelly there is also no fix for the problem in 'getLastVisitorsForUser' :(

LinkedIn drives traffic back to their site by periodically (one a week, from what I can tell) sending their members an e-mail stating "X number of people have looked at your profile this week! Click here to see who & update your profile"
(y)
 
Error trying to upgrade @Jake B.

Code:
Mysqli statement execute error : Duplicate column name 'adprofileviews'

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Audentio/ProfileViews/Listener/Install.php at line 17
Audentio_ProfileViews_Listener_Install::install()
call_user_func() in XenForo/Model/AddOn.php at line 215
XenForo_Model_AddOn->installAddOnXml() in ConvEss/Model/AddOn.php at line 24
ConvEss_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 237
XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /var/www/vhosts/wweforums.net/httpdocs/admin.php at line 13
 
Can confirm the error on update - same here:
Code:
Server Error

Mysqli statement execute error : Duplicate column name 'adprofileviews'

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 317
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Audentio/ProfileViews/Listener/Install.php at line 17
Audentio_ProfileViews_Listener_Install::install()
 
Error trying to upgrade @Jake B.

Code:
Mysqli statement execute error : Duplicate column name 'adprofileviews'

Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in Audentio/ProfileViews/Listener/Install.php at line 17
Audentio_ProfileViews_Listener_Install::install()
call_user_func() in XenForo/Model/AddOn.php at line 215
XenForo_Model_AddOn->installAddOnXml() in ConvEss/Model/AddOn.php at line 24
ConvEss_Model_AddOn->installAddOnXml() in XenForo/Model/AddOn.php at line 169
XenForo_Model_AddOn->installAddOnXmlFromFile() in XenForo/ControllerAdmin/AddOn.php at line 237
XenForo_ControllerAdmin_AddOn->actionUpgrade() in XenForo/FrontController.php at line 347
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /var/www/vhosts/wweforums.net/httpdocs/admin.php at line 13

Any idea? :/
 
Nice, but still no actual time included to calculate the difference between last and current visit.

Let's assume, I visited a profile page Sep 01st, 8am UTC (timestamp: 1441094400) and the cool down period is set with 12 hours.
With the current code ( (!$lastView || $lastView['view_date'] < ($xenOptions->adprofileviews_cooldownPeriod * 3600)) ) it would be:
(!$lastView || 1441094400 < (12 * 3600))
12 * 3600 = 43200 <-- far, far away from 1441094400 ;)
A second profile visit will never be counted.

Unfortunatelly there is also no fix for the problem in 'getLastVisitorsForUser' :(
@Audentio Design @Jake B.
Any update on this ?
My ticket on your website is closed, without any comment or feedback :(
 
How do I change the sidebar header text to something like "Recent Visitors"? I've tried searching that particular phrase in the templates/phrases, but I'm not quite sure where to change it? It was like this upon installation.

yD6yV6j.png

Or maybe this is actually a bug. Not sure. No one else seems to have had this issue.

@Jake B. @Mike Creuzer
 
Last edited:
How do I change the sidebar header text to something like "Recent Visitors"? I've tried searching that particular phrase in the templates/phrases, but I'm not quite sure where to change it? It was like this upon installation.

yD6yV6j.png

Or maybe this is actually a bug. Not sure. No one else seems to have had this issue.

@Jake B. @Mike Creuzer

We've uploaded a fix for this to our shop over at audentio.com.

Jake
 
Where's this fix at? I've taken a look over on Audentio, but haven't seen any updated .zip files. Maybe I'm missing where you were trying to tell me it's at?

It's the same version number, just redownload the files :)
 
Top Bottom