PDA

View Full Version : Forum Statistics in FORUMDISPLAY


VBDev
01-10-2004, 10:00 PM
This hack displays in the FORUMDISPLAY, a box where some stats of the forum are displayed.
These informations are :
- Total of Views
- Total of replies
- Total of views
- Average rating
- Last trhead created
- Total of threads
- Best poster
- Total of posts
- Last poster

A scrolling menu at the bottom of the box displays the last 3 statistics shown under

This statistics box is collapseable/expandable such as others elements of VB3.




Ce hack permet d'afficher dans le forumdisplay de vos forums, une boite d'affichage dans laquelle des stats sur le forum sont affich?es.
Les infos affich?es sont :
- Nombre de sujets
- Nombre de r?ponses
- Nombre de vues
- Moyenne des votes
- Dernier sujet cree par
- Nombre de sujets
- Meilleur posteur
- Nombre total de posts
- Titre du dernier sujet
- Dernier posteur

un menu deroulant permet d'afficher les 3 dernieres stats present?es plus haut

La boite de stats est retractable et sa position enregistr?e dans le cookie permet de la maintenir ferm?e/ouverte meme apres un changement de page.

Notez toutefois que 5 requetes sont ajout?es pour ce hack.


Installation time : 7 min
Templates to modify : 1
Templates to add : 1
Files to upload : 0
Files to modify : 1
Phrases to add : 10
Query to run : 0

:devious:

This hack has been released by VBulletinDev's team : http://www.vbulletindev.net

Ce hack a ete realis? par la team de VBulletinDev et est telechargeable en FR sur http://www.vbulletindev.net

Gio Takahashi
01-11-2004, 06:11 PM
Would this add a lot of querys? Just need to make sure.

VBDev
01-11-2004, 06:17 PM
This hack adds 5 queries on the forumdisplay

Boofo
01-11-2004, 06:18 PM
You need to take this down. I will be releasing an update to my hack for this from vB2. ;)

VBDev
01-11-2004, 06:20 PM
(I'm Grog6 boofo ;) )

Boofo
01-11-2004, 06:24 PM
Oh, ok. Why did you change your name?

FleaBag
01-11-2004, 06:45 PM
Was tweaking this in my vB2 today. Glad this has come along before I move to vB3. Did find the queries a problem for me, so took some of the features out. Maybe this version will perform well. :)

Gio Takahashi
01-11-2004, 06:48 PM
I installed this, I gotta tell you that your phrase stuff is a bit wierd.

VBDev
01-11-2004, 06:54 PM
It's a long story ...

In fact we created a site to produce our hack in french : http://www.vbulletindev.net

We created this username on vb.org, to release our hack, this username is used by :

Grog6, MtoR, p0s3id0n (which have already released some hacks on vb.org) + El Moneygask, thefreestyler

@Gio Takahashi : what is a bit wierd ?
My translation is not enough good ?

Rusche
01-11-2004, 06:56 PM
I installed this, I gotta tell you that your phrase stuff is a bit wierd.
Is it because there in French?

Gio Takahashi
01-11-2004, 06:59 PM
har har.

Oh. the "Total Views" seems to be the total views of the last thread created. Isn't it supposed to be the total views in this forum?

VBDev
01-11-2004, 07:07 PM
har har.

Oh. the "Total Views" seems to be the total views of the last thread created. Isn't it supposed to be the total views in this forum?
I had this problem in one forum when I did it, in other forums, it seems to work correctly

I think I had an idea, I'll take a look and try to repair it ;)

VBDev
01-11-2004, 07:35 PM
@Gio : modify in the forumdisplay.php :


$sujets=$DB_site->query_first("SELECT postusername, SUM(views) AS vues FROM " . TABLE_PREFIX . "thread WHERE forumid=$forumid GROUP BY postusername ORDER BY dateline DESC");


with


$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues
FROM " . TABLE_PREFIX . "thread
WHERE forumid =2
GROUP BY forumid
ORDER BY dateline DESC");


I'll update my archive

sypher_again
01-11-2004, 07:47 PM
Super taff les mecs ;) vive vbdev vous allez tout dechirer j'en suis sur ^^ / very good taff

