Can We change post content ?
5 posters
Page 1 of 1
Can We change post content ?
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 ?
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
Re: Can We change post content ?
Hello there,
It is possible through JavaScript but it would be quite a complex code to develop.
It is possible through JavaScript but it would be quite a complex code to develop.
Re: Can We change post content ?
The best thing you can do is create an announcement somewhere on your forum informing your members about this.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Can We change post content ?
hi, what version is your forum?
and what kind of html elements use in your post?
only <a></a>?
edit:
ok i write this code, try it, is for phpbb3
and what kind of html elements use in your post?
only <a></a>?
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(/&/g, '&').replace(/>/g, '>').replace(/</g, '<').replace(/"/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
- Posts : 138
Reputation : 50
Language : spanish
Re: Can We change post content ?
Thanks for your code, Ch@lo Valdez
I will test tomorrow, I just see it
mine is phpbb3
I will test tomorrow, I just see it
mine is phpbb3
Re: Can We change post content ?
i made some changes replace the code and let me know how work in your board
Ch@lo Valdez- Forumember
- Posts : 138
Reputation : 50
Language : spanish
Ch@lo Valdez- Forumember
- Posts : 138
Reputation : 50
Language : spanish
Re: Can We change post content ?
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» How is pre-content added to post edit box?
» Searching post content
» Post Adult Content?
» Keyframes Content Change
» Hide Code? or Post to See Content Code?
» Searching post content
» Post Adult Content?
» Keyframes Content Change
» Hide Code? or Post to See Content Code?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum