Custom Logout URL
4 posters
Page 1 of 1
Custom Logout URL
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...
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
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
- Spoiler:
- Code:
var logoutlink = document.getElementById("i_icon_mini_logout").parentNode.href;
document.getElementById("newlogoutlink").href = logoutlink;
Last edited by J0k3R^ on Wed 23 Apr - 10:01; edited 1 time in total
Re: Custom Logout URL
Hi
Well, there's a general logout link: /login?logout so the script should look something like:
Regards,
Pizza Boi
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- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Custom Logout URL
Hi
So you want the word to change? I experimented here in FM and this works fine for me:
Regards,
Pizza Boi
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- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Custom Logout URL
Hi
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:
Regards,
Pizza Boi
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- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Custom Logout URL
Hello J0k3R^,
You can edit the default logout navlink by selecting the 'logout' Id. See the script below :
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.
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.
Re: Custom Logout URL
okey, its working @Ange
but how can i avoid the confirm page? ("u sure want to logout?")
but how can i avoid the confirm page? ("u sure want to logout?")
Re: Custom Logout URL
Remove where we change its href content :
- Code:
$(function() {
var logout = document.getElementById('logout');
logout.innerHTML = 'My logout link';
});
Re: Custom Logout URL
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...
Re: Custom Logout URL
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:
to a custom url for all users, because this one is different for every user.
sorry for the missunderstanding
Re: Custom Logout URL
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';
});
Jophy- ForumGuru
- Posts : 17922
Reputation : 836
Language : English
Location : Somewhere
Similar topics
» Logout Popup
» automatic logout
» Logout problem.
» The logout link
» Forum logout without confirmation
» automatic logout
» Logout problem.
» The logout link
» Forum logout without confirmation
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum