Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-25-2015, 12:48 AM
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default help me write cron pls :D

Hello all.

Who can help me write cron perform the following actions:

I want users they can establish the time to open, locked their posts over time.

For example, he will setting open topic on Thursday 7:30 - 17:30 on Monday every week, then the thread will be open, locked again by cron.

This is my table open_close:


P/S:
- week : 2 = Monday; 4 = Tuesday; 8 = Wednesday; 16 = Thursday; 32 = Friday; 64 = Saturday; 128 = Sunday
Reply With Quote
  #2  
Old 06-25-2015, 12:02 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...well, I guess I'd do a query to get all the records from the open_close table ordered by threadid, and probably join it with the thread table to get the open field. Then for each threadid, find the record with the day of week and time that is closest to the current time, but before the current time (if there aren't any before the current time, then use the last one). Then make sure the thread open state is the same as that record calls for. But I don't have time to work out the details.

I guess if you're allowing down to the minute then you need a cron job scheduled to run every minute.
Reply With Quote
  #3  
Old 06-26-2015, 03:23 AM
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

pls move thread to Modification Requests/Questions (Unpaid). thanks
Reply With Quote
  #4  
Old 06-27-2015, 09:25 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Easy5s.net View Post
pls move thread to Modification Requests/Questions (Unpaid). thanks
Moved.

I assume that your question in the other thread about running scheduled tasks every minute was about this mod? It would be a concern if you don't have a lot of traffic that someone might show up some time after the thread should be open and see it closed. Maybe instead what you could do is, whenever anyone creates or edits a thread that includes open/close instructions, calculate the next time a thread has to open or close then save that time and threadid in the datastore. Then on the showthread page, check that value and open or close the thread being displayed if necessary (and recalculate the next thread/time). I guess you'd also need to do it on the forum display if you want the thread open/close icons to be right.
Reply With Quote
  #5  
Old 06-27-2015, 12:17 PM
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wrote the script cron file and it works fine if I press the Run button in the Scheduled Task Manager. But it does not work properly when I set it to run every minute.
Reply With Quote
  #6  
Old 06-27-2015, 12:38 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Easy5s.net View Post
I wrote the script cron file and it works fine if I press the Run button in the Scheduled Task Manager. But it does not work properly when I set it to run every minute.
What doesn't work right, it doesn't run? As was mentioned in the other thread, you need active forum users to get the tasks to run, so maybe that's the problem?

Anyway, you asked in the other thread about using the OS cron instead. Sorry, if I had known it owuld be hard to find I would have searched for it myself. Anyway, in this thread: http://www.vbulletin.com/forum/forum...l-system-cron-[-vbiv-13733] they talk about using cron, and Wayne Luke posted a simple command to use when setting up a cron job.

But there's also this article here: https://vborg.vbsupport.ru/showthread.php?t=160514 about doing that, and someone in the last post says it still works for vb4.2.2.
Reply With Quote
  #7  
Old 06-27-2015, 12:53 PM
Easy5s.net Easy5s.net is offline
 
Join Date: Jun 2011
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My files to comply with the work that I need, but the time required to do the job, it will not run because cron is not running. script file works fine when I click Run now. Because the work is checked regularly so it required to run every minute. I will try with addon https://vborg.vbsupport.ru/showthread.php?t=160514
Reply With Quote
  #8  
Old 06-27-2015, 12:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, I didn't really read enough of what that addon does. It looks like it prevents the cron img from delaying the page load, but it doesn't cause the scheduled tasks to run any more often, so i guess it isn't what you need. Sorry about that.

If you have a way of setting up actual linux cron jobs you can try what is posted in that other thread on vbulletin.com.
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 03:56 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.03793 seconds
  • Memory Usage 2,228KB
  • 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_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