Can We change post content ? Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
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 Aug 31, 2016 5:22 pm

    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 Sep 09, 2016 8:21 am; edited 1 time in total
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Can We change post content ?

    Post by Ape Thu Sep 01, 2016 6:54 am

    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 Sep 01, 2016 12:22 pm

    Hello there,

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


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Can We change post content ?

    Post by SLGray Thu Sep 01, 2016 2:01 pm

    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 Sep 08, 2016 5:38 pm

    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 Thu Sep 08, 2016 11:42 pm; edited 2 times in total
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Solved Re: Can We change post content ?

    Post by TamDonCo Thu Sep 08, 2016 9:54 pm

    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 Thu Sep 08, 2016 11:32 pm

    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 Sep 09, 2016 8:21 am

    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 Sep 09, 2016 9:19 am

    Smile

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

    Very Happy

    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Can We change post content ?

    Post by SLGray Fri Sep 09, 2016 2:49 pm

    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.