Social Bookmarks Mod updated

Social Bookmarks Mod updated

Just a quick update on the social bookmarks mod of mine, I recently noticed that when using it on a "page", it wasn't displaying the correct link url, so I have fixed fix this, if you were using my default social.php, this is a drop in replacement, if not, note the changes, first find;

//grabs the url to the article
$social_url = urlencode(_SITE.$uri."/".$r['asef']);

and then change it to;

//grabs the url to the article
if (empty($currentPage)) {
    $social_url = urlencode($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
} else {
    $social_url = urlencode(_SITE.$uri."/".$r['asef']);

That's it! Updated INSTALL instructions are included in the zip file.



You might like


Another addition to this would be to add the Facebook sharing link and icon: Add this to your social.php in the lik section:

<a href="$social_url&title=$social_title"><img src="/images/social/facebook.png" alt="facebook" style="$img_style" /></a>

And if you need a icon:

Thanks, Matty.

no problem man :)


can anyone tell me how to add to this bookmarks...the next pages:
* Twitter
* myspace
* google
* Live
* newsvine
If anyone would so good to poste the code! Tnx for your help!

Hi Tatsu,

Give these a try...

<a href="$social_title-$social_url"><img src="/images/social/twitter.png" alt="twitter" style="$img_style" /></a>
<a href="$social_url&t=$social_title"><img src="/images/social/myspace.png" alt="myspace" style="$img_style" /></a>
<a href="$social_url&$social_title=$social_title"><img src="/images/social/google.png" alt="google" style="$img_style" /></a>
<a href="$social_url&$social_title=$social_title"><img src="/images/social/live.png" alt="live" style="$img_style" /></a>
<a href="$social_url&h=$social_title"><img src="/images/social/newsvine.png" alt="newsvine" style="$img_style" /></a>

need to add just below the opening php tag:
if(strpos($_SERVER['PHP_SELF'], 'social.php') !== false){die("Forbidden");}
for security to ensure that php file is not directly included. Otherwise, the superglobal $_SERVER variable can be manipulated with possibly undesireable results.

Comments are closed. No new comments allowed.

Copyleft 2002 - 2017 Matt Jones
Hand crafted with HTML5 & CSS3
↑ Back to top