Advertisement:

Author Topic: Locked topic - no reply  (Read 5528 times)

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Locked topic - no reply
« on: July 23, 2008, 10:28:38 AM »
When I lock some topic and check on test account there is quick reply box with warning that topic is locked and only admins and mods can answer ( No.1 on picture ) and text box ( No.2 on piture ).

I want to remove that box when topic is locked and leave only warning that topic is locked.

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Locked topic - no reply
« Reply #1 on: July 24, 2008, 02:26:17 AM »
Disable quick reply. :) Or edit your Display.template.php and look for
Code: [Select]
if ($context['can_reply'] && !empty($options['display_quick_reply']))
Code: (replace) [Select]
if (($context['can_reply'] && !empty($options['display_quick_reply'])) && !$context['is_locked'])
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #2 on: July 24, 2008, 07:24:38 AM »
Didn't helped. :(

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: Locked topic - no reply
« Reply #3 on: July 26, 2008, 12:31:24 PM »
Did you edit the Display.template.php file for your own custom theme (it probably has one)?

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #4 on: July 26, 2008, 12:58:32 PM »
I didn't changed both of these lines.

Code: [Select]
if ($context['can_reply'] && !empty($options['display_quick_reply']))
When I changed, the quick reply box disappeared but there is no warning that topic is locked.

I'm using Babylon theme.

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #5 on: July 28, 2008, 07:40:11 PM »
Bump.

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #6 on: July 28, 2008, 08:10:09 PM »
Do you want the entire box gone?

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #7 on: July 28, 2008, 08:20:10 PM »
With the code that JohnyB gave me entire box disappeared. But what I want is to have a box with warning that topic is locked.

At place of quick reply but just to be simple divider nothing special.

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #8 on: July 28, 2008, 08:27:33 PM »
Sounds simple enough.

Add after the quick box:

Code: [Select]
if( $context['is_locked'] ) { echo '<div class="windowbg2">This topic is currently locked!</div>'; }

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #9 on: July 28, 2008, 08:41:58 PM »
That's it. I was putting that code on wrong place, inside the quick reply box.
Can this part of code make some problems if it isn't removed?

Quote
<td class="windowbg" width="25%" valign="top">', $txt['quick_reply_desc'], $context['is_locked'] ? '<br /><br /><b><font color="ffffcc">' . $txt['quick_reply_warning'] . '</font></b>' : '', '</td>

	
if ((
$context['can_reply'] && !empty($options['display_quick_reply'])) && !$context['is_locked'])
	
{
	
	
echo 
'
<a name="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="bordercolor" width="100%" style="clear: both;">
	
<tr>
	
	
<td colspan="2" class="catbg"><a href="javascript:oQuickReply.swap();"><img src="'
$settings['images_url'], '/'$options['display_quick_reply'] == 'collapse' 'expand''.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:oQuickReply.swap();">'$txt['quick_reply'], '</a></td>
	
</tr>
	
<tr id="quickReplyOptions"'
$options['display_quick_reply'] == '' ' style="display: none"''>
	
	
<td class="windowbg" width="25%" valign="top">'
$txt['quick_reply_desc'], $context['is_locked'] ? '<br /><br /><b><font color="ffffcc">' $txt['quick_reply_warning'] . '</font></b>' '''</td>
	
	
<td class="windowbg" width="90%" align="center">
	
	
	
<form action="'
$scripturl'?action=post2" method="post" accept-charset="'$context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
	
	
	
	
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />
	
	
	
	
<input type="hidden" name="subject" value="'
$context['response_prefix'], $context['subject'], '" />
	
	
	
	
<input type="hidden" name="icon" value="xx" />
	
	
	
	
<input type="hidden" name="notify" value="'
$context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' '0''" />
	
	
	
	
<input type="hidden" name="goback" value="'
, empty($options['return_to_post']) ? '0' '1''" />
	
	
	
	
<input type="hidden" name="num_replies" value="'
$context['num_replies'], '" />';
	
	
	

	
	
	
// Start of WYSIWYG Quick Reply
	
	
	
echo 
'<table border="0" cellpadding="3" width="100%">
	
	
	
	
	
<tr class="windowbg">
	
	
	
	
	
	
<td valign="top" align="center">'
;
	
	
	
	
	
	

	
	
	
// Only show bbcode bar if BBCodes are enabled, AND if its a quick reply mode with bbcode bar
	
	
	
if (
$context['show_bbc'] && (in_array($options['wysiwyg_quick_reply'], array(0145))))
	
	
	
	
echo 
template_control_richedit($context['post_box_name'], 'bbc').'<br />';
	
	

	
	
	
// Only show smilies if smiliesare enabled AND if its a quick reply mode with smilies
	
	
	
if (!empty(
$context['smileys']['postform']) && (in_array($options['wysiwyg_quick_reply'], array(0246))))
	
	
	
	
echo 
template_control_richedit($context['post_box_name'], 'smileys').'<br />';

	
	
	
// Show the quick reply (WYSIWYG vs NON-WYSIWYG dealt with already decided in source file)
	
	
	
echo 
template_control_richedit($context['post_box_name'], 'message'), '
	
	
	
	
	
	
</td>
	
	
	
	
	
</tr>
	
	
	
	
</table>'
;
	
	
	
// End of WYSIWYG Quick Reply
	
	
	

	
	
	
echo 
'
	
	
	
	
<input type="submit" name="post" value="'
$txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
	
	
	
	
<input type="submit" name="preview" value="'
$txt['preview'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />';
	
	
if (
$context['show_spellchecking'])
	
	
	
echo 
'
	
	
	
	
<input type="button" value="'
$txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" />';
	
	
echo 
'
	
	
	
	
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
	
	
	
	
<input type="hidden" name="seqnum" value="'
$context['form_sequence_number'], '" />
	
	
	
</form>
	
	
</td>
	
</tr>
</table>'
;
	
}
	
	
	
//Topic is locked?
	
	
	
if( 
$context['is_locked'] ) { echo '<div class="windowbg2">This topic is currently locked!</div>'; }

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #10 on: July 28, 2008, 08:45:53 PM »
It shouldn't matter. Does my code work for you?

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #11 on: July 28, 2008, 08:48:17 PM »
Excellent! Thanks a lot!

Is it possible to make admin lock for this?
Or this needs a lot more work?

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #12 on: July 28, 2008, 08:49:03 PM »
Depends. How do I define the admin lock?

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #13 on: July 28, 2008, 08:56:46 PM »
Well, I've looked this mod you gave me a link so maybe something like that.

P.S. How can I add this ( $txt['quick_reply_warning'] ) here ( if( $context['is_locked'] ) { echo '<div class="windowbg2" align="center">This topic is currently locked!</div>'; } )

When I try, I am getting template parse error.

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #14 on: July 28, 2008, 09:08:45 PM »
if( $context['is_locked'] ) { echo '<div class="windowbg2" align="center">'$txt['quick_reply_warning'] ,'</div>'; }
« Last Edit: July 28, 2008, 09:18:39 PM by ccbtimewiz »

Offline AlenNS

  • Full Member
  • ***
  • Posts: 617
  • Gender: Male
    • Baklja forum - Vaš forum
Re: Locked topic - no reply
« Reply #15 on: July 28, 2008, 09:17:50 PM »
I've putted the same code, but I've got an error.
Both of us forgot } on the end of the code. :)

Thanks for everything! :)

Now it's great!

Offline ccbtimewiz

  • SMF Hero
  • ******
  • Posts: 5,300
  • Gender: Male
  • OXEN
Re: Locked topic - no reply
« Reply #16 on: July 28, 2008, 09:18:52 PM »
Anytime.  :)