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

    Custom Logout URL

    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Custom Logout URL

    Post by J0k3R^ April 21st 2014, 4:58 pm

    Hey, how can i make a custom logout URL for my forum?
    the reason i want this is because i edit my navbar in css but i cant edit the "logout" one because the link is its different for every user...

    Spoiler:


    i found a tutorial about it which had the following code for js but it didnt work for me (i ofc tried to put new link there). Im using punbb, thanks again Very Happy

    Spoiler:


    Last edited by J0k3R^ on April 23rd 2014, 12:01 pm; edited 1 time in total
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: Custom Logout URL

    Post by Pizza Boi April 21st 2014, 5:59 pm

    Hi Very Happy

    Well, there's a general logout link: /login?logout so the script should look something like:

    Code:
    var logoutlink = document.getElementById("i_icon_mini_logout").parentNode.href;
    document.getElementById("New Logout Link // Replace this").href = login?logout;

    Regards,
    Pizza Boi
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 21st 2014, 6:22 pm

    already tried this mate..
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: Custom Logout URL

    Post by Pizza Boi April 21st 2014, 6:29 pm

    Hi Very Happy

    So you want the word to change? I experimented here in FM and this works fine for me:

    Code:
    a#logout {
      font-size: 0px !important;
    }
    a#logout:after {
      font-size: 12px !important;
      content: "Log Out Boi";
    }

    Regards,
    Pizza Boi
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 21st 2014, 6:58 pm

    although this code worked i want to change the logout link  loul
    Pizza Boi
    Pizza Boi
    Hyperactive


    Male Posts : 2016
    Reputation : 160
    Language : French
    Location : Pizza Hut!

    Solved Re: Custom Logout URL

    Post by Pizza Boi April 21st 2014, 7:11 pm

    Hi Very Happy

    Can you link me to the tutorial? I think the code's incomplete so let me see if I can check it. Here's what I got so far after snitching but I don't think this works:

    Code:
    var logoutlink = document.getElementById("a#logout").parentNode.href;
    document.getElementById("newlogoutlink").href = logoutlink;
    if
        {
        elem.innerHTML = "Can't logout";
        }
        else
        {
        elem.innerHTML = "Custom log out";
        }

    Regards,
    Pizza Boi
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Custom Logout URL

    Post by Ange Tuteur April 21st 2014, 10:43 pm

    Hello J0k3R^,

    You can edit the default logout navlink by selecting the 'logout' Id. See the script below :
    Code:
    $(function() {
     Â   var logout = document.getElementById('logout');
     Â   logout.href = '/login?logout=1';
     Â   logout.innerHTML = 'My logout link';
    });

    We set the href content; taking out the tid and key will open a prompt instead of instantly logging you out. Then we set the text content by changing the inner HTML of the logout link.
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 22nd 2014, 1:11 pm

    okey, its working @Ange
    but how can i avoid the confirm page? ("u sure want to logout?")
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Custom Logout URL

    Post by Ange Tuteur April 22nd 2014, 9:43 pm

    Remove where we change its href content :
    Code:
    $(function() {
        var logout = document.getElementById('logout');
        logout.innerHTML = 'My logout link';
    });
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 23rd 2014, 7:09 am

    Ange Tuteur wrote:Remove where we change its href content :
    Code:
    $(function() {
     Â   var logout = document.getElementById('logout');
     Â   logout.innerHTML = 'My logout link';
    });

    this didnt work, the link is the default. :/
    but i use your privious code and im fine i guess...
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Custom Logout URL

    Post by Ange Tuteur April 23rd 2014, 9:50 am

    Did you copy the code correctly ? It works perfectly fine for me.
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 23rd 2014, 11:50 am

    Ange Tuteur wrote:Did you copy the code correctly ? It works perfectly fine for me.

    EDIT: i want to change the logout url not the text at nav bar.
    ur code changes the text at nav bar, i want to change this: Custom Logout URL OUpeXQh
    to a custom url for all users, because this one is different for every user. Smile

    sorry for the missunderstanding  :rose:
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Custom Logout URL

    Post by Ange Tuteur April 23rd 2014, 10:57 pm

    If you remove the tid and key then you will be met with a confirmation page each time you logout.

    Code:
    $(function() {
     Â   var logout = document.getElementById('logout');
     Â   logout.href = '/login?logout=1';
    });
    J0k3R^
    J0k3R^
    Forumember


    Male Posts : 742
    Reputation : 28
    Language : Greek > English > Russian > Spanish
    Location : C:\>r00t

    Solved Re: Custom Logout URL

    Post by J0k3R^ April 24th 2014, 8:03 am

    *Solved*
    Jophy
    Jophy
    ForumGuru


    Male Posts : 17922
    Reputation : 836
    Language : English
    Location : Somewhere

    Solved Re: Custom Logout URL

    Post by Jophy April 24th 2014, 9:12 am

    Moved

      Current date/time is November 11th 2024, 7:06 pm