I found this script that i now use on my site.. maybe other want it too.. Social bookmarking is the big thing on the web ;)
Works in php article or php block.. remember to upload the images ;)
echo'<center>';
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; }
function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }
function soc_bookmark($link, $title, $icon = 'Y') {
$feed = 'feed';
$link = rawurlencode($link);
$title = rawurlencode($title);
$icon_folder = 'bookmarks/icons/';
$bookmark = array(
'protopage'=>
'http://www.protopage.com/add-button-site?url='.$link.'&label='.$title.'&type='.$feed,
'pubsub'=>
'http://www.pubsub.com/index.php?q='.$link,
'IceRocket'=>
'http://blogs.icerocket.com/search?q='.$link,
'digg'=>
'http://digg.com/submit?phase=2&url='.$link,
'BlinkBits'=>
'http://www.blinkbits.com/bookmarklets/save.php?v=1&source_url='.$link.'&title='.$title,
'BlogMarks'=>
'http://blogmarks.net/my/new.php?mini=1&simple=1&url='.$link.'&title='.$title,
'Del.icio.us'=>
'http://del.icio.us/post?v=2&url='.$link.'&title='.$title,
'Fark'=>
'http://cgi.fark.com/cgi/fark/edit.pl?new_url='.$link.'&title='.$title,
'Furl'=>
'http://www.furl.net/storeIt.jsp?t='.$title.'&u='.$link,
'Google'=>
'http://www.google.com/bookmarks/mark?op=add&bkmk='.$link.'&title='.$title,
'Ma.gnolia'=>
'http://ma.gnolia.com/bookmarklet/add?url='.$link.'&title='.$title,
'MyWeb'=>
'http://myweb2.search.yahoo.com/myresults/bookmarklet?t='.$title.'&u='.$link,
'Netscape'=>
'http://www.netscape.com/submit/?U='.$link.'&T='.$title,
'NetVouz'=>
'http://netvouz.com/action/submitBookmark?url='.$link.'&title='.$title,
'Newsvine'=>
'http://www.newsvine.com/_tools/seed&save?u='.$link.'&h='.$title,
'RawSugar'=>
'http://www.rawsugar.com/pages/tagger.faces?turl='.$link.'&tttl='.$title,
'Reddit'=>
'http://reddit.com/submit?url='.$link.'&title='.$title,
'Scuttle'=>
'http://www.scuttle.org/bookmarks.php/maxpower?action=add&address='.$link.'&description='.$title,
'Shadows'=>
'http://www.shadows.com/features/tcr.htm?url='.$link.'&title='.$title,
'Simpy'=>
'http://simpy.com/simpy/LinkAdd.do?title='.$title.'&href='.$link,
'Slashdot'=>
'http://slashdot.org/bookmark.pl?url='.$link.'&title='.$title,
'Spurl'=>
'http://www.spurl.net/spurl.php?url='.$link.'&title='.$title,
'Technorati'=>
'http://technorati.com/faves?add='.$link.'&title='.$title,
'Wists'=>
'http://wists.com/r.php?c=&r='.$link.'&title='.$title,
);
foreach($bookmark as $key=>$value) {
$link_text = $icon == 'Y' ? '
<img src="'.$icon_folder.str_replace(".", '', strtolower($key)).'.jpg"
border="0" alt="Post to '.$key.'" />' : $key;
echo '<a href="'.$value.'"
title="Post to '.$key.'" target="_blank">'.$link_text.'</a> ';
}
}
soc_bookmark(selfURL(), $definePageTitle);
echo'</center>';
This is how it looks in the forum.. It allows your members to easely add you page to their favourite social bookmarking software.
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fpix.nofrag.com%2F88%2Fdf%2Fe911f88fff869c1bc4185a63b406.jpg&hash=1fe9c784e3dede06abb4e71825216a2860f963dd) (http://pix.nofrag.com/88/df/e911f88fff869c1bc4185a63b406.html)
The protopage bookmark will add your page RSS feeds to the users protopage. This can be changed easely if you only want to add the bookmark !
Enjoy ;)
Code updated with more links :)
Code updated - very usefull script - does nobody want to use this ? Please debate if this is a good or bad thing to have on a forum ??? ::)
Greetings!
I'm not sure if I like the idea of social bookmarks or not.
Personally I don't use this services. I have the scrapbook plugin for my Firefox to keep interesting informations.
On the other hand I found some usefull links at sites of this kind. Sometimes this bookmarks are more useful than google.
To offer this kind of quick link & bookmark is a nice service anyway.
I integrated your code into my test page. As a side block at the moment but when I add TP to my ââ,¬Å"runningââ,¬Â board I plan to put it in a center block, maybe.
If somebody want so see this code in action
http://www.firopolis.de/forum/index.php
(code disabled)
So, I have to send a big ââ,¬Å"Thank youââ,¬Â for sharing this snipped.
Don't use them myself either, so I can't really give you a good answer to that. :)
I don't use them but I like it for the sake of my members on my website. Hey, one of them is bound to be using atleast one of those :D
:up: GOOD THanks
Brianjw
This block didn't work for me. Made my index page disappear. Luckily the block admin came back so I could delete it. :(
That sounds very strange.. im glad you was able to recover your index page.. you must have done something wrong.. did you remember to upload the images ? This snippet works fine on my page so again i must say i dont know why it did not work for you.
Greetings!
Maybe one of the given urlââ,¬â,,¢s of one service have changed?
I run this script since my first message in this post without any problems.
Two days ago my host wrote me, that I nearly reached the maximum of my webspace. A quick look shows that the error log causes this. (561 pages uses 120mb of webspace)
All errors look like this:
8: Undefined variable: definePageTitle
File: /is/htdocs/wp1025805_KTQRXQ5E3I/www/forum/Themes/default/BoardIndex.template.php (eval?)
Line: 78
After I disabled this block, no new errors appear in the log.
I canÃ,´t figure out the reason. This script was running very well and I havenÃ,´t changed the sources of SMF or TP, no new block, no new article.
I see a white page when I test some of the snippeds, for example the really great USER CP - An alternative to Profile Screen (http://www.tinyportal.net/index.php?topic=9809.0) causes this and I think, that this behavior depends on the SMF Version.
So it might be possible that my SMF Version (1.0.6) only bring up an error while it made the index disappear when 1.1.x is in use.
But I have no idea if this guess is correct.
We will just have one answer for you and that will be to UPGRADE you forum.
We have no support for your versions any more, most bugs and issues that were present in your setup is fixed.
So i suggest you upgrade your forum and then upgrade your TP aswell.
Greetings!
I havenââ,¬â,,¢t send a question but try to help figuring out the problem with some information input.
This code does not depend on SMF code and the latest TP (0.9.7) can handle the script.
So the only solution I can imagine, is a change in the part of the code, that points to a 3th party site.
As mentioned, this code was working very well and I know that other snippeds, especial when they are using the SMF database or some parts of the source code, wonââ,¬â,,¢t work with my outdated SMF.
And I know that itÃ,´s time for an update but a huge part of my contend based on the Table From CSV (http://www.simplemachines.org/community/index.php?topic=18917.0) mod. This one isnââ,¬â,,¢t available for 1.1.x and as long there is no newer version I am stuck.
I would love to use some of the snippeds but I never blame anybody because they arenÃ,´t compatible with my software. I use the ideas and change the code, in some cases (the ââ,¬Å"Ausrufââ,¬Â box at my frontpage for example). In other cases I put the thread to my favorites and keep them till I can update.
And finally, TP Version 0.9.7 installs without any problems and is up and running ââ,¬â€œ without SMF 1.1.x and all the problems (like stupid search funktion, chaptcha Problems, ââ,¬Â¦) I can read about.
So I suggest (as politely as possible) that you leave me the choice of software that fits to my needs ââ,¬â€œ tabels example 1 (http://www.firopolis.de/forum/index.php?topic=1386.msg2783#msg2783) / Example 2 (http://www.firopolis.de/forum/index.php?topic=1256.msg2299#msg2299)
Now both positions a clear and I would prefer to use this thread to figure out what causes the problem of DawnsWebDe
It's ok ianus. I was just telling people what happened. I probably didn't upload the images.
But I already added the digg this topic mod. It works. So it wasn't worth the trouble to mess with this. Blogs are more important to me than social bookmarking. I don't even use most of the stuff myself...I KNOW my family/friends don't. They won't even use our site.
So Tank don't be offended. This is surely fine code. I don't recall uploading any images...so I'm sure it's my fault it didn't work for me. It's just not worth my trouble. Most of the snippets/mods aren't worth my trouble. There's a few I go for every single time. Less is better. Less potential for bugs/filled up error logs. ;)
I never got offended.. and i wonder why my thread is being highjacked like this.. my snippet can not cause harm to any SMF/TP installation.. it dosnt interact with your database and if you didnt upload the images it would just show you some little red crosses. It can only cause a php error at the worst. And this snippet will act the same way no matter what versions of smf/TP that you are running. Only thing i can imaging is that your php version might not like some of the code.. So cheer up. TP is still the best software for creating nice websites :)
I never saw any X's...I didn't see nothing at all...a blank page.
But I found out my problems are with my host having things (fopen) disabled which makes free simple easy to use software programs basically worthless. I can't use the feed poster mod or TP's feed blocks.
I've had several hosts over 8/9 years & this is the first that disabled things for security reasons. Is everybody else ignorant? Or are they ignoring the security issue & enabling things just to make these softwares work?
So I've either gotta figure out a custom php (heh heh heh...so funny)...or move to an ignorant host for ignorant self-taught do-it-yourselfers like myself. Anybody know any good ignorant hosts? Preferably one with a reseller program?
Code works with my install just great, except for one thing. It shows the domain name as subdomain (it's addon domain on this shared account) which I would like to avoid.
So, it is:
mywebsite.aaaaa.com
instead of
mywebsite.com
Can I get help to fix it?
Quote from: itweb on April 05, 2007, 01:36:17 AM
Code works with my install just great, except for one thing. It shows the domain name as subdomain (it's addon domain on this shared account) which I would like to avoid.
So, it is:
mywebsite.aaaaa.com
instead of
mywebsite.com
Can I get help to fix it?
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI']; }
function strleft($s1, $s2) { return substr($s1, 0, strpos($s1, $s2)); }This bit of code actually graps the current address that the user is viewing when he clicks on one of the social bookmarks.. so if the address is a sub domain it will send that address to the rest of the script.. i did not write this code because php is not a language that i master in any way.. so maybe one of the fine php gurus can help determin how to fix the problem.. all i can say is that it works perfect on my site.. but then again, i dont use a subdomain..
Cheers
knat
Can we get help from our php gurus, then? :)
Well I don't know much about the $_SERVER global, but from what it looks like it is using the current URL you are visiting. I have no idea how you could change it to make it use a different URL than what you are currently viewing.
Actually, it's grabbing the whole server path. As my domain is an addon, it also grabs the main domain.
Maybe there is a way to show just the current url, instead of server path?
Same Problem. I could really need a fix.
Hi,
I feel this is an excellent snippet/mod you have created...
I have been hunting for this for ages and the one on SMF site did not work with my theme even after modification..
I had to manually submit stories....
I love this mod very much and so do my site members...
Thanks
Quote from: evilopinions on May 29, 2007, 03:39:50 AM
Hi,
I feel this is an excellent snippet/mod you have created...
I have been hunting for this for ages and the one on SMF site did not work with my theme even after modification..
I had to manually submit stories....
I love this mod very much and so do my site members...
Thanks
Im glad you could use it on your site.. and im sorry for the ones who cant..
Can i point you in this direction for something that will work on all sites: http://www.addthis.com/
THis is really cool block snippet but I am having problem with the code. I work fine in my forum but its created an error in my forum error log. Any way to fix it.
QuoteUndefined variable: definePageTitle
File: /home/vol2/4sql.net/sq_61554/oursitehere.net/htdocs/forum/Themes/dilbermc/MessageIndex.template.php (main_below sub template - eval?)
Line: 75
this is really great and hope that you will fix this error.
Sorry mate, but i have no idea why it does that.. :P
As it seems that the variable isn't even defined, yet the script still works... Try changing this line of code:
soc_bookmark(selfURL(), $definePageTitle);
To this:
soc_bookmark(selfURL());
See if it still works, and if the error is gone.
I got more errors there
QuoteMissing argument 2 for soc_bookmark()
Undefined variable: title