-
Notifications
You must be signed in to change notification settings - Fork 2
/
page--node--nid.tpl.php
308 lines (247 loc) · 11.1 KB
/
page--node--nid.tpl.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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
?>
<div id="page-wrapper">
<div id="header-wrapper">
<div id="header">
<div id="branding-wrapper">
<div class="branding">
<?php if ($logo): ?>
<div class="logo">
<a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a>
</div> <!-- end logo -->
<?php endif; ?>
<div class="name-slogan-wrapper">
<?php if ($site_name) : ?>
<?php if ($is_front) : ?>
<h1 class="site-name"><a href="<?php print $base_path ?>" title="<?php print $site_name ?>"><?php print $site_name ?></a></h1>
<?php endif; ?>
<?php if (!$is_front) : ?>
<h2 class="site-name"><a href="<?php print $base_path ?>" title="<?php print $site_name ?>"><?php print $site_name ?></a></h2>
<?php endif; ?>
<?php endif; ?>
<?php if ($site_slogan) : ?>
<span class='site-slogan'><?php print $site_slogan; ?></span>
<?php endif; ?>
</div> <!-- end site-name + site-slogan wrapper -->
</div>
</div> <!-- end branding wrapper -->
<?php if ($feed_icons): ?>
<!--
<div class="feed-wrapper">
<?php print $feed_icons; ?>
</div> --> <!-- end feed wrapper -->
<?php endif; ?>
<div id="authorize">
<ul style="padding:0; margin: 10px 0 0; text-align: right; line-height: 1em; ">
<li>(203) 221-3033</li>
<li> </li>
<li style="vertical-align: middle;"><a href="https://www.facebook.com/pages/Kyo-Logic-LLC/262030123831142" target="_blank"><img src="/sites/default/files/facebook.png" alt="facebook" width="16" height="16" /></a></li>
<li> </li>
<li style="vertical-align: middle;"><a href="http://twitter.com/#!/KyoLogicLLC" target="_blank"><img src="/sites/default/files/twitter.png" alt="twitter" width="16" height="16" /></a></li>
<?php if ($feed_icons): ?><li> </li><li class="last" style="vertical-align: middle;"><?php print $feed_icons; ?></li><?php endif; ?>
</ul>
<ul style="text-align: right; margin-top: 20px;">
<?php global $user;
if ($user->uid != 0) {
print '<li class="first">' .t('Logged in as '). '<a href="' .url('user/'.$user->uid). '">' .$user->name. '</a></li>';
// print '<li class="last"><a href="' .url('user/logout'). '">' .t('Logout'). '</a></li>'; }
print '<li class="last"><a href="' .url('user/logout'). '">' .t('Logout'). '</a></li>'; }
else {
print '<li class="first"><a href="' .url('user'). '">' .t('Login'). '</a></li>';
// print '<li class="last"><a href="' .url('user/register'). '">' .t('Register'). '</a></li>'; }
print '<li class="last"><a href="' .url('user/register'). '">' .t('Register'). '</a></li>'; }
?>
<!--
<li> </li>
<li><a href="https://www.facebook.com/pages/Kyo-Logic-LLC/262030123831142" target="_blank"><img src="/sites/default/files/facebook.png" alt="facebook" width="16" height="16" /></a></li>
<li class="last"><a href="http://twitter.com/#!/KyoLogicLLC" target="_blank"><img src="/sites/default/files/twitter.png" alt="twitter" width="16" height="16" /></a></li>
-->
</ul>
</div> <!-- end authorize -->
</div> <!-- end header -->
</div> <!-- end header wrapper -->
<div id="container-wrapper">
<div id="container-outer">
<div id="menu-wrapper">
<div class="menu-outer">
<div class="menu-inner">
<div class="menu-left"></div>
<?php if ($main_menu || $page['superfish_menu']): ?>
<div id="<?php print $main_menu ? 'menu' : 'superfish' ; ?>">
<?php if ($main_menu) {
print theme('links__system_main_menu', array('links' => $main_menu));}
elseif (!empty($page['superfish_menu'])) {
print render ($page['superfish_menu']);} ?>
</div> <!-- end menu / superfish -->
<?php endif; ?>
<div class="menu-right"></div>
</div>
</div>
<?php if (!$is_front) print $breadcrumb; ?>
</div> <!-- end menu wrapper -->
<?php if (!$page['slideshow']): ?>
<?php if (!$is_front): ?>
<div class="breadcrumb-shadow"></div> <!-- end breadcrumb shadow -->
<?php endif; ?>
<?php endif; ?>
<?php if ($page['slideshow']): ?>
<div id="slideshow-wrapper">
<div class="slideshow">
<?php print render ($page['slideshow']);?>
</div> <!-- end slideshow -->
</div> <!-- end slideshow wrapper -->
<?php endif; ?>
<?php if (!$page['slideshow']): ?>
<?php if ($is_front): ?>
<div id="slideshow-wrapper">
<?php if ($page['highlighted']): ?><div class="mission"><?php print render($page['highlighted']); ?></div><?php endif; ?>
<div class="slideshow">
<!-- KyoLogic Images -->
<!-- <img src="<?php print $base_path ?>sites/default/files/banner_1.jpg" width="804" height="375" alt="KyoLogic 1"/> -->
<img src="<?php print $base_path ?>sites/default/files/banner_2.jpg" width="804" height="375" alt="KyoLogic 2"/>
<!-- <img src="<?php print $base_path ?>sites/default/files/banner_3.jpg" width="804" height="375" alt="KyoLogic 3"/> -->
<!-- end KyoLogic Images -->
<img src="<?php print $base_path . $directory; ?>/images/slides/metropolis-1.jpg" width="804" height="375" alt="Metropolis 1"/>
<img src="<?php print $base_path . $directory; ?>/images/slides/metropolis-2.jpg" width="804" height="375" alt="Metropolis 2"/>
<img src="<?php print $base_path . $directory; ?>/images/slides/metropolis-3.jpg" width="804" height="375" alt="Metropolis 3"/>
</div> <!-- end slideshow -->
</div> <!-- end slideshow wrapper -->
<?php endif; ?>
<?php endif; ?>
<div id="container-inner">
<div id="content-wrapper" class="clearfix">
<?php if ($page['sidebar_second']): ?>
<div id="sidebar" class="column sidebar">
<div class="section">
<?php print render($page['sidebar_second']); ?>
</div>
</div> <!-- end sidebar-second -->
<!--div class="clearfix"></div-->
<?php endif; ?>
<div id="main-content">
<?php if($page['content_top']):?><div id="content-top"><?php print render ($page['$content_top']); ?></div><?php endif; ?>
<?php if ($show_messages) { print $messages; }; ?>
<?php print render($title_prefix); ?>
<?php print render($title_suffix); ?>
<?php if ($tabs): ?>
<div class="tabs">
<?php print render($tabs); ?>
</div>
<?php endif; ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?>
<ul class="action-links">
<?php print render($action_links); ?>
</ul>
<?php endif; ?>
<section id="content">
<?php print $messages; ?>
<?php if ($action_links): ?>
<ul class="action-links"><?php print render($action_links); ?></ul>
<?php endif; ?>
<?php
$query = new EntityFieldQuery();
$query->entityCondition( 'entity_type','node' );
$query->entityCondition( 'bundle','b_news' );
$query->propertyCondition('status', 1);
$query->propertyOrderBy('created', 'DESC');
$query->range(0, 3);
$result = $query->execute();
//get node ids
$nodearray = array_keys($result['node']);
//load node objects
$nodes = node_load_multiple($nodearray);
echo '<h1>Latest Articles</h1><ul id="lat">';
foreach ($nodes as $node) {
$tid=$node->field_brafton_term['und'][0]['tid'];
$term= taxonomy_term_load($tid);
$termpath = taxonomy_term_uri($term);
$termpath = drupal_get_path_alias($termpath['path']);
$options = array('absolute' => TRUE);
// print_r($node);
$url = url('node/' . $node->nid, $options);
echo '<li class="latest">';
echo '<img class="thumb" src="'.file_create_url($node->field_brafton_image['und'][0]['uri']).'">';
echo '<a href='.$url.'>'.$node->title.'</a><div class="sum">'.$node->body['und'][0]['summary'].'<br />
<a href='.$url.'>Read more</a>
</div>';
// echo '<h4>Categories</h4><a href="'.$termpath.'">'.$term->name.'</a></li>';
}
echo "</ul>";
//end latest
//start categories
//get all terms in brafton vocabulary
$terms = taxonomy_get_tree(1);
//loop through terms
foreach($terms as $termsin){
echo '<h1>'.$termsin->name.'</h1>';
$catquery = new EntityFieldQuery();
$catquery->entityCondition( 'entity_type','node' );
$catquery->entityCondition( 'entity_id',$nodearray,'NOT IN' );
$catquery->entityCondition( 'bundle','b_news' );
$catquery->propertyCondition('status', 1);
$catquery->propertyOrderBy('created', 'DESC');
$catquery->range(0, 3);
$catquery->fieldCondition('field_brafton_term', 'tid', $termsin->tid);
$result = $catquery->execute();
$nids = array_keys($result['node']);
$nodes = node_load_multiple($nids);
echo '<ul class="cats">';
foreach ($nodes as $node) {
$options = array('absolute' => TRUE);
// print_r($node);
$url = url('node/' . $node->nid, $options);
echo '<li class="catart">';
if($node->field_brafton_image)
echo '<img class="thumb" src="'.file_create_url($node->field_brafton_image['und'][0]['uri']).'">';
echo '<a href='.$url.'>'.$node->title.'</a><div class="sum">'.$node->body['und'][0]['summary'].'<br /><a href='.$url.'>Read more</a></div>';
//echo '<h4>Categories</h4><a href="'.$termpath.'">'.$term->name.'</a></li>';
//end loop through nodes
}
echo'</ul>';
//end loop through categories
}
?>
</section><!-- / #content -->
</div>
</div> <!-- end content wrapper-->
</div> <!-- end container inner -->
<?php if($page['bottom_1'] || $page['bottom_2'] || $page['bottom_3'] || $page['bottom_4']) : ?>
<div id="bottom-wrapper" class="in<?php print (bool) $page['bottom_1'] + (bool) $page['bottom_2'] + (bool) $page['bottom_3'] + (bool) $page['bottom_4']; ?> clearfix">
<?php if($page['bottom_1']) : ?>
<div class="column A">
<?php print render ($page['bottom_1']); ?>
</div>
<?php endif; ?>
<?php if($page['bottom_2']) : ?>
<div class="column B">
<?php print render ($page['bottom_2']); ?>
</div>
<?php endif; ?>
<?php if($page['bottom_3']) : ?>
<div class="column C">
<?php print render ($page['bottom_3']); ?>
</div>
<?php endif; ?>
<?php if($page['bottom_4']) : ?>
<div class="column D">
<?php print render ($page['bottom_4']); ?>
</div>
<?php endif; ?>
<div class="clearfix"></div>
</div><!-- end bottom wrapper-->
<?php endif; ?>
</div> <!-- end container outer -->
<div id="shadow-bottom"></div>
</div> <!-- end container wrapper -->
<div id="footer">
<?php print render ($page['footer']); ?>
<?php if($secondary_menu) : ?>
<div id="subnav">
<?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('class' => array('links', 'clearfix')))); ?>
</div>
<?php endif; ?>
<?php // print $notice; ?>
<div style="clear:both; font-size:11px; text-align:center;"><em>© 2002 - 2013 Kyo Logic, LLC (203) 221-3033</em></div>
</div> <!-- end footer -->
</div> <!-- end page wrapper -->