forked from MightyGorgon/icy_phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.php
106 lines (86 loc) · 2.7 KB
/
rules.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// End session management
$cms_page['page_id'] = 'rules';
$cms_page['page_nav'] = (!empty($cms_config_layouts[$cms_page['page_id']]['page_nav']) ? true : false);
$cms_page['global_blocks'] = (!empty($cms_config_layouts[$cms_page['page_id']]['global_blocks']) ? true : false);
$cms_auth_level = (isset($cms_config_layouts[$cms_page['page_id']]['view']) ? $cms_config_layouts[$cms_page['page_id']]['view'] : AUTH_ALL);
check_page_auth($cms_page['page_id'], $cms_auth_level);
// Load the appropriate Rules file
$lang_file = 'lang_rules';
$l_title = $lang['BoardRules'];
// Include the rules settings
setup_extra_lang(array($lang_file));
// Pull the array data from the lang pack
$j = 0;
$counter = 0;
$counter_2 = 0;
$rules_block = array();
$rules_block_titles = array();
for($i = 0; $i < sizeof($faq); $i++)
{
if($faq[$i][0] != '--')
{
$rules_block[$j][$counter]['id'] = $counter_2;
$rules_block[$j][$counter]['question'] = $faq[$i][0];
$rules_block[$j][$counter]['answer'] = $faq[$i][1];
$counter++;
$counter_2++;
}
else
{
$j = ($counter != 0) ? $j + 1 : 0;
$rules_block_titles[$j] = $faq[$i][1];
$counter = 0;
}
}
make_jumpbox(CMS_PAGE_VIEWFORUM, $forum_id);
$template->assign_vars(array(
'L_RULES_TITLE' => $l_title,
'L_BACK_TO_TOP' => $lang['Back_to_top']
)
);
for($i = 0; $i < sizeof($rules_block); $i++)
{
if(sizeof($rules_block[$i]))
{
$template->assign_block_vars('rules_block', array(
'BLOCK_TITLE' => $rules_block_titles[$i])
);
$template->assign_block_vars('rules_block_link', array(
'BLOCK_TITLE' => $rules_block_titles[$i])
);
for($j = 0; $j < sizeof($rules_block[$i]); $j++)
{
$row_class = (!($j % 2)) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('rules_block.rules_row', array(
'ROW_CLASS' => $row_class,
'RULES_QUESTION' => $rules_block[$i][$j]['question'],
'RULES_ANSWER' => $rules_block[$i][$j]['answer'],
'U_RULES_ID' => $rules_block[$i][$j]['id'])
);
$template->assign_block_vars('rules_block_link.rules_row_link', array(
'ROW_CLASS' => $row_class,
'RULES_LINK' => $rules_block[$i][$j]['question'],
'U_RULES_LINK' => '#f' . $rules_block[$i][$j]['id'])
);
}
}
}
full_page_generation('rules_body.tpl', $lang['BoardRules'], '', '');
?>