<?php
// social bookmarking
// what is?
/*
Social bookmarking is a method for Internet users to share, organize, search, and manage bookmarks of web resources.
Unlike file sharing, the resources themselves aren't shared, merely bookmarks that reference them.
*/
// http://en.wikipedia.org/wiki/Social_bookmarking
// define the correct link
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 for each site
function twitter()
{
$l = selfURL();
$social = "<a href=\"http://twitter.com/home?status=$l\"/><img src=\"../images/twitter.png\" align =\"middle\" border =\"0\" width =\"20\" height =\"20\" alt =\"twitter\" /></a>";
return $social;
}
function facebook()
{
$l = selfURL();
$social = "<a href=\"http://www.facebook.com/share.php?u=$l\"/><img src=\"../images/facebook.png\" align =\"middle\" border =\"0\" width =\"20\" height =\"20\" alt =\"facebook\" /></a>";
return $social;
}
function digg()
{
$l = selfURL();
$t = "Masterscliq Coding Tech";
$social = "<a href=\"http://digg.com/submit?phase=2&url=$l/&title=$t\"/><img src=\"../images/digg.gif\" align =\"middle\" border =\"0\" width =\"20\" height =\"20\" alt =\"digg\" /></a>";
return $social;
}
function delicious()
{
$l = selfURL();
$social = "<a href=\"http://del.icio.us/save?url=$l\"/><img src=\"../images/del.gif\" align =\"middle\" border =\"0\" width =\"20\" height =\"20\" alt =\"delicious\" /></a>";
return $social;
}
?>