Revision history for ShareOnLinkedIn


Revision [20913]

Last edited on 2009-11-02 15:34:38 by RolandStens
Additions:
* Display "Share on LinkedIn"
$text = "Share on LinkedIn";
""{{linkedinshare}}"" This will show a link on your page that says "Share on ""LinkedIn""" and will open a new window when clicked.
Deletions:
* Display "Share with LinkedIn"
$text = "Share with LinkedIn";
""{{linkedinshare}}"" This will show a link on your page that says "Share with ""LinkedIn""" and will open a new window when clicked.


Revision [20908]

Edited on 2009-11-02 15:02:57 by RolandStens
Additions:
>>{{image url="http://static02.linkedin.com/img/pic/pic_widgets_shareonlinkedin_115x93.gif" title="Share on LinkedIn"}}>>
Deletions:
>>{{image url="http://static02.linkedin.com/img/pic/pic_widgets_shareonlinkedin_115x93.gif" title="Share on LinkedIn"}}


Revision [20907]

Edited on 2009-11-02 15:02:07 by RolandStens
Additions:
>>{{image url="http://static02.linkedin.com/img/pic/pic_widgets_shareonlinkedin_115x93.gif" title="Share on LinkedIn"}}


Revision [20906]

Edited on 2009-11-02 15:01:11 by RolandStens
Additions:
{{image url="http://static02.linkedin.com/img/pic/pic_widgets_shareonlinkedin_115x93.gif" title="Share on LinkedIn"}}
Deletions:
{{image url="http://www.linkedin.com/static?key=developers_widget_shareonlinkedin"}}


Revision [20905]

Edited on 2009-11-02 15:00:18 by RolandStens
Additions:
{{image url="http://www.linkedin.com/static?key=developers_widget_shareonlinkedin"}}


Revision [20902]

Edited on 2009-11-02 14:51:46 by RolandStens
Additions:
""{{linkedinshare}}"" This will show a link on your page that says "Share with ""LinkedIn""" and will open a new window when clicked.
Deletions:
""{{linkedinshare}}"" This will show a link on your page that says "Share with LinkedIn" and will open a new window when clicked.


Revision [20901]

Edited on 2009-11-02 14:51:07 by RolandStens
Additions:
=====Share Page on ""LinkedIn""=====
Deletions:
=====Share Page on '""LinkedIn""=====


Revision [20900]

Edited on 2009-11-02 14:50:54 by RolandStens
Additions:
=====Share Page on '""LinkedIn""=====
Deletions:
=====Share Page on LinkedIn=====


Revision [20899]

Edited on 2009-11-02 14:50:13 by RolandStens
Additions:
A new action for adding a //Share on [[http://LinkedIn.com LinkedIn]]//, link to your website or blog allowing your users to share your content with their [[http://LinkedIn.com LinkedIn]] connections or networks. This gives your content legs: one user visits your site and can notify literally tens, hundreds, or thousands of others. Works great for news sites, blogs, and other content–rich sites. See [[http://www.linkedin.com/static?key=developers_widget_shareonlinkedin here]] for the ""LinkedIn"" description of this functionality.
Save file as **linkedinshare.php** in your \plugins\actions directory.
====Usage====
""{{linkedinshare}}"" This will show a link on your page that says "Share with LinkedIn" and will open a new window when clicked.
or
""{{linkedinshare text="Your Custom Link Text"}}"", same but this version gives you the opportunity to specify your own link name.
Deletions:
A new action for adding a //Share on [[http://LinkedIn.com LinkedIn]]//, link to your website or blog allowing your users to share your content with their [[http://LinkedIn.com LinkedIn]] connections or networks. This gives your content legs: one user visits your site and can notify literally tens, hundreds, or thousands of others. Works great for news sites, blogs, and other content–rich sites. See [[http://www.linkedin.com/static?key=developers_widget_shareonlinkedin here]] for the LinkedIn description of this functionality.


Revision [20898]

