DISCLAIMER: This should be tested on a development environment that is close to or the same as your production environment. Some of the mechanisms used here will not work in all server configurations. I will take any feedback and try to make it compatible with all setups.

Download

Download latest version: ct-community-college-course-search-latest.zip

Description

This Wordpress plugin lets you add two types of course search engines on your website: a quick search and a custom search. Either one, or both, can be added with some simple shortcodes. The great part about the custom search is that each field is added with a different shortcode, so you can lay out the form how you like.

This plugin only searches the CT Community College system website for courses.

I built this modularly so you can implement only what you want on your site. There are two distinct components – the quick search and the custom/advanced search.

Quick Search

Option 1: Single Term (search only one term)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term=1173]
    note: change the term parameter from 1173 to the one you want to search*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=1173]
    again, change the term parameter to match the previous.

* you can find term parameter codes by inspecting the HTML of the term select box on online.commnet.edu, or just ask me for some guidance here.

Option 2a: Top x Terms (a dropdown lets the user pick a term before running a quick search)

Demo: https://www.tunxis.edu/course-search/ (the first search area on the page)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term=top count=3]
    note: change the count parameter from 3 to the number of terms you want available (starts at most recent)*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=top]

Option 2b: Specific Terms (a dropdown lets the user pick a term before running a quick search)

To implement this:

  1. install the plugin
  2. add the search form shortcode to a page: [ccccs-course-search-basic term="1173,1181"]
    note: change the term parameter to a list of term codes you want available*.
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-basic term=top]

* you can find term parameter codes by inspecting the HTML of the term select box on online.commnet.edu, or just ask me for some guidance here.

Custom Search

Demo: 
https://www.tunxis.edu/course-search/
 (the second search area on the page)

To implement this:

  1. install the plugin
  2. add appropriate search field shortcodes to a page (see ccccs shortcode reference)
  3. on the same page, probably further down, add the results shortcode: [ccccs-course-results-advanced]
  4. add the class search-code-advanced to an HTML element (probably a div) which wraps the entire set of search field shortcodes

Shortcode Reference

// --- quick search --->
[ccccs-course-search-basic term="1173|1173,1181,...|top" [count=3]]
[ccccs-course-results-basic term="1173|top"]

// --- custom search --->
[ccccs-course-search-advanced field=sel_subj tag=select id=major label="Subjects"]
[ccccs-course-search-advanced field=TERM tag=select id=term label="Semester"]
[ccccs-course-search-advanced field=College_code tag=select id=college label="College"]
[ccccs-course-search-advanced field=sel_title tag=input id=major label="Course Title (optional)"]
[ccccs-course-search-advanced field=sel_schd tag=select label="Course Type"]
[ccccs-course-search-advanced field=sel_open tag=input id=open label="Open"]
[ccccs-course-search-advanced field=sel_open tag=input id=open label="Closed"]
[ccccs-course-search-advanced field=sel_open tag=input id=open label="Both"]
[ccccs-course-search-advanced field=sel_level tag=input id=level-credit label="Credit"]
[ccccs-course-search-advanced field=sel_level tag=input id=level-noncredit label="Non-credit"]
[ccccs-course-search-advanced field=sel_level tag=input id=level-both label="Both"]
[ccccs-course-search-advanced field=begin_hh tag=select id=class-type label="Hour"]
[ccccs-course-search-advanced field=begin_mi tag=select id=class-type label="Minute"]
[ccccs-course-search-advanced field=begin_ap tag=select id=class-type label="AM/PM"]
[ccccs-course-search-advanced field=end_hh tag=select id=class-type label="Hour"]
[ccccs-course-search-advanced field=end_mi tag=select id=class-type label="Minute"]
[ccccs-course-search-advanced field=end_ap tag=select id=class-type label="AM/PM"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Monday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Tuesday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Wednesday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Thursday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Friday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Saturday"]
[ccccs-course-search-advanced field=sel_day type=checkbox tag=input label="Sunday"]
[ccccs-course-search-advanced submit="Search"]
//
[ccccs-course-results-advanced]
// --- NOTE: you MUST add the class "course-search-advanced" to a wrapper (cannot be a form tag) that goes around all of the advanced search fields. Do not put the [ccccs-course-results-advanced] shortcode into this wrapper. -->

Other Notes

The code is GPL2.0 so you can take it, modify it, port it to other languages or CMS’s as you like. The only requirement is that the code stay free and publicly accessible.

Core Features:

Core Features of Quick Search:

Core Features of Custom Search:

Changelog

= 1.1.2 = 
* added nolo_crse variable to query with default value of 2 to satisfy search result requirements on remote server 

= 1.1.1 = 
* fixed something ... not sure what 

= 1.1.0 = 
* added ability to quick search multiple terms with one form (thanks for the idea Kristian C!) 

= 1.0.2 =
 * fixed something

= 1.0.1 =
 * added code to select default college based on host domain

= 1.0.0 =
 * initial release

@TODO