Set As Homepage

Discussion in 'Programming' started by desertst0rm, Jul 30, 2008.

  1. #1
    How make a button or link for a site that set as homepage when it's click? :confused:
     
    desertst0rm, Jul 30, 2008 IP
  2. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #2
    which script/language ?

    what you mean "set as homepage when it's click? "
     
    MeetHere, Jul 30, 2008 IP
  3. Shazz

    Shazz Prominent Member

    Messages:
    8,395
    Likes Received:
    453
    Best Answers:
    0
    Trophy Points:
    330
    #3
    Something like...

    <a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.vbcoderz.com');" style="font-size:12px;color:#ffffff;font-family:verdana;">Set as Home Page</a>
    Code (markup):
    Change the link to yours and the text if needed
     
    Shazz, Jul 30, 2008 IP
  4. desertst0rm

    desertst0rm Peon

    Messages:
    330
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Clicking it will set it as your homepage. Homepage is the house or home Icon on your browser.

    I added the code in php file on my template. It's not working, My default Homepage is still the homepage after clicking the link. It did not set a new homepage.
     
    desertst0rm, Jul 30, 2008 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    You can't... at least not with most modern browsers.
     
    nico_swd, Jul 30, 2008 IP
  6. Shazz

    Shazz Prominent Member

    Messages:
    8,395
    Likes Received:
    453
    Best Answers:
    0
    Trophy Points:
    330
    #6
    pff... on my forum I had one that worked :p

    Ill figure out what exactly Im missing -.-
     
    Shazz, Jul 30, 2008 IP
  7. oneyoucantsee

    oneyoucantsee Active Member

    Messages:
    64
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    68
    #7
    <a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://default.com');" style="font-size:12px;color:#ffffff;font-family:verdana;">Set As Homepage</a>
    HTML:
    That should work. Least I am pretty sure it should work.
     
    oneyoucantsee, Jul 30, 2008 IP
  8. desertst0rm

    desertst0rm Peon

    Messages:
    330
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hope you can share us how to make it work. Before it's working but now it doesn't change the homepage and I don't know why :mad:
     
    desertst0rm, Jul 31, 2008 IP
  9. oneyoucantsee

    oneyoucantsee Active Member

    Messages:
    64
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    68
    #9
    <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>
    Code (markup):
    Put that under your <head>

    
    <a href="javascript:bookmarksite('yoursite', 'http://www.yoursite.com')">Bookmark Our Site!</a>
    Code (markup):
    Use that in the page to add the link. Works in all browsers I am pretty sure. I tested in IE and FF.
     
    oneyoucantsee, Jul 31, 2008 IP
  10. desertst0rm

    desertst0rm Peon

    Messages:
    330
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It's bookmarking it instead of setting it to homepage
     
    desertst0rm, Jul 31, 2008 IP
  11. oneyoucantsee

    oneyoucantsee Active Member

    Messages:
    64
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    68
    #11
    Yeah thats the only way for all browsers best I can find. Just ask people to hit cntrl+D
     
    oneyoucantsee, Jul 31, 2008 IP
  12. desertst0rm

    desertst0rm Peon

    Messages:
    330
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    CTRL+D will only save and bookmark the site. I'm looking for how to set a site as Homepage. It's the site that opens when clicking the icon which looks like a House.
     
    desertst0rm, Aug 1, 2008 IP
  13. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #13
    Perhaps I should quote myself.

     
    nico_swd, Aug 1, 2008 IP
  14. desertst0rm

    desertst0rm Peon

    Messages:
    330
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Yahoo can do it on IE after downloading a toolbar

    Is there a script that works like Dragging a site or banner link and drop it onto the "House" icon. when the button or link was clicked? After clicking it a pop up window will open asking "Do you want this document to be your new home page?"
     
    desertst0rm, Aug 12, 2008 IP