<< Previous Topic | Next Topic >>  

Thorny: PersonalPic cookie code

February 14 2002 at 12:31 AM
Phil  (Login mrpip)
Forum Owner

 
The scripts for remembering your personal pic Url in cookies

This code I suggest is put near the top, in the header
<script language="Javascript">
<!--
function ReadCookie(cookieName){
var theCookie=""+document.cookie;
var ind=theCookie.indexOf(cookieName);
if (ind==-1 || cookieName=="") return "";
var ind1=theCookie.indexOf(';',ind);
if (ind1==-1) ind1=theCookie.length;
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
var today = new Date();
expiry = new Date(today.getTime() + 6*60*24*60*60*1000);
function SetCookie (name, value){
document.cookie=name + "=" + escape (value) + "; expires=" + expiry.toGMTString();
}
// -->
</script>


This code in your "Text Formatting" code
document.write("<a href='javascript:PersonalPic()'>PersonalPic</a><font size='-2'>[<a href='javascript:chgppic()'>url</a>]</font> ")
I placed the [url] link next to the PersonalPic link cause I couldn't think of anything else.

and this one can go anyway in your "Text Formatting" code
function chgppic(){
var ppicurl=ReadCookie("fid170347ppic");
var url=prompt("Enter the URL of your Personal Picture.", ppicurl);
if (url){SetCookie("fid170347ppic", url);}
}
function PersonalPic(){
if(document.all.message.type=="hidden"){alert("Unable to edit message in \"Preview Mode\"!")}
else{
var ppicurl=ReadCookie("fid170347ppic");
if (ppicurl > ""){document.all.message.value=document.all.message.value + '<img id=input src="'+ppicurl+'">';}
else{void(PPic=prompt("Enter the URL of your Personal Picture.", "http://"));
if(PPic)document.all.message.value=document.all.message.value + '<img id=input src="'+PPic+'">';}
document.all.message.focus()
}
}




    
This message has been edited by mrpip on Feb 14, 2002 12:45 AM


 
 Respond to this message   
AuthorReply
Thorny Rose
(Login ThornyRose)

Much thanks!

February 14 2002, 4:10 AM 

<clap clap clap from joy>




A Tale of Two Movies

Thorny’s Portal



 
 Respond to this message   
Phil
(Login mrpip)
Forum Owner

Re: Much thanks!

February 14 2002, 7:03 AM 

OMG, It worked, it worked 1st time, no problems


 
 Respond to this message   
Current Topic - Thorny: PersonalPic cookie code
  << Previous Topic | Next Topic >>  
Find more forums on Personal Web PagesCreate your own forum at Network54
 Copyright © 1999-2009 Network54. All rights reserved.   Terms of Use   Privacy Statement