Wednesday, June 6, 2012

Display a random "thirukkural" on your blog/website

To display a random thirukkural, copy and paste the HTML code below into your web page. :

<iframe src="http://justtrythis.co.in/demos/thirukkural/index.php" 
style="width: 100%; height: 120px; border: medium none;"></iframe>

Note:
  • You can see demo on top of this blog.
  • You can  customize width and height of iframe.If you want more customization inform me.
  • To create thirukkural database visit how-to-store-tamil-in-mysql

Download thirukkural : 
           download thirukkural.csv 
           download thirukkural.sql 
           download thirukkural.xml

6 comments:

  1. Great effort on Thirukkural SQL., but i could n't able to break the 4 & 3 of kural., ie the 4 words on first line & 3 lines on second line., i used explode command with space as separator, but no use..., how to split...

    ReplyDelete
    Replies
    1. To split it use regular expression , Thanks.

      Delete
  2. i don't understand.., can u please provide me the php code.



    ReplyDelete
    Replies
    1. assume "$kural" contains a thirukkural that fetched from database.

      echo preg_replace('/\s\s+/', ' ',preg_replace('/\s{3,4}|,/', '
      ', $kural))

      Delete
  3. Hi,

    In browser the kural is not displaying after 510..

    Showing following error when I try to access kural 511

    Error
    ----------------------
    This page contains the following errors:

    error on line 2 at column 72: Encoding error
    Below is a rendering of the page up to the first error.

    I think the problem is with the section heading "தெரிந்து வினையாடல்" is not properly encoded..

    Please provide proper value in sql for that.

    ReplyDelete
    Replies
    1. Hi,
      Here is the origin source of thirukkural, from which I convert into sql. https://www.dropbox.com/s/js0yv1sze5xch9p/kural.zip

      Delete