Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 05:37:40 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 54
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 53
Total: 54

Author Topic: Add to favorites / Set as Homepage Block  (Read 21729 times)

0 Members and 1 Guest are viewing this topic.

Gargoyle

  • Guest
Add to favorites / Set as Homepage Block
« on: March 04, 2006, 05:25:46 PM »
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...

Code: [Select]
<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

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #1 on: March 05, 2006, 11:33:03 AM »
Good Script, Thanks For it

ontap

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #2 on: March 06, 2006, 02:50:18 AM »

alan s

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #3 on: March 06, 2006, 02:53:46 AM »
like this script, could be very useful.

Gargoyle

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #4 on: March 06, 2006, 11:08:11 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

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #5 on: March 06, 2006, 11:27:27 AM »
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.

yeshaib

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #6 on: March 07, 2006, 11:35:00 AM »
Thank you

crip

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #7 on: March 07, 2006, 12:54:22 PM »
The code is strait forward, it works good in a script block..


miyagi

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #8 on: March 28, 2006, 06:26:38 AM »
great code... cheers :)

akulion

  • Guest
Re: Add to favorites / Set as Homepage Block
« Reply #9 on: April 30, 2006, 06:18:20 AM »
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)

Code: [Select]


<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
« Last Edit: April 30, 2006, 06:20:03 AM by akulion »