miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /  
 

locked topic - condition

 
Author tom322
Active Member
#1 | Posted: 29 Jun 2006 02:57 
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
Active Member
#3 | Posted: 31 May 2011 13:08 
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
Active Member
#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
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