How do I put a limit on the amount of characters a user can post to one blog?

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

How do I put a limit on the amount of characters a user can post to one blog?

helam
Some of the users are posting entire books on our blog and it is upsetting many people.  Can you limit the amount of characters that one person can write in each blog or response?
Thank You,
Holly
Reply | Threaded
Open this post in threaded view
|

Re: How do I put a limit on the amount of characters a user can post to one blog?

jsmoraes
yes helam. You can limit the amount of characters of a message.

It is done in message_control macro.

the original text has:
 <macro name="message_control" requires="node_page">
    <div class="field-box light-border-color">
        <div class="second-font field-title"><t>Message</t></div>
        <div class="weak-color">
            <n.if.visitor.is_registered>
                <then>
                    <n.html_format_field.checkbox />
                    <label for="[n.html_format_field.name/]"><t>Message is in HTML Format</t></label><br/>
                    <div style="margin:.1em 0">
                        <n.editor_toolbar
                            textarea_id="[n.message_field.name/]"
                            original_text="[n.if.page_node.is_post][then.page_node.message_quoted/][/n.if.page_node.is_post]"
                        />
                    </div>
                </then>
            </n.if.visitor.is_registered>
            <n.message_field.textarea wrap="SOFT" tabindex="2" style="min-width:30em;max-width:55em;width:100%;height:20em;" />
            <n.new_post_extra_fields/>
        </div>
    </div>
</macro>

the line:
<n.message_field.textarea wrap="SOFT" tabindex="2" style="min-width:30em;max-width:55em;width:100%;height:20em;" />

must to be changed to:
<n.message_field.textarea wrap="SOFT" tabindex="2" style="min-width:30em;max-width:55em;width:100%;height:20em;" maxlength="number of characters that you want permit" />
e. g.
<n.message_field.textarea wrap="SOFT" tabindex="2" style="min-width:30em;max-width:55em;width:100%;height:20em;" maxlength="200" />
Without the parameter maxlength the macro textarea called by message_field will not limit the amount of characters. The default it is not limited. Therefore the parameter isn't declared.
Observatório de Astronomia de Vilatur - W. Herschel
Saquarema - RJ - Brasil
http://www.astronomia.pousadavilatur.com.br