{"id":41903,"date":"2016-02-12T08:26:01","date_gmt":"2016-02-12T08:26:01","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/dbtable-to-datatable\/"},"modified":"2016-02-12T08:35:39","modified_gmt":"2016-02-12T08:35:39","slug":"dbtable-to-datatable","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/dbtable-to-datatable\/","author":14807084,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.1","stable_tag":"trunk","tested":"4.4.34","requires":"4.4","requires_php":"","requires_plugins":"","header_name":"DbTable to DataTable","header_author":"Guillaume Raineri","header_description":"","assets_banners_color":"","last_updated":"2016-02-12 08:35:39","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/github.com\/rikemsen\/","rating":5,"author_block_rating":0,"active_installs":30,"downloads":3962,"num_ratings":4,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"4"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[5804,202,1627,822,2289],"plugin_category":[59],"plugin_contributors":[90132],"plugin_business_model":[],"class_list":["post-41903","plugin","type-plugin","status-publish","hentry","plugin_tags-datatable","plugin_tags-jquery","plugin_tags-mysql","plugin_tags-sortable","plugin_tags-table","plugin_category-utilities-and-tools","plugin_contributors-rikemsen","plugin_committers-rikemsen"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/dbtable-to-datatable.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin allows you to display the content of MySql tables into sortable html tables thanks to the DataTable jQuery Plugin.<\/p>\n\n<p>You don't need any configuration and once installed, it is ready to use.<\/p>\n\n<p>Simply add the shortcode <code>[dbtable]<\/code> into an article or a page and you will have a nice and clean table.<\/p>\n\n<h3>Examples:<\/h3>\n\n<p>All parameters that contain more than one value have to be separated by commas without spaces.<\/p>\n\n<p>Minimum needed : <code>[dbtable from=MysqlTableName]<\/code><\/p>\n\n<ul>\n<li><code>select=field1,field2,field3<\/code> will display all rows of the table and only specified fields<\/li>\n<li><code>except=field1,field2,field3<\/code> will display all rows of the table except specified fields<\/li>\n<li><code>cssClass=class1,class2<\/code> will add class1 and class2 to the class attribut of the table<\/li>\n<li><code>comments=true|(false)<\/code> true will use comments specified in each field of the MySql table as datatable column names. If true and if a comment is missing, the plugin fallback on field name only for the one missing, not for the entire table.<\/li>\n<li><code>pagination=true|(false)<\/code> will show\/hide the bottom pagination links. If false, make sure you have the limit parameter large enough to display all your datas<\/li>\n<li><code>limit=25<\/code> Display 25 rows by default.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<h4>From your WordPress dashboard<\/h4>\n\n<ul>\n<li>Visit 'Plugins &gt; Add New'<\/li>\n<li>Search for 'DbTable to DataTable'<\/li>\n<li>Activate DbTable to DataTable from your Plugins page.<\/li>\n<li>That's it!<\/li>\n<\/ul>\n\n<h4>From WordPress.org<\/h4>\n\n<ul>\n<li>Download DbTable to DataTable.<\/li>\n<li>Upload the 'DbTable2DataTable' directory to your '\/wp-content\/plugins\/' directory, using your favorite method (ftp, sftp, scp, etc...)<\/li>\n<li>Activate 'DbTable to DataTable' from your Plugins page.<\/li>\n<li>That's it !<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt>How do I change default values?<\/dt>\n<dd><p>You can edit the main <code>dbTable2dataTable.php<\/code> file and change these values :<\/p>\n\n<pre><code>    $this-&gt;defaults = array(\n          'from'        =&gt; null,     \/\/ Mysql source table\n          'select'      =&gt; null,     \/\/ Select specific columns\n          'except'      =&gt; null,     \/\/ Ignore specific columns\n          'cssclass'    =&gt; null,     \/\/ Specify custom CSS class for the &lt;table&gt;\n          'comments'    =&gt; false,    \/\/ Use field comments instead of column name\n          'pagination'  =&gt; false,    \/\/ Enable \/ Disable pagination\n          'limit'       =&gt; 25,       \/\/ Limit of results per page\n          'width'       =&gt; '100',    \/\/ Set width in % of the table\n          'language'    =&gt; 'English' \/\/ Default language : French\n        );\n<\/code><\/pre><\/dd>\n<dt>What the `comments` attribut does?<\/dt>\n<dd><p>By default, column names will be the field name (e.g: product_id, custom_field). But if you want to have custom\/pretty names you should modify your table and add comments to the fields (e.g : <code>ALTER TABLE product CHANGE product_id product_id INT( 11 ) COMMENT 'Product ID'<\/code><\/p><\/dd>\n<dt>Why can't I display datas from a Wordpress Table ?<\/dt>\n<dd><p>This plugin is not intended to display WordPress datas. I blocked this for security reasons. It aims to give you the ability to show custom datas from custom tables. I had to extract informations from an ERP and display them.<\/p><\/dd>\n<dt>How can I force the plugin to shows WP tables ?<\/dt>\n<dd><p>You can remove the security check <code>line 58<\/code> by deleting <code>or substr($atts['from'], 0,strlen($wpdb-&gt;prefix)) === $wpdb-&gt;prefix<\/code><\/p><\/dd>\n<dt>Why the language doesn't change?<\/dt>\n<dd><p>You probably misstyped the language name. Make sure you write it exactly with the correct name.\nRefer to : https:\/\/www.datatables.net\/plug-ins\/i18n\/<\/p>\n\n<p>E.g for french : <code>\/\/cdn.datatables.net\/plug-ins\/1.10.10\/i18n\/French.json<\/code> , the parameter will be <code>French<\/code> with the first letter in uppercase.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.1<\/h4>\n\n<ul>\n<li>First version<\/li>\n<\/ul>","raw_excerpt":"Display mysql datas into datatable.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/41903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=41903"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rikemsen"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=41903"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=41903"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=41903"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=41903"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=41903"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=41903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}