PDA

View Full Version : Percent of thread views on threads created by user


Gamingforce
03-09-2002, 10:00 PM
I have been using this on my message board community for a while, but haven't seen a public hack out for it. This hack allows you to see what percent of all thread views made were threads started by that particular user. Very easy to install. Enjoy!

For a demo, check a profile on my board:
http://www.gamingforce.com/forums/member.php?action=getinfo&userid=1
(It's under activity summary)

File to edit: member.php
Template to edit: getinfo
Tested on vBulletin 2.0.3 - 2.2.4.

Dade
03-10-2002, 06:01 AM
I think I just might use this, thanks. And awesome board

Lesane
03-10-2002, 07:56 AM
Very nice, another addon on the user's profile page. Thanks. :up:

Edgar
03-10-2002, 11:35 AM
Nice Bobo,I always wondered why I could not find this hack.
Now it seems you made it :D

Overgrow
03-10-2002, 12:47 PM
That query ran faster than I expected on good size site. Nicely done.. and I had to respond to say *beautiful board* !

maverick1236
03-10-2002, 02:14 PM
Parse error: parse error in c:\program files\nusphere\apache\htdocs\forums\member.php on line 1179

line 1179=$userthreadviews $countviews['views'];

lifesourcerec
03-11-2002, 12:18 AM
Originally posted by maverick1236
Parse error: parse error in c:\program files\nusphere\apache\htdocs\forums\member.php on line 1179


line 1179=$userthreadviews $countviews['views'];

Change it to:


$userthreadviews = $countviews['views'];


the "=" is missing.

Mathiau
03-27-2002, 06:51 AM
nice, gonna try this one as well.

pattox2k1
05-06-2002, 05:34 AM
nice work :)

Boofo
06-21-2002, 05:05 PM
I tried to install this and I got a parse error because of another hack I have installed. Is the following basically the same hack?

### Open member.php

### Find

if ($userinfo[customtitle]==2)
$userinfo[usertitle] = htmlspecialchars($userinfo[usertitle]);
$userinfo[datejoined]=vbdate($dateformat,$userinfo[joindate]);

### After That Add
// Total Thread Views
$boardviews = $DB_site->query_first("SELECT SUM(views) AS totalviews FROM thread");
$totalviews = $boardviews['totalviews'];
$countviews=$DB_site->query_first("SELECT SUM(views) AS views FROM thread WHERE postuserid='$userinfo[userid]'");
$myviews= $countviews['views'];
$percentofmyviews = round(($myviews / $totalviews) * 100,2);

### Close member.php

### Login to your control panel

### Go to Templates -> Modify -> [expand list] -> User Info Display Templates [expand] -> getinfo [change original]

### Find In That Template

any place and add the code:

$percentofmyviews% of total views

### Done in the control panel

Originally posted by Gamingforce
I have been using this on my message board community for a while, but haven't seen a public hack out for it. This hack allows you to see what percent of all thread views made were threads started by that particular user. Very easy to install. Enjoy!

For a demo, check a profile on my board:
http://www.gamingforce.com/forums/member.php?action=getinfo&userid=1
(It's under activity summary)

File to edit: member.php
Template to edit: getinfo
Tested on vBulletin 2.0.3 - 2.2.4.

Chris M
06-21-2002, 07:23 PM
Nice!

Satan

PsyBlast
12-20-2002, 01:48 AM
I was wondering how I could get the threads started %?