PDA

View Full Version : Posts Made by User Over the Past Week and PPD Trend


Gamingforce
07-31-2002, 10:00 PM
[ Feature Description ]
While I was taking a shower I thought it would be pretty cool to display how many posts someone made over the past 7 days (week) and show how active the user was over that period of time compared to normal.

The posts made over the past 7 days is pretty much self explanatory but let me explain the trend part. Say your current posts per day is 100. Over the past week you made 140 posts making the ppd average for the past 7 days 20. Your ppd trend is -80 posts per day for the past 7 days. If you don't post at all that week, and your ppd is 100, your trend will be -100. I thought it was a clever way to show how active the user was over the past week.

The query runs pretty fast even on my database of over 700k posts. Only one block of code to add to member.php and one template to edit!

[ What you need to modify/add ]
File to modify: member.php (1 time)
Templates to modify: getinfo
Templates to add: none

[ Tested on ]
vBulletin version 2.2.6 (should work on any vB 2+)

[ Example ]
http://www.gamingforce.com/forums/member.php?action=getinfo&userid=2262

Enjoy, and as always, comments are appreciated!

Chris M
08-01-2002, 11:23 AM
Cool!:)

Satan

Massiel
08-01-2002, 01:19 PM
Wow your forums are mega cool!!

Admin
08-01-2002, 02:07 PM
If you don't already have an index on dateline (post table), one might speed up the query.

afterlab
08-01-2002, 02:22 PM
Good job, gamingforce. I'll be planning to install this onto my forums.

Velocd
08-01-2002, 03:08 PM
I don't suppose anybody could post of a picture of what this looks like, unless it's really simple. Maybe even a text version..:p

Anyways, it sounds cool, I'll defiantly have to add it :D
*clicks install*

Birdie501
08-01-2002, 03:26 PM
@Gamingforce
Your forum looks nice. Can you tell me, which hacks you used in the member bios?

Thanks!

kenny@ecn
08-01-2002, 04:31 PM
I need some help, that second step has me baffled:

STEP TWO -> Modify template: getinfo

[[ FIND ]]]

Add "$postsweek posts made over the past seven days. (trend: $ppdtrend posts per day)" to the getinfo template (according to your design) to display how many posts the user has made in the past week and their post per day trend!


What do I find to replace? What do I do? Some advice? THanks.


-Kenny

kenny@ecn
08-01-2002, 04:35 PM
This is my getinfo template, can someone just add it in there for me? lol

{htmldoctype}
<html>
<head>
<title>$bbtitle - View Profile</title>
$headinclude
<script language="javascript" type="text/javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?s=$session[sessionhash]&action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,wi dth=175,height=275,resizeable=yes,status=no")
}
// -->
</script>
</head>
<body>
$header

<br>

