Skip to content

Commit 9b9425c

Browse files
committed
v1.0.0 - Initial Public Release
0 parents  commit 9b9425c

12 files changed

+1117
-0
lines changed

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Bootstrap 4 Sphider Theme
2+
3+
A theme based on [Bootstrap 4][bootstrapurl] for the [Sphider][sphiderurl] PHP search engine and spider, a useful PHP-based spider and search interface with many advanced features, that simply lacks a modern interface. The theme features a minimal, responsive interface designed for use with modern sites and devices.
4+
5+
## Demo
6+
7+
You can see a demo of the theme at [accudio.com/sitesearch](https://accudio.com/sitesearch/), which displays results from accudio.com and sphider.eu.
8+
9+
## Requirements
10+
11+
All required is a working installation of [Sphider][sphiderdown] or one of it's forks. The theme has been tested with Sphider-PDO v1.3.10, but should work on many versions, including of the forks [Sphider Plus][sphiderplus] and [Sphider Pro][sphiderpro].
12+
13+
## Installation
14+
15+
1. Download the theme zip in the root Sphider directory:
16+
17+
```wget https://github.com/accudio/sphider-bootstrap4/archive/master.zip```.
18+
19+
2. Extract the zip: ```unzip master.zip```.
20+
3. Ensure ```templates/``` includes the folder ```bootstrap4```.
21+
4. Log in to Sphider administration page:
22+
1. Go to 'Settings';
23+
2. Under General Settings and Search Template, select ```bootstrap4```;
24+
3. 'Save Changes' at the bottom of the page.
25+
5. All new searches made will display the new theme.
26+
27+
## Version History
28+
29+
- v1.0.0—Initial public release
30+
31+
## License
32+
33+
Copyright © 2018 [Alistair Shepherd][accudiourl]. Licensed under the [GPLv3 License][licenseurl].
34+
35+
[bootstrapurl]:https://getbootstrap.com/
36+
[sphiderurl]:http://www.sphider.eu/
37+
[sphiderdown]:http://www.sphider.eu/download.php
38+
[sphiderplus]:https://www.sphider-plus.eu/
39+
[sphiderpro]:http://www.sphiderpro.eu/
40+
[accudiourl]:https://accudio.com
41+
[licenseurl]:https://github.com/accudio/sphider-bootstrap4/blob/master/LICENSE

index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
include ("search.php")

templates/bootstrap4/bootstrap.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/bootstrap4/bootstrap4-input-clearer.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/bootstrap4/categories.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php if ($catid && is_numeric($catid)){?>
2+
3+
<!-- category tree -->
4+
<br/>
5+
<div class="main_cat1">
6+
<a href="search.php"><?php print $sph_messages['Categories']?></a> >
7+
<?php foreach ($cat_info['cat_tree'] as $_val){?>
8+
<a href="?catid=<?php print $_val['category_id']?>"><?php print $_val['category']?></a> >
9+
<?php }?>
10+
</div>
11+
12+
13+
<!-- list of sub-categories -->
14+
<?php if ($cat_info['subcats']){?>
15+
<div class="catBanner"><?php print $sph_messages['Categories']?></div><br/>
16+
<?php foreach ($cat_info['subcats'] as $_key => $_val){?>
17+
<a href="?catid=<?php print $_val['category_id']?>"><b><?php print $_val['category']?></b></a> (<?php print $_val['count'][0][0]?>)<br>
18+
<?php }?>
19+
<?php }?>
20+
21+
22+
<!-- list of category web pages -->
23+
<?php if ($cat_info['cat_sites']){?>
24+
<div class="webPageBanner"><?php print $sph_messages['Web pages']?></div><br/>
25+
<?php foreach ($cat_info['cat_sites'] as $_key => $_val){?>
26+
<b><?php print $_key + 1?>.</b> <a href="<?php print $_val['url']?>"><b><?php print $_val['title']?></b></a><br><?php print $_val['short_desc']?><br><font class="url"><?php print $_val['url']?></font><br><br>
27+
<?php }?>
28+
<?php }?>
29+
<div class="divline">
30+
</div>
31+
32+
<?php } else {?>
33+
34+
35+
36+
<!-- category selection -->
37+
<?php if ($cat_info['main_list']){?>
38+
<center><br>
39+
<div id="cat_main">
40+
<?php print $sph_messages['CATEGORIES']?>
41+
</div>
42+
43+
<table id="cat_table" border="0" cellpadding="4">
44+
<tr>
45+
<?php foreach ($cat_info['main_list'] as $_key => $_val){
46+
$col_width=100/$cat_columns?>
47+
<td width="<?php print $col_width?>%">
48+
<a href="?catid=<?php print $_val['category_id']?>" class="main_cat1"><?php print $_val['category']?></a><br>&nbsp;&nbsp;
49+
<?php if (is_array($_val['sub'])) {
50+
foreach ($_val['sub'] as $__key => $__val){?>
51+
<!-- only 3 subcategories -->
52+
<?php if ($__key > 2) break?>
53+
<a href="?catid=<?php print $__val['category_id']?>" class="main_cat2"><?php print $__val['category']?></a>
54+
<?php }?>
55+
<?php }?>
56+
</td>
57+
<!-- column nr defined in config -->
58+
<?php if (!(($_key +1)% $cat_columns)) {?></tr><tr><?php }?>
59+
<?php }?>
60+
</tr>
61+
</table>
62+
<?php }?>
63+
<?php }?>
64+
65+
<div id="powered_by">
66+
<!--If you want to remove this, please donate to the project-->
67+
<?php poweredby()?>
68+
</div>
69+

templates/bootstrap4/footer.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
</div>
2+
<script src="templates/bootstrap4/jquery-3.2.1.slim.min.js"></script>
3+
<script src="templates/bootstrap4/bootstrap4-input-clearer.min.js"></script>
4+
<script>$("#query").clearer();</script>
5+
</body>
6+
</html>

templates/bootstrap4/header.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
5+
<title><?php if($query != ''){ print quote_replace($query); echo ' - '; }?>Search Results</TITLE>
6+
<link type="text/css" rel="stylesheet" href="templates/bootstrap4/bootstrap.min.css">
7+
<link type="text/css" rel="stylesheet" href="templates/bootstrap4/search.css">
8+
<!-- suggest script -->
9+
<style type="text/css">@import url("include/js_suggest/SuggestFramework.css");</style>
10+
<script type="text/javascript" src="include/js_suggest/SuggestFramework.js"></script>
11+
<script type="text/javascript">window.onload = initializeSuggestFramework;</script>
12+
<!-- /suggest script -->
13+
</head>
14+
15+
<body>
16+
<div class="container">
17+
<section id="header">
18+
<div class="row justify-content-center">
19+
<div class="col-md-6 text-center">
20+
<h1>Search</h1>

templates/bootstrap4/jquery-3.2.1.slim.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/bootstrap4/search.css

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#header {
2+
padding: 0;
3+
margin: 1.5rem 0 1rem;
4+
}
5+
6+
#header h1 {
7+
margin-bottom: 1rem;
8+
}
9+
10+
.input-clearer {
11+
position: absolute;
12+
right: 80px;
13+
top: 5px;
14+
color: #aaa;
15+
}
16+
.input-clearer:hover, .input-clearer:focus {
17+
color: #666;
18+
text-decoration: none;
19+
}
20+
21+
#advancedsearch {
22+
margin-top: 5px;
23+
}
24+
25+
.num-results {
26+
width: unset;
27+
}
28+
29+
.alert {
30+
padding: 3px;
31+
font-weight: bold;
32+
margin-bottom: 5px;
33+
}
34+
35+
#did_you_mean {
36+
font-size: 14px;
37+
text-align: left;
38+
margin: 10px;
39+
}
40+
41+
#result_report {
42+
background-color:#e5ecf9;
43+
margin-bottom: 14px;
44+
}
45+
46+
.title {
47+
font-size: 18px;
48+
font-weight: bold;
49+
}
50+
.page-link {
51+
cursor: default;
52+
}
53+
.url, .url a {
54+
color: #115599;
55+
}
56+
.description{
57+
font-size: 13px;
58+
}
59+
.summary{
60+
font-style: italic;
61+
color: #115599;
62+
}

