vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Forum statisctics at the top of each forum (https://vborg.vbsupport.ru/showthread.php?t=52215)

grog6 04-30-2003 08:26 PM

So, to add link to lastposter'sprofile, replace in admin/functions.php :

PHP Code:

$dposteurs=$DB_site->query_first("SELECT lastposter FROM thread WHERE forumid='$forumid' ORDER BY threadid DESC");
$dposteur=$dposteurs['lastposter']; 

with

PHP Code:

$dposteurs=$DB_site->query_first("SELECT lastposter, userid FROM thread,user WHERE (thread.forumid='$forumid' AND 

user.username=thread.lastposter) ORDER BY threadid DESC LIMIT 0,1"
);
$dposteurnom=$dposteurs['lastposter'];
$dposteurid=$dposteurs['userid']; 

and in the template forumdisplay_stats, replace $dposteur with

PHP Code:

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$dposteurid
target=_blank>$dposteurnom</a

:)

subu1 04-30-2003 09:38 PM

i cant find this in admin/functions.php :(

grog6 04-30-2003 10:29 PM

Haven't you it at the end of the modification there is to do for my hack :

PHP Code:

$dposteurs=$DB_site->query_first("SELECT lastposter FROM thread WHERE forumid='$forumid' ORDER BY threadid DESC");
$dposteur=$dposteurs['lastposter'];
eval(
"\$forumdisplaystats = \"".gettemplate('forumdisplay_stats')."\";"); 

??

Boofo 04-30-2003 10:58 PM

Quote:

Today at 06:38 PM subu1 said this in Post #62
i cant find this in admin/functions.php :(
grog6 meant to say the forumdisplay.php file, not functions.php. ;)

Boofo 04-30-2003 11:04 PM

grog6, the lastposter link code works like a charm. Thanks. ;)

bitg is right about the Top Thread Starter bug. If you have a forum with only one thread in it, it will also give the error where it will show 100 % but no Top Thread Starter username. If you also have a forum where every thread is started by a different user, it will not show the username, because it doesn't know which one to pick. You must have threads started by the same username for it to show the name. I hope that makes sense. ;)

Amy, is there a way to fix the Average rating like you posted? It is still showing in one of my forums as a thread rating of 4 stars for an average and there are no thread ratings whatsoever in that forum.

grog6 05-01-2003 08:41 AM

@ Boofo : strange for the vote :-/

Run this query on your DB, just replace the $forumid with your forumid, and say us which result, you have

PHP Code:

SELECT AVG(vote) AS moythread FROM thread,threadrate WHERE (thread.forumid='$forumid' AND 
threadrate.threadid=thread.threadid 

It may show you sthg between 3.5 and 4.5, if it is not, there really might be a problem, but take a look at it before ;)

Boofo 05-01-2003 10:20 AM

I ran this query because the one you gave me gave a db error.

SELECT AVG(vote) AS moythread FROM thread,threadrate WHERE thread.forumid='13' AND threadrate.threadid=thread.threadid;

and here is what it returned:

vote)ASmoythread

Holidazed 05-01-2003 05:11 PM

grog, thanks for the update. The Last Poster link works awesome. Now for the bug that shows no user name when more than one user has the same amount of posts.

Edgar 05-04-2003 03:57 PM

Sweet hack, works perfect on my forum.
I do have a few questions though. Will there be a similar hack in the future to display the same stats but then for all forums together on the forums home page?

I hope you know what I mean.

RetroDreams 05-04-2003 10:38 PM

Is there a reason that the total views doesn't use the proper comma format like the total threads and replys?


All times are GMT. The time now is 04:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01718 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete