#40 PostBoard 3 Bugs and 3 Fixes :)

User
open
nobody
5
2002-05-21
2002-05-21
No

1 BUG

Cannot delete the topic title if I have one post

Solution

You have to take the following line from common.php
function deletepost

mysql_query("UPDATE $pntable[postboard_topics] SET
topic_replies = (topic_replies - 1),
topic_last_post_id = $lastpost WHERE topic_id =
$topic_id");

and put it after

list($topic_replies) = mysql_fetch_row($result2);

and also change

if ($topic_replies <0) to if ($topic_replies <=0)

2 BUG

If a user leave emptty the TOPIC or the TEXT it gives
the warning message but it adds the post to the
database.

To fix this add on common.php on fuction PostNewTopic
these lines
============================================
//make sure there's a title and some text.
if (empty($topic_title)) error_message
(_NOTOPICTITLE);
else {
if (empty($post_text)) error_message
(_NOPOSTTEXT);
else {

// at the end of the routine put these brackets
}

}

3 BUG

Empty reply is posted

To Fix this add this line at the begining of the
fuction replypost on common.php

if (empty($post_text)) error_message (_NOPOSTTEXT);
else {

// dont forget to close the bracket at the end of the
function

}

Take Care

Kyriacos
http://www.cyusers.com

Discussion