0

i have a forum wherein a user can create a topic,delete and edit a topic. and i have a admin panel that can delete a topic,edit and locked a topic or closed. I'm done in delete,edit and create what I'm looking for is how can i lock the topic if the problem is solved, and i want to close the topic if the topic is none of their discussion.

I already search this discussion in google.

4
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by floatingDivs
0

first , i need some clarification,
what is the topic feature if that topic is locked????

and
set "is_lock" flag in your topics table in database,
then set it to 1 if it is locked, default is 0 means it is not locked.

Edited by Shanti C: n/a

0

first , i need some clarification,
what is the topic feature if that topic is locked????

and
set "is_lock" flag in your topics table in database,
then set it to 1 if it is locked, default is 0 means it is not locked.

as Shanti said, do that and then in inserting the reply check for unlocked forums. Incase the column indicates the post is locked then post back form and error message

0

@shanti "what is the topic feature if that topic is locked?" sir sorry for that what i mean is mark threads as solved if the topic is about a problem. sir just disable the button post-reply. if i mark the topic closed

0

u have an extra code 4 that issue sir?

<?php
    function is_locked()
    {
      // if locked, return 1 (true)
      // else return 0 (false)
    }

    if(is_locked())
      // display "locked thread" image
    else
       // display "open thread" image
?>

Edited by floatingDivs: n/a

0

@FloatingDivs thx for sharing...i need more and please elaborate your code...

0

@FloatingDivs thx for sharing...i need more and please elaborate your code...

I'm really unsure about how much code it is you need...do you know any PHP and MySQL? If not, maybe you should pay someone to do it for you? Quite frankly, I'm not sure how much more there is to it than the advice already given to you by the posters in this thread.

You have a database. It has a table called [insert table name containing Thread Status].

For instance, database name is "MyOwnCMS". The table name is "ThreadStatus". It contains two fields: thread ID and thread Status.

For example, the fields are called TS_ID (thread ID) and TS_Status (thread status). The ID pertains to the threads ID obviously and the TS_Status pertains to whether it's locked or opened. As you can see, there are two options: locked and opened. Thus, you only need a 0 (false) or 1 (true) as your data for TS_Status.

The function I posted in my previous post is_locked() would return a 0 if the thread isn't locked and 1 if it is.

Thus, the contents of the function is_locked() would simply query the Thread ID and find its status.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.