PDA

View Full Version : [release a minihack---personal glamour for vb2]


05-16-2001, 10:00 PM
This hack is get info on user statu.
when view user's profile a "personal glamour"will be display.
here is a demo:
http://my.yalaso.net/~ztsky/ztskydemo.jpg
It's a Chinese Version.
but in my zipfile ,It's a english Version.
file to be edit: member.php
template to be edit:getinfo
updated on 05-19-2001 04:32 AM
here's the hack:

Sarge
05-17-2001, 03:40 PM
Who said what to who?

What does this hack do?

Mega
05-17-2001, 04:38 PM
Next time make the image a JPG first.. that BMP takes hours to load !!!

or put it on a better server

ztsky
05-17-2001, 04:52 PM
Originally posted by Mega
Next time make the image a JPG first.. that BMP takes hours to load !!!

or put it on a better server
You are right!;)
The image is too big.I have it edited.

Sarge
05-17-2001, 07:04 PM
what does this hack do?

Pingu
05-17-2001, 08:20 PM
Originally posted by Sarge
what does this hack do?

Well, if you take a look in the textfile ztsky zipped, then you'll find a line like this:
2*$userinfo[posts]+$personal0[personalviews];

To keep it real simple, this hack produces a number of how active that user is on your forum, that's the personal glamour and I like it :)

MrLister
05-18-2001, 12:14 AM
great hack except you made a typo in your document.

change:
<td><normalfont>$starts</normalfont>
to:
<td><normalfont>$personal</normalfont>

ztsky
05-18-2001, 02:59 AM
Originally posted by mrlister
great hack except you made a typo in your document.

change:
<td><normalfont>$starts</normalfont>
to:
<td><normalfont>$personal</normalfont>

Thank you very much.
I confuseed another hack with it,but it has been updated.:p

Mark Hewitt
05-18-2001, 11:03 AM
I think personal views would be a better name.

Personal glamour could mean many things :eek:

Me2Be
05-18-2001, 02:04 PM
I'm still confused - what exactly does this hack do? :)

Mark Hewitt
05-18-2001, 02:05 PM
Number of threads you have viewed (I think)

ztsky
05-18-2001, 02:20 PM
Originally posted by Mark Hewitt
Number of threads you have viewed (I think)

2*$userinfo[posts]+$personal0[personalviews]
YOU CAN EDIT THIS CODE AS YOU LIKE.
It's produces a number of how active that user is on your forum.:( :)

Sarge
05-18-2001, 02:24 PM
what is how active?
I installed it and it didnt post anything next to glamour in profile
rc3

Me2Be
05-18-2001, 02:25 PM
Originally posted by ztsky
It's produces a number of how active that user is on your forum.:( :) Hi Ztsky! What exactly do you mean by "how active"? Number of times they view a thread? Number of times they visit your forums? :)

MrLister
05-18-2001, 02:26 PM
This hack is really good. I really like it. You can use it as a activity level. It's very simple to customize. How you want to customize it. Look here
2*$userinfo[posts]+$personal0[personalviews]

In this equation it will take the total number of posts the user has times it by 2 and add the total of views the user has. So if that user has 10 posts and has viewed 50 threads his activity level would be at 70. You can make it so it divides by 100 to use smaller numbers. Only thing missing is replies which would be nice. Ok I came up with this little add-on. There are two types of installations.

People who use tubedoggs User started X threads hack (http://vbulletin.com/forum/showthread.php?s=&threadid=12104) do this:

***Go to member.php and find
$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$starts = $startcount[starts];
if ($starts == ""):
$starts = "0";
endif;
***Below that add
$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$activity01= $userinfo[posts]-$starts;
$activity02= $starts;
$activity03= $personal0[personalviews];
$personal= 3*$activity02+2*$activity01+$activity03;
if ($personal2 == ""):
$personal2 = "0";
endif;

People who are doing a clean installation do this:
***open member.php and find [code]
eval("\$birthday = \"".gettemplate("getinfo_birthday")."\";");
}
***below that add
$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$starts = $startcount[starts];
if ($starts == ""):
$starts = "0";
endif;
$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$activity01= $userinfo[posts]-$starts;
$activity02= $starts;
$activity03= $personal0[personalviews];
$personal= 3*$activity02+2*$activity01+$activity03;
if ($personal2 == ""):
$personal2 = "0";
endif;

That's it. There's probably a cleaner way of doing the $activity01,02,03 thing but i'm still learning. Please not that i wish no credit for this. i have simply just put the two together and all thanks should go to ztsky and tubedogg. For the rest of the instructions download the file. (http://vbulletin.com/forum/attachment.php?s=&postid=107846)

Mark Hewitt
05-18-2001, 02:26 PM
Ah so it's like an Activity Index number sort of thing, which gives credits for posts and views.

Thats quite nice I think. Not sure if I could be bothered to install it though!!

Me2Be
05-18-2001, 02:34 PM
Ah, I see - thanks! Since I disabled views I'm not sure I could use this!

Mark Hewitt
05-18-2001, 02:39 PM
Even if you've disabled views they are still counted as far as I know.

What I would like to know is if this hack is backwards compatible. I'm not sure there is anything recording views per person at the moment so I'm not sure how my current members can get an activity index based on what they have done in the past rather than what they do after the hack is installed.

Me2Be
05-18-2001, 02:44 PM
Originally posted by Mark Hewitt
Even if you've disabled views they are still counted as far as I know. How would that work? I thought that if you disabled view counts in the code, then it doesn't count any views. Thanks Mark!

Mark Hewitt
05-18-2001, 02:46 PM
ah well if you've actually removed it from the code as opposed to just not displayi it then it wouldn't !

Me2Be
05-18-2001, 02:48 PM
Originally posted by Mark Hewitt
ah well if you've actually removed it from the code as opposed to just not displayi it then it wouldn't ! Phew, I was getting confused there for a second! :)

ztsky
05-20-2001, 03:09 AM
Originally posted by Me2Be
Hi Ztsky! What exactly do you mean by "how active"? Number of times they view a thread? Number of times they visit your forums? :)

I think Number of times they view a thread and Number of times they visit your forums and Number they post a thread and Number of their posts all of "how active" ,:)
I sugguest vb should support a function to display "how active" a user in our forum.

Pingu
05-20-2001, 11:57 AM
Well, this was what I needed.

I'm going to let my members advertise on my forums, but I only want to allow active members to do so. This hack could save me a lot of trouble :)

MrLister
05-20-2001, 02:04 PM
using this you can easily restrict access to those who aren't active

Pingu
05-20-2001, 05:22 PM
Originally posted by mrlister
using this you can easily restrict access to those who aren't active

Not quite so, because the result is cummulative. People can still have a high number after being inactive for months.
But I've added a little extra code to check for the last activity. If that activity was more then 21 days ago, the glamour thing is set to 0

ztsky
05-20-2001, 06:20 PM
Originally posted by Pingu


Not quite so, because the result is cummulative. People can still have a high number after being inactive for months.
But I've added a little extra code to check for the last activity. If that activity was more then 21 days ago, the glamour thing is set to 0

Of cause "how active" is difficult to definite and it is not as a same thing everybody think about.
But this hack can give you a point.:o

ThomasP
06-15-2001, 11:39 AM
Great hack!
Easy to setup and I love it :)
-Tom

Nocturnal
06-24-2001, 07:12 PM
Originally posted by Pingu

I've added a little extra code to check for the last activity. If that activity was more then 21 days ago, the glamour thing is set to 0

Care to share?

DeadlyMax
07-06-2001, 09:25 PM
modified it a bit:

this will add Personal Views to the posts
image:
https://vborg.vbsupport.ru/


in showthread.php

Find:

$onlinestatus="";
}


Below that add:

$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$personal= 2*$userinfo[posts]+$personal0[personalviews];
if ($personal0 == ""):
$personal0 = "0";
endif;


then edit template postbit:

Find:

Posts: $post[posts]</smallfont></td>

Replace that with:

Posts: $post[posts]<br>
Personal Views: $personal </smallfont></td>

that should do the trick ;)
have fun

ShadowTech
07-12-2001, 07:47 AM
I just thought I would point out that this hack has nothing to do with how active a member is on your forum.

ALL it does is shows how many times ANYONE has viewed a users thread. Not how many threads that user themselves have viewed.

If you want to see it in action to find out how it really works, open up a thread to view the posts.. look at the number of views for the thread creator.. then hit reload.. their number increases by one. Keep hitting reload and their number keeps rising.

So if you are using this hack thinking it shows how frequently your user is surfing around the board looking at people's posts.. you are mistaken.

