+ Reply to Thread
Results 1 to 15 of 21
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: "Bookmark This Thread" hack

  1. #1
    Member Moonwolf is on a distinguished road
    Join Date
    May 2000
    Posts
    92
    Another one of those minor hacks that are so minor it's embarassing to say it's a hack at all.

    Open showthread template

    Find:
    Code:
    </head>
    Insert Above:
    Code:
    <script language="JavaScript1.2">
    var bookmarkurl="http://your.domain.here$REQUEST_URI"
    var bookmarktitle="$threadtitle"
    function addbookmark(){
    if (document.all) {
      window.external.AddFavorite(window.location.href,document.title);
      } else {
      alert("Use Ctrl-D to add a bookmark in Netscape Navigator.");
      }
    }
    </script>
    Note you need to replace "http://your.domain.here" with the URL to your domain -itself-, not to the forums.

    e.g. Forums on http://www.underlight.com

    Code will read:
    Code:
    var bookmarkurl="http://www.underlight.com$REQUEST_URI"
    The $REQUEST_URI part will fill in the path and variables to the thread you're book marking.

    Then, in the showthread template, find:
    Code:
    <smallfont><img src="images/sendtofriend.gif" border="0"> <a href="sendtofriend.php?threadid=$threadid">Email This Page to Someone!</a></smallfont>
    Add below:
    Code:
    <br>
    <smallfont><IMG SRC="images/bookmark.gif" BORDER=0>  <a href="javascript:addbookmark()">Click to here bookmark this thread!</a></smallfont>
    Upload a bookmark icon, and you're all set.

    Kath

    [Edited by Moonwolf on 06-07-2000 at 10:19 AM]

  2. #2
    Senior Member Joe is on a distinguished road
    Join Date
    May 2000
    Location
    Highland, Utah.
    Age
    31
    Posts
    2,435
    You may want to change this:
    Code:
    <br>
    <smallfont><IMG SRC="images/bookmark.gif" BORDER=0>  <a href="javascript:addbookmark()">Click to here bookmark this thread!</a></smallfont>
    to this:
    Code:
    <br>
    <smallfont><IMG SRC="images/bookmark.gif" BORDER=0>  <a href="javascript:addbookmark()">Click here to bookmark this thread!</a></smallfont>
    Happy Day

    Thanks for the hacks Moonwolf.

  3. #3
    Senior Member Craig A is on a distinguished road Craig A's Avatar
    Join Date
    Apr 2000
    Posts
    620
    huh ? What's the difference ?

  4. #4
    Senior Member Joe is on a distinguished road
    Join Date
    May 2000
    Location
    Highland, Utah.
    Age
    31
    Posts
    2,435
    Click to here bookmark this thread! should be Click here to bookmark this thread!. Nothing big, but it just reads a bit better... dont think you so?

  5. #5
    Senior Member Craig A is on a distinguished road Craig A's Avatar
    Join Date
    Apr 2000
    Posts
    620

    Aha!

    Oh! I was looking VERY carefully at the code...

  6. #6
    Senior Member thetakerfan is on a distinguished road
    Join Date
    Jun 2000
    Posts
    1,097
    great job with this one, never saw this before.
    Works great, incredibly easy, and quite useful

  7. #7
    vBulletin Team eva2000 is on a distinguished road eva2000's Avatar
    Join Date
    May 2000
    Location
    Brisbane, Australia
    Posts
    29,252
    hehe another great addition... at this rate i don't think vbulletin forums will look like vbulletins.. lol
    _
    * Required server info for server performance issues here
    * Choosing right cpus for high concurrency vB servers

    => Xeon Nehalem-EP 55xx > Xeon 54xx harpertown > Xeon 53xx > Opteron
    => vB4 FAQ | vB 4 Features | vB4 Syle Info | Internet brand Message
    => IBxAnders vB4.0 Search & InnoDB | InnoDB conversion | Large forums drive configs!

  8. #8
    Senior Member phumphries is on a distinguished road phumphries's Avatar
    Join Date
    Jun 2000
    Posts
    169
    Love it. Is there a variable to insert the domain automatically? My users are on an Intranet and some, due to configuration errors beyond my control, have to access the site by its IP address while others use its name.
    Peter E. Humphries

  9. #9
    Senior Member phumphries is on a distinguished road phumphries's Avatar
    Join Date
    Jun 2000
    Posts
    169
    Actually, I looked at the code a little more closely, and the bookmarkurl and bookmarktitle variables are not being used. So, the actual URL is already being inserted.

    I eliminated the bookmarkurl variable and changed:
    Code:
    window.external.AddFavorite(window.location.href,document.title);
    to
    Code:
    window.external.AddFavorite(window.location.href,bookmarktitle);
    so that the shorter Thread Title is used.

    In looking around, I also found another JavaScript to display a message instead of a link for non IE users:
    Code:
    <br><smallfont><IMG SRC="images/bookmark.gif" BORDER=0>
    <SCRIPT LANGUAGE="JavaScript">
      if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
        var url=window.location.href;
        var title="$threadtitle";
        document.write('<A HREF="javascript:window.ext');
        document.write('ernal.AddFavorite(url,title);" ');
        document.write('onMouseOver=" window.status=');
        document.write("'Bookmark this thread!'; return true ");
        document.write('"onMouseOut=" window.status=');
        document.write("' '; return true ");
        document.write('">Click here to bookmark this thread!</a>');
      } else {
        var msg = "Bookmark this thread!";
        if(navigator.appName == "Netscape") msg += "  (CTRL-D)";
        document.write(msg);
      }
    </script></smallfont>
    Just stick this between the "Send E-mail" and "Printable" links.

    Now, I have to decide which I like better. Argh! Decisions!!

    [Edited by phumphries on 07-31-2000 at 11:42 AM]
    Peter E. Humphries

  10. #10
    Senior Member thetakerfan is on a distinguished road
    Join Date
    Jun 2000
    Posts
    1,097
    nice job phumphries.
    But, I don't use text, just the img, so the non IE users will just have to figure it out themselves...
    but then again, I'm just testing the board out, so I'll figure something out for those damned NS users later.
    I just HATE that 7% of people that use NS.

  11. #11
    Senior Member phumphries is on a distinguished road phumphries's Avatar
    Join Date
    Jun 2000
    Posts
    169

    NS Users

    What would we need "if" statements for if there where only IE users?
    Peter E. Humphries

  12. #12
    Senior Member thetakerfan is on a distinguished road
    Join Date
    Jun 2000
    Posts
    1,097
    good point. If it wasn't for all the wonderful NS users out there, we would never have to deal with all the cross-browser compatibility issues, and all the formatting errors, etc. Now WHAT would the world be like without all of that???
    Thank goodness for NS, thats all I have to say!


  13. #13
    Senior Member datman99 is on a distinguished road datman99's Avatar
    Join Date
    Jun 2000
    Location
    SF Bay Area
    Age
    44
    Posts
    207

    Luv you man

    Works like a charm....Thanks
    Webmaster: Dailydiva.com - My VB is OnTheHush.com

  14. #14
    New Member monica is on a distinguished road
    Join Date
    Jul 2002
    Posts
    24
    Hi ,

    I carefully checked my "showthread template". I didn't find any
    "send this link to a friend" in the code. Where do I insert this
    Bookmark image. Plz help

  15. #15
    Senior Member MUG has disabled reputation MUG's Avatar
    Join Date
    Apr 2002
    Location
    New York
    Posts
    1,192
    As you may notice, this thread is two years old. That may explain it.... (vB 1.1 was out at the time)

+ Reply to Thread
Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. Replies: 4
    Last Post: Thu 4th Sep '03, 1:11am
  2. Mass Move "Disappeared" All Threads (!!!) Board "Empty"...but Thread Counts Rema
    By Dunvegan in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 3
    Last Post: Thu 15th Nov '01, 5:52pm
  3. How do I make the "last post" hack jump to the beginning of the thread...
    By stile in forum vBulletin 2 'How Do I' and Troubleshooting
    Replies: 3
    Last Post: Sun 14th Oct '01, 9:06am
  4. Replies: 5
    Last Post: Sun 3rd Jun '01, 11:01pm

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts