-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbff.php
75 lines (63 loc) · 2.85 KB
/
bff.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
require PATH_BASE.'config/db.config.php';
require PATH_CORE.'bff.base.php';
//bff defines
define('BFF_DEBUG', 0);
define('BFF_COOKIE_PREFIX', 'bff_');
define('BFF_GENERATE_META_AUTOMATICALY', 0);
define('BFF_EMAIL_SUPPORT', '[email protected]');
define('BFF_EMAIL_NOREPLY', '[email protected]');
define('BFF_EMAIL_FROM_NAME', 'Example.com');
//themes
define('THEMES_DEFAULTTHEME_ID', 1);
define('THEMES_DEFAULTTHEME_KEY', 'default');
define('GEO_YMAPS_COUNTRY_TITLE', 'Украина');
define('GEO_YMAPS_COUNTRY_COORDS', '31.483768,49.315606');
define('GEO_YMAPS_COUNTRY_BOUNDS', '22.082584,44.369848;40.225768,52.379644');
define('GEO_YMAPS_CITY', 204); //город по-умолчанию (Запорожье)
define('GEO_YMAPS_CITY_COORDS', '35.095867,47.861561'); //координаты города по-умолчанию
/**
* Ограничение по работе с городами:
* 0(0) = все города, 1(0) = основные города, 2(id) = города района, 3(id) = один город
* @see sites::geoCityOptions
*/
define('GEO_CITY_BOX_TYPE', 2);
define('GEO_CITY_BOX_ID', 1006);
//contacts types
define('CONTACTS_TYPE_CONTACT', 0); // контакт
class bff extends bffBase
{
function initApp($isFrontend)
{
self::includeJS(array('jquery.min', 'bff.base'), false, true);
if($isFrontend) {
// self::includeJS('jquery.corner');
self::includeJS('app');
} else {
self::includeJS('fancybox', false, true);
self::includeJS('bff.adm');
self::includeJS('app.adm', false, false);
}
}
static function getPublicatePeriods($from = false)
{
if($from === false) {
$from = time();
}
$week = (60*60 * 24 * 7);
$periods = array();
$periods[6] = date('d.m.Y', $from + (60*60 * 24 * 3)); //3 дня
$periods[1] = date('d.m.Y', $from + $week); //1 неделя
$periods[2] = date('d.m.Y', $from + ($week*2)); //2 неделя
$periods[3] = date('d.m.Y', $from + ($week*3)); //3 неделя
$periods[4] = date('d.m.Y', mktime(0,0,0,date('m', $from)+1,date('d', $from),date('Y', $from))); //1 месяц
$periods[5] = date('d.m.Y', mktime(0,0,0,date('m', $from)+2,date('d', $from),date('Y', $from))); //2 месяца
$html = '<option value="6">на 3 дня</option>
<option value="1" selected="selected">на 1 неделю</option>
<option value="2">на 2 недели</option>
<option value="3">на 3 недели</option>
<option value="4">на 1 месяц</option>
<option value="5">на 2 месяца</option>';
return array('data'=>$periods, 'html'=>$html);
}
}