{% macro forum_category_listing(forums, title, colour) %} {% from _self import forum_category_entry %} {% from 'macros.twig' import container_title %}
{{ container_title(title) }} {% if forums|length > 0 %}
{% for forum in forums %} {{ forum_category_entry(forum) }} {% endfor %}
{% else %}
This category is empty.
{% endif %}
{% endmacro %} {% macro forum_header(title, breadcrumbs, omit_last_breadcrumb) %}
{% if breadcrumbs is iterable and breadcrumbs|length > 0 %}
{% for name, url in breadcrumbs %} {% if url != breadcrumbs|first %}
{% endif %} {% if not (omit_last_breadcrumb|default(false) and url == breadcrumbs|last) %} {{ name }} {% endif %} {% endfor %}
{% endif %} {% if title|length > 0 %}
{{ title }}
{% endif %}
{% endmacro %} {% macro forum_category_tools(info, perms, take, offset) %} {% from 'macros.twig' import pagination %}
{% if perms|perms_check(constant('MSZ_FORUM_PERM_CREATE_TOPIC')) %} New Topic {% endif %}
{{ pagination( info.forum_topic_count, take, offset, '/forum/forum.php'|url_construct({'f':info.forum_id}), false, null, 5 ) }}
{% endmacro %} {% macro forum_topic_tools(info, take, offset, can_reply) %} {% from 'macros.twig' import pagination %}
{% if can_reply %} Reply {% endif %}
{{ pagination( info.topic_post_count, take, offset, '/forum/topic.php'|url_construct({'t':info.topic_id}), false, null, 5 ) }}
{% endmacro %} {% macro forum_category_entry(forum, forum_unread, forum_type) %} {% set forum_type = forum_type|default(null) %} {% set forum_unread = forum_unread|default(forum.forum_unread|default(false)) ? 'unread' : 'read' %} {% if forum_type is null %} {% if forum.forum_archived is defined and forum.forum_archived %} {% set forum_type = 'fas fa-archive' %} {% elseif forum.forum_type is defined and forum.forum_type != 0 %} {% if forum.forum_type == 2 %} {% set forum_type = 'fas fa-link' %} {% elseif forum.forum_type == 1 %} {% set forum_type = 'fas fa-folder' %} {% endif %} {% else %} {% set forum_type = 'fas fa-comments' %} {% endif %} {% endif %}
{{ forum.forum_name }}
{{ forum.forum_description|nl2br }}
{% if forum.forum_subforums is defined and forum.forum_subforums|length > 0 %}
{% for subforum in forum.forum_subforums %} {{ subforum.forum_name }} {% endfor %}
{% endif %}
{% if forum.forum_type == 2 %} {% if forum.forum_link_clicks is not null %}
{{ forum.forum_link_clicks|number_format }}
{% endif %} {% elseif forum.forum_type != 1 %}
{{ forum.forum_topic_count|number_format }}
{{ forum.forum_post_count|number_format }}
{% endif %} {% if forum.forum_type == 0 or forum.forum_link_clicks is not null %} {% endif %}
{% endmacro %} {% macro forum_topic_locked(locked, archived) %} {% if locked is not null or archived %}
{% if archived %} This topic has been archived. {% else %} This topic was locked . {% endif %}
{% endif %} {% endmacro %} {% macro forum_topic_listing(topics) %} {% from _self import forum_topic_entry %} {% from 'macros.twig' import container_title %}
{{ container_title('Topics') }}
{% if topics|length > 0 %} {% for topic in topics %} {{ forum_topic_entry(topic) }} {% endfor %} {% else %}
There are no topics in this forum.
{% endif %}
{% endmacro %} {% macro forum_topic_entry(topic, topic_type, topic_unread) %} {% set topic_type = topic_type|default(null) %} {% set topic_unread = topic_unread|default(topic.topic_unread|default(false)) ? 'unread' : 'read' %} {% if topic_type is null %} {% if topic.topic_deleted is defined and topic.topic_deleted is not null %} {% set topic_type = 'fas fa-trash-alt' %} {% elseif topic.topic_type is defined and topic.topic_type != 0 %} {% if topic.topic_type == 2 %} {% set topic_type = 'fas fa-bullhorn' %} {% elseif topic.topic_type == 1 %} {% set topic_type = 'fas fa-thumbtack' %} {% endif %} {% elseif topic.topic_locked is defined and topic.topic_locked is not null %} {% set topic_type = 'fas fa-lock' %} {% else %} {% set topic_type = 'fas fa-comment' %} {% endif %} {% endif %}
{{ topic.topic_title }}
{% if topic.author_id is not null %} by {{ topic.author_name }}, {% endif %}
{{ topic.topic_post_count|number_format }}
{{ topic.topic_view_count|number_format }}
{% if topic.respondent_id is not null %} {{ topic.respondent_name }} {% endif %}
{% if topic.respondent_id is not null %} {% endif %}
{% endmacro %} {% macro forum_post_listing(posts, opening_post_id) %} {% from _self import forum_post_entry %} {% for post in posts %} {{ forum_post_entry(post, post.post_id == opening_post_id) }} {% endfor %} {% endmacro %} {% macro forum_post_entry(post, is_original_post, is_original_poster) %} {% set is_original_post = is_original_post|default(false) %} {% set is_original_poster = is_original_poster|default(false) %}
#{{ post.post_id }}
{{ post.post_text|escape|parse_text(post.post_parse)|raw }}
{% endmacro %} {% macro forum_posting_form(title, target_id, is_reply, element_id) %} {% from 'macros.twig' import container_title %} {% from '_layout/input.twig' import input_hidden, input_csrf, input_text %} {% set is_reply = is_reply ? true : false %} {{ container_title(title) }}
{{ input_hidden('post[' ~ (is_reply ? 'topic' : 'forum') ~ ']', target_id) }} {{ input_csrf('forum_post') }} {#

Error: Your post contained too much text, shorten it a bit or split it out in two posts.

#} {% if not is_reply %}
{{ input_text('post[title]', 'forum__posting__title__input', '', 'text', 'Topic title') }}
{% endif %}
{% endmacro %}