PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Statistik Hack von vB.ORG


nuke
12.01.2004, 01:02
Hallo wollte diesen Hack einfügen aber das geht leider nicht und ich kann nicht so Gut PHP als das ich es selber finden könnte.

Hier der Quelltext der da ist bzw ersetzt werden soll nur dann kommen nur fehlermeldung

Parse error: parse error in /var/www/web2/html/vb/forumdisplay.php on line 815




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 =2
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
*********************************************************************




Den Hack gibt es hier

http://www.vbulletin.org/forum/showthread.php?t=60075

martin
12.01.2004, 04:53
die zeile sieht merkwürdig aus:


// STATS DU FORUM par Grog6 pour VBulletinDev
$sujets=$DB_site->query_first("$sujets=$DB_site->query_first("SELECT postusername, SUM(


probier mal:


// STATS DU FORUM par Grog6 pour VBulletinDev
$sujets=$DB_site->query_first("SELECT postusername, SUM(

nuke
12.01.2004, 07:13
Hallo nee ging auch nicht hmmm komisch:confused:

pogo
12.01.2004, 10:31
martins Änderung ist schon richtig so, denk ich.

Du solltest nur nach dieser Änderung sagen, was in der Zeile und drumherum steht, die den Fehler erzeugt.

nuke
12.01.2004, 15:36
Hi

Wenn ich das so ändere bekomme ich Diese Meldung

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

pogo
12.01.2004, 19:01
Wie gesagt, anhand der Fehlermeldung kann ich auch nur sagen, dass da etwas falsch läuft. Wenn du mir jetzt mal Zeile 822 zeigen würdest oder vielleicht sogar noch 5 Zeilen vor und nach der Zeile 822, dann ließe sich eventuell der Fehler erkennen.

nuke
12.01.2004, 19:06
Achso Sorry Pogo hatte dich missverstanden hier der Code

/////////////////////////////////
if ($newthreads < 1 AND $unreadchildforums < 1)
{
// 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']);

$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') . '");');


// 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']);

Zeile 822

$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

pogo
12.01.2004, 19:41
Ändere mal// 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']);in// STATS DU FORUM par Grog6 pour VBulletinDev
$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']);

nuke
12.01.2004, 23:49
Hallo Danke es kommen zwar keine Fehler mehr aber die Anzeige kommt auch nicht ich meine man kann nun wrklich nicht so viel Falsch machen.

Ich sollte nach der erstellung der Temp das hier an einen geiegneten Platz einfügen.

$stats

Aber es geht nicht soll heissen es wird nix angezeigt ich Frage mich gerade warum dieser hack nicht inder Gruppe Beta ist den ausgereift ist der bestimmt nicht.



Hier mal die Ganze txt File


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 above.

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



#####################
# PHRASE MANAGER #
###################


In the phrase manager, add these phrases :


Type : GLOBAL
varname : statistiques
Test : Statistics


Type : GLOBAL
varname : stats_sujets
Test : Total of threads


Type : GLOBAL
varname : stats_reponses
Test : Total of replies


Type : GLOBAL
varname : stats_vues
Test : Total of views


Type : GLOBAL
varname : stats_votes
Test : Average vote


Type : GLOBAL
varname : stats_dsujet
Test : Last thread


Type : GLOBAL
varname : stats_mposteur
Test : Best poster


Type : GLOBAL
varname : stats_autres
Test : Other stats


Type : GLOBAL
varname : stats_total_posts
Test : Total Posts

Type : GLOBAL
varname : stats_dposteur
Text : Last Poster


##############################
# FILES MODIFICATIONS #
############################


In the file forumdisplay.php, find :

*********************************************************************
// 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',
'forumdisplay_loggedinuser',
'forumhome_moderator',
'forumdisplay_moderator',
'forumdisplay_sortarrow',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_post',
'forumrules'
*********************************************************************


and add just after :


*********************************************************************
,
'forumdisplay_stats'
*********************************************************************



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
*********************************************************************



######################
# NEW TEMPLATE #
####################



Create a new template called forumdisplay_stats :

**************************************************************************************************** ***************************
<div align=center><table class="tborder" cellpadding="6" cellspacing="1" border="0" width="80%">
<thead>
<tr>
<td class="thead">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('stats')"><img id="collapseimg_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_stats].gif" alt="" border="0" /></a> $vbphrase[statistiques] : <i>$foruminfo[title]</i>
</td>
</tr>
</thead>

<tbody id="collapseobj_stats" style="$vbcollapse[collapseobj_stats]">
<tr>
<td class="tcat">

<table border=0 width=100%>
<tr>
<td align=left>
$vbphrase[stats_sujets]: <b>$forum[threadcount]</b>
</td>
<td align=left>
$vbphrase[stats_reponses] : <b>$forum[posts]</b>
</td>
</tr>
<tr>
<td align=left>
$vbphrase[stats_vues] : <b>$nb_vues</b>
</td>
<td align=left>
$vbphrase[stats_votes] : $moyenne[votes]
</td>
</tr>
<tr>
<td align=left>
$vbphrase[stats_dsujet] : <b>$sujets[postusername]</b>
</td>
<td align=left colspan=2>
$vbphrase[stats_sujets] <img src="images/statusicon/forum_new_lock.gif"> : <b>$sujet[ferme]</b>
</td>
<tr>
<td align=center colspan=2>
$vbphrase[stats_mposteur] : <b>$meilleur[username] ($meilleur[postcount])</b>
</td>
</tr>
</table>
</td></tr>
</tbody>

<tr><td class="vbmenu_control"><font class="smallfont">
<span id="menuchat" class="vbmenu_control" style="float:$stylevar[center]">$vbphrase[stats_autres]
<script type="text/javascript"> vbmenu_register("menuchat"); </script>
</span>
</td></tr>

<!-- MENU DEROULANT -->

<div class="vbmenu_popup" id="smilies_chat_menu" style="display:none">
<table>
</table>
</div>

<div class="vbmenu_popup" id="menuchat_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="vbmenu_option">
$vbphrase[stats_total_posts] : <b>$forum[replycount]</b>
</td></tr>

<tr><td class="vbmenu_option">
$vbphrase[stats_dposteur] : <b>$forum[lastposter]</b>
</td></tr>

<tr><td class="vbmenu_option">
$vbphrase[stats_dsujet] : <b>$forum[lastthread]</b>
</td></tr>
</table>
</div>

<!-- MENU DEROULANT -->

<br><br>
**************************************************************************************************** *******


#############################
# TEMPLATE MODIFICATION #
###########################


In the template FORUMDISPLAY, find :

$navbar

and add under :

$stats