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.
The forum of the forums
3 posters

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

    Ramdaman
    Ramdaman
    Active Poster


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

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

    Post by Ramdaman Sat 2 May - 18:17

    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

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

    Post by SLGray Sat 2 May - 20:17

    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.
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur Sat 2 May - 22:03

    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.
    Ramdaman
    Ramdaman
    Active Poster


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

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

    Post by Ramdaman Sat 2 May - 22:52

    @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.
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

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

    Post by Ange Tuteur Sat 2 May - 23:01

    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=/,"")});
    Ramdaman
    Ramdaman
    Active Poster


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

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

    Post by Ramdaman Sun 3 May - 17:07

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


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

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

    Post by Ange Tuteur Sun 3 May - 21:04

    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 ?
    Ramdaman
    Ramdaman
    Active Poster


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

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

    Post by Ramdaman Sun 3 May - 22:08

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


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

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

    Post by Ange Tuteur Sun 3 May - 22:18

    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

      Current date/time is Sun 22 Sep - 20:24