/
infopage.php
185 lines (183 loc) · 8.67 KB
/
infopage.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
require_once('includes/application_top.php');
$page = $_GET['page'];
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="content-item <?php echo tep_get_infopages_type($page); ?>">
<h1>
<?php echo tep_get_infopages_title($page) ?>
</h1>
<?php
if (tep_get_infopages_type($page)=='rubrieken') {
?>
<span class="intro">
<?php echo tep_get_infopages_preview($page); ?>
</span>
<?php
if (tep_get_infopages_display($page)!='') {
foreach(explode("\n", tep_get_infopages_display($page)) as $option){
$values = explode(":", $option);
${$values[0].$page} = $values[1];
}
}
if (${'sort_field'.$page}!='') { $default_sort_field = ${'sort_field'.$page}; } else { $default_sort_field = 'i.sort_order'; }
if (${'sort_mode'.$page}!='') { $default_sort_mode = ${'sort_mode'.$page}; } else { $default_sort_mode = 'asc'; }
$blog_query = tep_db_query("SELECT i.infopages_id FROM infopages i JOIN infopages_text it USING (infopages_id) WHERE i.parent_id = '".(int)$page."' AND it.language_id = ".(int)$languages_id." order by ".$default_sort_field." ".$default_sort_mode);
if (tep_db_num_rows($blog_query)>0)
{
$blog_count = 0;
while ($blog = tep_db_fetch_array($blog_query))
{
if (tep_get_infopages_display($blog['infopages_id'])!='') {
foreach(explode("\n", tep_get_infopages_display($blog['infopages_id'])) as $option){
$values = explode(":", $option);
${$values[0].$blog['infopages_id']} = $values[1];
}
}
$blog_count++;
$column_width = 100;
if ($blog_count<=(${'leading'.$page})) {
$this_column = 'leading';
} else {
if ($blog_count==((${'leading'.$page})+1)) {
$this_column = 0;
}
if ($this_column>=(${'columns'.$page})) {
$this_column = 1;
} else {
$this_column++;
}
if (${'columns'.$page}>0) {
$column_width = 100/${'columns'.$page};
}
}
?>
<div class="blog-item blog-column-<?php echo $this_column; ?>" style="width:<?php echo $column_width; ?>%;">
<div class="blog-item-inner">
<?php if ((strstr(${'show_field'.$page}, 'infopages_title')) || (${'show_field'.$page}=='')) { ?>
<h2>
<?php if ((strstr(${'show_field'.$page}, 'infopages_title_link')) || (${'show_field'.$page}=='')) { ?>
<a href="<?php echo tep_href_link(FILENAME_INFOPAGE, 'page='.$blog['infopages_id']); ?>">
<?php } ?>
<span class="title">
<?php echo tep_get_infopages_title($blog['infopages_id']); ?>
</span>
<?php if ((strstr(${'show_field'.$page}, 'infopages_title_link')) || (${'show_field'.$page}=='')) { ?>
</a>
<?php } ?>
<?php if (strstr(${'show_field'.$page}, 'date_added')) { ?>
<span class="date"><?php echo date('d M Y', strtotime(tep_get_infopages_date_added($blog['infopages_id']))); ?></span>
<?php } ?>
</h2>
<?php } ?>
<div class="blog-item-text">
<?php
if ((strstr(${'show_field'.$page}, 'infopages_preview')) || (${'show_field'.$page}=='')) {
?>
<span class="intro">
<?php echo tep_get_infopages_preview($blog['infopages_id']); ?>
</span>
<?php
}
if (strstr(${'show_field'.$page}, 'infopages_description')) {
?>
<span class="full">
<?php echo tep_get_infopages_description($blog['infopages_id']); ?>
</span>
<?php
}
if (strstr(${'show_field'.$page}, 'subpages_list')) {
if (tep_get_infopages_type($blog['infopages_id'])=='rubrieken') {
$blog_sub_query = tep_db_query("SELECT i.infopages_id FROM infopages i JOIN infopages_text it USING (infopages_id) WHERE i.parent_id = '".(int)$blog['infopages_id']."' AND it.language_id = ".(int)$languages_id." order by ".$default_sort_field." ".$default_sort_mode);
if (tep_db_num_rows($blog_sub_query)>0) {
?>
<ul>
<?php
while ($blog_sub = tep_db_fetch_array($blog_sub_query)) {
?>
<li><a href="<?php echo tep_href_link(FILENAME_INFOPAGE, 'page='.$blog_sub['infopages_id']); ?>"><?php echo tep_get_infopages_title($blog_sub['infopages_id']); ?></a></li>
<?php
}
?>
</ul>
<?php
}
}
}
if ( (strstr(${'show_field'.$page}, 'readmore')) || (${'show_field'.$page}=='') ) {
if (${'readmore'.$blog['infopages_id']}!='none') {
?>
<a href="<?php echo tep_href_link(FILENAME_INFOPAGE, 'page='.$blog['infopages_id']); ?>"><?php echo Translate('Lees meer'); ?>: <?php echo tep_get_infopages_title($blog['infopages_id']); ?></a>
<?php
}
}
?>
</div>
</div>
</div>
<?php
if ($blog_count==tep_db_num_rows($blog_query)) {
?>
<div class="clear"></div>
<?php
}
}
}
} else {
?>
<div class="content-item">
<span class="blog-item-text-intro">
<?php echo tep_get_infopages_preview($page); ?>
</span>
<span class="blog-item-text-description">
<?php echo tep_get_infopages_description($page); ?>
</span>
</div>
<?php
}
?>
</div>
</td>
</tr>
</table>
</td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>