Add to favorites - Send Page Functions

Use GitHub to post feature requests for phpwcms.
Locked
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Add to favorites - Send Page Functions

Post by eglwolf »

If there is not one already it would be nice to have an add to favorites function built in And also a send page function.

like there is for "back", "top", "Print"

If this is built in already can someone point me to it?
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Add to Favorites Update

Post by eglwolf »

Ok I searched and played around enought that I found a snippet of code that works.

Code: Select all

     
<script> 
<!-- 
if (document.all && document.getElementById){ 
document.write("<a href=\"#\" onclick=\"window.external.AddFavorite('" +document.URL+ "', '" +document.title+ "');return false;\">bookmark</a>") 
} 
else 
{ 
document.write("Bookmark This Page") 
} 
// --> 
</script> 


The only last thing I would like to do is get the icon to also be hyperlinked to the script. So that they can click the icon or the text and add to favorites.

Code: Select all

<img src="img/article/icn_bookmark.gif" border="0">
Any coders out there know how to do this?
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Send This Page

Post by eglwolf »

Well I have the "Send this Page" thing worked out.


In your template HTML head you can enter:

Code: Select all

<script language="javascript">
function mailpage()
{
mail_str = "mailto:?subject=Check out the " + document.title;
mail_str += "&body=I thought you might be interested in the " + document.title;
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}
</script> 
(I personally like to make a .js file for these and then call it from the html head of the template:

Code: Select all

<script type="text/javascript" language="JavaScript1.2" src="images/email.js"></script>
And save this code as the email.js and upload it to your desired location:

Code: Select all

function mailpage()
{
mail_str = "mailto:?subject=Check this out - " + document.title;
mail_str += "&body=I thought you might be interested in the " + document.title;
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}


Then for the link use:

Code: Select all

javascript:mailpage()

I finally found this on this site:

http://www.hooverwebdesign.com/emailpage.html
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

http://www.studmed.dk Portal for doctors and medical students in Denmark
Jérôme
Posts: 481
Joined: Tue 16. Mar 2004, 10:33
Location: Cologne, Germany
Contact:

Post by Jérôme »

I would also recommend the hack - the other method is too dependend on browser/email client. If the email client is not correctly configured and included in the browser, this method will not work.
eglwolf
Posts: 70
Joined: Mon 12. Apr 2004, 01:23

Post by eglwolf »

Thanks I will take a look at this.

Does anyone know of a better cross browser "Bookmark", "Add to Favorites". The one I am using now only works with IE, and I would like something to work with IE, Netscape, Mozilla, FireFox and Opera.
Locked