MGM
01-11-2004, 08:23 PM
sweet..... i added this to my vB2 board, I'll be sure to use this on vB3

/me clicks Install

MGM out

eXtremeTim
01-11-2004, 08:31 PM
@Gio : modify in the forumdisplay.php :


$sujets=$DB_site->query_first("SELECT postusername, SUM(views) AS vues FROM " . TABLE_PREFIX . "thread WHERE forumid=$forumid GROUP BY postusername ORDER BY dateline DESC");


with


$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues
FROM " . TABLE_PREFIX . "thread
WHERE forumid =2
GROUP BY forumid
ORDER BY dateline DESC");


I'll update my archive
One problem all the forums would show the thread views amount for forum id number 2 in that new sql query you posted above.

nuke
01-11-2004, 09:21 PM
Hmm Sorry Error

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/web2/html/vb/forumdisplay.php on line 823

vB RC 2???

g-force2k2
01-12-2004, 04:46 AM
One problem all the forums would show the thread views amount for forum id number 2 in that new sql query you posted above.

If you updated the sql query you will get this error. Just change the code from his recent fix:

WHERE forumid =2

to:

WHERE forumid = $forumid

Regards,
g-force2k2

VBDev
01-12-2004, 04:51 AM
The zip was updated

Thx for the report of bugs :)

Vb-Hispano
01-12-2004, 07:14 AM
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/httpd/vhosts/juegos21.org/httpdocs/foros/forumdisplay.php on line 812

is error ???

VBDev
01-12-2004, 08:58 AM
are you sure that you haven't made a mistakes during the modifications of forumdisplay.php file ?

eXtremeTim
01-14-2004, 07:09 PM
If you updated the sql query you will get this error. Just change the code from his recent fix:

WHERE forumid =2

to:

WHERE forumid = $forumid

Regards,
g-force2k2
I know this. I was just letting him know so he could fix it. :)

Dark Shogun
01-31-2004, 12:38 PM
I get this:
Parse error: parse error, unexpected T_STRING in /home/virtual/site23/fst/var/www/html/project/forumdisplay.php on line 809

This is line 809:

$sujets=$DB_site->query_first("$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues

Please help

Dark Shogun

VBDev
01-31-2004, 12:58 PM
I get this:
Parse error: parse error, unexpected T_STRING in /home/virtual/site23/fst/var/www/html/project/forumdisplay.php on line 809

This is line 809:

$sujets=$DB_site->query_first("$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues

Please help

Dark Shogun
:|

An obscur error in my install script ;)

Remove $sujets=$DB_site->query_first(" At the begining of this line

Boofo
01-31-2004, 01:00 PM
That line should read:

$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues

gamevn
02-01-2004, 06:14 AM
wow,this hack is very cool,thz for sharing :D

Boofo
02-15-2004, 01:08 PM
You can do total threads, total replies and total views all in 1 query. ;)

sabret00the
02-15-2004, 01:51 PM
which is the best version this of the boofo one?

Boofo
02-15-2004, 01:55 PM
which is the best version this of the boofo one?
You decide. ;) Cache or queries?

VBDev
02-16-2004, 01:02 PM
You decide. ;) Cache or queries?
It's sure you can win queries by using cache, but informations aren't always right ... I didn't look at your code boofo but if you did the same that you did for the first version, yours use less query ;)

Boofo
02-16-2004, 01:40 PM
Well, I hate to differ with you but all the information from the queries in my hack is 100% correct. It has been tested thoroughly. Yes, I am using the same cache type that I used for the forumhome stats cache hack. And my hack was completely rewritten for version 2 with the cache. It only uses 1 query when reading from the cache and 6 when writing to it at the preset time. So, if queries is a big issue for anyone (and on bigger boards it usually is), then my hack will save them that. ;)

SpeedStreet
03-11-2004, 12:49 AM
Can you install this hack on a per forum basis?

Gio Takahashi
03-21-2004, 09:46 AM
Can you install this hack on a per forum basis?
Seems that this one may not be compatible with Gold. Had problem installiong this. Get a blank white page when I Try to do this:


Then find :


************************************************** *******************
$show['forumdescription'] = iif ($foruminfo['description'] != '', true, false);
$show['forumsearch'] = iif ($forumperms & CANSEARCH, true, false);
$show['forumslist'] = iif ($forumshown, true, false);
$show['stickies'] = iif ($threadbits_sticky != '', true, false);

eval('print_output("' . fetch_template('FORUMDISPLAY') . '");');
************************************************** *******************


and add above :


************************************************** *******************
// STATS DU FORUM par Grog6 pour VBulletinDev
$sujets=$DB_site->query_first("$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues
FROM " . TABLE_PREFIX . "thread
WHERE forumid = $forumid
GROUP BY forumid
ORDER BY dateline DESC");
$nb_vues = vb_number_format($sujets['vues']);");
$nb_vues = vb_number_format($sujets['vues']);

$moyenne = $DB_site->query_first("SELECT AVG(votetotal/votenum) AS votes FROM " . TABLE_PREFIX . "thread where forumid=$forumid AND votenum<>0");
$moyenne['votes'] = vb_number_format($moyenne['votes']);
$moyenne['votes'] = "<img src=\"images/rating/rating_$moyenne[votes].gif\" alt=\"Vote : $moyenne[votes]\">";

$meilleur = $DB_site->query_first("SELECT " . TABLE_PREFIX . "user.userid, " . TABLE_PREFIX . "user.username, COUNT(" . TABLE_PREFIX . "post.postid) AS postcount FROM " . TABLE_PREFIX . "post LEFT JOIN " . TABLE_PREFIX . "thread ON (" . TABLE_PREFIX . "post.threadid=" . TABLE_PREFIX . "thread.threadid) LEFT JOIN " . TABLE_PREFIX . "user ON (" . TABLE_PREFIX . "post.userid=" . TABLE_PREFIX . "user.userid) WHERE " . TABLE_PREFIX . "thread.forumid=$forumid GROUP BY " . TABLE_PREFIX . "post.userid ORDER BY POSTCOUNT DESC LIMIT 1");
$meilleur['postcount'] = vb_number_format($meilleur['postcount']);

$sujet = $DB_site->query_first("SELECT COUNT(open) AS ferme FROM " . TABLE_PREFIX . "thread WHERE forumid=$forumid AND open=0");

$forum = $DB_site->query_first("SELECT lastthread, lastposter, replycount, threadcount FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
$forum['posts'] = ($forum['replycount'] - $forum['threadcount']);

eval('$stats .= "' . fetch_template('forumdisplay_stats') . '";');
// STATS par Grog6
************************************************** *******************

VBDev
03-21-2004, 09:57 AM
@Gio : it should work but I haven't tested it on vb3 Gold, I'll have to modify all my hacks for Vb3 Gold ;)

It should be posted during the week

VBDev
03-24-2004, 08:40 PM
Our team has opened its support forum.

Now we will make support on our forum

So if you want better support on our hacks go on our forum: http://www.vbulletindev.net/

There are not a lot of hacks for the moment but it will come.

Cya soon on our forum :)

OCH-Stan
06-15-2004, 01:09 PM
I get this message: Parse error: parse error, unexpected T_STRING in /home/ochost/public_html/forum/forumdisplay.php on line 825. What's wrong??

EscortCossie
02-02-2005, 03:01 PM
I'm sorry to bump this thread, but I still get a parse error when installing exactly as stated in this thread. (also the fix..)

vakvak
03-25-2005, 02:57 AM
Parse error: parse error, unexpected T_STRING in /home/pcteknik/public_html/fr2/forumdisplay.php on line 816

forumdisplay error help pls

vakvak
03-25-2005, 05:46 PM
My FILES MODIFICATIONS
// pre-cache templates used by specific actions
$actiontemplates = array(
'none' => array(
'FORUMDISPLAY',
'threadbit',
'threadbit_deleted',
'forumdisplay_announcement',
'forumhome_lastpostby',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_post',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level2_nopost',
'forumhome_subforumbit_nopost',
'forumhome_subforumseparator_nopost',
'forumdisplay_loggedinuser',
'forumhome_moderator',
'forumdisplay_moderator',
'forumdisplay_sortarrow',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_post',
'forumrules'
,
'forumdisplay_stats'
)
);







