Showing A Thread Is Locked Without Opening It? (General)

by Magma, Saturday, October 31, 2015, 04:42 (3099 days ago)

I know you have the little padlock icon for when a thread is locked but it would be nice to be able to see a thread is locked before opening it. Like replace the icon (next to the word problem in the below image) with the padlock icon?

Is there an easy fix for this?

[image]

Avatar

Showing A Thread Is Locked Without Opening It?

by Micha ⌂, Saturday, October 31, 2015, 09:59 (3098 days ago) @ Magma

Hi,

Is there an easy fix for this?

Yes, I think so.

You have to modify the index.inc.tpl in line 43. The extended line is:

<li><a class="{if $data.$element.pid==0 && $data.$element.new}{if $data.$element.sticky==1 && $data.$element.locked==1}threadnew-sticky-locked{elseif $data.$element.sticky==1}threadnew-sticky{elseif $data.$element.locked==1}threadnew-locked{else}threadnew{/if}{elseif $data.$element.pid==0}{if $data.$element.sticky==1 && $data.$element.locked==1}thread-sticky-locked{elseif $data.$element.sticky==1}thread-sticky{elseif $data.$element.locked==1}thread-locked{else}thread{/if}{elseif $data.$element.pid!=0 && $data.$element.new}replynew{else}reply{/if}{if $read && in_array($data.$element.id,$read)} read{/if}" href="index.php?id={$data.$element.id}"{if $data.$element.spam==1} title="{#spam#}"{/if}>{if $data.$element.spam==1}<span class="spam">{$data.$element.subject}</span>{else}{$data.$element.subject}{/if}</a>{if $data.$element.no_text} <img class="no-text" src="{$THEMES_DIR}/{$theme}/images/no_text.png" title="{#no_text_title#}" alt="{#no_text_alt#}" width="11" height="9" />{/if} - <strong>{if $data.$element.user_type==2}<span class="admin registered_user" title="{#administrator_title#}">{$data.$element.name}</span>{elseif $data.$element.user_type==1}<span class="mod registered_user" title="{#moderator_title#}">{$data.$element.name}</span>{elseif $data.$element.user_id>0}<span class="registered_user">{$data.$element.name}</span>{else}{$data.$element.name}{/if}</strong>, <span id="p{$data.$element.id}" class="tail">{$data.$element.formated_time}{if $data.$element.pid==0} <a href="index.php?mode=thread&amp;id={$data.$element.id}" title="{#open_whole_thread#}"><img src="{$THEMES_DIR}/{$theme}/images/complete_thread.png" title="{#open_whole_thread#}" alt="[*]" width="11" height="11" /></a>{/if}{if $admin || $mod} <a id="marklink_{$data.$element.id}" href="index.php?mode=posting&amp;mark={$data.$element.id}" title="{#mark_linktitle#}">{if $data.$element.marked==0}<img id="markimg_{$data.$element.id}" src="{$THEMES_DIR}/{$theme}/images/unmarked.png" title="{#mark_linktitle#}" alt="[○]" width="11" height="11" />{else}<img id="markimg_{$data.$element.id}" src="{$THEMES_DIR}/{$theme}/images/marked.png" title="{#unmark_linktitle#}" alt="[●]" width="11" height="11" title="{#unmark_linktitle#}" />{/if}</a> <a href="index.php?mode=posting&amp;delete_posting={$data.$element.id}&amp;back=index" title="{#delete_posting_title#}"><img src="{$THEMES_DIR}/{$theme}/images/delete_posting.png" title="{#delete_posting_title#}" alt="[x]" width="9" height="9" /></a>{/if}

This new line checks the value $data.$element.locked and adds four new css-classes called:

  • threadnew-sticky-locked
  • threadnew-locked
  • thread-sticky-locked
  • thread-locked

You have to style this class, e.g.:

