vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Scheduled Task (User Promotions) Not working correctly (https://vborg.vbsupport.ru/showthread.php?t=276803)

Xcynic 01-11-2012 04:19 PM

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!

kh99 01-11-2012 04:25 PM

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.

Xcynic 01-11-2012 04:27 PM

Oh, lol. Whats the best time to set it to for a starting community for it to run frequently?

kh99 01-11-2012 04:29 PM

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.

Raimund 03-26-2012 04:46 PM

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.

kh99 03-26-2012 06:43 PM

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.

Raimund 03-27-2012 12:34 PM

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!

christon26 08-15-2012 07:15 PM

Quote:

Originally Posted by kh99 (Post 2313564)
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


All times are GMT. The time now is 02:17 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.00998 seconds
  • Memory Usage 1,727KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete