PDA

View Full Version : Dynamic Bookmark Links 1.0.0


reismarktq2
02-20-2006, 10:00 PM
Dynamic Bookmark Links

This hack will dynamically create a link on each page of your forums that will allow your users to bookmark the page they are currently on. The Javascript function that calls the browser's bookmark tool works with Internet Explorer and with any browser in the Mozilla family (Firefox, Netscape, and the Mozilla suite). I have not tested this hack with Opera or any other alternative browser, or with any version of vBulletin other than the most current (3.5.3 at the time of this writing). I can't imagine it not working with any version of the 3.5 series, however.

Installation

This hack requires:

1 product import
1 file upload
3 template edits
Product Import

Import 'product-dynamic_bookmarks.xml' using vBulletin's Product Management tool. (Expand the Plugin System submenu, select 'Manage Products', then select 'Add/Import Product' at the bottom and use the 'Import Product' dialog.

The product XML adds one plug-in at the 'navbits' location to facilitate the creation of the URL and page title for the bookmark, and adds one global phrase.
File Upload

Upload bookmark.gif to your images/misc folder.

Template Edits

In template 'headinclude', find:

<if condition="$vboptions['externalrss']"><link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] RSS Feed" href="external.php?type=RSS" /></if>Add after:

<!-- Dynamic Bookmark Links -->
<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
***********************************************/
function bookmarksite(title, url) {
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "");
}
</script>
<!-- /Dynamic Bookmark Links -->
In template 'navbar', find:

<else />
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>Replace with:

<else />
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong>
<!-- Dynamic Bookmark Links -->
<a href="javascript:bookmarksite('$vboptions[bbtitle]', '$vboptions[bburl]')"><img src="$stylevar[imgdir_misc]/bookmark.gif" alt="$vbphrase[bookmark_this_page]" border="0" width="16" height="16" style="vertical-align: bottom;" /></a>
<!-- /Dynamic Bookmark Links -->
</div>
</if>
In template 'navbar_link', find:

<else />
$nav_title
</if>Replace with:

<else />
$nav_title
<!-- Dynamic Bookmark Links -->
<a href="javascript:bookmarksite('$booktitle - $vboptions[bbtitle]', '$bookurl')"><img src="$stylevar[imgdir_misc]/bookmark.gif" alt="$vbphrase[bookmark_this_page]" border="0" width="16" height="16" style="vertical-align: bottom;" /></a>
<!-- /Dynamic Bookmark Links -->
</if>
DONE! :)

I will not be guaranteeing support for this hack, but I will try my best to handle all problems that may arise for you whenever I am online. This hack may only be distributed on vBulletin.org and may not be ported, translated, or otherwise modified and then made available publicily without my consent.

Please don't forget to click https://vborg.vbsupport.ru/images/smoothblue/buttons/installed.gif (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=108542) after installing this product! :)

reismarktq2
02-21-2006, 03:07 PM
A simple screenshot that tells the whole story:

D|ver
02-21-2006, 03:19 PM
nice idea, thank you :)

bashy
02-21-2006, 04:01 PM
Hi

Installed image is showing in firefox but when i click the image nothing happens
Actually i have just tried it in IE and again nothing happens when the image is clicked!

The Chief
02-21-2006, 04:04 PM
good idea, thanks!!

reismarktq2
02-21-2006, 04:05 PM
Installed image is showing in firefox but when i click the image nothing happens
Actually i have just tried it in IE and again nothing happens when the image is clicked!
Did you install the product XML? It's necessary for all the links to work except for forumhome.

bashy
02-21-2006, 04:30 PM
Hi

Yip of course :)
Just dowble checked all edits and reimported the xml with overwrite ticked and still not working as it should be!!

reismarktq2
02-21-2006, 05:34 PM
It looks like the Javascript is clashing with something you've already got on your boards. This is the error I'm getting when I try it on your boards on IE:

Line: 1
Char: 43
Error: Expected ')'
Code: 0
URL: http://www.bashys-place.com/forums/forumdisplay.php?f=71The only thing I can think of is in headinclude, to replace this:

window.sidebar.addPanel(title, url, "")with this:

window.sidebar.addPanel(title, url, "");(The only difference between the two lines is the semi-colon at the end. I noticed this before posting the hack, but this was how the DynamicDrive function was originally written, and it didn't cause any problems on my boards that way.)

Hack updated to include this change.

bashy
02-21-2006, 05:40 PM
Hi m8 thanks for trying but this didnt work either!!

reismarktq2
02-21-2006, 05:52 PM
Hi m8 thanks for trying but this didnt work either!!Found another error on your site which seems to be completely unrelated to my code. Maybe this is what is causing your conflict?

Line: 994
Char: 258
Error: Object doesn't support this action
Code: 0
URL: http://www.bashys-place.com/forums/...isplay.php?f=71Needless to say, it doesn't appear as though my code is what's causing the problem. Sorry :(

bashy
02-21-2006, 05:58 PM
Yeah i did notice that but i aint got a clue on how to fix
not only that there does not appear to be any problems so i left it..
Yeah its nowt to do with yours!!

Any ideas on how to fix it ;)

-=Sniper=-
02-21-2006, 06:16 PM
Yeah i did notice that but i aint got a clue on how to fix
not only that there does not appear to be any problems so i left it..
Yeah its nowt to do with yours!!
Any ideas on how to fix it ;)
http://www.dynamicdrive.com/dynamicindex9/addbook.htm

Remember, if your site's title contains apostrophes, they need to be backslashed when entered:

You will need to add slashes to the title before including it in the javascript, I'm not sure if theres a built in function in vb.

addslashes($string) can be used in php

reismarktq2
02-21-2006, 06:23 PM
http://www.dynamicdrive.com/dynamicindex9/addbook.htm



You will need to add slashes to the title before including it in the javascript, I'm not sure if theres a built in function in vb.

addslashes($string) can be used in php
The plug-in in the product XML already performs this task, so unfortunately, it isn't the cause of Bashy's problem. There is a special function in vB called addslashes_js for this specific purpose.

bashy
02-21-2006, 06:43 PM
Hi guys...

You have both gone well above head
would 1 of you like to have admin access and take a gander? :)

FleaBag
02-21-2006, 08:57 PM
Nice hack! :D

reismarktq2
02-21-2006, 09:59 PM
Nice hack! :D

I've just upgraded my boards to version 3.5.4, and this hack should continue to work as intended without any extra steps needed.

Floris
02-22-2006, 10:15 AM
Now there's a cool idea! :D

Good stuff and thank you for sharing ;)

Snake
02-22-2006, 10:58 AM
Nice one! Thanks. :)

bashy
02-22-2006, 03:30 PM
Hi peeps

With regards to my problems and this hack, would i be better off uninstlling the hack
Or is some one gonna be kind enough to try and resolve this, admin access to me forum is available ;)

reismarktq2
02-24-2006, 02:25 PM
Hello,

no idea for my problem with CMPS?

Without a solution this mod is not usable with portal frontends that takes forum threads in a block on the first site of the board for news or announcements.

Thanks!

I'm not sure I follow precisely what the problem is. You mind posting a link to your boards so I can see what you're talking about?

reismarktq2
02-24-2006, 03:18 PM
Ignore my previous stupidity...

Looks like all the issue is that the path for the image is wrong. You may just want to go into the template for the news block and change it to the correct absolute path. (This doesn't seem to have anything to do with my hack, for those that are reading.)

klaush
02-24-2006, 03:27 PM
Ups...., sorry, forget it!

I wrote this in the wrong section here!

It´s not your modification!

Just stupid!

Sorry!

reismarktq2
02-24-2006, 03:30 PM
Ups...., sorry, forget it!

I wrote this in the wrong section here!

It?s not your modification!

Just stupid!

Sorry!

Yup, I realized my stupidity two seconds after you posted that :)

Polo
07-06-2006, 12:31 PM
thanks. This mod could come in handy ;)

reismarktq2
05-28-2007, 01:29 AM
I have confirmed that this hack is working in vBulletin 3.6.7 PL1 without any edits. Hence, this should work fine for any board in the 3.5 or 3.6 series.