Add LinkedIn Share Button




Simple Tutorial to Create LinkedIn Share Popup Window.

Sharing Any article on linkedin via your site or a web page is very simple. just follow below simple steps. linkedpopup() functions create a popup window for sharing content.

function linkedpopup()
{
var url1='http://www.linkedin.com/shareArticle?mini=true&url=<LINK_TO_SHARE>&title=<TITLE_TO_SHARE>&summary=<DESCRIPTION_TO_SHARE>&source=<YOUR_WEBSITE_NAME>';
      newwindow=window.open(url1,'<TITLE_OF_POPUP>','height=450,width=650');
      if (window.focus) {newwindow.focus()}

}

Parameter List:--

Parameter

Character Limit Description
mini

4 Must always be true
url

1024 The permanent link to the article. Must be URL encoded
title

200 The title of the article. Must be URL encoded
source

200 The source of the article. Must be URL encoded. Example: Wired Magazine
summary

256 A brief summary of the article. Must be URL encoded. Longer titles will be truncated gracefully with ellipses.


for more information visit:- http://developer.linkedin.com/documents/share-linkedin

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Twitter tweet button



Simple Tutorial to Create Twitter Share Popup Window.

tweetpopup() function helps your visitor to create popup for tweeting content and connect on twitter.

function tweetpopup() 
{
      var url2='https://twitter.com/intent/tweet?hashtags=<HASHTAG>&text=<TEXT_TO_TWEET>&url=<URL_TO_TWEET>&via=<HANDLE_FOR_TWEET>';

      newwindow=window.open(url2,<TITLE_OF_POPUP>','height=450,width=650');
      if (window.focus) {newwindow.focus()}

}

for more information visit:- https://about.twitter.com/resources/buttons#tweet

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Add facebook share button




Simple Tutorial to Create Facebook Share Popup Window.

function facebookshare()
{
var url2='http://www.facebook.com/sharer.php?s=100&p[title]='+encodeURIComponent(' TITLE_OF_SHARE') + '&p[summary]=' + encodeURIComponent(' DESCRIPTION_TO_SHARE') + '&p[url]=' + encodeURIComponent(' URL_TO_SHARE ') + '&p[images][0]=' + encodeURIComponent(' IMAGE_TO_SHARE');
newwindow=window.open(url2," POPUP_WINDOW_HEADING",'height=480,width=680');
if (window.focus) {newwindow.focus()}

}

Note :- You can use encodeURIComponent('Text To Encode') javascript function to encode text into url format.

0 comments :

Export Mysql Table in XML using php



This tutorial will go over how to download Mysql Table into XML file. This is Very useful for generating XML Data files when you have to work with javascript to get data.

<?php
$conn = mysql_connect('localhost', 'user_name','password');
mysql_select_db('database_name');
$xml = '';

//query the db
$query = mysql_query("SELECT col1, col2, col3, col4 FROM TableName");
    $xml .='<main>';
//loop through query results
while ( $row = mysql_fetch_array ( $query ) )
{
 //Add to xml
$xml .= '<group>';
 $xml .= '<col1><![CDATA[' . $row['col1'] . ']]></col1>'; 
$xml .= '<col2><![CDATA[' . $row['col2'] . ']]></col2>'; 
 $xml .= '<col3><![CDATA[' . $row['col3'] . ']]></col3>'; 
$xml .= '<col4 ><![CDATA[' . $row['col4 '] . ']]></col4 >'; 
$xml .= '</group>';
}

    $xml .='</main>'; 

//Write to xml and override
$handle = fopen('data.xml', 'w+');
fwrite($handle, $xml);
?>

Note:- Please Assign 777 permission to folder to write file into it.

0 comments :