|
|
Forum moderator: bigblog |
uCoz Community For Webmasters Design Customization How to redirecting to file catalog |
How to redirecting to file catalog |
Harina,
Code <?if($USER_LOGGED_IN$)?> <script> window.location.href = "http://yourdomain.com/load"; </script> <?endif?> I am not sure if you insert it on top of site it will work but it works at home page template. You might need to insert it manual in all codes. Systems developer
|
Soldierdevil, this will make all pages inaccessible for logged-in users, I'm not sure this is what OP wants. If that's the case, then your answer is good.
In all other cases, I'd suggest using cookies. The general idea is to have a cookie (let's call it "justLoggedIn") that would be checked upon by a script that will execute on every page load. If this cookie exists in the user's browser, then don't do anything. Otherwise, create the cookie and redirect the user to /load. If the user is logged out and the cookie exists, delete the cookie and redirect to whatever page (/, for example). Harina, if this is what you have in mind, let me know and I'll try to help you write this script for your website. I am not sure if you insert it on top of site it will work but it works at home page template. You might need to insert it manual in all codes. Should work in global blocks, if that's what you mean. hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
Harina, this should do the job:
Code <script src="https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js"></script> <script type="text/javascript"> window.onload = function () { <?if($USER_LOGGED_IN$)?> if (!Cookies.get('uuser_logged_in')) { Cookies.set('uuser_logged_in', 1, { expires: 365 } ); window.location.href = '/load'; } <?else?> if (Cookies.get('uuser_logged_in')) { Cookies.remove('uuser_logged_in'); } <?endif?> } </script> place this in the Bottom part of the website global template hey i'm joe and i do not work for the company anymore, please contact other staff or tech support
icon by ch-chau sometimes i lurk here |
| |||
| |||