Can We change post content ?

Go down

Solved Can We change post content ?

Post by TamDonCo on September 1st 2016, 12:22 am

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 September 9th 2016, 3:21 pm; edited 1 time in total
TamDonCo
TamDonCo
Forumember

Posts : 416
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Can We change post content ?

Post by APE on September 1st 2016, 1:54 pm

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
APE
APE
Administrator
Administrator

Male Posts : 14821
Reputation : 1615
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Can We change post content ?

Post by Draxion on September 1st 2016, 7:22 pm

Hello there,

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


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as Can We change post content ? Solved11 when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

Can We change post content ? Draxio14
Draxion
Draxion
Support Moderator
Support Moderator

Male Posts : 2384
Reputation : 301
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Solved Re: Can We change post content ?

Post by SLGray on September 1st 2016, 9: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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46555
Reputation : 3269
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

Solved Re: Can We change post content ?

Post by Ch@lo Valdez on September 9th 2016, 12:38 am

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 September 9th 2016, 6:42 am; edited 2 times in total
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: Can We change post content ?

Post by TamDonCo on September 9th 2016, 4:54 am

Thanks for your code, Ch@lo Valdez


I will test tomorrow, I just see it

mine is phpbb3
TamDonCo
TamDonCo
Forumember

Posts : 416
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Can We change post content ?

Post by Ch@lo Valdez on September 9th 2016, 6:32 am

i made some changes replace the code and let me know how work in your board
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: Can We change post content ?

Post by TamDonCo on September 9th 2016, 3:21 pm

Thank You Very Much , Ch@lo Valdez

Both work fine
TamDonCo
TamDonCo
Forumember

Posts : 416
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Solved Re: Can We change post content ?

Post by Ch@lo Valdez on September 9th 2016, 4:19 pm

Smile

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

Very Happy

Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: Can We change post content ?

Post by SLGray on September 9th 2016, 9: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.
SLGray
SLGray
Administrator
Administrator

Male Posts : 46555
Reputation : 3269
Language : English
Location : United States

https://help.forumotion.com/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum