-
Notifications
You must be signed in to change notification settings - Fork 8
/
search.php
115 lines (101 loc) · 3.69 KB
/
search.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
<?php include('inc_header.php'); ?>
<!-- .container main -->
<!-- .page-header -->
<!-- .header -->
<h3><?php echo gettext('Search'); ?></h3>
</div><!-- .header -->
</div><!-- /.page-header -->
<div class="page-header row">
<div class="col-xs-offset-1 col-xs-10 col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6">
<?php printSearchForm(); ?>
</div>
</div>
<div class="search-wrap">
<?php
$numimages = getNumImages();
$numalbums = getNumAlbums();
$total_gallery = $numimages + $numalbums;
$numnews = $numpages = 0;
if ($_zenpage_enabled && !isArchive()) {
if ($_zenpage_news_enabled) {
$numnews = getNumNews();
}
if ($_zenpage_pages_enabled) {
$numpages = getNumPages();
}
}
$total = $total_gallery + $numnews + $numpages;
$searchwords = getSearchWords();
$searchdate = getSearchDate();
if (!empty($searchdate)) {
if (!empty($searchwords)) {
$searchwords .= ": ";
}
$searchwords .= $searchdate;
}
?>
<div class="page-header">
<h4>
<?php
if ($total == 0) {
echo gettext("Sorry, no matches found. Try refining your search.");
} else {
printf(ngettext('%1$u Hit for <em>%2$s</em>', '%1$u Hits for <em>%2$s</em>', $total), $total, html_encode($searchwords));
}
?>
</h4>
</div>
<?php
if (getOption('search_no_albums')) { //test of images search
if ($numimages > 0) {
echo '<h4 class="margin-top-double margin-bottom-double"><strong>'; printf(gettext('Images (%s)'), $numimages); echo '</strong></h4>';
}
} else {
if (getOption('search_no_images')) { //test of albums search
if ($numalbums > 0) {
echo '<h4 class="margin-top-double margin-bottom-double"><strong>'; printf(gettext('Albums (%s)'), $numalbums); echo '</strong></h4>';
}
} else {
if ($total_gallery > 0) { //test of albums and images search
echo '<h4 class="margin-top-double margin-bottom-double"><strong>'; printf(gettext('Albums (%1$s) & Images (%2$s)'), $numalbums, $numimages); echo '</strong></h4>';
}
}
}
printPageListWithNav('«', '»', false, true, 'pagination pagination-sm', NULL, true, 7);
if (getNumAlbums() > 0) {
include('inc_print_album_thumb.php');
}
if (getNumImages() > 0) {
include('inc_print_image_thumb.php');
}
printPageListWithNav('«', '»', false, true, 'pagination pagination-sm margin-top-reset', NULL, true, 7);
if (($_zenpage_enabled) /*&& ($_zp_page == 1)*/) { //test of zenpage searches
if ($_zenpage_news_enabled && ($numnews > 0)) { ?>
<h4 class="margin-top-double margin-bottom-double"><strong><?php printf(gettext('Articles (%s)'), $numnews); ?></strong></h4>
<?php while (next_news()) { ?>
<div class="list-post clearfix">
<h4 class="post-title"><?php printNewsURL(); ?></h4>
<div class="post-content clearfix">
<?php echo shortenContent(getBare(getNewsContent()), getOption("zpB_exerpt_length"), getOption("zenpage_textshorten_indicator")); ?>
</div>
</div>
<?php
}
}
if ($_zenpage_pages_enabled && ($numpages > 0)) { ?>
<h4 class="margin-top-double margin-bottom-double"><strong><?php printf(gettext('Pages (%s)'), $numpages); ?></strong></h4>
<?php while (next_page()) { ?>
<div class="list-post clearfix">
<h4 class="post-title"><?php printPageURL(); ?></h4>
<div class="post-content clearfix">
<?php echo shortenContent(getBare(getPageContent()), getOption("zpB_exerpt_length"), getOption("zenpage_textshorten_indicator")); ?>
</div>
</div>
<?php
}
}
}
?>
</div><!-- /.search-wrap -->
</div><!-- /.container main -->
<?php include('inc_footer.php'); ?>