myBB Community Forums
login - register - member list - search - help - calendar - home

myBB Community Forums » Customization » Code Modifications and Hacks » [RC2] Release - Profile Views

 
[RC2] Release - Profile Views
Author: Message:
Dale
Junior Member



Posts: 33
Group: Registered
Joined: Oct 2003
Status: Online
Reputation:
[RC2] Release - Profile Views

Mod Name: Profile Views

Author: Dale Hay (me)

Whats It Do? It counts how many times someones profile has been viewed.

Its a small simple hack and im not very familar to the mysql and php world.. so excuse me on any coding problems that i have. I have installed this on a test board that i have (on apache) and it works fine. I did have a bit of trouble when looking at a profile as Last Poster but thats sorted now.

Enjoy

Attachment: install1.txt (1.8 KB)
This file has been downloaded 3 time(s).
This post was edited on 04-16-2004 at 06:07 AM by Dale.


IP Address: Logged

04-15-2004 06:54 AM
martin
Junior Member



Posts: 39
Group: Registered
Joined: Oct 2003
Status: Offline
Reputation:
RE: [RC2] Release - Profile Views

good idea
me have no time to test it know, but ill try it later and report bugs if ne

IP Address: Logged

04-15-2004 07:47 AM
WDZ
Lazy Admin




Posts: 491
Group: Administrators
Joined: Aug 2002
Status: Offline
Reputation:
RE: [RC2] Release - Profile Views

It is a good idea... maybe I should add something like it on the MsgPlus! forums. The main issue is that people could refresh like crazy to get more views...

Anyway,  I see some possible problems with your mod:

In the UPDATE query, you're updating the user $mybb[uid], which is you, not the user whose profile you're viewing. You should do...

UPDATE users SET views=views+1 WHERE uid='$uid'

instead. The $uid variable will be set properly even if you're accessing the profile via lastposter.

Second, the stripslashes($memprofile[views]) is unnecessary, because it's a number, not a string.

Finally, the TINYINT column type is much too tiny. Once you get 128 views, it will stop counting. I suggest using MEDIUMINT.

IP Address: Logged

04-15-2004 06:40 PM
Dale
Junior Member



Posts: 33
Group: Registered
Joined: Oct 2003
Status: Online
Reputation:
RE: [RC2] Release - Profile Views

Fixed Thanks for the comments and thanks WDZ, i've updated the txt file now, also how many views can be done if im using MEDIUMINT ?


IP Address: Logged

04-16-2004 06:07 AM
WDZ
Lazy Admin




Posts: 491
Group: Administrators
Joined: Aug 2002
Status: Offline
Reputation:
RE: [RC2] Release - Profile Views

8388607. I think it will take a while for a profile to get viewed eight million times. :p If you want to support an even larger number, you can make the column unsigned, which will allow up to about 16777215 views...

MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL

IP Address: Logged

04-16-2004 03:20 PM
« Next Oldest Return to Top Next Newest »
 


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add to your Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You cannot edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On
 


<Contact Us - myBulletinBoard >
[Return to Top]


Powered by myBulletinBoard 1.00 Release Candidate 2
Copyright © 2003 The myBulletinBoard Group