Changeset - d7044a583ccc
[Not reviewed]
default
0 2 0
Nathan Brink (binki) - 14 years ago 2012-02-11 19:57:37
ohnobinki@ohnopublishing.net
Add the name of the chosen university/school to <title/> for SEO.
2 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -66,13 +66,13 @@ if (file_exists($config_inc)) {
 
 * various features.
 
 */
 
class page
 
{
 

	
 
  /* Site-wide configuration options */
 
  private $base_title = 'SlatePermutate - Find the schedule that works for you!';
 
  private $base_title = array('SlatePermutate', 'Find the schedule that works for you!');
 
  private $doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"';
 
  private $htmlargs = 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"';
 

	
 
  private $pageGenTime = 0;
 

	
 
  private $xhtml = FALSE;
 
@@ -180,12 +180,15 @@ class page
 
    self::session_start();
 
    /* everything that needs sessions started to work: */
 

	
 
    if (empty($options['school']))
 
      $options['school'] = school_load_guess();
 
    $this->school = $options['school'];
 
    if ($this->school['id'] != 'default')
 
      /* If we have a non-generic school, put it into base_title */
 
      array_unshift($this->base_title, $this->school['name']);
 

	
 
    if (empty($options['semester']))
 
      $options['semester'] = school_semester_guess($this->school);
 
    $this->semester = $options['semester'];
 

	
 
    if (!isset($options['school_semester_constant']))
 
@@ -367,13 +370,13 @@ class page
 
    else
 
      header('Content-Type: text/html; charset=utf-8');
 

	
 
    echo '<!DOCTYPE ' . $this->doctype . '>'. PHP_EOL .
 
	  '<html ' . $this->htmlargs . '>'. PHP_EOL .
 
	  '  <head>'. PHP_EOL .
 
	  '    <title>' . $this->pagetitle . ' - ' . $this->base_title . '</title>'. PHP_EOL .
 
	  '    <title>' . $this->pagetitle . ' - ' . $this->base_title[0] . ' - ' . $this->base_title[1] . '</title>'. PHP_EOL .
 
          '    <link rel="stylesheet" href="styles/general.css" type="text/css" media="screen" charset="utf-8" />'.  PHP_EOL .
 
	  '    <link rel="stylesheet" type="text/css" media="print" href="styles/print.css" />'. PHP_EOL .
 
          '    <!--[if IE]>'. PHP_EOL .
 
          '      <link rel="stylesheet" type="text/css" media="screen" charset="utf-8" href="styles/ie.css" />'. PHP_EOL .
 
          '    <![endif]-->'. PHP_EOL .
 
          '    <link rel="shortcut icon" href="images/favicon.png" />'. PHP_EOL
input.php
Show inline comments
 
@@ -108,13 +108,13 @@ elseif (!empty($_REQUEST['e']))
 
/*
 
 * We cannot initialize the page object nor guess the school before
 
 * figuring loading a saved schedule because we'll default to that
 
 * saved_schedule's school/semester.
 
 */
 
$scripts = array('jQuery', 'jQueryUI', 'qTip2', 'schedInput');
 
$inputPage = page::page_create('Scheduler', $scripts, $inputPage_options);
 
$inputPage = page::page_create('Enter Courses', $scripts, $inputPage_options);
 
$school = $inputPage->get_school();
 
$semester = $inputPage->semester_get();
 

	
 
$my_hc = 'var slate_permutate_example_course_id = ' . json_encode(school_example_course_id($school)) . ';
 

	
 
jQuery(document).ready(
 
@@ -178,19 +178,19 @@ if ($qtips_always || !isset($_SESSION['s
 
if ($school['id'] != 'default'
 
    && empty($_REQUEST['selectschool'])
 
    && empty($_REQUEST['selectsemester']))
 
  {
 
    /*
 
     * If we have chosen a school, set the canonical URL so that it
 
     * contains the school and semester.
 
     * contains the school and, optionall, the specified
 
     * schedule. This way, when Google caches the input.php page, the
 
     * <title/> it sees will reflect the selected school.
 
     */
 
    $query = array('school' => $school['id']);
 
    if ($sch)
 
      $query['s'] = $sch->id_get();
 
    if (!empty($semester))
 
      $query['semester'] = $semester['id'];
 
    $inputPage->canonize('input.php', $query);
 
  }
 

	
 
$inputPage->head();
 

	
 
/*
0 comments (0 inline, 0 general)