-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
71 lines (65 loc) · 2.41 KB
/
index.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
<?php
/**
* Index page
*
* @copyright http://smartfactory.ca The SmartFactory
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @since 1.0
* @author marcan aka Marc-André Lanciault <marcan@smartfactory.ca>
* @package imtagging
*
*/
/**
* Include the module's header for all pages
*/
include_once 'header.php';
$xoopsOption['template_main'] = 'imtagging_index.html';
/**
* Include the ICMS header file
*/
include_once ICMS_ROOT_PATH . '/header.php';
// At which record shall we start display
$clean_start = isset($_GET['start']) ? (int) ($_GET['start']) : 0;
$clean_tag_uid = isset($_GET['uid']) ? (int) ($_GET['uid']) : false;
$clean_year = isset($_GET['y']) ? (int) ($_GET['y']) : false;
$clean_month = isset($_GET['m']) ? (int) ($_GET['m']) : false;
$Basic_Check = defined('_CALENDAR_TYPE') && _CALENDAR_TYPE == "jalali" && $icmsConfig['use_ext_date'] == 1;
if (!empty($_GET['y']) && !empty($_GET['m']) && $Basic_Check) {
$jyear = $clean_year;
$jmonth = $clean_month;
list($gyear, $gmonth, $gday) = jalali_to_gregorian($jyear, $jmonth, '1');
$clean_year = $gyear;
$clean_month = $gmonth;
}
$imtagging_tag_handler = icms_getModulehandler('tag');
$icmsTpl->assign('imtagging_tags', $imtagging_tag_handler->getTags($clean_start, $icmsModuleConfig['tags_limit'], $clean_tag_uid, $clean_year, $clean_month));
/**
* Create Navbar
*/
$tags_count = $imtagging_tag_handler->getTagsCount($clean_tag_uid, $clean_year, $clean_month);
if ($clean_tag_uid) {
$extr_arg = 'uid=' . $clean_tag_uid;
} else {
$extr_arg = '';
}
$pagenav = new icms_view_PageNav($tags_count, $icmsModuleConfig['tags_limit'], $clean_start, 'start', $extr_arg);
$icmsTpl->assign('navbar', $pagenav->renderNav());
$icmsTpl->assign('imtagging_module_home', icms_getModuleName(true, true));
if ($clean_tag_uid) {
$icmsTpl->assign('imtagging_category_path', sprintf(_CO_IMTAGGING_TAG_FROM_USER, icms_member_user_Handler::getUserLink($clean_tag_uid)));
}
if ($clean_year && $clean_month) {
if ($Basic_Check) {
$gyear = $clean_year;
$gmonth = $clean_month;
$gday = 1;
list($jyear, $jmonth, $jday) = gregorian_to_jalali($gyear, $gmonth, $gday);
$clean_year = icms_conv_nr2local($jyear);
$clean_month = $jmonth;
}
$icmsTpl->assign('imtagging_category_path', sprintf(_CO_IMTAGGING_TAG_FROM_MONTH, Icms_getMonthNameById($clean_month), $clean_year));
}
/**
* Include the module's footer
*/
include_once 'footer.php';