<table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{tablebordercolor}" {tableouterextra} width="{contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{tableinnerborderwidth}" border="0" {tableinnerextra} width="100%">
<tr>
<td bgcolor="{tableheadbgcolor}" colspan="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr id="cat">
<td align="left"><normalfont color="{tableheadtextcolor}"><b>Profile For $userinfo[username]</b></normalfont></td>
<td align="right"><a href="search.php?s=$session[sessionhash]&action=finduser&userid=$userinfo[userid]"><smallfont color="{tableheadtextcolor}" class="thtcolor">Search for all posts by this user.</smallfont></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Date Registered:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>$userinfo[datejoined]</normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Status:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$userinfo[usertitle]&nbsp;<img src="$userinfo[avatarurl]" border="0" align="middle"></normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Total Posts:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>$userinfo[posts] ($postsperday posts per day)</normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Last Post:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$lastpostdate $lastposttime<br><a href="$lastposturl">$lastposttitle</a>$nolastpost</normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Contact $userinfo[username]:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>
<a href="member.php?s=$session[sessionhash]&action=mailform&userid=$userinfo[userid]">Click here to email $userinfo[username]</a>
$userinfo[sendpm]
</normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Homepage:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont><a href="$userinfo[homepage]" target="_blank">$userinfo[homepage]</a>&nbsp;</normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>ICQ Number:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>$userinfo[icq] <!-- $ userinfo[icqicon] THE ICQ FLOWER - remove comments --></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>AOL Instant Messenger Handle:</b></normalfont></td>
<td bgcolor="{firstaltcolor}"><normalfont>$userinfo[aim] <!-- $ userinfo[aimicon] AIM ICON - remove comments --></normalfont></td>
</tr>
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Yahoo Instant Messenger Handle:</b></normalfont></td>
<td bgcolor="{secondaltcolor}"><normalfont>$userinfo[yahoo] <!-- $ userinfo[yahooicon] YAHOO ICON - remove comments --></normalfont></td>
</tr>
$referrals
$birthday
$customfields
<tr>
<td bgcolor="{tableheadbgcolor}" align="center" colspan="2"><smallfont>
<a href="member2.php?s=$session[sessionhash]&action=addlist&userlist=buddy&userid=$userinfo[userid]"><font color="{tableheadtextcolor}">Add $userinfo[username] to Your Buddy List</font></a>
&nbsp; &nbsp;
<a href="member2.php?s=$session[sessionhash]&action=addlist&userlist=ignore&userid=$userinfo[userid]"><font color="{tableheadtextcolor}">Add $userinfo[username] to Your Ignore List</font></a>
</smallfont></td>
</tr>
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr>
<td align="center"><smallfont><b>
Administrative Options: <a href="moderator.php?s=$session[sessionhash]&action=useroptions&userid=$userinfo[userid]">User Options</a>
</b></smallfont></td>
</tr>
</table>

$footer

</body>
</html>

Mr_P
08-01-2002, 06:39 PM
Keeny in get info just add this as an example

Latest Posts From $userinfo[username]<br>Who has made $postsweek posts within last 7 Days($ppdtrend posts per day)

kenny@ecn
08-01-2002, 07:01 PM
lol, where how? can you just add it into that code I put in there?

Mr_P
08-01-2002, 07:30 PM
Originally posted by Mr_P

Latest Posts From $userinfo[username]<br>Who has made $postsweek posts within last 7 Days($ppdtrend posts per day)


what i have in quotes above copy the full line into your getinfo template in admin cp

then go to a user profile and u will see it has filled the name and post(s) in for u.

now delete it and follow the orginal hack now as its dead easy to install this one

kenny@ecn
08-01-2002, 07:35 PM
should i replace everything in my getinfo template with that stuff?

Mr_P
08-01-2002, 07:38 PM
no u see this bit at end of your getinfo

<br>

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td align="center"><smallfont><b>
Administrative Options: <a href="moderator.php?s=$session[sessionhash]&action=useroptions&userid=$userinfo[userid]">User Options</a>
</b></smallfont></td>
</tr>
</table>

$footer

</body>
</html>

ok i have added it for u now put it in get info and view a profile - u will kick yourself when u see how easy it is

<br>
Latest Posts From $userinfo[username]<br>Who has made $postsweek posts within last 7 Days($ppdtrend posts per day)

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td align="center"><smallfont><b>
Administrative Options: <a href="moderator.php?s=$session[sessionhash]&action=useroptions&userid=$userinfo[userid]">User Options</a>
</b></smallfont></td>
</tr>
</table>

$footer

</body>
</html>

tacoX
08-01-2002, 09:52 PM
That 'bios' looks great! One of the best so far that I have seen!

Velocd
08-01-2002, 10:53 PM
tacoX your signatures are going to get manipulated by Firefly if you don't remove 2 out of the 3, since you can only have 1 image signature. :cheeky:

As for this hack and what it does, I now understand :)

Those of you who keep buggin Gamingforce about what hacks he uses in his postbit, don't because that is not what this thread is meant for. :p

Admin
08-02-2002, 07:46 AM
Good guess...