Web Resources
Contacts
Sandra Wingard
IT Manager
129 Sparks Building
University Park, PA 16802
Chris Thomas
IT Consultant
College Web Contact
131 Sparks Building
University Park, PA 16802
Computer Support Services
College of the Liberal Arts
131 Sparks Building
University Park, PA 16802
Instructions: To insert this code into your web document simple copy and paste it into your code where you want it. Then you must change several lines of code to enable it to search your site. These lines are highlighted in RED.
The red text "www.la.psu.edu" should be changed to reflect your web site address. Example: http://philosophy.la.psu.edu.
The red text "Liberal Arts" should be changed to reflect your department or area name. Example: Department of Philosophy.
If you need assistance implementing this search engine, please email Chris Thomas at clt16@psu.edu
<script type="text/javascript">
//<![CDATA[
/
function getElement( id) {
if ( document.getElementById) {
return document.getElementById( id);
} else {
return document.all[id];
}
}
/**
* Allow multiple search destinations
*
* @return boolean True if we're searching the default form, false if not (should never get to return in this case)
*/
function doMultiSearch() {
searchRealmList = getElement( 'searchRealm');
searchRealm = searchRealmList.options[searchRealmList.options.selectedIndex].value;
searchQuery = getElement( 'searchQuery').value;
switch ( searchRealm) {
case "web":
/* Search the web with google */
getElement( 'webSearchQuery').value = searchQuery;
getElement( 'webSearchForm').submit();
return false;
break;
case "psu":
/* Search PSU using the google appliance */
getElement( 'psuSearchQuery').value = searchQuery;
getElement( 'psuSearchForm').submit();
return false;
break;
case "people":
/* Search for people using the LDAP CGI */
getElement( 'peopleSearchQuery').value = '(|(cn=' + searchQuery + ')(cn=*' + searchQuery + '*)(cn=' + searchQuery + ')(cn=*' + searchQuery + ')(edupersonnickname=' + searchQuery + ')(uid=' + searchQuery + '))';
getElement( 'peopleSearchForm').submit();
return false;
break;
case "dept":
/* Search for departments, also using the LDAP CGI */
getElement( 'deptSearchQuery').value = '(&(EDUPERSONPRIMARYAFFILIATION=DEPT)(|(PSDEPARTMENT=' + searchQuery + ')(PSDEPARTMENT=*' + searchQuery + '*)(PSDEPARTMENT=' + searchQuery + '*)(PSDEPARTMENT=*' + searchQuery + ')))';
getElement( 'deptSearchForm').submit();
return false;
break;
case "forum":
/* Search the WSG forum */
getElement( 'forumSearchQuery').value = searchQuery;
getElement( 'forumSearchForm').submit();
return false;
break;
case "this":
default:
/* Search the web style guide, using the google appliance */
//getElement( 'thisSearchForm').submit();
return true;
break;
}
}
//]]>
</script>
Search
<!-- Search PSU using the google appliance -->
</h5>
<form method="get" action="http://search-results.aset.psu.edu/search" id="psuSearchForm" name="psuSearchForm" style="display: none;">
<h5>
<input type="hidden" name="q" value="" id="psuSearchQuery" />
</h5>
</form>
<form id="deptSearchForm" action="http://www.psu.edu/cgi-bin/ldap/dept_query.cgi" method="post" name="deptSearchForm" style="display: none;">
<h5>
<input type="hidden" name="qry_str" value="" id="deptSearchQuery" />
</h5>
</form>
<!-- Search the web style guide, using the google appliance (default, only option available sans-JavaScript) -->
<img src="../images/searchimage.jpg" alt="Search Liberal Arts" width="362" height="252" hspace="5" vspace="5" border="1" align="right" />
<form id="thisSearchForm" action="http://search-results.aset.psu.edu/search" method="get" name="thisSearchForm" onsubmit="return doMultiSearch();" style="background-color: #FFF;"">
<p>
<input type="hidden" name="client" value="PennState" />
<input type="hidden" name="proxystylesheet" value="PennState" />
<input type="hidden" name="output" value="xml_no_dtd" />
<input type="hidden" name="site" value="PennState" />
<input type="hidden" name="as_sitesearch" value="http://www.la.psu.edu" />
<!-- Label for Section 508 compliance only -->
</p>
<p>Enter a search criteria and select from the dropdown to search Liberal Arts, Penn State people, Penn State departments or search the World Wide Web. </p>
<label for="searchQuery" style="display: none;">Search Query: </label>
<p>
<input type="text" name="q" value="" id="searchQuery" />
<script type="text/javascript">
//<![CDATA[
/* Generate the select element with JavaScript, so that
* clients without scripting don't see the option of changing
* the search realm.
*/
document.writeln('<select name="searchRealm" id="searchRealm">');
document.writeln('<option value="this" selected>Liberal Arts</option>');
document.writeln('<option value="psu">Penn State</option>');
document.writeln('<option value="people">Penn State People</option>');
document.writeln('<option value="dept">Penn State Departments</option>');
document.writeln('<option value="web">The Web</option>');
document.writeln('</select>');
//]]>
</script>
<input type="submit" name="doSearch" id="doSearch" value="Search" />
</p>
</form>