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.

Forum logout without confirmation

4 posters

Go down

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?
Van-Helsing
Van-Helsing
Hyperactive

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

http://itexperts.forumgreek.com/

Back to top Go down

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();
  });
});
Ace 1
Ace 1
Helper
Helper

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

https://help.forumotion.com

Back to top Go down

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

Back to top Go down

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;
         
        }
    });
});
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

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.
Ace 1
Ace 1
Helper
Helper

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

https://help.forumotion.com

Back to top Go down

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
Van-Helsing
Van-Helsing
Hyperactive

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

http://itexperts.forumgreek.com/

Back to top Go down

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

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

Back to top

- Similar topics

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