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.

problem with code redirects Association

View previous topic View next topic Go down

problem with code redirects Association

Post by GAMSgr on January 31st 2017, 6:50 pm

Code:
(function(){
varhtml_page ='/h10-Page',
link_change =true,
redirect =true;

$(function(){
varregex =newRegExp(html_page);

// link change
if(link_change && !regex.test(window.location.href)) {
$('a[href^="/login"], a[href^="http://'+ window.location.host +'/login"]').attr('href', html_page);
}

// redirect to classic if login page isn't available
if(!document.getElementById('fa_form_container') && regex.test(window.location.href)) {
window.location.href ='/login#login_classic';
}
});

// login redirection
// saves redirect location so you're taken to the correct page upon login
if(/\/login\?redirect/.test(window.location.href)) {
my_setcookie('fa_login_form_redirect', window.location.search.replace(/.*?redirect=(.*?)(?:&|$)/,'$1'));
}

// redirect
if(redirect &&/\/login/.test(window.location.href)) {
if(/login_classic/.test(window.location.hash) ||/admin=1/.test(window.location.href))return;
window.location.href = html_page;
}
}());

I put this but it operates with the connection

good night!

GAMSgr
Forumember

Posts : 53
Reputation : 1
Language : greek,english

http://www.best-gaming.net/forum

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