ztsky
07-12-2001, 07:52 AM
Originally posted by ShadowTech
I just thought I would point out that this hack has nothing to do with how active a member is on your forum.

ALL it does is shows how many times ANYONE has viewed a users thread. Not how many threads that user themselves have viewed.

If you want to see it in action to find out how it really works, open up a thread to view the posts.. look at the number of views for the thread creator.. then hit reload.. their number increases by one. Keep hitting reload and their number keeps rising.

So if you are using this hack thinking it shows how frequently your user is surfing around the board looking at people's posts.. you are mistaken.

I don't think you had read this hack.
$personal= 2*$userinfo[posts]+$personal0[personalviews];

ShadowTech
07-12-2001, 07:54 AM
Originally posted by ztsky


I don't think you had read this hack.
$personal= 2*$userinfo[posts]+$personal0[personalviews];

this is the same exact code I edited in my .php files to install this hack and that is how it works on my board. Anyone who views the thread increases the thread starters' views count.

ztsky
07-12-2001, 08:10 AM
Originally posted by ShadowTech


this is the same exact code I edited in my .php files to install this hack and that is how it works on my board. Anyone who views the thread increases the thread starters' views count.
Anyone who views the thread increases the thread starters' views count.

Do you think it not good to count as this?
You can cancell this .
just use:
$personal= 2*$userinfo[posts]+$personal0

ShadowTech
07-12-2001, 08:29 AM
I'm not saying it's a bad hack or anything.. just pointing out to those people who think this tracks a user's activity that it in fact doesn't with the default scripting.

I am not too familiar with the code variables on this board.. but I don't doubt it would just take a simple change to track the actual user's specific views.

webhost
07-13-2001, 04:28 PM
Ztsky
I have added this hack also which counts total page views for the entire board. You can see at the top of board at http://forums.realwebhost.net When I add the numbers from members from your personalpage view hack your number is around 300 views higher. How would I correct the total count in your hack to reduce the count by 300?

http://vbulletin.com/forum/showthread.php?threadid=14739&perpage=15&pagenumber=1

ztsky
07-13-2001, 05:43 PM
Originally posted by webhost
Ztsky
I have added this hack also which counts total page views for the entire board. You can see at the top of board at http://forums.realwebhost.net When I add the numbers from members from your personalpage view hack your number is around 300 views higher. How would I correct the total count in your hack to reduce the count by 300?

http://vbulletin.com/forum/showthread.php?threadid=14739&perpage=15&pagenumber=1

$personal= 3*$userinfo[posts]+2$personal0[personalviews];
edit this code,you can figure your own,like:
$personal= $userinfo[posts]+$personal0[personalviews];
or:
$personal= 1/2*$userinfo[posts]+$personal0[personalviews];

webhost
07-13-2001, 07:59 PM
member.php Where in here nothing matchs what you posted showthread below.

Thanks Joey

// Find out how much personal glamour does this user has
$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$activity01= $userinfo[posts]-$starts;
$activity02= $starts;
$activity03= $personal0[personalviews];
$personal= 3*$activity02+2*$activity01+$activity03;

if ($personal2 == ""):
$personal2 = "0";
endif;
// end Findhow much personal glamour

showthread.php

$onlinestatus="";
}
$personal0 = $DB_site->query_first("

SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");

$personal= 2*$userinfo[posts]+$personal0[personalviews];

if ($personal0 == ""):

$personal0 = "0";

endif;

ztsky
07-17-2001, 03:57 PM
Hi! webhost
1??**********Edit member.php
**********FIND
eval("\$birthday = \"".gettemplat("getinfo_birthday")."\";");
}
**********AFTER THIS,ADD

$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$starts = $startcount[starts];
if ($starts == ""):
$starts = "0";
endif;
$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$activity01= $userinfo[posts]-$starts;
$activity02= $starts;
$activity03= $personal0[personalviews];
$personal= 3*$activity02+2*$activity01+$activity03;
if ($personal2 == ""):
$personal2 = "0";
endif;