Edited on 2009-11-02 14:45:49 by RolandStens
Additions:
=====Share Page on LinkedIn=====
A new action for adding a //Share on [[http://LinkedIn.com LinkedIn]]//, link to your website or blog allowing your users to share your content with their [[http://LinkedIn.com LinkedIn]] connections or networks. This gives your content legs: one user visits your site and can notify literally tens, hundreds, or thousands of others. Works great for news sites, blogs, and other content–rich sites. See [[http://www.linkedin.com/static?key=developers_widget_shareonlinkedin here]] for the LinkedIn description of this functionality.
%%(php)
<?php
/**
* Display "Share with LinkedIn"
*
* @package Actions
* @author Roland Stens
* @version 1.0
* @license LinkedIn Widgets License Agreement
* By using a LinkedIn widget, you are entering into a legally binding agreement with LinkedIn Corporation that includes provisions that:
* 1. Allow your use of a LinkedIn widget under certain terms and conditions
* 2. Make it clear that your use of the widget does not indicate a partnership relationship with LinkedIn
* 3. Make it clear that you can not sell access to the LinkedIn widget, and
* 4. Allow LinkedIn to terminate this Agreement and your use of the widgets at any time.
* http://www.linkedin.com/static?key=developers_widgets_agreement
*/
// default Link Text
$text = "Share with LinkedIn";
// getting params
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
if ($param == 'text')
{
$text = $value;
}
}
}
//Get the url of the page, for https servers simply change http to https.
$url = urlencode('http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
$title = urlencode($this->PageTitle());
//Get the summary from the content but strip the title and just send the first 200 characters
$summary = urlencode(strip_tags($this->Format($this->page["body"])));
$summary = substr(trim(str_replace($title, "", $summary)),0,200);
//The name of your WikkaWiki installation
$source = urlencode($this->GetConfigValue("wakka_name"));
$output = '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$url.'&title='.$title.'&summary='.$summary.'&source='.$source.'" target="_blank">'.$text.'</a>';
print $output;
?>
Deletions:
=====Highlight Searched-for Text=====
The following code implements a feature that will highlight the search word in the pages that where found by TextSearch or by Google, Yahoo and many other search engines. The core of this feature is a JavaScript library by the name of [[http://www.kryogenix.org/code/browser/searchhi/ searchhi]].
From the searchhi website:
//The searchhi JavaScript library is a way of automatically highlighting words on a page when that page was reached by a search engine. In essence, if you search, for example, Google for some words, and then follow a link from the search results to a searchhi enabled page, the words you searched for will be highlighted on that page.//
First I had to make a few minor changes to this JavaScript libary. This to make it aware of the TextSearch activity.
The resulting file (searchhi.js) is then copied in the //3rdparty/plugins/searchhi// directory. Also make sure that your create a **.htaccess** file in the same directory with the following content:
<IfModule mod_rewrite.c>
RewriteEngine off
</IfModule>
Then copy the **searchhi.js** file into the //3rdparty/plugins/searchhi// directory.
%%(javascript)
/* http://www.kryogenix.org/code/browser/searchhi/ */
/* Modified 20021006 to fix query string parsing and add case insensitivity */
function highlightWord(node,word) {
// Iterate into this nodes childNodes
if (node.hasChildNodes) {
var hi_cn;
for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
highlightWord(node.childNodes[hi_cn],word);
}
}

// And do this node itself
if (node.nodeType == 3) { // text node
tempNodeVal = node.nodeValue.toLowerCase();
tempWordVal = word.toLowerCase();
if (tempNodeVal.indexOf(tempWordVal) != -1) {
pn = node.parentNode;
if (pn.className != "searchword") {
// word has not already been highlighted!
nv = node.nodeValue;
ni = tempNodeVal.indexOf(tempWordVal);
// Create a load of replacement nodes
before = document.createTextNode(nv.substr(0,ni));
docWordVal = nv.substr(ni,word.length);
after = document.createTextNode(nv.substr(ni+word.length));
hiwordtext = document.createTextNode(docWordVal);
hiword = document.createElement("span");
hiword.className = "searchword";
hiword.appendChild(hiwordtext);
pn.insertBefore(before,node);
pn.insertBefore(hiword,node);
pn.insertBefore(after,node);
pn.removeChild(node);
}
}
}
}
function SearchHighlight() {
if (!document.createElement) return;
ref = document.referrer;
if (ref.indexOf('?') == -1) return;
qs = ref.substr(ref.indexOf('?')+1);
qsa = qs.split('&');
for (i=0;i<qsa.length;i++) {
qsip = qsa[i].split('=');
if (qsip.length == 1) continue;
if (qsip[0] == 'q' || qsip[0] == 'p' || qsip[0] == 'phrase') { // q= for Google, p= for Yahoo, phrase for wikka
words = unescape(qsip[1].replace(/\+/g,' ')).split(/\s+/);
for (w=0;w<words.length;w++) {
highlightWord(document.getElementsByTagName("body")[0],words[w]);
}
}
}
}
window.onload = SearchHighlight;
Now all that rest us is two small changes to the **wikka.css** file and to the **header.php** action.
In **css/wikka.css** add the following lines:
%%(css)
/* ##### searchhi plugin ##### */
.searchword {
background-color: yellow;
}
In the **actions/header.php** file add the following code just before the **</HEAD>** tag:
%%(html4strict)
<script src="3rdparty/plugins/searchhi/searchhi.js" type="text/javascript"></script>
It is installed on [[http://stens.ca/kb my Wikka]] so you can see for yourself how it works.


Revision [20897]

The oldest known version of this page was created on 2009-11-02 14:40:21 by RolandStens
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki