forked from chnm/mall-theme
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
67 lines (55 loc) · 3.21 KB
/
index.php
File metadata and controls
67 lines (55 loc) · 3.21 KB
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
<?php echo head(); ?>
<div role="main">
<div id="intro">
<h1><?php echo get_theme_option('intro_head'); ?></h1>
<p><?php echo get_theme_option('intro'); ?></p>
<p><a href="<?php echo get_theme_option('intro_button_slug'); ?>" class="button"><?php echo get_theme_option('intro_button'); ?></a></p>
</div>
<?php if ((get_theme_option('index_background_image') === null)): ?>
<?php $defaultBgImage = img('rome.jpg'); ?>
<?php else: ?>
<?php $defaultBgImage = default_index_bg();?>
<?php endif ?>
<?php $featuredExhibit = exhibit_builder_random_featured_exhibit(); ?>
<?php if (!is_null($featuredExhibit)): ?>
<?php $featuredExhibitId = $featuredExhibit->id; ?>
<?php $featuredExhibitItem = get_records('Item', array('exhibit' => $featuredExhibitId, 'random' => true, 'has files' => true), 1); ?>
<?php $featuredExhibitImage = empty($featuredExhibitItem) ? NULL : get_db()->getTable('File')->findWithImages($featuredExhibitItem[0]->id, 0); ?>
<div id="featured-question" class="featured" style="background-image:url('<?php echo (!is_null($featuredExhibitImage) ? file_display_url($featuredExhibitImage, 'original') : $defaultBgImage); ?>')">
<h1>
<span class="category">Featured Exploration</span>
<span class="title"><?php echo $featuredExhibit->title; ?></span>
</h1>
<p><?php echo snippet($featuredExhibit->description, 0, 200); ?></p>
<p class="jump-link"><?php echo exhibit_builder_link_to_exhibit($featuredExhibit, 'Read More', array('class' => 'button')); ?></p>
</div>
<?php else: ?>
<div id="featured-question" class="featured" style="background-image:url('<?php echo $defaultBgImage; ?>')">
<h1>
<span class="category">Featured Exploration</span>
<span class="title">No Featured Exploration Selected</span>
</h1>
<p>Adminstrators can add one in the admin page.</p>
</div>
<?php endif; ?>
<?php
$featuredPeople = get_records('Item', array(
'featured' => 1,
'sort_field' => 'random',
'hasImage' => true,
'item_type' => 'People'), 1);
?>
<?php if (count($featuredPeople) > 0): ?>
<?php $featuredPerson = $featuredPeople[0]; ?>
<?php $featuredPersonFile = get_db()->getTable('File')->findWithImages($featuredPerson->id, 0); ?>
<div id="featured-person" class="featured" style="background-image:url(<?php echo file_display_url($featuredPersonFile); ?>)">
<h1>
<span class="category">Featured Person</span>
<span class="title"><?php echo metadata($featuredPerson, array('Dublin Core', 'Title')); ?></span>
</h1>
<p><?php echo snippet(metadata($featuredPerson, array('Dublin Core', 'Description')), 0, 200); ?></p>
<p class="jump-link"><?php echo link_to_item('Read More', array('class' => 'button'), 'show', $featuredPerson); ?></p>
</div>
<?php endif; ?>
</div>
<?php echo foot(); ?>