forked from vincent3569/i-feel-dirty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
executable file
·126 lines (109 loc) · 3.54 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
116
117
118
119
120
121
122
123
124
125
126
<?php include ('inc_header.php'); ?>
<div class="main">
<div class="content">
<div id="breadcrumb">
<h2>
<?php printGalleryIndexURL('', gettext('Home'), false); ?>
» <?php echo '<em>'.gettext('Search').'</em>'; ?>
</h2>
</div>
<?php
$numimages = getNumImages();
$numalbums = getNumAlbums();
$total1 = $numimages + $numalbums;
$numnews = $numpages = 0;
if ($_zenpage_enabled && !isArchive()) {
if ($_zenpage_and_news_enabled) {
$numnews = getNumNews();
}
if ($_zenpage_and_pages_enabled) {
$numpages = getNumPages();
}
}
$total = $total1 + $numnews + $numpages ;
$searchwords = getSearchWords();
$searchdate = getSearchDate();
if (!empty($searchdate)) {
if (!empty($searchwords)) {
$searchwords .= ": ";
}
$searchwords .= $searchdate;
}
?>
<div class="search-result">
<p><?php printf(ngettext('%1$u Hit for <em>%2$s</em>', '%1$u Hits for <em>%2$s</em>', $total), $total, html_encode($searchwords)); ?></p>
<?php if ($total == 0) { ?>
<p><?php echo gettext("Sorry, no matches found. Try refining your search."); ?></p>
<?php } ?>
</div>
<div>
<?php
if (getOption('search_no_albums')) {
if ($numimages > 0) {
echo'<ul class="search-item"><li>'; printf(gettext('Images (%s)'), $numimages); echo'</li></ul>';
}
} else {
if (getOption('search_no_images')) {
if ($numalbums > 0) {
echo'<ul class="search-item"><li>'; printf(gettext('Albums (%s)'), $numalbums); echo'</li></ul>';
}
} else {
if ($total1 > 0) {
echo'<ul class="search-item"><li>'; printf(gettext('Albums (%1$s) & Images (%2$s)'), $numalbums, $numimages); echo'</li></ul>';
}
}
}
?>
<?php printPageListWithNav(gettext('« prev'), gettext('next »'), false, true, 'pagelist', NULL, true, 7); ?>
<?php if (function_exists('printSlideShowLink')) { ?>
<div class="img-slide clearfix">
<?php printSlideShowLink(gettext('Slideshow')); ?>
</div>
<?php } ?>
<?php
if (getNumAlbums() > 0) {
include('inc_print_album_thumb.php');
}
if (getNumImages() > 0) {
include('inc_print_image_thumb.php');
}
?>
<?php printPageListWithNav(gettext('« prev'), gettext('next »'), false, true, 'pagelist', NULL, true, 7); ?>
</div>
<?php
if ($_zp_page == 1) { //test of zenpage searches
if ($numnews > 0) { ?>
<div>
<ul class="search-item"><li><?php printf(gettext('Articles (%s)'), $numnews); ?></li></ul>
<?php while (next_news()) { ?>
<div class="search-news clearfix">
<h3 class="search-title"><?php printNewsURL(); ?></h3>
<div class="search-content clearfix">
<?php echo shortenContent(getBare(getNewsContent()), 100, getOption("zenpage_textshorten_indicator")); ?>
</div>
</div>
<?php } ?>
</div>
<?php
}
if ($numpages > 0) { ?>
<div>
<ul class="search-item"><li><?php printf(gettext('Pages (%s)'), $numpages); ?></li></ul>
<?php while (next_page()) { ?>
<div class="search-page clearfix">
<h3 class="search-title"><?php printPageURL(); ?></h3>
<div class="search-content clearfix">
<?php echo shortenContent(getBare(getPageContent()), 100, getOption("zenpage_textshorten_indicator")); ?>
</div>
</div>
<?php } ?>
</div>
<?php
}
}
?>
<br class="clearfix" />
</div> <!-- content -->
<?php include('inc_sidebar.php'); ?>
</div> <!-- main -->
<?php include('inc_footer.php'); ?>