Schedule inside template

javier

Новичок
Регистрация
25.08.2012
Сообщения
93
Благодарностей
0
Баллы
0
Hello,

I need run a template only between 10:00 to 22:00.

I run this template with schedule of zenno every day at 10 am with 1000 repeats.

The problem is that I no want template run if time is more than 10 pm. Some time finish 1000 reps before 22 and other times after.

I think that is posible doing this :

{-timenow.date-} to variabletime

variabletime = 09/02/2012 23:20:18

make regex to get hour time

hourtimevar = 23

Then make swith

if hourtime = 10, 11, 12, 13... 22 (litle bug because template run to 22:59 ) go to first step of template


I think work good but I need a lot code.


I want know if you know other way more easy to make same.


bye
 

javier

Новичок
Регистрация
25.08.2012
Сообщения
93
Благодарностей
0
Баллы
0
I have new idea

{-timenow.date-} to variabletime

variabletime = 09/02/2012 23:20:18

make regex to get time in numbers

hourtimevar = 2320

Then make if/else

if 2201>{-variable.hourtime-}>959 go to first step of template

else go to last step of template


I go to try!!
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
I have new idea

{-timenow.date-} to variabletime

variabletime = 09/02/2012 23:20:18

make regex to get time in numbers

hourtimevar = 2320

Then make if/else

if 2201>{-variable.hourtime-}>959 go to first step of template

else go to last step of template


I go to try!!
Any luck?
 

javier

Новичок
Регистрация
25.08.2012
Сообщения
93
Благодарностей
0
Баллы
0
I don't know jet

In 30 min I now if work good or not.

I try yesterday and seemns work good outside time. When start template go to last sted. Now I need see if go to step 1.


I tell you
 

javier

Новичок
Регистрация
25.08.2012
Сообщения
93
Благодарностей
0
Баллы
0
Nop, don't work, always say outside time.

I need write good if/else.:confused:
 

Thru_K

Client
Регистрация
04.07.2012
Сообщения
45
Благодарностей
12
Баллы
0
I think your problem is not in the IF.
2201 > {-variable.hourtime-} > 959 seems good: it is true for {-variable.hourtime-} between 1000 and 2200
 

raphael

Client
Регистрация
20.07.2012
Сообщения
62
Благодарностей
4
Баллы
8
you if is not good you need to insert a if linke into a double if php variable and it work
 

javier

Новичок
Регистрация
25.08.2012
Сообщения
93
Благодарностей
0
Баллы
0
Yes youar right Raphael

I put two if/else and work perfect
 

raphael

Client
Регистрация
20.07.2012
Сообщения
62
Благодарностей
4
Баллы
8
if 2201>{-variable.hourtime-}&&{-variable.hourtime-}>959
That work better ;-)
 
  • Спасибо
Реакции: Thru_K

Thru_K

Client
Регистрация
04.07.2012
Сообщения
45
Благодарностей
12
Баллы
0
javascript syntax?
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)