miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Master Class miniBB Support Forums / Master Class /   

locked topic - condition

Author 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

Author Paul
Lead Developer
#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.

Author 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!');

{

Author Paul
Lead Developer
#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...
}


Author 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 ; ).

Master Class miniBB Support Forums / Master Class / locked topic - condition Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB