đž Archived View for chirale.org âş 2008-04-23_62.gmi captured on 2024-08-31 at 11:47:34. Gemini links have been rewritten to link to archived content
âŹ ď¸ Previous capture (2024-05-12)
-=-=-=-=-=-=-
Tested on:
On your page.tpl.php, change default node links rendering with this:
\<?php if ($links): ?\>
\<div class=âlinksâ\>
\<?php
\# add to favorites / bookmarks link
$node-\>links\[âadd2favâ\] = Array(
âtitleâ=\>trim(t(âAdd to favoritesâ)),
âhrefâ=\>$\_GET\[âqâ\],
âattributesâ=\>Array(
âclassâ=\>âadd2favâ,
âonclickâ=\>âbookmark()â,
)
);
\# intercept and theme node links
print theme_links($node-\>links);
print â\<script type=âtext/javascriptâ\>// \<!\[CDATA\[
function bookmark(){
var url = window.document.location;
var title = window.document.title;
if ((navigator.appName == âMicrosoft Internet Explorerâ) && (parseInt(navigator.appVersion) \>= 4)) {
window.external.AddFavorite(url,title);
} else if (navigator.appName == âNetscapeâ) {
window.sidebar.addPanel(title,url,ââ);
} else {
alert(âPress CTRL-D (Netscape) or CTRL-T (Opera) to bookmarkâ);
}
}
// \]\]\>\</script\>â;
?\>
\</div\>
\<?php endif; ?\>
Now any node has your âAdd to favoritesâ link, try to click it.
If you wrap alert message in a t() function, you can also translate displayed message.
https://web.archive.org/web/20080423000000*/http://drupal.org/node/176913