(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-16-24 10:28 PM
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: 6318 days
Last view: 6299 days
Skype
Posted on 11-28-05 02:32 PM Link | Quote
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: 6396 days
Last view: 6332 days
Posted on 11-28-05 03:40 PM Link | Quote
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: 6318 days
Last view: 6299 days
Skype
Posted on 11-28-05 04:31 PM Link | Quote
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: 6483 days
Last view: 6298 days
Posted on 11-28-05 04:34 PM Link | Quote
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: 6695 days
Last view: 6326 days
Posted on 11-28-05 05:08 PM Link | Quote
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 |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.010 seconds; used 365.93 kB (max 438.90 kB)