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
4 posters

    Forum logout without confirmation

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Forum logout without confirmation

    Post by Van-Helsing October 24th 2016, 1:52 am

    Hello,
    I forgot the code for forum logging out without confirmation. scratch Can someone hep me?
    Ace 1
    Ace 1
    Helper
    Helper


    Male Posts : 843
    Reputation : 64
    Language : English - French?
    Location : Druid Hill Park

    Solved Re: Forum logout without confirmation

    Post by Ace 1 October 24th 2016, 3:10 pm

    @Van-Helsing If you're talking about the Log out found in the toolbar, then add this to your JavaScripts:

    Code:
    $(function() {
      $('ul#fa_menulist li a').last().click(function(e) {
        $.get(this.href, function(data) {
          $('input[value="Yes"]', data).click();
        });
        e.preventDefault();
      });
    });
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Solved Re: Forum logout without confirmation

    Post by Ch@lo Valdez October 24th 2016, 11:55 pm

    try:

    Code:

    $(function () {
        $(function () {
            var b, c, a = document.getElementById('logout');
            if (a) {
                b = document.getElementById('fa_menulist');
                c = b && b.lastChild.childNodes[0];
                b.onclick = function () {
                    $.post('/login?logout' + '&tid=' + a.href.match(/(\w+)(?=\&key)/g)[0] + '&key=' + a.href.match(/(\w+)$/)[0] + '&confirm=1', function () {
                        window.location.reload()
                    });
                    return false
                };
            }
        });
    });
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Solved Re: Forum logout without confirmation

    Post by Ch@lo Valdez October 25th 2016, 12:03 am

    more easy Smile

    Code:

    $(function () {
        $(function () {
            var b, c,d, a = document.getElementById('logout');
            if (a) {
                b = document.getElementById('fa_menulist');
                c = b && b.lastChild.childNodes[0];
                d = a.href;
                c.href = d;
             
            }
        });
    });
    Ace 1
    Ace 1
    Helper
    Helper


    Male Posts : 843
    Reputation : 64
    Language : English - French?
    Location : Druid Hill Park

    Solved Re: Forum logout without confirmation

    Post by Ace 1 October 25th 2016, 12:38 am

    Always with the non-AJAX (or even jQuery) JavaScript @Ch@lo Valdez.

    Good work.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Forum logout without confirmation

    Post by Van-Helsing October 27th 2016, 12:30 am

    Hi dear all,
    Thanks a lot, I adapt it to fit on my forum because. I am not using the fa toolbar so I made some changes to work. Wink

    My problem has been solved.
    Hello
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: Forum logout without confirmation

    Post by SLGray October 27th 2016, 7:04 am

    Problem solved & topic archived.
    Please read our forum rules:  ESF General Rules



    Forum logout without confirmation Slgray10

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

      Current date/time is November 11th 2024, 8:04 pm