TinyPortal

Development => Block Codes => Topic started by: Gargoyle on March 05, 2006, 12:25:46 AM

Title: Add to favorites / Set as Homepage Block
Post by: Gargoyle on March 05, 2006, 12:25:46 AM
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>
Title: Re: Add to favorites / Set as Homepage Block
Post by: alan s on March 05, 2006, 06:33:03 PM
Good Script, Thanks For it
Title: Re: Add to favorites / Set as Homepage Block
Post by: 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
Title: Re: Add to favorites / Set as Homepage Block
Post by: alan s on March 06, 2006, 09:53:46 AM
like this script, could be very useful.
Title: Re: Add to favorites / Set as Homepage Block
Post by: Gargoyle on March 06, 2006, 06:08:11 PM
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
Title: Re: Add to favorites / Set as Homepage Block
Post by: TwinsX2Dad on March 06, 2006, 06:27:27 PM
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.
Title: Re: Add to favorites / Set as Homepage Block
Post by: yeshaib on March 07, 2006, 06:35:00 PM
Thank you
Title: Re: Add to favorites / Set as Homepage Block
Post by: crip on March 07, 2006, 07:54:22 PM
The code is strait forward, it works good in a script block..

Title: Re: Add to favorites / Set as Homepage Block
Post by: miyagi on March 28, 2006, 02:26:38 PM
great code... cheers :)
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on April 30, 2006, 01:18:20 PM
Well this isnt much (the button graphics arent that great) but I made buttons instead of those long text lnks

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fmisc%2Fbookmark.gif&hash=7f2dac1a1bcf3c450ff2aaf7b9ce74a9fab3c8b3)
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fmisc%2Fhomepage.gif&hash=95a2bb9da1c32707b65e25d01e8ea6e8eb7f0541)

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 (http://path-to-peace.net/forum/index.php)
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on May 02, 2006, 02:26:23 PM
ok made better buttons lol

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fforum%2Fclocks%2Fbookmark.gif&hash=58da193d6776a045c6c526e7c51203a324b81de5)

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fforum%2Fclocks%2Fhomepage.gif&hash=65fc52bcbe710ba994abbcf87c7647879b9afa28)
Title: Re: Add to favorites / Set as Homepage Block
Post by: deadpoeticstar on May 02, 2006, 03:33:54 PM
Here is My Try at a Bookmark image, and Home
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on May 02, 2006, 03:43:20 PM
OI u just used the button generator lool

But still good - i think u shoudl rename the "home" to "set as homepage" or something
Title: Re: Add to favorites / Set as Homepage Block
Post by: Jump1979man on July 27, 2006, 12:15:57 AM
Quote from: akulion on May 02, 2006, 02:26:23 PM
ok made better buttons lol

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fforum%2Fclocks%2Fbookmark.gif&hash=58da193d6776a045c6c526e7c51203a324b81de5)

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fforum%2Fclocks%2Fhomepage.gif&hash=65fc52bcbe710ba994abbcf87c7647879b9afa28)

Thank you, I am using these.
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on July 27, 2006, 06:48:17 AM
ur welcome :D
Title: Re: Add to favorites / Set as Homepage Block
Post by: sburke930 on August 13, 2006, 10:53:37 PM
NICE...works great!
Title: Re: Add to favorites / Set as Homepage Block
Post by: Joshsux on August 26, 2006, 08:46:46 AM
"""FIXED"""" durr, i had to use javascrit / html not just html.
Title: Re: Add to favorites / Set as Homepage Block
Post by: nikita on August 26, 2006, 06:10:59 PM
nice just used it great mod.... saalam
Title: Re: Add to favorites / Set as Homepage Block
Post by: ZarPrime on September 11, 2006, 08:04:44 AM
Quote from: akulion on April 30, 2006, 01:18:20 PM
Well this isnt much (the button graphics arent that great) but I made buttons instead of those long text lnks

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fmisc%2Fbookmark.gif&hash=7f2dac1a1bcf3c450ff2aaf7b9ce74a9fab3c8b3)
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpath-to-peace.net%2Fmisc%2Fhomepage.gif&hash=95a2bb9da1c32707b65e25d01e8ea6e8eb7f0541)

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



