TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 10:33:24 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 92
  • Total: 92

Add to favorites / Set as Homepage Block *NEW* (All browsers)

Started by SMITHONLINE, April 27, 2007, 12:35:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SMITHONLINE

I Have used other peoples script's on other sites and combined to get the best one so i thought i would share with everyone:-

This script will give you two buttons one bookmark this site and the other set as hompage. I have attached some buttons for you to use but you can make your own with any online button generator.

The buttons fit nicely in the left or right blocks

I have put the sections of code you need to change in capitals:
(e.g http://www.yoursite.com)

<script type="text/javascript">

/***********************************************
* Bookmark site script- Ã,© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>

<a href="javascript:bookmarksite('YOUR SITE NAME', 'http://www.YOURSITE.com')"><img src="http://www.URLTOIMAGE.com" border=0></a>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
// If it's Internet Explorer, use automatic link
// Be sure to change the "http://www.yoursite.com\"
// to the URL you want them to bookmark.
if (document.all){
Ã,  document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.YOURSITE.com\');">');
Ã,  document.write('<img src="http://URLTOIMAGE.com" width="160" height="25">');
}

// If it's Netscape 6, tell user to drag link onto Home button
// Be sure to change the "http://www.yoursite.com\"
// to the URL you want them to bookmark.
else if (document.getElementById){
Ã,  document.write('<a href="http://www.YOURSITE.com">Drag this link onto your Home button to make this your Home Page.</a>');
}

// If it's Netscape 4 or lower, give instructions to set Home Page
else if (document.layers){
Ã,  document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
}

// If it's any other browser, for which I don't know the specifications of home paging, display instructions
else {
Ã,  document.write('<b>Make this site your home page:</b><br>- Go to <b>Preferences</b> in the <B>Edit</B> Menu.<br>- Choose <b>Navigator</b> from the list on the left.<br>- Click on the <b>"Use Current Page"</b> button.');
}
//Ã,  End -->
</script>



noxe

Thank you, I've been looking for this script that works on all browsers :)


2bz2p

Hello,

     I was wondering if it is possible to use this code (or a code for book marking) in the footer of the index.template.php?

Thanks
2b


DawnsWebDesigns