http://atutor.ca/atutor/mantis/view.php?id=3032
authorjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 6 Jun 2007 15:41:07 +0000 (15:41 -0000)
committerjoel kronenberg <joel.kronenberg@utoronto.ca>
Wed, 6 Jun 2007 15:41:07 +0000 (15:41 -0000)
docs/forum/new_thread.php
docs/include/html/dropdowns/posts.inc.php
docs/include/html/forum.inc.php
docs/include/lib/forums.inc.php
docs/install/db/atutor_schema.sql
docs/install/db/atutor_upgrade_1.5.4_to_1.5.5.sql [new file with mode: 0644]

index eecff2c..90701d3 100644 (file)
@@ -78,7 +78,7 @@ if (isset($_POST['cancel'])) {
                $sql_subject = $addslashes($_POST['subject']);
                $sql_body    = $addslashes($_POST['body']);
 
-               $sql = "INSERT INTO ".TABLE_PREFIX."forums_threads VALUES (NULL, $_POST[parent_id], $_SESSION[member_id], $_POST[fid], '".addslashes(get_display_name($_SESSION['member_id']))."', '$now', 0, '$sql_subject', '$sql_body', '$now', 0, 0)";
+               $sql = "INSERT INTO ".TABLE_PREFIX."forums_threads VALUES (NULL, $_POST[parent_id], $_SESSION[member_id], $_POST[fid], '$now', 0, '$sql_subject', '$sql_body', '$now', 0, 0)";
                $result = mysql_query($sql, $db);
                $this_id = mysql_insert_id($db);
 
index e9888cf..741ca31 100644 (file)
@@ -24,12 +24,12 @@ ob_start();
 
 $forum_list = get_group_concat('forums_courses', 'forum_id', "course_id={$_SESSION['course_id']}");
 if ($forum_list != 0) {
-       $sql = "SELECT login, subject, post_id, forum_id FROM ".TABLE_PREFIX."forums_threads WHERE parent_id=0 AND forum_id IN ($forum_list) ORDER BY last_comment DESC LIMIT $post_limit";
+       $sql = "SELECT subject, post_id, forum_id, member_id FROM ".TABLE_PREFIX."forums_threads WHERE parent_id=0 AND forum_id IN ($forum_list) ORDER BY last_comment DESC LIMIT $post_limit";
        $result = mysql_query($sql, $db);
 
        if (mysql_num_rows($result) > 0) {
                while ($row = mysql_fetch_assoc($result)) {
-                       echo '&#176; <a href="' . $_base_path.'forum/view.php?fid=' . $row['forum_id'] . SEP . 'pid=' . $row['post_id'] . '" title="' . $row['subject'] . ': ' . $row['login'] . '">' . AT_print($row['subject'], 'forums_threads.subject') . '</a><br />';
+                       echo '&#176; <a href="' . $_base_path.'forum/view.php?fid=' . $row['forum_id'] . SEP . 'pid=' . $row['post_id'] . '" title="' . $row['subject'] . ': ' . htmlspecialchars(get_display_name($row['member_id'])) . '">' . AT_print($row['subject'], 'forums_threads.subject') . '</a><br />';
                }
        } else {
                echo '<em>'._AT('none_found').'</em>';
index 03f00d7..bc04af3 100644 (file)
@@ -29,7 +29,7 @@ $num_pages = ceil($num_threads/$num_per_page);
 $page_string = SEP.'fid='. $fid;
 
 $orders = array('asc' => 'desc', 'desc' => 'asc');
-$cols   = array('subject' => 1, 'num_comments' => 1, 'login' => 1, 'last_comment' => 1);
+$cols   = array('subject' => 1, 'num_comments' => 1, 'last_comment' => 1);
 
 if (isset($_GET['asc'])) {
        $order = 'asc';
@@ -60,10 +60,6 @@ if (!($row = mysql_fetch_assoc($result))) {
                <col  />
                <col class="sort" />
                <col span="3" />
-       <?php elseif($col == 'login'): ?>
-               <col span="2" />
-               <col class="sort" />
-               <col span="2" />
        <?php elseif($col == 'last_comment'): ?>
                <col span="3" />
                <col class="sort" />
@@ -74,7 +70,7 @@ if (!($row = mysql_fetch_assoc($result))) {
 <tr>
        <th scope="col"><a href="forum/index.php?<?php echo $orders[$order]; ?>=subject<?php echo $page_string; ?>"><?php echo _AT('topic'); ?></a></th>
        <th scope="col"><a href="forum/index.php?<?php echo $orders[$order]; ?>=num_comments<?php echo $page_string; ?>"><?php echo _AT('replies'); ?></a></th>
-       <th scope="col"><a href="forum/index.php?<?php echo $orders[$order]; ?>=login<?php echo $page_string; ?>"><?php echo _AT('started_by'); ?></a></th>
+       <th scope="col"><?php echo _AT('started_by'); ?></th>
        <th scope="col"><a href="forum/index.php?<?php echo $orders[$order]; ?>=last_comment<?php echo $page_string; ?>"><?php echo _AT('last_comment'); ?></a></th>
 <?php
        $colspan = 4;
index d851f33..95c85c1 100644 (file)
@@ -252,7 +252,7 @@ function print_entry($row) {
        <li class="<?php if ($counter %2) { echo 'odd'; } else { echo 'even'; } ?>">
                <a name="<?php echo $row['post_id']; ?>"></a>
                <div class="forum-post-author">
-                       <a href="profile.php?id=<?php echo $row['member_id']; ?>" class="title"><?php echo AT_print($row['login'], 'members.login'); ?></a><br />
+                       <a href="profile.php?id=<?php echo $row['member_id']; ?>" class="title"><?php echo htmlspecialchars(get_display_name($row['member_id'])); ?></a><br />
                        <?php print_profile_img($row['member_id']); ?>
                </div>
 
index 9367bb7..333bf14 100644 (file)
@@ -367,7 +367,6 @@ CREATE TABLE `forums_threads` (
   `parent_id` mediumint(8) unsigned NOT NULL default '0',
   `member_id` mediumint(8) unsigned NOT NULL default '0',
   `forum_id` mediumint(8) unsigned NOT NULL default '0',
-  `login` varchar(20) NOT NULL default '',
   `last_comment` TIMESTAMP NOT NULL,
   `num_comments` mediumint(8) unsigned NOT NULL default '0',
   `subject` varchar(100) NOT NULL default '',
diff --git a/docs/install/db/atutor_upgrade_1.5.4_to_1.5.5.sql b/docs/install/db/atutor_upgrade_1.5.4_to_1.5.5.sql
new file mode 100644 (file)
index 0000000..c462d14
--- /dev/null
@@ -0,0 +1,7 @@
+###############################################################
+# Database upgrade SQL from ATutor 1.5.4 to ATutor 1.5.5
+###############################################################
+
+
+## remove login field - #3032
+ALTER TABLE `forums_threads` DROP `login`;