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.

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

View previous topic View next topic Go down

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

Post by Ramdaman on 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
Active Poster

Male Posts : 1614
Reputation : 96
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 on 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.


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


SLGray
Administrator
Administrator

Male Posts : 35661
Reputation : 2375
Language : English
Location : United States

http://fmthemes.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 Ange Tuteur on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://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 on 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
Active Poster

Male Posts : 1614
Reputation : 96
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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://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 on May 3rd 2015, 5:07 pm

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

Ramdaman
Active Poster

Male Posts : 1614
Reputation : 96
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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://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 on May 3rd 2015, 10:08 pm

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

Ramdaman
Active Poster

Male Posts : 1614
Reputation : 96
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 on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

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