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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2012, 04:19 PM
Xcynic's Avatar
Xcynic Xcynic is offline
 
Join Date: Jul 2007
Location: Sweden
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Scheduled Task (User Promotions) Not working correctly

Hello! I have a problem with my User Promotions task. I have set it to run every minute since my community is not that big atm for it to cause lag/loadtime but it doesent run. I have to manually press it for it to actually perform.

It is active and everything else seems fine but it does not run when its supposed to. Any advice?

Thanks!
Reply With Quote
  #2  
Old 01-11-2012, 04:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Scheduled tasks will only run when your site has traffic, so if you set it to run once per minute, it will only run that often if you have continuous traffic on your site.

Also, I believe the promotion scheduled task only promotes users who have been active recently (the past 24 hours, I think). But if you run it by pressing the "Run Now" button, then I think it will pronote all users who meet the requirements.
Reply With Quote
  #3  
Old 01-11-2012, 04:27 PM
Xcynic's Avatar
Xcynic Xcynic is offline
 
Join Date: Jul 2007
Location: Sweden
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, lol. Whats the best time to set it to for a starting community for it to run frequently?
Reply With Quote
  #4  
Old 01-11-2012, 04:29 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know really - you could leave it at once per minute and most of the time it won't have anything to do. I guess if your site eventually gets very busy you might want to have it run less often.
Reply With Quote
  #5  
Old 03-26-2012, 04:46 PM
Raimund Raimund is offline
 
Join Date: Apr 2002
Location: Austria
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for bumping this thread again, but how can i change the promotion.php NOT to check if the user has been active recently? i want the same behavior like if i press the "Run Now" button, only sheduled.
Reply With Quote
  #6  
Old 03-26-2012, 06:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you look at includes/cron/promotion.php around line 40, you see this:

Code:
	LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
	" . iif(VB_AREA != 'AdminCP', "WHERE user.lastactivity >= $lastrun")
);

if you change it to this (delete everything after the first " on line 41):

[CODE]
Code:
	LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
	"
);

Then you should always get everyone (but it might add a lot of processing, especially if you have many members and/or are running it once per minute). BTW, what I said in an earlier post wasn't correct - it processes all users active since the last time the cron job ran, not the last 24 hours).

Why did you want to do this again? It seems like if promotions are based on number of posts then there's no way that's going to change unless the user was active.

It might be a good mod if someone could come up with one that recalculated possible promotions as soon as a user posts. It might be as easy as taking the guts of this function and putting it in a plugin somewhere.
Reply With Quote
  #7  
Old 03-27-2012, 12:34 PM
Raimund Raimund is offline
 
Join Date: Apr 2002
Location: Austria
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Why did you want to do this again? It seems like if promotions are based on number of posts then there's no way that's going to change unless the user was active.
Because the promotions are not used based of number of posts on our forums, but to restrict permissions to some functions (like actually posting) to any new registered user for 2 days... we have more then 27000 active members and get lots of new members who actually post like on facebook and the like (especially when it's holiday season)... it's a good way to prevent this, but we did this manually the last year. processing is not an issue, if it is, we will upgrade to the next bigger ded. server

thanks btw, i'll give it a try!
Reply With Quote
  #8  
Old 08-15-2012, 07:15 PM
christon26 christon26 is offline
 
Join Date: Dec 2008
Location: Australia
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
It might be a good mod if someone could come up with one that recalculated possible promotions as soon as a user posts. It might be as easy as taking the guts of this function and putting it in a plugin somewhere.
That would be something I'd be interested in....I don't have the skill to do it myself LOL
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 02:41 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.03859 seconds
  • Memory Usage 2,227KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete