View Thread
Point Defense Systems » Administrative Information » Site & Forum Issues
 Print Thread
Thread View while typing Reply
Homdax
A function I implemented at HWACCESS (manually) was the ability to see previous posts while typing the reply. Since we have pretty large text masses here, I think that might ease things when replying.

This would show as an scrolling window below the post that are being typed.
It will not work during editing of an existing post.

The implementation is manual, but involves only one coherent line of code, and adding one file to the site. It is documented at HWACCESS.

Opinions?
Edited by Homdax on 09-09-2005 14:02
 
Inert
It will be a good idea to implement. (I was wondering, in fact, why it hasn't been already.)
 
Homdax
Because if something screws up while doing it, I can blame whoever supported it...Wink

No, becuse we do stuff that have a meaningful purpose, and that is announced and somewhat scrutinized before doing it.
Not to mention documented.
 
Glacialis
Vote aye. Very useful feature.
 
paladin1
It is a very useful feature as it is easier to type reply's to certain other members posts without having to go to the trouble of quoting eveyone.
I feel like a one legged man in an ASS kickin' contest!
 
TelQuessir
Good thing to have - go for it.
 
Homdax
Acknowledged.

Inserted new file in to root/forum/

thread_review.php :


tablebreak();
opentable("Thread Review");

$itemsperpage = 20;
$rows = dbrows(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id='$thread_id'"));
if (!$rowstart) $rowstart = 0;

echo "

\n";

if ($rows != 0) {
   $result = dbquery("SELECT * FROM ".$db_prefix."posts INNER JOIN ".$db_prefix."users ON ".$db_prefix."posts.post_author=".$db_prefix."users.user_id WHERE thread_id='$thread_id' ORDER BY post_datestamp DESC");
   $numrows = dbrows($result);
   $i = 0;
   $sp = 1;
   while ($data = dbarray($result)) {
      $i++;
      $message = $data['post_message'];
      if ($data['post_smileys'] == "y") { $message = parsesmileys($message); }
      $message = parseubb($message);
      $message = nl2br($message);
      //$message = wordwrap($message, 100, "\n", 1);
      if ($data['post_edittime'] != "0") {
         if ($data['post_author'] != $data['post_edituser']) {
            $data2 = dbarray(dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE user_id='".$data['post_edituser']."'"));
            $edituser = "".$data2['user_name']."";
         } else {
            $edituser = "".$data['user_name']."";
         }
         $edittime = strftime($settings['forumdate'], $data['post_edittime']+($settings['timeoffset']*3600));
      }
      if ($sp == 1) {
         $cl = " class='tbl1'";
         $sp = 2;
      }
      elseif ($sp == 2) {
         $cl = " class='tbl1'";
         $sp = 1;
      }
      echo "
";
      echo "";
      echo "
$message";
      echo "
$data[user_name]


Posted: ".strftime($settings['forumdate'], $data['post_datestamp']+($settings['timeoffset']*3600))."
";
   }
   echo "

";
}

closetable();
?>


Changes made in existing root/forum/postreply.php:
Add after:


\n";
   closetable();

this:

include "thread_review.php";


Height of created scroll window may be changed by altering the value of:

style='height:300px;


which originally was 195, but I assumed it would mostly be too short.

The order in which the thread contents is showed, may also be altered by selecting to sort it differently, altering the SQL-command that presently is:

thread_id='$thread_id' ORDER BY post_datestamp DESC


But I figure viewing the last post on top, is the way to go, normally.

I hope it will be useful.
Edited by Homdax on 11-09-2005 13:03
 
Glacialis
Good implementation. Last first is indeed useful.
 
Homdax
Keeping for documentation.
 
Jump to Forum