Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2005, 04:12 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Corn Problem, please help

ok i made a script the delete info from some table,

now i added it to corn in admin cp to run every 1st of month

its apper like that

Code:
30	0	1	*	*
now the problem is that its never run

when i click on run now its works like a charm
but its dosent work alone

also in next time it says :
02-28-2005 11:30 PM

but date now is 06/03 and script didnt runned yet

any idea what might be the problem

thanks MiZ
Reply With Quote
  #2  
Old 03-09-2005, 03:53 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump

please help... not supuse to be that hard
Reply With Quote
  #3  
Old 03-09-2005, 03:59 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try posting the script. The scheduled tasks can be a bit tricky sometimes, had to learn that the hard way myself. Sometimes things run ok with Run Now, but fail when run scheduled.
Reply With Quote
  #4  
Old 03-09-2005, 04:10 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok
here is the info of the file

scoreboardupdate.php
=================

Code:
error_reporting(E_ALL & ~E_NOTICE);

if (!is_object($DB_site))
{
	exit;
}


// Score board , Award system , Ratio system

	
 // looking for a winner

	  $scorewinner =$DB_site->query("SELECT * FROM ".TABLE_PREFIX."user  order by tmsecs Desc limit 1");
	 while ($scorewins = $DB_site->fetch_array($scorewinner)) {
		 
	$totaltmsecs = $scorewins['tmsecs'];
	$winnername = $scorewins['username'];
	$winnerid = $scorewins['userid'];
	$lastmonth = $scorewins['tmsecs'];;

}

	 
	 
	 // clear last month modes

	  $DB_site->query("UPDATE ".TABLE_PREFIX."useraward SET award1 = '0'");
	  
	  // set new award winner
	  
	  $DB_site->query("UPDATE ".TABLE_PREFIX."useraward SET award1 = '1' where userid='$winnerid'");
	  
	  // upadte user ratio
	
	  $DB_site->query("UPDATE ".TABLE_PREFIX."user SET credit =credit+50 where userid='$winnerid' ");
  
	  // update winner last month secs
$DB_site->query("UPDATE ".TABLE_PREFIX."user SET lmsecs ='$lastmonth' where userid='$winnerid'");
	  // clear all tmsecs of users	 
	  $DB_site->query("UPDATE ".TABLE_PREFIX."user SET tmsecs = 0");
	  $DB_site->query("TRUNCATE TABLE ".TABLE_PREFIX."`scoreboard`");




log_cron_action('Scoreboard Updated', $nextitem);
Reply With Quote
  #5  
Old 03-09-2005, 05:38 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't see a good reason why it should not run in cron. Did you check if you maybe got a SQL-error mail?
A few remarks though:
- The table useraward, does it contain all users? If not the new winner might fail if it is the first time someone wins.
- No need to use quotes around numeric values in queries, only cast the value to an INT if it is a dirty value (user inputed).
- Not sure if that truncate statement will work correct when a table prefix is used, because of the back-tics.
- Does the run get logged in the cron-log?
Reply With Quote
  #6  
Old 03-10-2005, 05:25 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

when i run the script with run now button its work perfect

and when i click on run now its get logged

but else its just not working.
script working great as script
but on corn its not get executed
Reply With Quote
  #7  
Old 03-10-2005, 05:30 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well if it gets logged, then it is executed without a SQL-error.

Will try to look at it tomorrow (hmm why this sentence sounds familiar, hmmm think i forgot to do some things i promosed to do today )

What about the table being populated with all userids before the script is run?
Reply With Quote
  #8  
Old 03-10-2005, 05:54 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what about it >
Reply With Quote
  #9  
Old 03-10-2005, 05:55 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does the useraward table already have an entry for every existing userid in it?

PHP Code:
      // set new award winner
      
      
$DB_site->query("UPDATE ".TABLE_PREFIX."useraward SET award1 = '1' where userid='$winnerid'"); 
You only do an update for the new winner, but what if this user never win before? Will there already be an (empty?) entry in the table?
Reply With Quote
  #10  
Old 03-11-2005, 02:24 PM
miz miz is offline
 
Join Date: Mar 2003
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well then it shows as

USERID : 54
AWARD1 : 0

same for all users
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:21 AM.


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.04724 seconds
  • Memory Usage 2,248KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete