vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Community Lounge (https://vborg.vbsupport.ru/forumdisplay.php?f=13)
-   -   What's your average Post length? (https://vborg.vbsupport.ru/showthread.php?t=96230)

Fuzz 09-20-2005 10:24 PM

Ah, what a great query to run!

650 on my board.

I was wondering if you could place a code in the showtread function file (3.0.7) to display the average post length for each user, is this possible?? I thought it would be as simple as adding a WHERE clause to the end of the this original query, but how do you code it so that each postbit will display a different #, and not just the userid amount of the current viewer.

Here Is My Current Incorrect CODE:

PHP Code:

$postlength $DB_site->query_first("
SELECT SUM(length(pagetext))/count(postid) AS length
FROM post
WHERE userid=
$bbuserinfo[userid]"); 

then of course just toss $postlength[length] into the postbit template...

This would be a nifty stat for users, plus it would show who is typing the short posts. Just don't know what I'm doing wrong. Didn't mean to take this topic off course, just thought it was relevant for this thread, as opposed to making a new one.

Xenon 09-21-2005 12:25 AM

a tip:
don't do that Fuzz, the query is a nice one to look at the result once, but it is definitelly not a query to be run on showthread.

it's way to intense and as showthread is the most used script of vb, it would give your poor server a lot of work, which shouldn't be for just a nifty stat

Fuzz 09-21-2005 02:32 AM

Xenon -

Thanks for the tip... Probably wont go down that road then; or atleast until a more efficient way is revealed. Still a cool query to run a few times. Might be something to consider to put in a user's profile or some other less-active script, as opposed to showthread.

EricaJoy 09-21-2005 08:14 PM

177.94 on wbs-reloaded.com
474.18 on realzetas.com

SHANE-D-PAIN 09-23-2005 11:44 AM

My average is 129.81

Oh well, its not bad considering its a site for teenagers whose language is 'spam'


All times are GMT. The time now is 08:45 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.01025 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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