Editor Having Problems With Html Code

0

HI,

How can i stop the html validation?

Error showing - The url u submitted has disallowed chars.

I want to be able to post any html code.

Also are you able to add ckeditor?

Thanks

Question Resolved For: Simple Forum - Responsive Bulletin Board 0 Votes 20 Answers 1.2k Views
Asked by danfix 2 years ago

0

Answered by danfix 2 years ago

Hi,

I managed to get it to work from your information.
Its posting the data not.

Thanks for all your help

0

Answered by Mian Saleem 2 years ago

Hello,

Your form can be in the topic/post body but javascript code shouldn't be there.

<div id="result"></div>
<form name="Form_8a72b12" id="Form_8a72b12" method="POST" enctype="application/x-www-form-urlencoded" action="javascript:;">
    <input type="hidden" id="lethe_form" name="lethe_form" value="Form_8a72b12" />
    <input type="hidden" id="l_oid" name="l_oid" value="5dbc432713de45d853149d4a0c3123e8" />
    <div class="form-group">
        <label for="text_b09fc">First Name</label>
        <input
            type="text"
            name="text_b09fc"
            id="text_b09fc"
            value=""
            class="form-control"
            required
            placeholder="First Name"
            pattern="^[a-zA-Z0-9 ]+$"
        />
    </div>
    <div class="form-group">
        <label for="Form_Mail">E-Mail</label>
        <input type="email" name="Form_Mail" id="Form_Mail" value="" class="form-control" required placeholder="E-Mail" />
    </div>
    <div class="form-group">
        <button type="submit" name="Form_Save" id="Form_Save" class="btn btn-primary">Submit</button>
    </div>
</form>
<!-- // This would not work in topic/post body, so add it to header or footer -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#Form_8a72b12').on('submit', function () {
            $.ajax({
                url: '/newsletter.php?pos=subscribe',
                type: 'POST',
                contentType: 'application/x-www-form-urlencoded',
                crossDomain: true,
                data: $('#Form_8a72b12').serialize(),
                success: function (data) {
                    $('#result').html(data);
                    $('html,body').animate({ scrollTop: $('#result').offset().top }, 'slow');
                },
                error: function () {
                    $('#result').html("<div class='alert alert-danger'>There is error while submit</div>");
                },
            });
        });
    });
</script>

The heaader/footer view files are in themes/default/views/

Thank you

0

Answered by danfix 2 years ago

Thanks for the code & where i need to put it.

I have found a problem.

On the popup create a thread box. there is no Description textarea.
When in Admin area, to approve the topic there shows the description textarea box, but it has unwanted content in it,
This shows when you edit the post.

Thanks

0

Answered by Mian Saleem 2 years ago

Hello,

Users are not allowed to set description as it's used for SEO. Only admins will see this field.

For non-admins, system will use starting (160 chars) of the topic body as description.

Thank you

0

Answered by danfix 2 years ago

Hi,

This is what i was meaning about the description textarea.
I put video iframe code in the body section

In admin the topic description is showing like this
.viid_iframe_video{max-width:800px;margin:0 auto}.viid_iframe_video iframe{width:100%;height:480px;border:none}@media(max-width:767px){.viid_iframe_video…

Also please see image of the email

0

Answered by Mian Saleem 2 years ago

Hello,

Admins can set the description as they want.

If case of user, edit will need to edit the thread to set correct description.

Thank you

0

Answered by danfix 2 years ago

Hi,
Can you not make it, when the post is created the user can enter their own text description details, rather then having to edit it again to fix the text?

0

Answered by Mian Saleem 2 years ago

Hello,

No. There is no plan to change this.

You can modify themes/default/views/topics/add.php to display the field to all users and add method of app/controllers/Topics.php

Thank you

0

Answered by danfix 2 years ago

Hi,

Do i need to change this
if ($this->Admin || $this->Moderator)
To
if ($this->Admin || $this->Moderator || $this->User)

Also how can i remove all the stripping of the html code?
I have to go into the DB - tec_posts, and add the html code in there.

Also when i edit the topic by which ever user, it strips all the html code.

Thanks

0

Answered by Mian Saleem 2 years ago

Hello,

There is no such $this->User but you can use $this->Member instead OR remove the if statement. Make sure there is no syntax error 😃

Thank you

We use Cookies

We use cookies to ensure that we give you the best experience on our website. By continuing to browse the site you are agreeing to our use of cookies.