miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Master Class
/
locked topic - condition
tom322
Registered
#1
|
Posted: 29 Jun 2006 02:57
|
Edited by: tom322
In bb_plugins I would like to write the folliwing condition:
if [topic is locked/closed] then do this...
I'm not sure how to determine when the topic is locked or closed...
tom
Paul
CEO
#2
|
Posted: 29 Jun 2006 07:27
Depends on which page you want to call this condition. If on topics listing page (action=vtopic), it's good to use parseTopic() function, and compare values with $GLOBALS['cols'][5] and $GLOBALS['cols'][7] which indicate locked and sticky status. On messages listing page, it's better to get topic status with additional SQL request.
tom322
Registered
#3
|
Posted: 31 May 2011 13:08
|
Edited by: tom322
I mean messages listing page. Is this correct? ( I think it misses something because it doesn't work ;)
-------------
if($action=='vthread' and $row=db_simpleSelect(0, $Tt, 'topic_status', '=', '1'))
echo ('This topic is locked!')
This one doesn't work either:
if($row=db_simpleSelect(0, $Tt, 'topic_status', '=', '1') and $action=='vthread')
{
if($row[0]=1) echo ('This topic is locked!');
{
Paul
CEO
#4
|
Posted: 1 Jun 2011 09:42
If you are in the topic already, and would like to add something to the topic viewing page,
$topicData[1]
variable should be preloaded and contain the status of the currently browsed topic.
I.e.
if($topicData[1]==1){
//...your code follows...
}
tom322
Registered
#5
|
Posted: 1 Jun 2011 14:59
That's it, thanks! (I realized I used this code in the past but my bb_plugins.php is too big for search now ; ).
miniBB Support Forums
/
Master Class
/ locked topic - condition
↑
Top
Your Reply
Short link for this topic:
?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, make sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
The Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Features
Requirements
Demo
Download
Showcase
Gallery of Arts
Compiler
Premium Extensions
Premium Support
License
Contacts
Extend your miniBB-forums, attaching the images and files,
get the
File and Picture Attachments add-on
!