Added a better results page.
This commit is contained in:
10
index.php
10
index.php
@ -41,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h1 class="mg-md text-lg-center text-md-center text-sm-center text-center tc-black">
|
<h1 class="mg-md text-lg-center text-md-center text-sm-center text-center tc-black">
|
||||||
<strong>Fathom - Deep Links for PowerPAC</strong>
|
<a href="index.php"><strong>Fathom - Deep Links for PowerPAC</strong></a>
|
||||||
</h1>
|
</h1>
|
||||||
<p class="text-lg-center text-md-center text-sm-center text-center">
|
<p class="text-lg-center text-md-center text-sm-center text-center">
|
||||||
Create a persistent link to materials and results list in your Polaris PowerPAC.
|
Create a persistent link to materials and results list in your Polaris PowerPAC.
|
||||||
@ -57,11 +57,11 @@
|
|||||||
<div class="container bloc-lg bloc-md-lg">
|
<div class="container bloc-lg bloc-md-lg">
|
||||||
<div class="row l-bloc">
|
<div class="row l-bloc">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<form id="form_1" data-form-type="blocs-form" novalidate data-success-msg="Success" data-fail-msg="Fail." action="testsubmit.php" method="post">
|
<form id="form_1" data-form-type="blocs-form" novalidate data-success-msg="Success" data-fail-msg="Fail." action="yourlink.php" method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>
|
<label>
|
||||||
Base URL
|
Base URL
|
||||||
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="The base URL of your PowerPAC"></span>
|
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="The base URL of your PowerPAC. Do not use a forward slash (/) at the end."></span>
|
||||||
<input id="url" name="url" class="form-control" required placeholder="https://catalog.mylibrary.org" />
|
<input id="url" name="url" class="form-control" required placeholder="https://catalog.mylibrary.org" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -86,13 +86,13 @@
|
|||||||
<label>
|
<label>
|
||||||
Author<br>
|
Author<br>
|
||||||
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="Search by author"></span>
|
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="Search by author"></span>
|
||||||
<input id="author" class="form-control" placeholder="Gail Simone" />
|
<input id="author" name="author" class="form-control" placeholder="Gail Simone" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>
|
<label>
|
||||||
Subject Heading<br>
|
Subject Heading<br>
|
||||||
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="Search by subject heading"></span>
|
</label><span class="far fa-question-circle icon-sm" data-placement="right" data-toggle="tooltip" title="Search by subject heading"></span>
|
||||||
<input id="email" class="form-control" placeholder="Graphic Novels" />
|
<input id="subject" name="subject" class="form-control" placeholder="Graphic Novels" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>
|
<label>
|
||||||
|
@ -1,67 +1,65 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$url = $_POST['url'];
|
// Variable intake and sanitization
|
||||||
$ctx = $_POST['ctx'];
|
$incomingurl = $_POST['url'];
|
||||||
$keywords = $_POST['keywords'];
|
$url = filter_var($incomingurl, FILTER_SANITIZE_URL);
|
||||||
|
$incomingctx = $_POST['ctx'];
|
||||||
|
$ctx = filter_var($incomingctx, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingkeywords = $_POST['keywords'];
|
||||||
|
$keywords = filter_var($incomingkeywords, FILTER_SANITIZE_STRING);
|
||||||
$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
|
$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
|
||||||
$title = $_POST['title'];
|
$incomingtitle = $_POST['title'];
|
||||||
|
$title = filter_var($incomingtitle, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingsubject= $_POST['subject'];
|
||||||
|
$subject = filter_var($incomingsubject, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingauthor = $_POST['author'];
|
||||||
|
$author = filter_var($incomingauthor, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
|
// Global variables used for URL construction
|
||||||
$searchprefix = "/search/searchresults.aspx?ctx=";
|
$searchprefix = "/search/searchresults.aspx?ctx=";
|
||||||
$searchmiddle = "&type=Boolean&term=";
|
$searchmiddle = "&type=Boolean&term=";
|
||||||
$searchsuffix = "&sort=RELEVANCE&limit=&query=&page=0";
|
$searchsuffix = "&sort=RELEVANCE&limit=&query=&page=0";
|
||||||
$searchjoiner = "%20and%20";
|
$searchjoiner = "%20and%20";
|
||||||
|
|
||||||
|
// Display posted variables
|
||||||
echo '<strong>URL:</strong> '.$url.'<br />';
|
echo '<strong>URL:</strong> '.$url.'<br />';
|
||||||
echo '<strong>CTX:</strong> '.$ctx.'<br />';
|
echo '<strong>CTX:</strong> '.$ctx.'<br />';
|
||||||
echo '<strong>Keyword(s):</strong> '.$keywords.'<br />';
|
echo '<strong>Keyword(s):</strong> '.$keywords.'<br />';
|
||||||
echo '<strong>Langauge:</strong> '.$language.'<br />';
|
|
||||||
echo '<strong>Title:</strong> '.$title.'<br />';
|
echo '<strong>Title:</strong> '.$title.'<br />';
|
||||||
|
echo '<strong>Author:</strong> '.$author.'<br />';
|
||||||
|
echo '<strong>Subjects:</strong> '.$subject.'<br />';
|
||||||
|
echo '<strong>Langauge:</strong> '.$language.'<br />';
|
||||||
|
|
||||||
// Check for data
|
// Begin building the URL
|
||||||
|
|
||||||
|
// Langauge selection starts the URL
|
||||||
$la = 'la='.$language;
|
$la = 'la='.$language;
|
||||||
|
|
||||||
if (!empty($keywords)) {
|
if (!empty($keywords)) {
|
||||||
$kw = 'kw='.$keywords;
|
$kw = $searchjoiner.'kw='.$keywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($subject)) {
|
||||||
|
$su = $searchjoiner.'su='.$subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($author)) {
|
||||||
|
$au = $searchjoiner.'au='.$author;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Title status determines end of URL
|
||||||
if (!empty($title)) {
|
if (!empty($title)) {
|
||||||
$urlend = $searchjoiner.'ti='.$title.$searchsuffix;
|
$urlend = $searchjoiner.'ti='.$title.$searchsuffix;
|
||||||
} else {
|
} else {
|
||||||
$urlend = $searchsuffix;
|
$urlend = $searchsuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Display the Search link
|
||||||
|
echo '<h3>Your Deep Link is:</h3>';
|
||||||
echo '<h3>Constructed link</h3>';
|
|
||||||
//echo $url.'/'.$ctx.'/';
|
//echo $url.'/'.$ctx.'/';
|
||||||
|
|
||||||
// $address = implode(", ", array_filter(array($addressline1, $addressline2, $addressline3));
|
$SearchURL = implode("", array_filter(array($url, $searchprefix, $ctx, $searchmiddle, $la, $au, $kw, $su, $urlend)));
|
||||||
|
|
||||||
$SearchURL = implode("", array_filter(array($url, $searchprefix, $ctx, $searchmiddle, $la, $searchjoiner, $kw, $urlend)));
|
|
||||||
|
|
||||||
echo '<a href="'.$SearchURL.'">'.$SearchURL.'</a><br /><br />';
|
echo '<a href="'.$SearchURL.'">'.$SearchURL.'</a><br /><br />';
|
||||||
|
|
||||||
$ConstructedURL = $url.$searchprefix.$ctx.$searchmiddle.$kw.'%20and%20la='.$language.$searchsuffix;
|
|
||||||
|
|
||||||
echo '<a href="'.$ConstructedURL.'">'.$ConstructedURL.'</a>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// https://ccs.polarislibrary.com/polaris/search/searchresults.aspx?ctx=14.1033.0.0.35&type=Boolean&term=COL=YOTHER%20and%20MAT=KIT%20and%20LA=POL%20and%20GENRE=games&sort=RELEVANCE&page=0
|
|
||||||
// https://escondido.librarycatalog.info/polaris/search/searchresults.aspx?ctx=3.1033.0.0.6&type=Boolean&term=kw=batgirl
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Search for:
|
|
||||||
* Keyword
|
|
||||||
* Title
|
|
||||||
* Author
|
|
||||||
* Language
|
|
||||||
* Subject Heading
|
|
||||||
* Collection Code
|
|
||||||
* Material Type
|
|
||||||
* ISBN
|
|
||||||
|
|
||||||
*/
|
|
||||||
?>
|
?>
|
196
yourlink.php
Normal file
196
yourlink.php
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Variable intake and sanitization
|
||||||
|
$incomingurl = $_POST['url'];
|
||||||
|
$url = filter_var($incomingurl, FILTER_SANITIZE_URL);
|
||||||
|
$incomingctx = $_POST['ctx'];
|
||||||
|
$ctx = filter_var($incomingctx, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingkeywords = $_POST['keywords'];
|
||||||
|
$keywords = filter_var($incomingkeywords, FILTER_SANITIZE_STRING);
|
||||||
|
$language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING);
|
||||||
|
$incomingtitle = $_POST['title'];
|
||||||
|
$title = filter_var($incomingtitle, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingsubject= $_POST['subject'];
|
||||||
|
$subject = filter_var($incomingsubject, FILTER_SANITIZE_STRING);
|
||||||
|
$incomingauthor = $_POST['author'];
|
||||||
|
$author = filter_var($incomingauthor, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
|
// Global variables used for URL construction
|
||||||
|
$searchprefix = "/search/searchresults.aspx?ctx=";
|
||||||
|
$searchmiddle = "&type=Boolean&term=";
|
||||||
|
$searchsuffix = "&sort=RELEVANCE&limit=&query=&page=0";
|
||||||
|
$searchjoiner = "%20and%20";
|
||||||
|
|
||||||
|
// Begin building the URL
|
||||||
|
|
||||||
|
// Langauge selection starts the URL
|
||||||
|
$la = 'la='.$language;
|
||||||
|
|
||||||
|
if (!empty($keywords)) {
|
||||||
|
$kw = $searchjoiner.'kw='.$keywords;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($subject)) {
|
||||||
|
$su = $searchjoiner.'su='.$subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($author)) {
|
||||||
|
$au = $searchjoiner.'au='.$author;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Title status determines end of URL
|
||||||
|
if (!empty($title)) {
|
||||||
|
$urlend = $searchjoiner.'ti='.$title.$searchsuffix;
|
||||||
|
} else {
|
||||||
|
$urlend = $searchsuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
$SearchURL = implode("", array_filter(array($url, $searchprefix, $ctx, $searchmiddle, $la, $au, $kw, $su, $urlend)));
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="keywords" content="">
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||||
|
<link rel="canonical" href="https://playingaround.com/results.php">
|
||||||
|
<meta name="robots" content="index, follow">
|
||||||
|
<link rel="shortcut icon" type="image/png" href="favicon.png">
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="./css/bootstrap.min.css?7923">
|
||||||
|
<link rel="stylesheet" type="text/css" href="style.css?9626">
|
||||||
|
<link rel="stylesheet" type="text/css" href="./css/all.min.css">
|
||||||
|
|
||||||
|
<title>Results</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Analytics -->
|
||||||
|
|
||||||
|
<!-- Analytics END -->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<!-- Preloader -->
|
||||||
|
<div id="page-loading-blocs-notifaction" class="page-preloader"></div>
|
||||||
|
<!-- Preloader END -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Main container -->
|
||||||
|
<div class="page-container">
|
||||||
|
|
||||||
|
<!-- bloc-0 -->
|
||||||
|
<div class="bloc" id="bloc-0">
|
||||||
|
<div class="container bloc-lg bloc-sm-lg">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<img src="img/library-4785580_1920.jpg" class="img-fluid mx-auto d-block" alt="library 4785580_1920" />
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<h1 class="mg-md text-lg-center text-md-center text-sm-center text-center tc-black">
|
||||||
|
<a href="index.php"><strong>Fathom - Deep Links for PowerPAC</strong></a>
|
||||||
|
</h1>
|
||||||
|
<p class="text-lg-center text-md-center text-sm-center text-center">
|
||||||
|
Create a persistent link to materials and results list in your Polaris PowerPAC.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- bloc-0 END -->
|
||||||
|
|
||||||
|
<!-- bloc-2 -->
|
||||||
|
<div class="bloc l-bloc " id="bloc-2">
|
||||||
|
<div class="container bloc-lg bloc-md-lg">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col text-md-left text-center">
|
||||||
|
<h4 class="mg-md">
|
||||||
|
<strong>Your deep link:</strong>
|
||||||
|
</h4>
|
||||||
|
<p><span style="color: blue">
|
||||||
|
<?php echo '<a href="'.$SearchURL.'">'.$SearchURL.'</a><br /><br />'; ?>
|
||||||
|
</span></p>
|
||||||
|
<h4 class="mg-md">
|
||||||
|
<strong>Your parameters:</strong>
|
||||||
|
</h4>
|
||||||
|
<p>
|
||||||
|
<?php
|
||||||
|
echo '<strong>URL:</strong> '.$url.'<br />';
|
||||||
|
echo '<strong>CTX:</strong> '.$ctx.'<br />';
|
||||||
|
echo '<strong>Keyword(s):</strong> '.$keywords.'<br />';
|
||||||
|
echo '<strong>Title:</strong> '.$title.'<br />';
|
||||||
|
echo '<strong>Author:</strong> '.$author.'<br />';
|
||||||
|
echo '<strong>Subjects:</strong> '.$subject.'<br />';
|
||||||
|
echo '<strong>Langauge:</strong> '.$language.'<br />';
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- bloc-2 END -->
|
||||||
|
|
||||||
|
<!-- ScrollToTop Button -->
|
||||||
|
<a class="bloc-button btn btn-d scrollToTop" onclick="scrollToTarget('1',this)"><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 32 32"><path class="scroll-to-top-btn-icon" d="M30,22.656l-14-13-14,13"/></svg></a>
|
||||||
|
<!-- ScrollToTop Button END-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- bloc-2 -->
|
||||||
|
<div class="bloc bgc-black d-bloc" id="bloc-2">
|
||||||
|
<div class="container bloc-lg bloc-sm-lg">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-sm-6">
|
||||||
|
<h4 class="mg-md text-sm-left text-center tc-white">
|
||||||
|
About
|
||||||
|
</h4><a href="index.php" class="a-btn a-block footer-link">Created by Daniel Messer</a><a href="index.php" class="a-btn a-block">Changelog</a><a href="index.php" class="a-btn a-block footer-link">Email Dan</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-6">
|
||||||
|
<h4 class="mg-md text-sm-left text-center tc-white">
|
||||||
|
Other Goodies
|
||||||
|
</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6 col-sm-2 col offset-sm-0">
|
||||||
|
<div class="text-center">
|
||||||
|
<a href="https://blocsapp.com/"><span class="icon-md fa fa-headphones-alt"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-sm-2">
|
||||||
|
<div class="text-center">
|
||||||
|
<a href="https://blocsapp.com/"><span class="icon-md fab fa-mastodon"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-sm-2">
|
||||||
|
<div class="text-center">
|
||||||
|
<a href="https://blocsapp.com/"><span class="icon-md fab fa-gitlab"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 col-sm-2">
|
||||||
|
<div class="text-center">
|
||||||
|
<a href="https://blocsapp.com/"><span class="icon-md fa fa-beer"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- bloc-2 END -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Main container END -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Additional JS -->
|
||||||
|
<script src="./js/jquery.min.js?3605"></script>
|
||||||
|
<script src="./js/bootstrap.bundle.min.js?5248"></script>
|
||||||
|
<script src="./js/blocs.min.js?5348"></script>
|
||||||
|
<script src="./js/lazysizes.min.js" defer></script><!-- Additional JS END -->
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user