Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
Acmlm's Board - I3 Archive - Programming - User Stats On Index.php | New poll | | |
Add to favorites | Next newer thread | Next older thread |
User | Post | ||
VGFreak877 Kabu Since: 11-17-05 Last post: 6333 days Last view: 6314 days |
| ||
I usually don't ask for a lot of help since I like to figure things out for myself, but this time I'm at a loss. I'm trying to put simple stats on the main page like number of posts, amount of experience, level, and experience left for the logged in user. I was able to do posts and username (those were easy since you can pull those from MySQL), but doing things like EXP and level are not stored on any tables, they are figured out based on registration date. I tried looking at the code in profile.php to match up, but trying to get exp/level/etc to show for the logged in user is the tricky part. Any help is greatly appreciated, thanks. My main board is using 1.A2. (edited by VGFreak877 on 11-28-05 02:14 PM) |
|||
Ice Man Panser Since: 11-18-05 From: Germany Last post: 6411 days Last view: 6348 days |
| ||
I don't know if his works, but you could try it.
$loguser[exp]=calcexp($posts,$days); $loguser[level]=calclvl($loguser[exp]); $loguser[lvllen]=totallvlexp($loguser[level]); $loguser[expdone]=$loguser[exp]-calclvlexp($loguser[level]); $loguser[expnext]=calcexpleft($loguser[exp]); Else look in function.php, most of these things are in there, you just need to make them work with the $loguser variable IMO. I could be totally wrong though. |
|||
VGFreak877 Kabu Since: 11-17-05 Last post: 6333 days Last view: 6314 days |
| ||
Part of that code was right Ice Man. However, in that first line you have to put in this:
$loguser[exp]=calcexp($loguser[posts],(ctime()-$loguser[regdate])/86400); I was able to pull that exact line from profile.php. I was also able to figure it out from there -- thanks for the help. (edited by VGFreak877 on 11-28-05 03:32 PM) |
|||
smwedit Red Paragoomba Since: 11-18-05 Last post: 6498 days Last view: 6314 days |
| ||
do you mean like that thing at my board (http://edit.ed.funpic.org/forums) with the info (edited by smwedit on 09-09-06 06:23 PM) (edited by smwedit on 09-28-06 10:14 PM) |
|||
Elric Octoballoon Since: 11-18-05 From: Melniboné Last post: 6710 days Last view: 6341 days |
| ||
I'm thinking he was basing it off my board... But the Exp and Level I show there have nothing to do with when you registered or how much you post.
And you don't have to do $loguser[exp], since you don't have an exp field in the users table. You can just call the var $exp and that will work fine. $loguser[xxx] is only for pulling data from the users table. Whatever you put into the [brackets] should be an actual field in the users table. |
Add to favorites | Next newer thread | Next older thread |
Acmlm's Board - I3 Archive - Programming - User Stats On Index.php | | |