templates/bootstrap4/search_form.html

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
if (!isset($query))
3+
$query = "";
4+
if (!isset($adv))
5+
$adv = 0;
6+
?>
7+
8+
<form method="post">
9+
10+
<div class="input-group mb-3">
11+
<input type="text" class="form-control" placeholder="Search for..." aria-label="Search for" name="query" id="query" size="40" value="<?php print quote_replace($query);?>" action="include/js_suggest/suggest.php" autocomplete="off" delay="1500">
12+
<div class="input-group-append">
13+
<button class="btn btn-primary" type="submit" value="<?php print $sph_messages['Search']?>">Search</button>
14+
</div>
15+
</div>
16+
17+
<?php if ($adv==1 || $advanced_search==1) {
18+
?>
19+
<div class="row text-left" id="advancedsearch">
20+
<div class="col-md-6">
21+
<div class="custom-control custom-radio">
22+
<input id="radio1" name="type" value="and" type="radio" class="custom-control-input" <?php print $type=='and'?'checked':''?>>
23+
<label class="custom-control-label" for="radio1"><?php print $sph_messages['andSearch']?></label>
24+
</div>
25+
</div>
26+
<div class="col-md-6">
27+
<div class="custom-control custom-radio">
28+
<input id="radio2" name="type" value="or" type="radio" class="custom-control-input" <?php print $_REQUEST['type']=='or'?'checked':''?>>
29+
<label class="custom-control-label" for="radio2"><?php print $sph_messages['orSearch']?></label>
30+
</div>
31+
</div>
32+
<div class="col-md-6">
33+
<div class="custom-control custom-radio">
34+
<input id="radio3" name="type" value="phrase" type="radio" class="custom-control-input" <?php print $_REQUEST['type']=='phrase'?'checked':''?>>
35+
<label class="custom-control-label" for="radio3"><?php print $sph_messages['phraseSearch']?></label>
36+
</div>
37+
</div>
38+
<div class="col-md-6">
39+
<select name="results" class="custom-select form-control-sm num-results">
40+
<option <?php if ($results_per_page==10) echo "selected";?>>10</option>
41+
<option <?php if ($results_per_page==20) echo "selected";?>>20</option>
42+
<option <?php if ($results_per_page==50) echo "selected";?>>50</option>
43+
<option <?php if ($results_per_page==100) echo "selected";?>>100</option>
44+
</select>
45+
<?php print $sph_messages['resultsPerPage']?>
46+
</div>
47+
</div>
48+
<?php }?>
49+
50+
<?php if ($catid<>0){?>
51+
<center><b><?php print $sph_messages['Search']?></b>: <input type="radio" name="category" value="<?php print $catid?>"><?php print $sph_messages['Only in category']?> "<?php print $tpl_['category'][0]['category']?>'" <input type="radio" name="category" value="-1" checked><?php print $sph_messages['All sites']?></center>
52+
<?php }?>
53+
54+
<input type="hidden" name="search" value="1">
55+
56+
</form>
57+
58+
<?php if ($has_categories && $search==1 && $show_categories){?>
59+
<a href="search.php"><?php print $sph_messages['Categories']?></a>
60+
<?php }?>
61+
62+
</div>
63+
</div>
64+
</section>

0 commit comments

Comments
 (0)