function writeTable($qualifier, $get_assoc_subs = 1, $print_display = 0) { global $tel_prefix; global $mod_rewrite; // sanitize submission $selected = scrubData($qualifier); switch ($qualifier) { case "Faculty Profiles": $q = "select lname, fname, title, tel, email, staff_id, ptags\n\t\t\tFROM staff\n\t\t\tWHERE active = 1\n AND ptags like '%librarian%'\n\t\t\torder by lname, fname"; $r = $db->query($q); $items = "<table width=\"98%\" class=\"item_listing\">"; $row_count = 0; $colour1 = "oddrow"; $colour2 = "evenrow"; $current_dept = ""; foreach ($r as $myrow) { $row_colour = $row_count % 2 ? $colour1 : $colour2; $lname = $myrow["0"]; $fname = $myrow["1"]; $title = $myrow["2"]; $tel = $myrow["3"]; $email = $myrow["4"]; $name_id = explode("@", $email); $staff_id = $myrow["5"]; $ptags = $myrow["6"]; if ($get_assoc_subs == 1) { // Grab our subjects, if any $assoc_subjects = self::getAssocSubjects($staff_id, $ptags); } else { $assoc_subjects = ""; } if ($mod_rewrite == 1) { $link_to_details = "staff/" . $name_id[0]; } else { $link_to_details = "staff_details.php?name=" . $name_id[0]; } $items .= "<tr class=\"{$row_colour}\">\n\t\t<td style=\"width: 20%\" align=\"left\" class=\"{$row_colour}\"><span class=\"staff_contact\">"; if ($print_display != 1) { $items .= "<a href=\"{$link_to_details}\">{$lname}, {$fname}</a>"; } else { $items .= "{$lname}, {$fname}"; } $items .= "</span></td>\n\t\t\t<td style=\"width: 40%\" align=\"left\" class=\"{$row_colour}\">{$title} {$assoc_subjects}</td>\n\t\t\t<td align=\"left\" class=\"{$row_colour}\">{$tel_prefix}{$tel} </td>\n\t\t\t<td class=\"{$row_colour}\"><a href=\"mailto:{$email}\">{$email}</a></td></tr>"; $row_count++; } $items .= "</table>"; break; case "By Department": $q = "select distinct d.department_sort, staff.staff_sort, name, lname, fname, title, staff.tel, staff.email, d.department_id, d.telephone, staff.staff_id, staff.ptags\n\t\t\tFROM department d, staff\n\t\t\tWHERE d.department_id = staff.department_id\n\t\t\tAND user_type_id = '1'\n AND active = 1\n\t\t\torder by department_sort, d.name, staff_sort desc, lname"; $db = new Querier(); $r = $db->query($q); $items = "<table class=\"footable foo2\"><thead><tr><th data-sort-ignore=\"true\"> </th><th data-sort-ignore=\"true\"> </th><th data-sort-ignore=\"true\" data-hide=\"phone,mid\"> </th><th data-sort-ignore=\"true\" data-hide=\"phone\"> </th><th data-hide=\"phone,mid\" data-sort-ignore=\"true\"> </th></tr></thead>"; $row_count = 0; $colour1 = "oddrow"; $colour2 = "evenrow"; $current_dept = ""; foreach ($r as $myrow) { $row_colour = $row_count % 2 ? $colour1 : $colour2; $dept_name = $myrow["2"]; $lname = $myrow["3"]; $fname = $myrow["4"]; $title = $myrow["5"]; $tel = $myrow["6"]; $email = $myrow["7"]; $dept_id = $myrow["8"]; $dept_tel = $myrow["9"]; $name_id = explode("@", $email); $staff_id = $myrow["10"]; $ptags = $myrow["11"]; if ($get_assoc_subs == 1) { // Grab our subjects, if any $assoc_subjects = self::getAssocSubjects($staff_id, $ptags); } else { $assoc_subjects = ""; } // end subject listing if ($mod_rewrite == 1) { $link_to_details = "staff/" . $name_id[0]; } else { $link_to_details = "staff_details.php?name=" . $name_id[0]; } if ($current_dept != $dept_id) { $items .= "<tr><td class=\"dept_label\" colspan=\"5\"><a name=\"{$dept_id}\"></a><h2 class=\"dept_header\">{$dept_name} " . $tel_prefix . $dept_tel . "</h2></td></tr>"; } $items .= "<tr class=\"{$row_colour}\">\n <td class=\"{$row_colour} staffpic\">"; // Here we stick in their headshot; comment out if you don't want; maybe later this should be an admin parameter $items .= getHeadshot($email, 'medium'); $items .= "</td>\n\t\t <td class=\"{$row_colour}\"><span class=\"staff_contact\">"; if ($print_display != 1) { $items .= "<a href=\"{$link_to_details}\">{$lname}, {$fname}</a>"; } else { $items .= "{$lname}, {$fname}"; } $items .= "</span></td>\n \t\t\t<td class=\"{$row_colour}\">{$title} {$assoc_subjects}</td>\n \t\t\t<td class=\"{$row_colour}\">{$tel_prefix}{$tel} </td>\n \t\t\t<td class=\"{$row_colour}\"><a href=\"mailto:{$email}\">{$email}</a></td></tr>"; $row_count++; $current_dept = $dept_id; } $items .= "</table>"; break; case "Subject Librarians A-Z": $q = "select distinct lname, fname, title, tel, email, staff.staff_id\n from staff, staff_subject ss, subject su\n where staff.staff_id = ss.staff_id\n AND ss.subject_id = su.subject_id\n AND staff.active = 1\n AND type = 'Subject'\n AND su.active = '1'\n AND user_type_id = '1'\n AND shortform != 'NewDatabases'\n order by lname, fname"; $db = new Querier(); $r = $db->query($q); $items = "<table class=\"footable foo3\" width=\"100%\">\n <thead><tr class=\"staff-heading\"><th data-sort-ignore=\"true\"> </th><th><strong>" . _("Librarian") . "</strong></th><th data-hide=\"phone,mid\" data-sort-ignore=\"true\"><strong>" . _("Subject Responsibilities") . "</strong></th></tr></thead>"; $row_count = 0; $colour1 = "oddrow"; $colour2 = "evenrow"; foreach ($r as $myrow) { $row_colour = $row_count % 2 ? $colour1 : $colour2; $items .= "<tr class=\"{$row_colour}\">\n"; $items .= showStaff($myrow[4], '', '', 1); $items .= "<td>"; $sub_query = "select subject, shortform from subject, staff_subject\n WHERE subject.subject_id = staff_subject.subject_id\n AND staff_id = '{$myrow['5']}'\n AND type = 'Subject'\n AND active = '1'\n AND shortform != 'NewDatabases'\n ORDER BY subject"; /* Select all active records (this is based on a db connection made above) */ $sub_result = $db->query($sub_query); $num_rows = count($sub_result) - 1; // Loop through all items, sticking commas in between $subrowcount = 0; foreach ($sub_result as $subrow) { if ($mod_rewrite == 1) { $linky = $subrow[1]; } else { $linky = "guide.php?subject=" . $subrow[1]; } $items .= "<a href=\"{$linky}\">{$subrow['0']}</a>"; if ($subrowcount < $num_rows) { $items .= ", "; } $subrowcount++; } $items .= "</td>\n\n\t\t\t\t\t</tr>"; $row_count++; } $items .= "</table>"; break; case "Librarians by Subject Specialty": $q = "select lname, fname, title, tel, email, subject, staff.staff_id, shortform from\n staff, staff_subject, subject\n\t\t\twhere staff.staff_id = staff_subject.staff_id\n\t\t\tAND staff_subject.subject_id = subject.subject_id\n\t\t\tAND type = 'Subject'\n AND staff.active = 1\n AND subject.active = 1\n AND shortform != 'NewDatabases'\n\t\t\torder by subject, lname, fname"; $head_fields = array("Subject", "Library Liaison", "Phone", "Email"); $db = new Querier(); $r = $db->query($q); $items = prepareTH($head_fields); $row_count = 0; $colour1 = "oddrow"; $colour2 = "evenrow"; $subrowsubject = ""; foreach ($r as $myrow) { $full_name = $myrow["lname"] . ", " . $myrow["fname"]; $title = $myrow["title"]; $tel = $tel_prefix . $myrow["tel"]; $email = $myrow["email"]; $name_id = explode("@", $email); if ($subrowsubject == $myrow["subject"]) { //$psubject = " "; $psubject = $myrow["subject"]; $row_count--; } else { $subrowsubject = $myrow["subject"]; $psubject = $myrow["subject"]; $shortsub = $myrow["shortform"]; } $row_colour = $row_count % 2 ? $colour1 : $colour2; $items .= "<tr class=\"{$row_colour}\">\n\n\t\t\t\t\t<td>"; if ($mod_rewrite == 1) { $linky = $shortsub; } else { $linky = "guide.php?subject=" . $shortsub; } $items .= "<a href=\"{$linky}\">{$psubject}</a>"; $items .= "</td>\n"; $items .= "<td>"; if ($mod_rewrite == 1) { $linky = "staff_details.php?name=" . $name_id[0]; } else { $linky = "staff_details.php?name=" . $name_id[0]; } $items .= "<a href=\"{$linky}\">{$full_name}</a></td>"; $items .= "<td>"; $items .= $tel; $items .= "</td>\n"; $items .= "<td>"; $items .= "<a href=\"mailto:{$email}\">{$email}</a>"; $items .= "</td>\n\n\t\t\t\t\t</tr>"; $row_count++; } $items .= "</table>"; break; case "A-Z": default: $q = "SELECT s.staff_id, lname, fname, title, tel, s.email, name, ptags\n\t\t\tFROM staff s\n\t\t\tLEFT JOIN department d on s.department_id = d.department_id\n\t\t\tWHERE user_type_id = '1'\n AND active = 1\n\t\t\tORDER BY s.lname, s.fname"; $hf1 = array("label" => "Name", "hide" => false, "nosort" => false); $hf2 = array("label" => "Title", "hide" => true, "nosort" => false); $hf3 = array("label" => "Phone", "hide" => false, "nosort" => true); $hf4 = array("label" => "Email", "hide" => true, "nosort" => true); $head_fields = array($hf1, $hf2, $hf3, $hf4); $db = new Querier(); $r = $db->query($q, PDO::FETCH_ASSOC); $items = prepareTHUM($head_fields); $row_count = 0; $colour1 = "oddrow"; $colour2 = "evenrow"; foreach ($r as $myrow) { $row_colour = $row_count % 2 ? $colour1 : $colour2; $staff_id = $myrow["staff_id"]; $full_name = $myrow["lname"] . ", " . $myrow["fname"]; $title = $myrow["title"]; $tel = $tel_prefix . $myrow["tel"]; $email = $myrow["email"]; $name_id = explode("@", $email); $department = $myrow["name"]; $ptags = $myrow["ptags"]; if ($get_assoc_subs == 1) { // Grab our subjects, if any $assoc_subjects = self::getAssocSubjects($staff_id, $ptags); } else { $assoc_subjects = ""; } if ($mod_rewrite == 1) { $link_to_details = "staff/" . $name_id[0]; } else { $link_to_details = "staff_details.php?name=" . $name_id[0]; } //$headshot = getHeadshot($email, "medium"); $items .= "\n\t\t<tr class=\"zebra {$row_colour}\">\n\t\t\t<td class=\"staff-name-row\">"; if ($print_display != 1) { $items .= "<a href=\"{$link_to_details}\" class=\"no_link\">{$full_name}</a>"; } else { $items .= "{$full_name}"; } $items .= "</td>\n\t\t\t<td class=\"staff-title-row\">{$title} {$assoc_subjects}</td>\n\t\t\t<td class=\"staff-tel-row\">{$tel} </td>\n\t\t\t<td class=\"staff-email-row\"><a href=\"mailto:{$email}\">{$email}</a></td>\n\t\t</tr>"; $row_count++; } $items .= "</table>"; break; } return $items; }
public function displayNav() { global $AssetPath; global $CpanelPath; global $subcat; global $is_um; $headshot = getHeadshot($_SESSION["email"], "smaller", ""); $headshot_lg = getHeadshot($_SESSION["email"], "", ""); $staff_page = $CpanelPath . "admin/profile.php"; if ($_SESSION["fname"]) { $name = $_SESSION["fname"]; } else { $name = $_SESSION["email"]; } print "\n <ul id=\"topnav\">\n <li id=\"logospot\"><a href=\"{$CpanelPath}" . "index.php\"><img src=\"{$AssetPath}" . "images/admin/logo_v3_full.png\" /></a>\n <div>{$headshot_lg}\n <p> Hi {$name} </p>\n <br style=\"clear: both\" />\n <ul>\n <li><a href=\"{$staff_page}\">" . _("Edit Your Profile") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "logout.php\">" . _("Log Out") . "</a></li>\n </ul>\n </div>\n </li>\n "; /////////////// // RECORDS // records and guides use same authentication credential /////////////// if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) { print "\n\t <li"; if ($subcat == "records") { print " class=\"selected\""; } print "><a href=\"{$CpanelPath}" . "records/\">" . _("Records") . "</a>\n <div>\n <ul>\n <li><a href=\"{$CpanelPath}" . "records/record.php\">" . _("New Record") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "records/index.php\">" . _("Browse Items") . "</a></li>\n </ul>\n\t\t </div></li>"; /////////////// // GUIDES ////////////// print "<li"; if ($subcat == "guides") { print " class=\"selected\""; } print "><a href=\"{$CpanelPath}" . "guides/\">" . _("Guides") . "</a>\n <div>\n <ul>\n <li><a href=\"{$CpanelPath}" . "guides/metadata.php\">" . _("New Guide") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/\">" . _("Browse Guides") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/manage.php\">" . _("Manage Files") . "</a></li>\n <!--<li><a href=\"{$CpanelPath}" . "guides/delish_url.php\">" . _("Delicious Builder") . "</a></li>-->\n <li><a href=\"{$CpanelPath}" . "guides/link_checker.php\">" . _("Link Checker") . "</a></li>\n </ul>\n </div></li>"; } ////////// // FAQs ////////// if (isset($_SESSION["faq"]) && $_SESSION["faq"] == 1) { print "\n <li"; if ($subcat == "faq") { print " class=\"selected\""; } print "><a href=\"{$CpanelPath}" . "faq/\">" . _("FAQs") . "</a>\n <div>\n <ul>\n <li><a href=\"{$CpanelPath}" . "faq/faq.php\">" . _("New FAQ") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=subject\">" . _("Browse by Subject") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=holding\">" . _("Browse by Collection") . "</a></li>\n </ul>\n </div>\n </li>"; } // TalkBack tab if (isset($_SESSION["talkback"]) && $_SESSION["talkback"] == 1) { print "\n\t<li"; if ($subcat == "talkback") { print " class=\"selected\""; } print "><a href=\"{$CpanelPath}" . "talkback/\">" . _("TalkBack") . "</a></li>"; } // Videos tab if (isset($_SESSION["videos"]) && $_SESSION["videos"] == 1) { print "\n <li><a href=\"{$CpanelPath}" . "videos/\""; if ($subcat == "videos") { print " class=\"selected\""; } print ">" . _("Videos") . "</a>\n <div>\n <ul>\n <li><a href=\"{$CpanelPath}" . "videos/\">" . _("List Current") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "videos/ingest.php\">" . _("Find/Ingest") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "videos/video.php\">" . _("Manually Enter") . "</a></li>\n </ul>\n </div></li>"; } // Stats tab if ($is_um == TRUE) { if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) { print "\n <li><a href=\"{$CpanelPath}" . "stats/\""; if ($subcat == "stats") { print " class=\"selected\""; } print ">" . _("Stats") . "</a>\n <div>\n <ul>\n <li><a href=\"{$CpanelPath}" . "stats/\">" . _("Overview") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "stats/ref_stats.php\">" . _("Add Transaction") . "</a></li>\n </ul>\n </div></li>"; } } // Admin tab if (isset($_SESSION["admin"]) && $_SESSION["admin"] == 1) { print "\n\t<li"; if ($subcat == "admin") { print " class=\"selected\""; } print "><a href=\"{$CpanelPath}" . "admin/\">" . _("Admin") . "</a>\n <div>\n \t\t<ul>\n \t\t\t<li><a href=\"{$CpanelPath}" . "admin/user.php\">" . _("Add New User") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "admin/user.php?browse\">" . _("Manage Users") . "</a></li>\n \t\t\t<li><a href=\"{$CpanelPath}" . "admin/manage_guides.php\">" . _("Manage Guides") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "admin/guide_collections.php\">" . _("Guide Collections") . "</a></li>\n \t\t\t<li><a href=\"{$CpanelPath}" . "admin/departments.php\">" . _("Departments") . "</a></li>\n \t\t\t<li><a href=\"{$CpanelPath}" . "admin/sources.php\">" . _("Sources") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "admin/faq_collections.php\">" . _("FAQ Collections") . "</a></li>\n \t\t\t<li><a href=\"{$CpanelPath}" . "edit-config.php\">" . _("Config Site") . "</a></li>\n \t\t</ul>\n </div>\n\t </li>"; } // determine our default search/search box text switch ($subcat) { case "records": $input_text = _("Search records"); $target_url = "record.php?record_id="; break; case "guides": $input_text = _("Search guides"); $target_url = "../guides/guide.php?subject_id="; break; case "faq": $input_text = _("Search faqs"); $target_url = "faq.php?faq_id="; break; case "home": $input_text = _("Search all"); $target_url = "../control/guides/guide.php?subject_id="; break; case "talkback": $input_text = _("Search talkback"); $target_url = "talkback.php?talkback_id="; break; case "admin": $input_text = _("Search users"); $target_url = "user.php?staff_id="; break; default: $input_text = _("Search all"); $target_url = "guide.php?subject_id="; break; } print "\n <li class=\"nohover\">"; $input_box = new CompleteMe("sp_search", $CpanelPath . "search.php", $target_url, $input_text, $subcat, "", "private"); $input_box->displayBox(); print "\n </li>"; }
public function displayNav() { global $AssetPath; global $CpanelPath; global $subcat; $headshot = getHeadshot($_SESSION["email"], "smaller"); print "\n\t<div class=\"float-left\" id=\"logo\"><a href=\"{$CpanelPath}" . "index.php\"><img src=\"{$AssetPath}" . "images/admin/logo_small.png\" border=\"0\" class=\"logo\" alt=\"SubjectsPlus\" /></a></div>\n <div id=\"navcats\">\n <ul class=\"topnav\">"; // Records tab, Guides Tab if (isset($_SESSION["records"]) && $_SESSION["records"] == 1) { // Actually, someone with the NOFUN permission can't view records if (!isset($_SESSION["NOFUN"])) { print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "records/\""; if ($subcat == "records") { print " class=\"selected\""; } print ">" . _("Records") . "</a>\n <ul class=\"subnav\">\n <li><a href=\"{$CpanelPath}" . "records/record.php\">" . _("New Record") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "records/index.php\">" . _("Browse Items") . "</a></li>\n </ul>\n\t\t</li>"; } /////////////// // GUIDES ////////////// print "<li class=\"zoom\"><a href=\"{$CpanelPath}" . "guides/\""; if ($subcat == "guides") { print " class=\"selected\""; } print ">" . _("Guides") . "</a>\n <ul class=\"subnav\">\n <li><a href=\"{$CpanelPath}" . "guides/metadata.php\">" . _("New Guide") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/\">" . _("Browse Guides") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/manage.php\">" . _("Manage Files") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/delish_url.php\">" . _("Delicious Builder") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "guides/link_checker.php\">" . _("Link Checker") . "</a></li>\n </ul>\n</li>"; } // FAQ tab if (isset($_SESSION["faq"]) && $_SESSION["faq"] == 1) { print "\n <li class=\"zoom\"><a href=\"{$CpanelPath}" . "faq/\""; if ($subcat == "faq") { print " class=\"selected\""; } print ">FAQs</a>\n <ul class=\"subnav\">\n <li><a href=\"{$CpanelPath}" . "faq/faq.php\">" . _("New FAQ") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=subject\">" . _("Browse by Subject") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "faq/browse_faq.php?type=holding\">" . _("Browse by Collection") . "</a></li>\n </ul>\n\n </li>"; } // TalkBack tab if (isset($_SESSION["talkback"]) && $_SESSION["talkback"] == 1) { print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "talkback/\""; if ($subcat == "talkback") { print " class=\"selected\""; } print ">TalkBack</a></li>"; } // Videos tab if (isset($_SESSION["videos"]) && $_SESSION["videos"] == 1) { print "\n <li class=\"zoom\"><a href=\"{$CpanelPath}" . "videos/\""; if ($subcat == "videos") { print " class=\"selected\""; } print ">Videos</a>\n <ul class=\"subnav\">\n <li><a href=\"{$CpanelPath}" . "videos/\">" . _("List Current") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "videos/ingest.php\">" . _("Find/Ingest") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "videos/video.php\">" . _("Manually Enter") . "</a></li>\n </ul>\n </li>"; } // Admin tab if (isset($_SESSION["admin"]) && $_SESSION["admin"] == 1) { print "\n\t<li class=\"zoom\"><a href=\"{$CpanelPath}" . "admin/\""; if ($subcat == "admin") { print " class=\"selected\""; } print ">" . _("Admin") . "</a>\n\t\t<ul class=\"subnav\">\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/user.php\">" . _("Add New User") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "admin/user.php?browse\">" . _("Manage Users") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/manage_guides.php\">" . _("Manage Guides") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/departments.php\">" . _("Departments") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "admin/sources.php\">" . _("Sources") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "admin/faq_collections.php\">" . _("FAQ Collections") . "</a></li>\n\t\t\t<li><a href=\"{$CpanelPath}" . "edit-config.php\">" . _("Config Site") . "</a></li>\n\t\t</ul>\n\n\t</li>"; } print "</ul>\n\t\t</div>\n <div class=\"right-nav-container\">\n <div id=\"supersearch\">"; // determine our default search/search box text switch ($subcat) { case "records": $input_text = _("Search records"); $target_url = "record.php?record_id="; break; case "guides": $input_text = _("Search guides"); $target_url = "guide.php?subject_id="; break; case "faq": $input_text = _("Search faqs"); $target_url = "faq.php?faq_id="; break; case "talkback": $input_text = _("Search talkback"); $target_url = "talkback.php?talkback_id="; break; case "admin": $input_text = _("Search users"); $target_url = "user.php?staff_id="; break; default: $input_text = _("Search all"); $target_url = "guide.php?subject_id="; break; } // don't show to the NOFUN crowd if (!isset($_SESSION["NOFUN"])) { $input_box = new CompleteMe("quick_search", $CpanelPath . "search.php", $target_url, $input_text, $subcat, "", "private"); $input_box->displayBox(); } print "</div>\n <div id=\"user\">\n <ul class=\"topnav\">\n <li class=\"zoom\"><a>"; print $headshot; print _("Hi") . ", " . $_SESSION["fname"]; print "</a>\n <ul class=\"subnav\">\n <li><a href=\"#\">" . _("View My Profile") . "</a></li>\n <li><a href=\"{$CpanelPath}" . "logout.php\">" . _("Logout") . "</a></li>\n </ul>\n </li>\n </ul>\n </div>\n </div>\n"; }
$results = ""; foreach ($our_result as $myrow) { $talkback_id = $myrow["0"]; $question = $myrow["1"]; $answer = $myrow["5"]; $answer = preg_replace('/<\\/?div.*?>/ ', '', $answer); $answer = tokenizeText($answer); // $answer = stripslashes(htmlspecialchars_decode($myrow["5"])); Louisa's proposed fix for messy answer @todo $keywords = $myrow["3"]; $responder_email = $myrow["9"]; // Let's link back to the staff page $name_id = explode("@", $responder_email); $lib_page = "staff_details.php?name=" . $name_id[0]; $results .= "\n\t\t<div class=\"tellus_item oddrow\">\n\n\t\t<a name=\"{$talkback_id}\"></a>\n\n\t\t<p class=\"tellus_comment\"><span class=\"comment_num\">{$row_count}</span> <strong>{$question}</strong><br />\n\t\t<span style=\"clear: both;font-size: 11px;\">Comment from {$myrow['2']} on <em>{$myrow['4']}</em></span></p><br />\n\n\t\t<p>"; if ($show_talkback_face == 1) { $results .= getHeadshot($myrow[9]); } $results .= $answer; $results .= "<p style=\"clear: both;font-size: 11px;\">Answered by <a href=\"{$lib_page}\">{$myrow['7']} {$myrow['8']}</a>, {$myrow['10']}</p></div>\n"; // Add 1 to the row count, for the "even/odd" row striping $row_count++; } } else { $results = "<p>" . _("There are no comments just yet. Be the first!") . "</p>"; $no_results = TRUE; } /////////////////// // Incomplete Comment submission /////////////////// if (isset($_POST['skill']) and $_POST['skill'] != $stk_answer) { $stk_message = "\n\t<div class=\"talkback-message talkback-error\">\n\n\t<h2>" . _("Hmm, That Was a Tricky Bit of Math") . "</h2>\n\n\t<div class=\"talkback-message-body\">\n\n\t<p>" . _("Sorry, you must answer the Skill Testing Question correctly. It's an anti-spam measure . . . .") . "</p>\n\t</div>\n\n\t</div>\n\n\t";
function showStaff($email, $picture = 1, $pic_size = "medium", $link_name = 0) { global $tel_prefix; global $mod_rewrite; $q = "SELECT fname, lname, title, tel, email FROM staff WHERE email = '{$email}'"; $db = new Querier(); $r = $db->query($q); $row_count = count($r); if ($row_count == 0) { return; } foreach ($r as $myrow) { if ($link_name == 1) { $email = $myrow["email"]; $name_id = explode("@", $email); if ($mod_rewrite == 1) { $linky = "staff_details.php?name=" . $name_id[0]; } else { $linky = "staff_details.php?name=" . $name_id[0]; } $full_name = "<a href=\"{$linky}\">" . $myrow[0] . " " . $myrow[1] . "</a>"; } else { $full_name = $myrow[0] . " " . $myrow[1]; } $staffer = "<td>"; $staffer .= getHeadshot($email, $pic_size); $staffer .= "</td><td><strong>{$full_name}</strong><br />{$myrow['2']}<br />{$tel_prefix}{$myrow['3']}<br /><a href=\"mailto:{$myrow['4']}\">{$myrow['4']}</a></td>"; } return $staffer; }