Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

May 17, 2012

The best Guide to install Facebook comments in your website

I found the best guide to implement Facebook comments in your website:

http://wp.tutsplus.com/tutorials/the-ultimate-guide-to-implementing-facebook-comments-on-your-blog/




Using Facebook Comments on your blog offers your readers a way to instantaneously comment on posts, as well as to share them without having to do any work. If you think this type of commenting system will suit your audience, read on to find out how you can implement it the right way.

Step 1: Create A Facebook App

Before you actually generate the Facebook Comments code and implement it on your blog, you need to create an app for your site.
  1. Go to developers.facebook.com
  2. Click Apps
  3. Click Create New App
  4. Enter an App Display Name and Namespace
On the next screen, you’ll see your newly created app’s App ID and App Secret Key. You won’t need the secret key, but the App ID will be used later. Take note of it.
Below these keys, go ahead and fill out the Contact Email and App Domain (your blog’s domain). Go down and click on Website. Fill in the same domain that you used for the App Domain. Click Save Changes.

Step 2: Insert the Facebook Comments Code into Your Theme

In this tutorial, we’ll be implementing Facebook Comments alongside the default WordPress comment system instead of replacing it. If you want, you can head over to the Facebook Comments code generator to get the code you’ll need for inserting the comment system; however, I’ve included it here so you can just copy it. You’ll need to customize a few parts of it, however; I’ll note which parts those are for each block.
The code block below should be placed in your theme’s header.php file. Find the opening tag and paste the block directly below it. On the 6th line, replace “Your App ID Here” with your App ID.
  1. <div id="fb-root">div>  
  2. <script>(function(d, s, id) {  
  3.   var js, fjs = d.getElementsByTagName(s)[0];  
  4.   if (d.getElementById(id)) return;  
  5.   js = d.createElement(s); js.id = id;  
  6.   js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=Your App ID Here";  
  7.   fjs.parentNode.insertBefore(js, fjs);  
  8. }(document, 'script', 'facebook-jssdk'));script>  
While you’re still in your header.php file, go up into the section and paste this block of code somewhere. It will ensure that the Facebook Commenting system on your blog posts knows it’s owned by the app you created before. Replace the “Your App ID Here” bit with your App ID (leave the quotes in place).
  1. <meta property="fb:app_id" content="Your App ID Here"/>  
The next code block should be placed in your theme’s comments.php file. Since we’re implementing Facebook Comments alongside WordPress comments, you’ll just be pasting it where you want the Facebook Comments box to appear, and you won’t be deleting any of the original code.
  1. <div class="fb-comments" data-href="" data-num-posts="2" data-width="470" data-colorscheme="light" data-mobile="false">div>  
If you generate your Facebook Comments code from the link I gave you earlier, instead of just grabbing it from this tutorial, remember to change the data-href attribute from the original URL to , otherwise Facebook Comments won’t work.
You can also edit the data-num-postsdata-width, and data-colorscheme attributes to your liking. The first defines how many comments will be shown on each post before a user needs to click “See More”, the second defines the width of the commenting system (set it to something slightly smaller than your content area’s width), and the last is the color scheme, which can be set to “light” or “dark”

Feb 28, 2012

New project

Today, we lance a new project. It is BETA version. But the website is Up. It's about http://www.dentaldirectorylinks.com. It is a link directory with/for dentists and dental network in the world.

It's all withh html, css javascript, jQuery, Mysql and PHP.

Dec 20, 2011

Creating XML from MySQL as easy as PI


ANALYSIS
Unfortunately, importing XML into MySQL is more like chocolate cheesecake, but there are solutions available. Just follow this guide and you'll be on your way to integrating Web services with your database in no time. Starting from scratch
With the growing popularity of XML, developers have found an easy method to present data sets in a standardised way. What else does that sound like? A database! It's only natural that it should be simple to convert your information without a lot of fuss -- and you can. Some proprietary database manufacturers, such as Microsoft and IBM, have taken steps to integrate XML into their systems. This comes as no surprise since these two companies are both heavily involved in the XML standardisation project. Not wanting to be left behind, the creators of MySQL database incorporated a means for generating an XML data file. It's supported in version 3.23.48 and up. You can use the command line or facilitate the process with the programming language of your choice. To get started, you can download MySQL database  for free from MySQL.com. The current release is sufficient to support this feature, and you don't need to compile it with any special parameters. Fruit filling
Once you're installed, created, and populated your database, execute the following command to generate an XML file:
mysqldump --xml databasename [tables]
If you'd like to save this to a file, simply use the standard *NIX method of outputting to a file:
mysqldump --xml databasename > filename.xml
This produces a well formed XML document. Because XML is datacentric, if you dump your entire database and it contains no information, your file will result in a series of empty tags based on the table names. Your output should look something like this:

Now you're free to use this data file with any application you desire. This method is useful in a number of ways. Not only will it create a standardised representation of your data, but it can also take a snapshot of your database (or portion of your database) for display. Rather than making repeated calls to the database server, just generate an XML document when your database changes and reference that from Web pages or whatever you're using. This can localize calls for data, reduce the overhead of frequent calls to a database, and easily present a subset of your information for improved performance, security, or localization. Ice cream on the side
It's really easy to get XML from MySQL, but how about the other direction? That's a little trickier. MySQL itself doesn't support this function, and with good reason. The database currently has no way to validate the XML file. This could result in a number of scenarios, ranging from a partial load to ignoring malformed tags and statements to simply forcing the entire load to fail. MySQL supports only cascading back-outs in current development versions. While it's not pretty from a native standpoint, you do have some options. One solution is Perl's DBIx::XML_RDB module. You can use this method to both import and export XML, though understandably the import is heavily dependent upon a correctly structured XML file. To get the data, the module essentially runs a query and formats the results in an XML file. Conversely, you can use the module to read an XML file, create a SQL query, and execute it. There is a simpler option as well. The DBIx::XML_RDB module ships with two utility scripts to facilitate the process: xml2sql.pl and sql2xml.pl. I found agreat tutorial  on using this Perl module at O'Reilly's XML.com Web site. It will walk you through the process. Another, more generalized effort comes from Ron Bourret's XML-DBMS project . This is an ongoing effort to support XML imports and exports with relational databases using Perl and Java. There's also some very interesting work that supports mapping one database to another using XML as facilitating middleware. This is a community-oriented open source project being managed on SourceForge . Other languages, particularly Web scripting languages, haven't ignored the need to import XML into SQL databases either. There are similar efforts for Python, such as the xml2sql and dtd2sql modules, outlined in detail in this article from IBM , and a couple of projects in the works for PHP, such as the "XML MySQL class" project. Scrumptious
With these utilities, importing and exporting XML into and from MySQL is easy! Since MySQL is popular and free, it's been the test bed for integrating many scripting languages in XML, and as a result there are a number of tutorials and scripts specific for this database. With the power of a relational database and the ability to easily create XML files, MySQL can be an integral part of your Web services solution.