The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Can We change post content ?

View previous topic View next topic 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://s13.postimg.org/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
Forumember

Posts : 180
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





APE
Manager
Manager

Male Posts : 8636
Reputation : 756
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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.

Draxion
Helper
Helper

Male Posts : 576
Reputation : 84
Language : English
Location : USA

http://dawnofthedragons.forumotion.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.


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


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.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
Forumember

Male Posts : 100
Reputation : 31
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
Forumember

Posts : 180
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
Forumember

Male Posts : 100
Reputation : 31
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
Forumember

Posts : 180
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? --->

Very Happy


Ch@lo Valdez
Forumember

Male Posts : 100
Reputation : 31
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


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


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


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