vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   help fix this error... (https://vborg.vbsupport.ru/showthread.php?t=53007)

Xenon 05-17-2003 11:16 AM

Quote:

above ur code it will affect when u apply the code right?
huh? what do you mean?

no the postnumber won't recount every 7 days, it will always be dynamical for the last seven days, so every day you'll see another value

squawell 05-17-2003 11:58 AM

Quote:

Today at 08:16 PM Xenon said this in Post #11
huh? what do you mean?

no the postnumber won't recount every 7 days, it will always be dynamical for the last seven days, so every day you'll see another value

i mean i use ur code it will affect when i apply it right...

so it cant count last 7 days the most posts user and change the stats every 7days later.....

Xenon 05-17-2003 12:52 PM

yes the code will work right.

nope every new day the value will be recalculated.
it will not have weekly stats but stats the last 7 days

squawell 05-20-2003 03:33 PM

Quote:

05-17-03 at 09:52 PM Xenon said this in Post #13
yes the code will work right.

nope every new day the value will be recalculated.
it will not have weekly stats but stats the last 7 days

so Xenon the variable mean last 7 days

$d = mktime (0,0,0,date("m"),date("d")-7,date("Y"));

if i want last 30 days should i change like this

$d = mktime (0,0,0,date("m"),date("d")-30,date("Y"));

is that right?

Xenon 05-20-2003 06:16 PM

exactly

Boofo 05-21-2003 01:01 PM

Quote:

05-17-03 at 06:08 AM Xenon said this in Post #9
@squawell: yes right, every variabole appearing in the template has to be before that eval!

@boofo:

it would slow down the query but i think this should do the trick:

PHP Code:

$post7day $DB_site->query_first("
  SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username 
  FROM post 
  LEFT JOIN user USING(userid)
  LEFT JOIN thread USING(threadid)
  WHERE post.userid > 0 AND post.dateline>=
$d AND thread.forumid=xx
  GROUP BY post.userid 
  ORDER BY posts DESC 
  LIMIT 1
"
); 


I tried this code and this is the error I got.

Database error in vBulletin 2.2.9:

Invalid SQL: SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username
FROM post
LEFT JOIN user USING(userid)
LEFT JOIN thread USING(threadid)
WHERE post.userid > 0 AND post.dateline>=1052895600 AND thread.forumid=34
GROUP BY post.userid
ORDER BY posts DESC
LIMIT 1

mysql error: Unknown column 'user.threadid' in 'on clause'

mysql error number: 1054

Date: Wednesday 21st of May 2003 06:31:41 AM
Script: http://www.bearfacts2.com/forum/foru...php?forumid=34
Referer: http://www.bearfacts2.com/forum/
Repair Report: This type of error cannot be automatically repaired.

Xenon 05-21-2003 01:04 PM

hmm than that way:

PHP Code:

$post7day $DB_site->query_first("
  SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username 
  FROM post 
  LEFT JOIN user USING(userid)
  LEFT JOIN thread ON(post.threadid=thread.threadid)
  WHERE post.userid > 0 AND post.dateline>=
$d AND thread.forumid=xx
  GROUP BY post.userid 
  ORDER BY posts DESC 
  LIMIT 1
"
); 


Boofo 05-21-2003 01:58 PM

That ran without any errors but it wouldn't show the stats.

squawell 05-21-2003 03:25 PM

Quote:

Yesterday at 10:58 PM Boofo said this in Post #18
That ran without any errors but it wouldn't show the stats.
that code i use in index.php not forumdisplay.php......

and it works..................... :D

Boofo 05-21-2003 03:30 PM

But it also should work in the forumdisplay.


All times are GMT. The time now is 01:29 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.01125 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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