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.

How do you enable HTML preference for all members by default + no post screen?

3 posters

Go down

In progress How do you enable HTML preference for all members by default + no post screen?

Post by Ramdaman May 2nd 2015, 6:17 pm

Hello Forumotion, it's been a while.

I'd like to know how can I have the "Always Allow HTML: Yes" preference enabled for all members. Currently, they have to enable it themselves.

Also, what was the Javascript code so when you post you're sent directly to the post, and not the the "post successful" page.

Thank you.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1590
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by SLGray May 2nd 2015, 8:17 pm

There is not an option to set HTML for all members.  It is one of the options that they have to set in their profiles.

You can only activate it for the forum.


How do you enable HTML preference for all members by default + no post screen? 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 : 51554
Reputation : 3523
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ange Tuteur May 2nd 2015, 10:03 pm

Hi @Ramdaman,

It should be possible via AJAX, give this a try :
Administration Panel > Modules > JavaScript codes management > Create a new script

Placement : In all the pages
Code:
// auto enable HTML in the preferences
(function($) {
  if (my_getcookie('faAutoHTML') != 'checked') {
    $.get('/profile?mode=editprofile&page_profil=preferences', function(d) {
      d = $('#ucp', d).serialize(); // serialize form data for submission
     
      /allowhtml=0/.test(d) && $.post('/profile', d.replace(/allowhtml=0/, 'allowhtml=1') + '&submit=1'); // if HTML is disabled we'll submit the modified form data
     
      my_setcookie('faAutoHTML', 'checked'); // set a cookie to prevent constant checks
    });
  }
})(jQuery);
// par ange tuteur

That should send 1 request to the profile preferences and serialize the form data. If that form data contains autohtml=0, we'll update that to 1 and send another request to submit the updated preferences. To prevent multiple requests, a cookie is set after the first check.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ramdaman May 2nd 2015, 10:52 pm

@Ange Tuteur - The code did not work, there is still a page when you post asking if you want to go back to the topic or go back to the forum.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1590
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ange Tuteur May 2nd 2015, 11:01 pm

Oh sorry, I missed the last part. That code I gave you was to auto enable HTML.

Add this script in all the pages for the immediate redirection :
Code:
$("meta[http-equiv='refresh'][content]:first").each(function(){window.location.href=$(this).attr("content").replace(/^.*;url=/,"")});
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ramdaman May 3rd 2015, 5:07 pm

It still appears for a quick second, is there a way I can completely skip that page?
Ramdaman
Ramdaman
Active Poster

Male Posts : 1590
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ange Tuteur May 3rd 2015, 9:04 pm

It appears instantaneous for me. You can try the following which utilizes native JavaScript rather than jQuery, it'll probably be marginally faster.
Code:
(function(a) {
  for (var b = document.getElementsByTagName('META'), c, i = 0; c = b[i]; i++) {
    if (/refresh/i.test(c.httpEquiv)) {
      a.location.href = c.content.replace(/^.*?;url=/, '');
      break;
    }
  }
})(window);

Which device and browser are you using ?
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ramdaman May 3rd 2015, 10:08 pm

It's on my Windows 8 Laptop. I'm using Chrome by the way.
Ramdaman
Ramdaman
Active Poster

Male Posts : 1590
Reputation : 99
Language : English, Albanian, Macedonian, Russian | HTML, CSS
Location : New York City

http://ndihme.forumotion.com/forum

Back to top Go down

In progress Re: How do you enable HTML preference for all members by default + no post screen?

Post by Ange Tuteur May 3rd 2015, 10:18 pm

Did the script I give you work, or was it the same ? From what I recall, people using Chrome have had trouble with this method. I don't know why, because it works on both Firefox and Chrome, along with a few other browsers I use for testing. blackeye
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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