The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
5 posters

    Can We change post content ?

    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Can We change post content ?

    Post by TamDonCo Wed 31 Aug - 22:22

    Hi All

    When user posts in HTML and some users turn off HTML and see like this


    <a href='https://postimg.org/image/orsg1wa/' target='_blank'><img src='https://2img.net/h/s13.postimg.cc/ie3cyn5qf/abc.jpg' border='0' alt='image'/><br /><a target='_blank' href='https://postimage.org/app.php'>screenshot windows</a><br /><br />


    instead of see the image



    I want to replace that with

    If you can not see video/image, going to: Profile-->Prefrences-->Always allow html tick yes and save.



    Is that possible ?


    Last edited by TamDonCo on Fri 9 Sep - 13:21; edited 1 time in total
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19435
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Can We change post content ?

    Post by Ape Thu 1 Sep - 11:54

    I am not 100% sure you can do that Sad



    Can We change post content ? Left1212Can We change post content ? Center11Can We change post content ? Right112
    Can We change post content ? Ape_b110
    Can We change post content ? Ape1010
    Draxion
    Draxion
    Helper
    Helper


    Male Posts : 2518
    Reputation : 321
    Language : English
    Location : USA

    Solved Re: Can We change post content ?

    Post by Draxion Thu 1 Sep - 17:22

    Hello there,

    It is possible through JavaScript but it would be quite a complex code to develop.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    Solved Re: Can We change post content ?

    Post by SLGray Thu 1 Sep - 19:01

    The best thing you can do is create an announcement somewhere on your forum informing your members about this.



    Can We change post content ? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Solved Re: Can We change post content ?

    Post by Ch@lo Valdez Thu 8 Sep - 22:38

    hi, what version is your forum?

    and what kind of html elements use in your post?
    only <a></a>?

    scratch

    edit:

    ok i write this code, try it, is for phpbb3

    Code:

    $(document).ready(function ($) {
        //***** Escrito por Chalo para Open Source 2014-2016 *****//
        //-------Visita http://www.opensourcephpbb3.com ----------//
        if (/\/t\d+/g.test(window.location.pathname)) {
            var e, a, n, m, t, p;
            e = document.getElementsByClassName('post');
            t = '<span style="width: 91%; text-shadow: 0 1px 0 #fffaf1; background-position: 10px center; background-repeat: no-repeat; font-family: Arial, Helvetica, sans-serif; font-size: 14px; padding: 15px 10px 15px 30px; text-align: justify; line-height: 3; margin: 10px;background-color: rgba(255, 0, 0, .24); color: #d8000c; border: 1px solid rgba(255, 0, 0, .13);"><img style= "vertical-align: middle;" src="https://cdn3.iconfinder.com/data/icons/discovery/32x32/status/important.png"/> Please, going to: Profile-->Prefrences-->Always allow html tick yes and save.</span></br>';
            for (m = 0; m < e.length; m++) {
                a = e[m].getElementsByClassName('content')[0];
                if (a && a.textContent.match(/(<[^>]*>(\w*.+)>)/g)) {
                    n = a.innerHTML.replace(/&amp;/g, '&').replace(/&gt;/g, '>').replace(/&lt;/g, '<').replace(/&quot;/g, '"');
                    a.innerHTML = n;
                    a.insertAdjacentHTML('afterbegin', t)
                }
            }
        }
    });


    Last edited by Ch@lo Valdez on Fri 9 Sep - 4:42; edited 2 times in total
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Re: Can We change post content ?

    Post by TamDonCo Fri 9 Sep - 2:54

    Thanks for your code, Ch@lo Valdez


    I will test tomorrow, I just see it

    mine is phpbb3
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Solved Re: Can We change post content ?

    Post by Ch@lo Valdez Fri 9 Sep - 4:32

    i made some changes replace the code and let me know how work in your board
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Re: Can We change post content ?

    Post by TamDonCo Fri 9 Sep - 13:21

    Thank You Very Much , Ch@lo Valdez

    Both work fine
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Solved Re: Can We change post content ?

    Post by Ch@lo Valdez Fri 9 Sep - 14:19

    Smile

    can you click here? ---> Can We change post content ? Captur10

    Very Happy

    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3524
    Language : English
    Location : United States

    Solved Re: Can We change post content ?

    Post by SLGray Fri 9 Sep - 19:49

    Problem solved & topic archived.
    Please read our forum rules:  ESF General Rules



    Can We change post content ? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.

      Current date/time is Wed 13 Nov - 17:29