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.

Forum logout without confirmation

View previous topic View next topic Go down

Solved Forum logout without confirmation

Post by Van-Helsing on Mon Oct 24 2016, 02:52

Hello,
I forgot the code for forum logging out without confirmation. scratch Can someone hep me?
avatar
Van-Helsing
Hyperactive

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Forum logout without confirmation

Post by Ace 1 on Mon Oct 24 2016, 16:10

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

Male Posts : 808
Reputation : 55
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Forum logout without confirmation

Post by Ch@lo Valdez on Tue Oct 25 2016, 00:55

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

Male Posts : 131
Reputation : 45
Language : spanish

Back to top Go down

Solved Re: Forum logout without confirmation

Post by Ch@lo Valdez on Tue Oct 25 2016, 01:03

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

Male Posts : 131
Reputation : 45
Language : spanish

Back to top Go down

Solved Re: Forum logout without confirmation

Post by Ace 1 on Tue Oct 25 2016, 01:38

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

Good work.
avatar
Ace 1
Helper
Helper

Male Posts : 808
Reputation : 55
Language : English - French?
Location : Druid Hill Park

http://help.forumotion.com

Back to top Go down

Solved Re: Forum logout without confirmation

Post by Van-Helsing on Thu Oct 27 2016, 01:30

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

Male Posts : 2306
Reputation : 90
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Forum logout without confirmation

Post by SLGray on Thu Oct 27 2016, 08:04

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 40171
Reputation : 2714
Language : English
Location : United States

https://fmthemes.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