2??*************editTemplate getinfo
*******FIND
<tr>
<td bgcolor="#DFDFDF"><normalfont><b>Total Posts:</b></normalfont></td>
<td bgcolor="#DFDFDF"><normalfont>$userinfo[posts] ($postsperday posts per day)</normalfont></td>
</tr>
<tr>
<td bgcolor="#F1F1F1"><normalfont><b>Last Post:</b></normalfont></td>
<td bgcolor="#F1F1F1"><normalfont>$lastpostdate $lastposttime<br><a href="$lastposturl">$lastposttitle</a>$nolastpost</normalfont></td>
</tr>
********AFTER THIS CODE,ADD:
<tr>
<td bgcolor="#DFDFDF"><normalfont><b>Start Threads:</b></normalfont></td>
<td bgcolor="#DFDFDF"><normalfont>$starts </normalfont></td>
</tr>
<tr>
<td bgcolor="#F1F1F1"><normalfont><b>Personal Views:</b></normalfont></td>
<td bgcolor="#F1F1F1"><normalfont><b>$personal </b></normalfont></td>
</tr>

3??**********Edit SHOWTHREAD.PHP
**********FIND
//$post[message].=$post[signature]; [CODE]
**********AFTER THIS,ADD
[CODE] // Find out how many threads this user has started
$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$starts = $startcount[starts];
if ($starts == ""):
$starts = "0";
endif;
$personal0 = $DB_site->query_first("
SELECT SUM(views) AS personalviews FROM thread WHERE postuserid='$userinfo[userid]' AND open!='10'");
$activity01= $userinfo[posts]-$starts;
$activity02= $starts;
$activity03= $personal0[personalviews];
$personal= 3*$activity02+2*$activity01+$activity03;
if ($personal2 == ""):
$personal2 = "0";
endif;

4??**********Edit template POSTBIT
*********FIND:
<smallfont>Registered: $post[joindate]<br>
Location: $post[field2]<br>
Posts: $post[posts]</smallfont></td>
*******replace it with :
<smallfont>Registered: $post[joindate]<br>
location: $post[field2]<br>
posts: $post[posts]<br>
personalviews:$personal </smallfont></td>


that's all.

webhost
07-17-2001, 04:37 PM
ztsky

ok I reinstalled per your instructions above this is what I have.

Total page views of all members from your hack shows 9602.

My total views shows 9280 a difference of 322. So based on your script above what do I change to subract your count by 322 views?

Joey

webhost
07-17-2001, 04:45 PM
ztsky

I don't know how hard it would be for you to do but the best thing would to be somehow take your hack count numbers of personalpageviews and total them up. That way you could use that number for total views of the entire site instead of using the other hack for total views. That way they would always match.

ztsky
07-17-2001, 05:11 PM
Originally posted by webhost
ztsky

I don't know how hard it would be for you to do but the best thing would to be somehow take your hack count numbers of personalpageviews and total them up. That way you could use that number for total views of the entire site instead of using the other hack for total views. That way they would always match.

I think you misunderstand this hack's function.

webhost
07-17-2001, 05:15 PM
ok then so to get the numbers to match up, I need to change the numbers below.

$personal= 3*$userinfo[posts]+2$personal0[personalviews];
edit this code,you can figure your own,like:
$personal= $userinfo[posts]+$personal0[personalviews];
or:
$personal= 1/2*$userinfo[posts]+$personal0[personalviews];

ShadowTech
07-19-2001, 02:35 PM
Originally posted by webhost
ok then so to get the numbers to match up, I need to change the numbers below.

$personal= 3*$userinfo[posts]+2$personal0[personalviews];
edit this code,you can figure your own,like:
$personal= $userinfo[posts]+$personal0[personalviews];
or:
$personal= 1/2*$userinfo[posts]+$personal0[personalviews];

the reason you are getting numbers that don't match is because of the "$personal= 2*$userinfo[posts]+$personal0[personalviews]; "

what it is doing is multiplying the number of posts a person has made .. and then adding it to the number of views their threads have had. So I think if you wanted to get the same number of views for your user totals and the board total.. you would change "$personal= 2*$userinfo[posts]+$personal0[personalviews]; " to "$personal= $personal0[personalviews]"

But, I am not a vB guru or anything.. just going by what I see in the code and applying some common sense,

webhost
07-19-2001, 02:43 PM
thanks I will try it and see if it works?

webhost
08-02-2001, 01:25 PM
ztsky Help Please

Will you probably know by now how everything has chnaged with the new
version of vb 2.0.3, now alot of stuff got moved from the showthread.php file to the functions.php file.
Your hack still works in the member profile section but does not in the showthread page, text shows up personalviews but no data to the right of it. Can you tell me what I need to do to fix this.

Joey:(