/* sticky and locked threads: */
a.thread-sticky-locked,
a.thread-sticky-locked:link     { padding-left:18px; color:#0000cc; text-decoration:none; font-weight:bold; background:url(images/bg_sprite_1.png) no-repeat 0 -1210px; }
a.thread-sticky-locked:visited  { /*color:#800080;*/ }
a.thread-sticky-locked:hover    { color:#0000ff; text-decoration:underline; }
a.thread-sticky-locked:active   { color:#ff0000; }
/* locked threads: */
a.thread-locked,
a.thread-locked:link     { padding-left:18px; color:#0000cc; text-decoration:none; font-weight:bold; background:url(images/bg_sprite_1.png) no-repeat 0 -1110px; }
a.thread-locked:visited  { /*color:#800080;*/ }
a.thread-locked:hover    { color:#0000ff; text-decoration:underline; }
a.thread-locked:active   { color:#ff0000; }
/* new sticky and locked threads: */
a.threadnew-sticky-locked,
a.threadnew-sticky-locked:link    { padding-left:18px; color:#0000cc; text-decoration:none; font-weight:bold; background:url(images/bg_sprite_1.png) no-repeat 0 -1260px; }
a.threadnew-sticky-locked:visited { /*color:#800080;*/ }
a.threadnew-sticky-locked:hover   { color:#0000ff; text-decoration:underline; }
a.threadnew-sticky-locked:active  { color:#ff0000; }
/* new locked threads: */
a.threadnew-locked,
a.threadnew-locked:link    { padding-left:18px; color:#0000cc; text-decoration:none; font-weight:bold; background:url(images/bg_sprite_1.png) no-repeat 0 -1160px; }
a.threadnew-locked:visited { /*color:#800080;*/ }
a.threadnew-locked:hover   { color:#0000ff; text-decoration:underline; }
a.threadnew-locked:active  { color:#ff0000; }

Finally, you have to replace the bg_sprite_1.png image by the new one: http://forum.derletztekick.com/themes/derletztekick/images/bg_sprite_1.png

I add this modifications to my my_little_forum_2.3.5_RC.zip, see MLF RC - 2.3.5

kind regards
Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Working in threaded view but not table view

by Magma, Saturday, October 31, 2015, 23:01 (3098 days ago) @ Micha

Micha thank you I swapped out the files from 2.3.5

The locked logo shows great in threaded view but not in table view?

Avatar

Working in threaded view but not table view

by Micha ⌂, Sunday, November 01, 2015, 00:18 (3098 days ago) @ Magma

Hi,

The locked logo shows great in threaded view but not in table view?

Oh, I don't modify the index_table.inc.tpl. Replace the line 19 by:

<li><a class="{if $data.$element.pid==0 && $data.$element.new}{if $data.$element.sticky==1 && $data.$element.locked==1}threadnew-sticky-locked{elseif $data.$element.sticky==1}threadnew-sticky{elseif $data.$element.locked==1}threadnew-locked{else}threadnew{/if}{elseif $data.$element.pid==0}{if $data.$element.sticky==1 && $data.$element.locked==1}thread-sticky-locked{elseif $data.$element.sticky==1}thread-sticky{elseif $data.$element.locked==1}thread-locked{else}thread{/if}{elseif $data.$element.pid!=0 && $data.$element.new}replynew{else}reply{/if}{if $read && in_array($data.$element.id,$read)} read{/if}" href="index.php?mode=thread&amp;id={$data.$element.tid}{if $data.$element.pid!=0}#p{$data.$element.id}{/if}" title="{$data.$element.name}, {$data.$element.formated_time}">{if $data.$element.spam==1}<span class="spam">{$data.$element.subject}</span>{else}{$data.$element.subject}{/if}</a>{if $data.$element.no_text} <img class="no-text" src="{$THEMES_DIR}/{$theme}/images/no_text.png" title="{#no_text_title#}" alt="[ {#no_text_alt#} ]" width="11" height="9" />{/if}<span id="p{$data.$element.id}" class="tail">{if $admin || $mod} <a id="marklink_{$data.$element.id}" href="index.php?mode=posting&amp;mark={$data.$element.id}" title="{#mark_linktitle#}">{if $data.$element.marked==0}<img id="markimg_{$data.$element.id}" src="{$THEMES_DIR}/{$theme}/images/unmarked.png" title="{#mark_linktitle#}" alt="[○]" width="11" height="11" />{else}<img id="markimg_{$data.$element.id}" src="{$THEMES_DIR}/{$theme}/images/marked.png" title="{#unmark_linktitle#}" alt="[●]" width="11" height="11" title="{#unmark_linktitle#}" />{/if}</a> <a href="index.php?mode=posting&amp;delete_posting={$data.$element.id}&amp;back=index" title="{#delete_posting_title#}"><img src="{$THEMES_DIR}/{$theme}/images/delete_posting.png" title="{#delete_posting_title#}" alt="[x]" width="9" height="9" /></a>{/if}</span>

or download the 2.3.5 RC files again.

/Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Working now thanks

by Magma, Sunday, November 01, 2015, 01:05 (3098 days ago) @ Micha

Micha thank you so much. It's working now, nice little touch to the forum :ok:

RSS Feed of thread