// mark a single forum as read as it appears all threads are read
set_bbarray_cookie('forum_view', $foruminfo['forumid'], TIMENOW);
}
construct_forum_rules($foruminfo, $forumperms);

//remove html to stop the breaking of the meta description
$foruminfo['description'] = strip_tags($foruminfo['description']);

// STATS DU FORUM par Grog6 pour VBulletinDev
$sujets=$DB_site->query_first("$sujets=$DB_site->query_first("SELECT postusername, SUM( views ) AS vues
FROM " . TABLE_PREFIX . "thread
WHERE forumid = $forumid
GROUP BY forumid
ORDER BY dateline DESC");
$nb_vues = vb_number_format($sujets['vues']);");
$nb_vues = vb_number_format($sujets['vues']);

$moyenne = $DB_site->query_first("SELECT AVG(votetotal/votenum) AS votes FROM " . TABLE_PREFIX . "thread where forumid=$forumid AND votenum<>0");
$moyenne['votes'] = vb_number_format($moyenne['votes']);
$moyenne['votes'] = "<img src=\"images/rating/rating_$moyenne[votes].gif\" alt=\"Vote : $moyenne[votes]\">";

$meilleur = $DB_site->query_first("SELECT " . TABLE_PREFIX . "user.userid, " . TABLE_PREFIX . "user.username, COUNT(" . TABLE_PREFIX . "post.postid) AS postcount FROM " . TABLE_PREFIX . "post LEFT JOIN " . TABLE_PREFIX . "thread ON (" . TABLE_PREFIX . "post.threadid=" . TABLE_PREFIX . "thread.threadid) LEFT JOIN " . TABLE_PREFIX . "user ON (" . TABLE_PREFIX . "post.userid=" . TABLE_PREFIX . "user.userid) WHERE " . TABLE_PREFIX . "thread.forumid=$forumid GROUP BY " . TABLE_PREFIX . "post.userid ORDER BY POSTCOUNT DESC LIMIT 1");
$meilleur['postcount'] = vb_number_format($meilleur['postcount']);

$sujet = $DB_site->query_first("SELECT COUNT(open) AS ferme FROM " . TABLE_PREFIX . "thread WHERE forumid=$forumid AND open=0");

$forum = $DB_site->query_first("SELECT lastthread, lastposter, replycount, threadcount FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
$forum['posts'] = ($forum['replycount'] - $forum['threadcount']);

eval('$stats .= "' . fetch_template('forumdisplay_stats') . '";');
// STATS par Grog6

$show['forumdescription'] = iif ($foruminfo['description'] != '', true, false);
$show['forumsearch'] = iif ($forumperms & CANSEARCH AND $vboptions['enablesearches'], true, false);
$show['forumslist'] = iif ($forumshown, true, false);
$show['stickies'] = iif ($threadbits_sticky != '', true, false);

eval('print_output("' . fetch_template('FORUMDISPLAY') . '");');


but
Parse error: parse error, unexpected T_STRING in /home/pcteknik/public_html/fr2/forumdisplay.php on line 816
help.. :ninja:

Elfo King
06-05-2005, 12:41 PM
I have this error....


Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\Inetpub\wwwroot\forum\forumdisplay.php on line 822


This is line 822......


$nb_vues = vb_number_format($sujets['vues']);

Elfo King
06-13-2005, 04:26 PM
Any solutions or link to contact VBDev ?? are not http://www.vbulletindev.net/ ......

yoyoyoyo
06-13-2005, 04:50 PM
I get this message: Parse error: parse error, unexpected T_STRING in /home/ochost/public_html/forum/forumdisplay.php on line 825. What's wrong??I get the same error when changing line 819 as indicated earlier in this thread... is there a fix?

Elfo King
06-20-2005, 09:06 PM
I have this error....


Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in D:\Inetpub\wwwroot\forum\forumdisplay.php on line 822


This is line 822......



$nb_vues = vb_number_format($sujets['vues']);





UP
:ermm: :disappointed:

Elfo King
06-20-2005, 09:11 PM
WTF....this is a Full Version ?????....
we not have support for this hack and have big error....

........