Locked topic icon

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Locked topic icon

Fygaroo
Is there a way to see what topic is locked before opening it , like you open a subforum and you see a list of all topic there but it doesn't show what topic is locked till you open it.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
Hi,
you'll have to edit your NAML code.
Go to "See how NAML generates this page"
"engine wheel" -> Search macros -> Macro by name - > topics_column
topics_column -> override this macro

starting from  line 249, your code will be like this
   <span class="weak-color">
    <t>by <t.author.owner.name truncate="20"/></t>
   </span>
</else>
Then, paste this code after line 251:
<span id="lock-icon" class="weak-color" style="padding:0 .5em;margin-right:.5em;[n.hidden_if.not.current_node.is_locked_topic/]">
    <img src="/images/lock_sm.png" width="10" height="15" style="vertical-align:middle"/> <t>Locked</t> 
</span> 
You final code, starting form line 249 will be like this:
   <span class="weak-color">
    <t>by <t.author.owner.name truncate="20"/></t>
   </span>
   <span id="lock-icon" class="weak-color" style="padding:0 .5em;margin-right:.5em;[n.hidden_if.not.current_node.is_locked_topic/]">
    <img src="/images/lock_sm.png" width="10" height="15" style="vertical-align:middle"/> <t>Locked</t> 
   </span> 
</else>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Fygaroo
Thank you very much it worked perfectly .
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi,

I know this thread is a bit old, but does this works for boards as well?

When you enter a section, you will see the topics/threads. If a topic is pinned, then a pin icon will appear to the left. If the topic is locked as well, then no icon is showing until you enter the topic.

Let me know if you can do this on "Boards" as well.
Thanks!

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
Did you try to it on a board application?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Yes, I did. But it appears to only work on all other than Board.
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
Please, give me your forum url.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi again,

http://forum.exce.se/ 

Please be careful if you are about to edit the codes.
Also, do not put the "Edit this Page" link back. I have the link to it, so no worries.

- Kind regards,
  Timmie.
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
If you want to show this icon, using a macro, at the root table and inside the topic, you should create and edit your macros like this:
1 - Creating:
<macro name="show_lock_icon" requires="node">    
    <span id="lock-icon" class="weak-color" style="padding:0 .5em;margin-right:.5em;[n.hidden_if.not.this_node.is_locked_topic/]">
        <img src="http://images.staticjw.com/exc/9454/exce-icon-thread-locked.png" width="13" height="18" style="vertical-align:middle"/> <t>Thread is locked</t>
    </span>
</macro>
2- Edit subcategories_column, line 15:
<td class="weak-color [n.column_default_border/] adbayes-content" style="width:60%">
	<div style="font-weight:bold;margin-bottom:.3em">
		<n.current_node.node_link/> <n.current_node.show_lock_icon/>
	</div>
3- Edit topic_controls_right:
<override_macro name="topic_controls_right" requires="forum_topic_namespace">
	<n.page_node.tweet_button/>
	<n.pin_icon/>
	<n.page_node.show_lock_icon/>
	<n.message_count/>
	<img src="/images/gear.png" class="image16" alt="[t]Options[/t]"/>
	<n.page_node.topic_dropdown/> 
</override_macro>  
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi again Pedro,

Thank you for your high quality support. Now it works.
But the lock icon dosen't show next to the pin icon. That seems to not working. The icon appears when you enter the site, and when you enter a locked topic.

What I want as well, is that it should appear when you enter for exampel "OFFIClAL ANNOUNCEMENTS". Then you see a bunch of topics. If the topic is locked, then the lock icon should appear before you enter the thread as well.

Hope you understand what I talking about here and thank you again.

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
Hi,
you should also add "<n.current_node.show_lock_icon/> "at topics_column macro, around line 42. In this way, the icon will also be shown in forums.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi again,

Sorry. What do you mean with around line 42? Under or above line 42?
I mean, should there be more codes than that? I am still learning NAML, and it seems to be a bit similar as HTML but not so much.

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
Add it after line 43 and see if it is good for you.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi again,

So I added the code after line 43, then this error came up:

 Error: macro or method for 'current_node' not found in [basic, nabble, ad] stack = [basic, nabble, ad]
 in current_node(custom_tweak:topics_column:19) - <n.current_node.>
 in body(nabble:columns.naml:21) - <else.body />
 in if(nabble:columns.naml:19) - <else.if.is_in_command name="table_header"> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
 in if(nabble:columns.naml:12) - <n.if.is_in_command name="calc_table_column_count"> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
 in table_column(custom_tweak:topics_column:2) - <n.table_column>
 in (custom_tweak:topics_column:1) - <override_macro name="topics_column" parameters="width,title,count">

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
It seems that you changed again the type of that app. I've added the topic_column file to your editor.
Try to discover which macro are generating the table your type are using. It is much easier when you have the "Edit this page" link at your footer.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hello there again Pedro,

I have been looking around, tested a lot of things and have got much more experience within NAML.
Still, I can't find the macro that generates the website.

Let me know how we should proceed this further.
Thanks!

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
What is the type of the app where you want to put the icon?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi,

So, it is the Forum type.

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

Pedro
So, edit topics_column macro. Add after line 43: <n.current_node.show_lock_icon/>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Locked topic icon

NiTEMARE
Hi again Pedro,

Thank you for your assistance and effort, but the icon still doesn't show up.

- Timmie
The trick to creativity is knowing how to hide your sources - Albert Einstein.
12