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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:07:24 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 143
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 113
  • Total: 113

Add to favorites / Set as Homepage Block

Started by Gargoyle, March 05, 2006, 12:25:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gargoyle

This goes in a Java/html box and adds the ability for your users to either add you to their favorites or set your site as their homepage.

You will OBVIOUSLY want to replace the URL that points to my site to your sites URL in ALL of the below instances where it occurs.

The Bookmark script was fetched from another post in here... Just not sure where...


<center>
<Script>
function ssbookmark(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
</script>
<a href="javascript:ssbookmark('SouthSideStreetCars.org', 'http://www.SouthSideStreetCars.org')"><b>Add South Side Street Cars to your list of favorite's</b></a>
<br><br>
<SCRIPT LANGUAGE="JavaScript">

if (document.all){
  document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.southsidestreetcars.org\');">');
  document.write('<B>Make South Side Street Cars Your Homepage</B></a>');
}

// If it's Netscape 6, tell user to drag link onto Home button
else if (document.getElementById){
  document.write('<a href="http://www.southsidestreetcars.org"><b>Drag this link onto your Home button to make South Side Street Cars your Home Page.</b></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 South Side Street Cars 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></center>

alan s



alan s


Gargoyle

Quote from: OnTap! on March 06, 2006, 09:50:18 AM

something like this was posted before....

http://www.tinyportal.net/smf/index.php?topic=1847.msg16069#msg16069

That is similar but this also adds the ability to set the site as your homepage. I think I used the code from that post in the bookmark section though. ;D

TwinsX2Dad

Or you might have pulled it from just about anywhere - that script is very standard.

I am noticing that your code above causes some themes to move out - the block created by this doesn't always render correctly.

I am looking at it to see what bugs might be worked out.


crip

The code is strait forward, it works good in a script block..



akulion

#9
Well this isnt much (the button graphics arent that great) but I made buttons instead of those long text lnks




simply use the code below: (and be sure to replace yoursite.com with ur site addy)




<center>
<Script>
function ssbookmark(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
</script>
<a href="javascript:ssbookmark('Your Site.Com', 'http://www.yoursite.net')"><img src="http://yoursite.com/bookmark.gif" border=0></a>
<br><br>
<SCRIPT LANGUAGE="JavaScript">

if (document.all){
  document.write('<A HREF="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://yoursite.com\');">');
  document.write('<img src="http://yoursite.com/homepage.gif" border=0>');
}

// If it's Netscape 6, tell user to drag link onto Home button
else if (document.getElementById){
  document.write('<a href="http://yoursite.com"><img src="http://yoursite.com/homepage.gif" border=0><br><font size=1>Drag the icon above<br>to your browser<br>homebutton</font></a>');
}

// If it's Netscape 4 or lower, give instructions to set Home Page
else if (document.layers){
  document.write('<font size="2"><b>Make this page 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.</font>');
}

// If it's any other browser, for which I don't know the specifications of home paging, display instructions
else {
  document.write('<font size="2"><b>Make this 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.</font>');
}
//  End -->
</script></center>





Demo: Here