Пример #1
0
         if (!in_array($_GET['forum'], $legalForumValues)) {
             eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=forum&message=" . urlencode(_UNPRIVILEGEDATTEMPT) . "&message_type=failure");
         }
     }
 }
 if (isset($_GET['topic']) && !in_array($_GET['topic'], $legalTopicValues)) {
     eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=forum&message=" . urlencode(_UNPRIVILEGEDATTEMPT) . "&message_type=failure");
 }
 if (isset($_GET['topic_id']) && !in_array($_GET['topic_id'], $legalTopicValues)) {
     eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=forum&message=" . urlencode(_UNPRIVILEGEDATTEMPT) . "&message_type=failure");
 }
 //Get forum configuration values
 $forum_config = eF_getTableDataFlat("f_configuration", "*");
 sizeof($forum_config) > 0 ? $forum_config = array_combine($forum_config['name'], $forum_config['value']) : ($forum_config = array());
 $smarty->assign("T_FORUM_CONFIG", $forum_config);
 $user_type = eF_getUserBasicType($_SESSION['s_login']);
 $smarty->assign("T_USER", $user_type);
 if ($_GET['type'] == 'forum' && isset($_GET['delete']) && in_array($_GET['delete'], $legalForumValues)) {
     try {
         $forum = new f_forums($_GET['delete']);
         $forum->delete();
     } catch (Exception $e) {
         header("HTTP/1.0 500 ");
         echo rawurlencode($e->getMessage()) . ' (' . $e->getCode() . ')';
     }
     exit;
 } else {
     if ($_GET['type'] == 'topic' && isset($_GET['delete']) && in_array($_GET['delete'], $legalTopicValues)) {
         try {
             $topic = new f_topics($_GET['delete']);
             $topic->delete();
Пример #2
0
     $stripedContent = EfrontSearch::resultsTextLimit(preg_replace("#<script.*?>.*?</script>#", "", $res1[0]['data']), $cr, 'resultsText');
     if (strcmp($stripedContent, "...") == 0) {
         $stripedContent = _SEARCHTEXTWASINSCRIPT;
     }
     $tmp_data = array('id' => $res1[0]['id'], 'name' => EfrontSearch::highlightText($res1[0]['name'], $cr, 'resultsTitleBold'), 'table_name' => $results[$i]['table_name'], 'lessons_ID' => $res1[0]['lessons_ID'], 'lesson_name' => EfrontSearch::highlightText($lesson[0]['name'], $cr, 'resultsTitleBold'), 'ctg_type' => $res1[0]['ctg_type'], 'content' => $stripedContent, 'score' => $results[$i]['score'] * 100, 'type' => $type_str, 'user_type' => $basic_user_type, 'position' => $position_str);
     $search_results_data[] = $tmp_data;
     if ($res1[0]['lessons_ID'] != $_SESSION['s_lessons_ID']) {
         $search_results_lessons[$res1[0]['lessons_ID']][] = $tmp_data;
         $lesson_names[$res1[0]['lessons_ID']]['name'] = $lesson[0]['name'];
     } else {
         $search_results_current_lesson[$res1[0]['lessons_ID']][] = $tmp_data;
         $current_lesson_name = $lesson[0]['name'];
     }
 } else {
     if ($results[$i]['table_name'] == "questions" && $_SESSION['s_type'] == 'professor') {
         $basic_user_type = eF_getUserBasicType(false, $res1[0]['lessons_ID']);
         $stripedContent = EfrontSearch::resultsTextLimit(preg_replace("#<script.*?>.*?</script>#", "", $res1[0]['name']), $cr, 'resultsText');
         if (strcmp($stripedContent, "...") == 0) {
             $stripedContent = _SEARCHTEXTWASINSCRIPT;
         }
         $tmp_data = array('id' => $res1[0]['id'], 'name' => EfrontSearch::highlightText($res1[0]['name'], $cr, 'resultsTitleBold'), 'table_name' => $results[$i]['table_name'], 'lessons_ID' => $res1[0]['lessons_ID'], 'lesson_name' => EfrontSearch::highlightText($lesson[0]['name'], $cr, 'resultsTitleBold'), 'question_type' => $res1[0]['type'], 'content' => $stripedContent, 'score' => $results[$i]['score'] * 100, 'type' => $type_str, 'user_type' => $basic_user_type, 'position' => $position_str);
         $search_results_data[] = $tmp_data;
         if ($res1[0]['lessons_ID'] != $_SESSION['s_lessons_ID']) {
             $search_results_lessons[$res1[0]['lessons_ID']][] = $tmp_data;
             $lesson_names[$res1[0]['lessons_ID']]['name'] = $lesson[0]['name'];
         } else {
             $search_results_current_lesson[$res1[0]['lessons_ID']][] = $tmp_data;
             $current_lesson_name = $lesson[0]['name'];
         }
     }
 }