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.

Custom Logout URL

4 posters

Go down

Solved Custom Logout URL

Post by J0k3R^ Mon 21 Apr 2014 - 16:58

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 Wed 23 Apr 2014 - 12:01; edited 1 time in total
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Pizza Boi Mon 21 Apr 2014 - 17:59

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
Pizza Boi
Pizza Boi
Hyperactive

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

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Mon 21 Apr 2014 - 18:22

already tried this mate..
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Pizza Boi Mon 21 Apr 2014 - 18:29

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
Pizza Boi
Pizza Boi
Hyperactive

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

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Mon 21 Apr 2014 - 18:58

although this code worked i want to change the logout link  loul
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Pizza Boi Mon 21 Apr 2014 - 19:11

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
Pizza Boi
Pizza Boi
Hyperactive

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

Back to top Go down

Solved Re: Custom Logout URL

Post by Ange Tuteur Mon 21 Apr 2014 - 22:43

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

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Tue 22 Apr 2014 - 13:11

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

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Ange Tuteur Tue 22 Apr 2014 - 21:43

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

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Wed 23 Apr 2014 - 7:09

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...
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Ange Tuteur Wed 23 Apr 2014 - 9:50

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

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Wed 23 Apr 2014 - 11:50

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:
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Ange Tuteur Wed 23 Apr 2014 - 22:57

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';
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Custom Logout URL

Post by J0k3R^ Thu 24 Apr 2014 - 8:03

*Solved*
J0k3R^
J0k3R^
Forumember

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

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: Custom Logout URL

Post by Jophy Thu 24 Apr 2014 - 9:12

Moved
Jophy
Jophy
ForumGuru

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

Back to top Go down

Back to top

- Similar topics

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