source: trunk/www.guidonia.net/wp/wp-content/plugins/parteibuch-aggregator/social_bookmarks.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 4.5 KB
Line 
1<?php
2
3//this script is called directly by browsers
4//we need php in this script only to put in the link to the social bookmark directory
5$directory=preg_replace('/\/[^\/]*$/',"",$_SERVER['REQUEST_URI']);
6
7?>function sbopen(url){
8 sbwin=window.open(url, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no');
9 sbwin.focus();
10}
11
12function replace_link_title(intext, link, thetext) {
13 intext = intext.replace('##THE_LINK##', link);
14 intext = intext.replace('##THE_TITLE##', thetext);
15 intext = intext.replace('%23%23THE_TITLE%23%23', thetext);
16 return intext.replace('%23%23THE_TITLE%23%23', thetext);
17}
18
19
20function sbbview(divid, sbblink, sbbtitle){
21 var ssbdiv = document.getElementById(divid);
22 if (ssbdiv.style.display != 'block') {
23 ssbdiv.style.display = 'block';
24 }else {
25 if (ssbdiv.style.display == 'block') {
26 ssbdiv.style.display = 'none';
27 }
28 }
29
30 if(ssbdiv.id != 'sbbpt_id_social_prototype'){
31 var sbbprototype = document.getElementById('sbbpt_id_social_prototype');
32 var numofchilds = sbbprototype.childNodes.length -1;
33 for(var i = 0; numofchilds >= i; i++) {
34 if(!ssbdiv.childNodes[i]){
35 var clonednode = sbbprototype.childNodes[i].cloneNode(true);
36 ssbdiv.appendChild(clonednode);
37 }
38 }
39 }
40
41 var numofchilds = ssbdiv.childNodes.length -1;
42 for(var i = 0; numofchilds >= i; i++) {
43 if(ssbdiv.childNodes[i].href){
44 ssbdiv.childNodes[i].href=replace_link_title(ssbdiv.childNodes[i].href, sbblink, sbbtitle);
45 }
46 if(ssbdiv.childNodes[i].title){
47 ssbdiv.childNodes[i].title=replace_link_title(ssbdiv.childNodes[i].title, sbblink, sbbtitle);
48 }
49 }
50
51 return;
52}
53
54function writesbb(link, caption, icon){
55 document.write('<a onclick="sbopen(this.href);return false;" href="' + link + '" title="\'##THE_TITLE##\' bookmarken bei ' + caption + '"><img style="padding:1px; width:18px; height:18px; border-width:0px;" src="<?php echo $directory; ?>' + icon + '" alt="' + caption + '" /></a>');
56 return;
57}
58
59
60document.write('<div id="sbbpt_id_social_prototype" style="display:none;padding:5px; margin-left:auto; margin-right:auto; text-align:center;">');
61
62writesbb('http://www.wikio.de/vote?url=##THE_LINK##', 'Wikio', '/ico/sb/wikio2_18x18.jpg');
63writesbb('http://www.alltagz.de/bookmarks/?action=add&amp;address=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23', 'Alltagz', '/ico/sb/alltagz.gif');
64writesbb('http://www.icio.de/add.php?url=##THE_LINK##"', 'icio', '/ico/sb/icio.gif');
65writesbb('http://infopirat.com/node/add/userlink?edit[url]=##THE_LINK##&amp;edit[title]=%23%23THE_TITLE%23%23"', 'Infopirat', '/ico/sb/infopirat.gif');
66writesbb('http://linkarena.com/bookmarks/addlink/?url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Linkarena', '/ico/sb/linkarena.gif');
67writesbb('http://www.mister-wong.de/addurl/?bm_url=##THE_LINK##&amp;bm_description=%23%23THE_TITLE%23%23"', 'Mister Wong', '/ico/sb/mister-wong.gif');
68writesbb('http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Oneview', '/ico/sb/oneview.gif');
69writesbb('http://tausendreporter.stern.de/submit.php?url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Tausend Reporter', '/ico/sb/tausend-reporter-stern.gif');
70writesbb('http://www.webnews.de/einstellen?url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Webnews', '/ico/sb/webnews.gif');
71writesbb('http://yigg.de/neu?exturl=##THE_LINK##"', 'Yigg', '/ico/sb/yigg.gif');
72writesbb('http://del.icio.us/post?url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Del.icio.us', '/ico/sb/delicious.png');
73writesbb('http://digg.com/submit?phase=2&amp;url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'digg', '/ico/sb/digg.png');
74writesbb('http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Name=%23%23THE_TITLE%23%23&amp;Description=%23%23THE_TITLE%23%23&amp;Url=##THE_LINK##"', 'blinklist', '/ico/sb/blinklist.png');
75writesbb('http://www.technorati.com/faves?add=##THE_LINK##"', 'Technorati', '/ico/sb/technorati.png');
76writesbb('http://myweb2.search.yahoo.com/myresults/bookmarklet?u=##THE_LINK##&amp;t=%23%23THE_TITLE%23%23"', 'Yahoo My Web', '/ico/sb/yahoo_myweb.png');
77writesbb('http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Google Bookmarks', '/ico/sb/google.png');
78writesbb('http://co.mments.com/track?url=##THE_LINK##&amp;title=%23%23THE_TITLE%23%23"', 'Co.mments', '/ico/sb/comments.png');
79writesbb('http://www.bloglines.com/sub/##THE_LINK##"', 'Bloglines', '/ico/sb/bloglines.png');
80
81document.write('</div>');
Note: See TracBrowser for help on using the repository browser.