function genTalkBacks($tbArray, $show_response = 1) { global $IconPath; $row_count1 = 0; $row_count2 = 0; $colour1 = "evenrow"; $colour2 = "oddrow"; $tb_answer = ""; foreach ($tbArray as $value) { $row_colour = $row_count2 % 2 ? $colour1 : $colour2; if ($value[2]) { $q_from = $value[2]; } else { $q_from = _("Anonymous"); } if (isset($show_response) && $show_response == 0) { $first_div_width = "90%"; $last_mod_tb = ""; } else { $first_div_width = "45%"; $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15))); $last_mod_tb = lastModded("talkback", $value["talkback_id"], 0, 1); } $short_question = Truncate($value["question"], 200); if ($last_mod_tb) { $mod_line = _("--") . $last_mod_tb; } else { $mod_line = ""; } $tb_answer .= "\n <div style=\"clear: both; float: left; padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour}\">\n <div style=\"float: left; width: 32px; max-width: 5%;\"><a class=\"showcustom\" style=\"color: #333;\" href=\"talkback.php?talkback_id={$value['0']}&wintype=pop\"><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i></a></div>\n <div style=\"float: left; width: {$first_div_width};\">\n <strong>Q:</strong> {$short_question} <span style=\"color: #666; font-size: 10px;\">({$q_from}, {$value['date_formatted']})</span>\n </div>"; if (isset($show_response) && $show_response == 1) { $tb_answer .= "<div style=\"float: left; width: 45%; margin-left: 4%;\">\n <strong>A:</strong> {$short_answer} <span style=\"color: #666; font-size: 10px;\">{$mod_line}</span>\n </div>\n "; } $tb_answer .= "</div>"; $row_count2++; } return $tb_answer; }
} else { $limit = ""; } $querierVid = new Querier(); $qVid = "SELECT video_id, title, description, source, foreign_id, duration, date, display, vtags\n\tFROM video\n\tORDER BY video_id DESC\n\t{$limit}"; $vidArray = $querierVid->query($qVid); $row_count1 = 0; $row_count2 = 0; $colour1 = "evenrow"; $colour2 = "oddrow"; $vid_list = ""; if ($vidArray) { foreach ($vidArray as $value) { $row_colour1 = $row_count1 % 2 ? $colour1 : $colour2; $short_title = Truncate($value["title"], 200); $short_desc = stripslashes(htmlspecialchars_decode(TruncByWord($value["description"], 15))); $last_revised_line = lastModded("video", $value[0]); if ($value[7] != "1") { $activity = " <span style=\"color: #666;\">* " . _("unpublished") . "</span>"; } else { $activity = ""; } $vid_list .= "\n <div style=\"clear: both; float: left; padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour1}\">\n <div style=\"pluslet_body\">\n <a class=\"showmedium\" href=\"video.php?video_id={$value['0']}&wintype=pop\"><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i></a>\n <a href=\"" . $VideoPath . "?video_id={$value['0']}\" target=\"_blank\"><i class=\"fa fa-eye fa-lg\" alt=\"" . _("View") . "\"></i></a>\n </div>\n <div style=\"float: left; width: 90%;\">\n {$short_title} <span style=\"color: #666; font-size: 10px;\">({$last_revised_line})</span> {$activity}\n </div>\n </div>"; $row_count1++; } } else { $vid_list = "<p>" . _("No Videos yet. Grab your camera.") . "</p>"; } $ingest_body_text = "<a href=\"ingest.php\">" . _("FIND VIDEOS") . "</a>"; $add_metadata_text = "<a href=\"video.php\">" . _("ENTER VIDEO") . "</a>"; $about_videos_text = "<p><i class=\"fa fa-pencil fa-lg\" alt=\"" . _("Edit") . "\"></i> = " . _("Edit") . "</p>\n <p><i class=\"fa fa-eye fa-lg\" alt=\"" . _("View") . "\"></i> = " . _("View Video on Public Site") . "</p>";
function changeMe($table, $flag, $item_id, $record_title, $staff_id) { $db = new Querier(); global $dbName_SPlus; $record_title = TruncByWord($record_title, 15); // Can be insert, update, delete; only the first creates a new record, so... if ($flag == "insert" || $flag == "delete") { $q = "insert into chchchanges (staff_id, ourtable, record_id, record_title, message)\n values(" . $staff_id . ", \"{$table}\", " . $item_id . ", \"" . $record_title . "\", \"{$flag}\")"; $r = $db->exec($q); if ($r) { return true; } else { return false; } } else { // find out person who made last change to this record $qtest = "SELECT staff_id, chchchanges_id, message\n FROM `chchchanges`\n WHERE record_id = \"{$item_id}\" and ourtable = \"{$table}\" ORDER BY date_added DESC"; $result = $db->query($qtest); // If there are no results, we need to insert a record if (!$result) { $q = "insert into chchchanges (staff_id, ourtable, record_id, record_title, message)\n values(" . $staff_id . ", \"{$table}\", " . $item_id . ", \"" . $record_title . "\", \"{$flag}\")"; $r = $db->exec($q); if ($r) { return true; } else { return false; } } else { // If the editor is the same as last time & it's not the first record, // just update the time; Otherwise, add a new entry to the table if ($result[0] == $staff_id && $result[2] != "insert") { // Editor is same as last guide updater, just update the time $q = "UPDATE chchchanges SET message = 'update', date_added = NOW() WHERE chchchanges_id = " . $result[1]; } else { //Editor is different, add entry to table $q = "insert into chchchanges (staff_id, ourtable, record_id, record_title, message)\n values(" . $staff_id . ", \"{$table}\", " . $item_id . ", \"" . $record_title . "\", \"update\")"; } //print $q; $r = $db->exec($q); if ($r) { return true; } else { return false; } } } }
} else { $limit = "LIMIT 0,10"; } $querierFAQ = new Querier(); $qFAQ = "SELECT faq_id, question, answer, keywords\n\tFROM faq\n\tORDER BY faq_id DESC\n\t{$limit}"; $faqArray = $querierFAQ->query($qFAQ); $row_count1 = 0; $row_count2 = 0; $colour1 = "evenrow"; $colour2 = "oddrow"; $faq_list = ""; if ($faqArray) { foreach ($faqArray as $value) { $row_colour1 = $row_count1 % 2 ? $colour1 : $colour2; $short_question = Truncate($value["question"], 200); $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15))); $last_revised_line = lastModded("faq", $value[0]); // Answered FAQs $faq_list .= "\n <div class=\"striper faq_wrapper {$row_colour1}\">\n <div class=\"faq_tools\">\n <a href=\"faq.php?faq_id={$value['0']}&wintype=pop\" class=\"showmedium-reloader\"><img src=\"{$IconPath}/pencil.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a>\n <a href=\"" . $FAQPath . "?faq_id={$value['0']}\" target=\"_blank\"><img src=\"{$IconPath}/eye.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a>\n </div>\n <div class=\"faq_question\">\n {$short_question} <span class=\"faq-short-question\">({$last_revised_line})</span>\n </div>\n </div>"; $row_count1++; } } else { $faq_list = "<p>" . _("No FAQs yet. Why not dream one up?") . "</p>"; } $faq_body = "<p><strong>{$row_count1} " . _("FAQs visible"); if (!isset($limit) || $limit != "all") { $faq_body .= " (<a href=\"index.php?limit=all\">" . _("See All") . "</a>)"; } $faq_body .= "</strong></p>" . $faq_list; ?> <div class="pure-g">
function genTalkBacks($tbArray, $show_response = 1) { global $IconPath; $row_count1 = 0; $row_count2 = 0; $colour1 = "evenrow"; $colour2 = "oddrow"; $tb_answer = ""; if (!is_array($tbArray)) { return "<strong>" . _("Alas, there are no items with this tag.") . "</strong>"; } foreach ($tbArray as $key => $value) { $tb_tagger = ""; $row_colour = $row_count2 % 2 ? $colour1 : $colour2; if ($value[2]) { $q_from = $value[2]; } else { $q_from = _("Anonymous"); } if ($value["answer"] == '') { $row_colour = "tb_highlight"; } //show tag even if answer is not empty $tb_tagger = "<span class=\"ctag-on\">" . $value["tbtags"] . "</span>"; if (isset($show_response) && $show_response == 0) { $first_div_width = "90%"; $last_mod_tb = ""; } else { $first_div_width = "45%"; $short_answer = stripslashes(htmlspecialchars_decode(TruncByWord($value["answer"], 15))); $last_mod_tb = lastModded("talkback", $value["talkback_id"], 0, 1); } $short_question = Truncate($value["question"], 200); if ($last_mod_tb) { $mod_line = _("--") . $last_mod_tb; } else { $mod_line = ""; } $tb_answer .= "\n <div style=\"clear: both; float: left; padding: 3px 5px; width: 98%;\" class=\"striper {$row_colour}\">\n <div style=\"float: left; width: 32px; max-width: 5%;\"><a class=\"showmedium-reloader\" style=\"color: #333;\" href=\"talkback.php?talkback_id={$value['0']}&wintype=pop\"><img src=\"{$IconPath}/pencil.png\" alt=\"edit\" width=\"16\" height=\"16\" /></a></div>\n <div style=\"float: left; width: {$first_div_width};\">\n {$tb_tagger}<strong>Q:</strong> {$short_question} <span style=\"color: #666; font-size: 10px;\">({$q_from}, {$value['date_formatted']})</span>\n </div>"; if (isset($show_response) && $show_response == 1) { $tb_answer .= "<div style=\"float: left; width: 45%; margin-left: 4%;\">\n <strong>A:</strong> {$short_answer} <span style=\"color: #666; font-size: 10px;\">{$mod_line}</span>\n </div>\n "; } $tb_answer .= "</div>"; $row_count2++; } return $tb_answer; }