Jump to content

How to create Lock Topic script


ColdEdge

Recommended Posts

Hi, I am writing little PHP and MySQL based forum software which I plan to distribute for free ^^. Anyhow I got some of the minor things completed, and now I am wondering what can I do to lock posts?So if a post is locked a user will not be able to see Post Reply button nor will he she will be able to see the Reply box at the bottom of the page.One of my ideas was to create a new field in posts row. And have it be either 0 which means unlocked or 1 which means locked and make the topic.php page do the rest.How would I do something like this?- Thanks

Link to comment
Share on other sites

I personally would like to know what approach you took. Even though I'm not creating anything like what you're doing, it seems like something notable.

Link to comment
Share on other sites

I personally would like to know what approach you took. Even though I'm not creating anything like what you're doing, it seems like something notable.
I used if statement.example
$result3 = mysql_query($sql3);  while($row = mysql_fetch_assoc($result3)){							   #post status if 1 post locked else un-locked							   $topic_status = $row['topic_status'];							   $topic_locked_by = $row['topic_cby'];									 								if ($topic_status=="1") {echo '<div style="padding:10px;background-color:#FAE3E3;border:2px solid #B25959;text-align:center;">This thread was locked by '.$topic_locked_by.'. </div><br>';#topic is locked, remove the reply....} else {#topic is open display topic + reply.}

Works fine, + there seems to be no way to get the reply form back up as the reply.php file also checks if topic status = 1 which means locked or if topic status = 0 meaning open. I am going to add something like this to user profile page permissions.... ex..... 0 = public, 1 = some info hidden, 2 = all info hidden.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...