Minor forum fixes

skala
Julio Montoya 14 years ago
parent 76e4a93994
commit e51ef35ff6
  1. 23
      main/forum/forumqualify.php
  2. 12
      main/forum/reply.php
  3. 2
      main/forum/viewpost.inc.php
  4. 4
      main/forum/viewthread_flat.inc.php

@ -26,23 +26,20 @@ if (isset($_GET['origin'])) {
}
// including additional library scripts
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//require_once (api_get_path(LIBRARY_PATH).'resourcelinker.lib.php');
$nameTools=get_lang('ToolForum');
/*
Including necessary files
*/
/* Including necessary files */
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
$(document).ready(function(){ $(\'.hide-me\').slideUp() });
function hidecontent(content){ $(content).slideToggle(\'normal\'); }
</script>';
/*
MAIN DISPLAY SECTION
*/
/* MAIN DISPLAY SECTION */
/*
Retrieving forum and forum categorie information
*/
@ -53,10 +50,9 @@ $current_thread=get_thread_information($_GET['thread']); // note: this has to be
$current_forum=get_forum_information($current_thread['forum_id']); // note: this has to be validated that it is an existing forum.
$current_forum_category=get_forumcategory_information($current_forum['forum_category']);
$whatsnew_post_info=$_SESSION['whatsnew_post_info'];
/*
-----------------------------------------------------------
Header and Breadcrumbs
-----------------------------------------------------------
*/
if (isset($_SESSION['gradebook'])){
$gradebook= $_SESSION['gradebook'];
@ -219,7 +215,7 @@ if ($message<>'PostDeletedSpecial') {// in this case the first and only post of
echo '<span>'.prepare4display($current_thread['thread_comment']).'</span>';
echo "</table>";
include_once('viewpost.inc.php');
include_once 'viewpost.inc.php';
} // if ($message<>'PostDeletedSpecial') // in this case the first and only post of the thread is removed
@ -247,6 +243,7 @@ if ($allowed_to_edit) {
$return_message = get_lang('QualificationCanNotBeGreaterThanMaxScore');
Display :: display_error_message($return_message,false);
}
// show qualifications history
$user_id_thread = (int)$_GET['user_id'];
$opt=Database::escape_string($_GET['type']);
@ -292,9 +289,7 @@ if ($allowed_to_edit) {
api_not_allowed();
}
/*
FOOTER
*/
/* FOOTER */
if ($origin!='learnpath') {
Display :: display_footer();
}

@ -47,7 +47,6 @@ require_once 'forumfunction.inc.php';
// javascript
$htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
@ -106,12 +105,13 @@ if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Reso
$_SESSION['origin'] = $_SERVER['REQUEST_URI'];
$_SESSION['breadcrumbs'] = $interbreadcrumb;
header('Location: ../resourcelinker/resourcelinker.php');
exit;
}
/* Header */
if ($origin == 'learnpath') {
include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
include api_get_path(INCLUDE_PATH).'reduced_header.inc.php';
} else {
// The last element of the breadcrumb navigation is already set in interbreadcrumb, so give an empty string.
Display :: display_header('');
@ -164,17 +164,17 @@ if ($origin != 'learnpath') {
/* Display Forum Category and the Forum information */
echo "<table class=\"data_table\" width=\"100%\">\n";
echo "<table class=\"data_table\" width=\"100%\">";
// The forum category
echo "\t<tr>\n\t\t<th style=\"padding-left:5px;\" align=\"left\" colspan=\"2\">";
echo "<tr><th style=\"padding-left:5px;\" align=\"left\" colspan=\"2\">";
echo '<span class="forum_title">'.prepare4display($current_thread['thread_title']).'</span><br />';
if (!empty ($current_forum_category['cat_title'])) {
echo '<span class="forum_low_description">'.prepare4display($current_forum_category['cat_title'])." - </span>";
}
echo "</th>\n";
echo "\t</tr>\n";
echo "</th>";
echo "</tr>";
echo '</table>';
// The form for the reply

@ -101,6 +101,8 @@ if (isset($_POST['idtextqualify'])) {
}
$result = get_statistical_information($current_thread['thread_id'], $_GET['user_id'], $_GET['cidReq']);
if($userinf['status']!='1') {
echo '<div class="forum-qualification-input-box">';
require_once 'forumbody.inc.php';

@ -83,11 +83,11 @@ if (isset($current_thread['thread_id'])){
if( isset($_GET['gradebook'])){
if ($increment>0 && $user_status!=1 ) {
$info_thread=get_thread_information($clean_thread_id);
echo "<a href=\"forumqualify.php?".api_get_cidreq()."&amp;gidReq=".Security::remove_XSS($_GET['gidReq'])."&amp;forum=".$info_thread['forum_id']."&amp;thread=".$clean_thread_id."&amp;action=list&amp;post=".$row['post_id']."&amp;user=".$row['poster_id']."&amp;user_id=".$row['poster_id']."&amp;origin=".$origin."&amp;idtextqualify=".$current_qualify_thread."&amp;gradebook=".Security::remove_XSS($_GET['gradebook'])."\" >".icon('new_test_small.gif',get_lang('Qualify'))."</a>";
echo "<a href=\"forumqualify.php?".api_get_cidreq()."&amp;gidReq=".Security::remove_XSS($_GET['gidReq'])."&amp;forum=".$info_thread['forum_id']."&amp;thread=".$clean_thread_id."&amp;action=list&amp;post=".$row['post_id']."&amp;user=".$row['poster_id']."&amp;user_id=".$row['poster_id']."&amp;origin=".$origin."&amp;idtextqualify=".$current_qualify_thread."&amp;gradebook=".Security::remove_XSS($_GET['gradebook'])."\" >".Display::return_icon('quiz.gif',get_lang('Qualify'))."</a> ";
}
} else {
if ($increment>0 && $user_status!=1 ) {
echo "<a href=\"forumqualify.php?".api_get_cidreq()."&amp;gidReq=".Security::remove_XSS($_GET['gidReq'])."&amp;forum=".$clean_forum_id."&amp;thread=".$clean_thread_id."&amp;action=list&amp;post=".$row['post_id']."&amp;user=".$row['poster_id']."&amp;user_id=".$row['poster_id']."&amp;origin=".$origin."&amp;idtextqualify=".$current_qualify_thread."\" >".icon('new_test_small.gif',get_lang('Qualify'))."</a>";
echo "<a href=\"forumqualify.php?".api_get_cidreq()."&amp;gidReq=".Security::remove_XSS($_GET['gidReq'])."&amp;forum=".$clean_forum_id."&amp;thread=".$clean_thread_id."&amp;action=list&amp;post=".$row['post_id']."&amp;user=".$row['poster_id']."&amp;user_id=".$row['poster_id']."&amp;origin=".$origin."&amp;idtextqualify=".$current_qualify_thread."\" >".Display::return_icon('new_test_small.gif',get_lang('Qualify'))."</a>";
}
}
}

Loading…
Cancel
Save