1/** //** ----= updateLandingCookie =--------------------------------------------------------------------------------------\**//** \ 2* 3* Basic landing cookie manager. 4* 5* @param string [$page] - Source page to redirect from. By default current page is used. 6* @param MIXED $url - Target url. If link element specified - will use href attribute. 7* If set to FALSE redirect will be deleted. 8* 9\**//** ---------------------------------------------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/ 10function updateLandingCookie ($page, $url) { 11 12 // Preparing target 13 $page = !isEmpty($page) ? $page : location.pathname; 14 15 // Reading url 16 $url = $url.pathname ? $url.pathname : $url; 17 18 // Reading current cookie, to update/add new redirect 19 var $c = getCookie('mwLandingUrls', {}); 20 21 if ( !isObject($c) ) 22 $c = JSON.parse($c); 23 24 // Adding/updating/removing redirect 25 if ( $url ) 26 $c[$page] = $url; 27 else 28 delete($c[$page]); 29 30 // Saving cookie 31 $c = JSON.stringify($c); 32 setCookie('mwLandingUrls', $c); 33 34} //FUNC updateLandingCookie 35 36/** //** ----= setLandingUrl =--------------------------------------------------------------------------------------\**//** \ 37* 38* Stores landing cookie for specified page. 39* 40* @param MIXED $url - Target url. If link element specified - will use href attribute. 41* @param string [$page] - Source page to redirect from. By default current page is used. 42* 43\**//** ---------------------------------------------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/ 44function setLandingUrl ($url, $page) { 45 updateLandingCookie($page, $url); 46} //FUNC setLandingUrl 47 48/** //** ----= clearLandingUrl =--------------------------------------------------------------------------------------\**//** \ 49* 50* Clears landing cookie for specified page. 51* 52* @param string $page - Source page to clear redirect for. If link element specified - will use href attribute. 53* 54\**//** ---------------------------------------------------------------------------= by Mr.V!T @ Morad Media Inc. =----/** //**/ 55function clearLandingUrl ($page) { 56 57 // Reading target 58 $page = $page.pathname ? $page.pathname : $page; 59 60 if ( !$page ) 61 return; 62 63 updateLandingCookie($page, false); 64 65} //FUNC clearLandingUrl
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.