SNIP




Demo: Here (http://path-to-peace.net/forum/index.php)


Greetings,

The buttons aren't there anymore so I can't check it out.  However, I did see a couple of things I really liked.  For instance that Top Posters Section at the bottom.  Oh wait, that looks like it is maybe some fancy dhtml using a div class called windowbg.  Perhaps I will have to look into that.

Oh, and I really like your requirements.jpg on the site.  Any chance you wouldn't mind if I borrowed that for mine?

ZarPrime
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on September 11, 2006, 08:09:41 AM
sure feel free to copy the image

as for the top posters thingie you see....thats called Poster Cloud, just check in the Block Code Snippets Index (on this site) and you will find it listed...easy to install and use :)
Title: Re: Add to favorites / Set as Homepage Block
Post by: ZarPrime on September 11, 2006, 08:14:07 AM
Quote from: akulion on September 11, 2006, 08:09:41 AM
sure feel free to copy the image

as for the top posters thingie you see....thats called Poster Cloud, just check in the Block Code Snippets Index (on this site) and you will find it listed...easy to install and use :)

Ah, great, thanks.  :up: I'll check it out.  ;)

ZarPrime
Title: Re: Add to favorites / Set as Homepage Block
Post by: Porky on October 21, 2006, 11:03:40 PM
what type of box due you put them in now that java and html boxes are split up?
I am retarded I should read first....Don't yell at me G6
Title: Re: Add to favorites / Set as Homepage Block
Post by: exodia on October 28, 2006, 07:38:10 PM
am using the following code but the homepage button isnt working in firefox.can someone help me.
<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('ltlforum.net', 'http://www.ltlforum.net')"><b><img src="Themes/images/b32.gif"/> Favorites</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.ltlforum.net\');">');
  document.write('<B><img src="Themes/images/b34.gif"/> 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.ltlforum.net"><b><img src="Themes/images/b34.gif"/> Home Page</b></a>');
}

// If it's Netscape 4 or lower, give instructions to set Home Page
else if (document.layers){
  document.write('<b><img src="Themes/images/b34.gif"/> 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><img src="Themes/images/b34.gif"/> 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>
Title: Re: Add to favorites / Set as Homepage Block
Post by: copter on October 31, 2006, 02:34:40 PM
Hi!

I get a problem in FF too, but anyway here is my code:




Javascript/Html Block

Bookmark Us

<b><img hspace="3" src="http://img315.imageshack.us/img315/8533/favsnx2.png" align="absMiddle" vspace="3" width="16" height="16">   
<a href="javascript:window.external.AddFavorite('url','sitename');">Bookmark Site</a><br>
<img hspace="3" src="http://img428.imageshack.us/img428/4397/pagenv5.png" align="absMiddle" vspace="3" width="16" height="16">   
<a href="javascript:window.external.AddFavorite(location.href,document.title);">Bookmark Page</a><br>
<img hspace="3" src="http://img428.imageshack.us/img428/2893/homeiu6.png" align="absMiddle" vspace="3" width="16" height="16">   
<a href onclick="javascript:this.style.behavior='url(#default#homepage)';this.setHomePage('url') ;">Make Homepage</a></b>


Yup you'll need to edit the url to your forums url and also edit ur site name, im not sure if it'll work - but it shud do. if not ul have to mess around with it.
Title: Re: Add to favorites / Set as Homepage Block
Post by: akulion on October 31, 2006, 02:35:55 PM
yea the functions in each browser are different for bookmarking
so causes a conflict
Title: Re: Add to favorites / Set as Homepage Block
Post by: falguni1 on November 28, 2007, 07:27:55 AM
I sill cant get how to make this your homepage

I have the bookmark code

I want the homepage code, the homepage code here doesnot work, it only opens the site, doesnot make it your homepage.