The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I want to give members the satisfaction of seeing how many views all their posts have received.
i.e. Total views of all your posts: 34500 Anyone one know if this hack has been done? |
#2
|
||||
|
||||
So, to sum all the views of the threads started by the person viewing the page? Not hard at all.
Tell me if this is what you want. |
#3
|
|||
|
|||
I was going to put this information in their control panel, for each members own private reference.
|
#4
|
|||
|
|||
I have just realized that this is a more important requirement for my message boards then I thought.
If no one knows how to do it, can anyone point me to a hack that is similar? I must say, that this would be a great hack. - It could double for a points program. - The person must be the thread starter however to count the impressions towards their total... thanks. |
#5
|
|||
|
|||
Something like this:
PHP Code:
|
#6
|
||||
|
||||
Code:
$yourviews=$DB_site->query_first("SELECT SUM(views) AS totalviews FROM thread WHERE postuserid='$bbuserinfo[userid]'"); |
#7
|
|||
|
|||
OK, how about a short, quick explanation of "query_first".
|
#8
|
||||
|
||||
$DB_site->query() is just like mysql_query().
$DB_site->query_first() is the same as the above, only it returns the first row in the result. For example if you want to find out someone's username, you can do this: Code:
$userinfo=$DB_site->query_first("SELECT username FROM user WHERE userid='$userid'"); But if you do it this way (the wrong way): Code:
$userinfo=$DB_site->query("SELECT username FROM user WHERE userid='$userid'"); You must do $DB_site->fetch_array(), because the result in this case it a 2D array. Am I making sense here? |
#9
|
||||
|
||||
Thanks Firefly, learned something 2day
Why not making a new forum where the php guys can add their little tutorials like this one above? |
#10
|
|||
|
|||
Quote:
One more question, which file is this object defined in? Thank You |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|