-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsearch.php
87 lines (61 loc) · 2.98 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
<?php include("header.php"); ?>
<?php ufandshands_breadcrumbs(); ?>
<div id="content-wrap">
<div id="content-shadow">
<div id="content" class="container">
<article id="main-content" class="span-24" role="main">
<div class="box">
<?php if (have_posts()) : ?>
<?php
// Retrieve search count
global $wp_query;
$count = $wp_query->found_posts;
?>
<h1 class="title medium-blue">Search Results for <span class="light-blue">“</span><strong class="dark-blue"><?php the_search_query(); ?></strong><span class="light-blue">”</span></h1>
<h4 class="black-75"><?php if($count == '1') { echo ' ' . $count . ' result was found'; } else { echo ' ' . $count . ' results were found'; } ?></h4>
<?php while (have_posts()) : the_post(); ?>
<?php // Set Loop variables
$currenttemplate = get_post_meta($post->ID,'_wp_page_template',true);
$ip = $_SERVER['REMOTE_ADDR'];
$members_only = ufandshands_members_only();
?>
<div class="entry">
<?php
if($currenttemplate == "membersonly.php") :
if ($members_only) :
?>
<!-- Members Only -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<p class="published"><span class="black-50">Published: <?php the_time('M jS, Y') ?></span></p>
<?php the_excerpt(); ?>
<?php else : ?>
<!-- Non-Members -->
<p>This document can only be seen by users inside the UF/Shands network.</p>
<?php endif; ?>
<?php else : ?>
<!-- Non Members-Only Templates -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<p class="published"><span class="black-50">Published: <?php the_time('M jS, Y') ?></span></p>
<?php the_excerpt() ?>
</div><!-- end .entry -->
<?php endif; ?>
<?php endwhile; ?>
<?php
if (function_exists("ufandshands_pagination")) {
ufandshands_pagination($wp_query->max_num_pages);
} else { ?>
<div class="single-navigation clear">
<div class="nav-previous"><?php previous_posts_link('← Newer Entries') ?></div>
<div class="nav-next"><?php next_posts_link('Older Entries →') ?></div>
</div>
<?php }?>
<?php else : ?>
<h2>No results found. Try a different search?</h2>
<?php endif; ?>
</div> <!-- end box div -->
</article><!-- end #main-content -->
</div>
</div>
</div>
<?php include('user-role-menu.php'); ?>
<?php include("footer.php"); ?>