Version Description
- Fixed:
escape
is now working, you can use escape to skipdelimiter
s (alsoterminator
s if they're not \r or \n) using escape (default escape character is backslash)
Download this release
Release Info
Developer | takien |
Plugin | Easy Table |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2 to 1.3
- easy-table.php +7 -4
- languages/easy-table-id_ID.mo +0 -0
- languages/easy-table-id_ID.po +2 -2
- languages/english.mo +0 -0
- languages/english.po +2 -2
- readme.txt +26 -1
easy-table.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Table
|
|
4 |
Plugin URI: http://takien.com/
|
5 |
Description: Create table in post, page, or widget in easy way.
|
6 |
Author: Takien
|
7 |
-
Version: 1.
|
8 |
Author URI: http://takien.com/
|
9 |
*/
|
10 |
|
@@ -87,7 +87,7 @@ function __construct(){
|
|
87 |
private function easy_table_base($return){
|
88 |
$easy_table_base = Array(
|
89 |
'name' => 'Easy Table',
|
90 |
-
'version' => '1.
|
91 |
'plugin-domain' => 'easy-table'
|
92 |
);
|
93 |
return $easy_table_base[$return];
|
@@ -1191,7 +1191,7 @@ function easy_table_init() {
|
|
1191 |
* Use dedicated str_getcsv since 1.1
|
1192 |
*/
|
1193 |
if (!function_exists('easy_table_str_getcsv')) {
|
1194 |
-
function easy_table_str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape =
|
1195 |
|
1196 |
/**
|
1197 |
* Bug fix, custom terminator wont work
|
@@ -1203,6 +1203,8 @@ if (!function_exists('easy_table_str_getcsv')) {
|
|
1203 |
$input = str_replace("\n",'NLINEBREAK',$input);
|
1204 |
$input = str_replace("\r",'RLINEBREAK',$input);
|
1205 |
}
|
|
|
|
|
1206 |
$fiveMBs = 5 * 1024 * 1024;
|
1207 |
if (($handle = fopen("php://temp/maxmemory:$fiveMBs", 'r+')) !== FALSE) {
|
1208 |
fputs($handle, $input);
|
@@ -1215,12 +1217,13 @@ if (!function_exists('easy_table_str_getcsv')) {
|
|
1215 |
|
1216 |
$option = get_option('easy_table_plugin_option');
|
1217 |
$limit = !empty($option['limit']) ? (int)$option['limit'] : 2000;
|
1218 |
-
while (($data = @fgetcsv($handle, $limit, $delimiter, $enclosure)) !== FALSE) {
|
1219 |
$num = count($data);
|
1220 |
for ($c=0; $c < $num; $c++) {
|
1221 |
$line++;
|
1222 |
$data[$c] = str_replace('NLINEBREAK',"\n",$data[$c]);
|
1223 |
$data[$c] = str_replace('RLINEBREAK',"\r",$data[$c]);
|
|
|
1224 |
$return[$line] = $data[$c];
|
1225 |
}
|
1226 |
}
|
4 |
Plugin URI: http://takien.com/
|
5 |
Description: Create table in post, page, or widget in easy way.
|
6 |
Author: Takien
|
7 |
+
Version: 1.3
|
8 |
Author URI: http://takien.com/
|
9 |
*/
|
10 |
|
87 |
private function easy_table_base($return){
|
88 |
$easy_table_base = Array(
|
89 |
'name' => 'Easy Table',
|
90 |
+
'version' => '1.3',
|
91 |
'plugin-domain' => 'easy-table'
|
92 |
);
|
93 |
return $easy_table_base[$return];
|
1191 |
* Use dedicated str_getcsv since 1.1
|
1192 |
*/
|
1193 |
if (!function_exists('easy_table_str_getcsv')) {
|
1194 |
+
function easy_table_str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = '\\'){
|
1195 |
|
1196 |
/**
|
1197 |
* Bug fix, custom terminator wont work
|
1203 |
$input = str_replace("\n",'NLINEBREAK',$input);
|
1204 |
$input = str_replace("\r",'RLINEBREAK',$input);
|
1205 |
}
|
1206 |
+
$input = str_ireplace( $escape.$delimiter,'_ESCAPED_SEPATATOR_',$input );
|
1207 |
+
|
1208 |
$fiveMBs = 5 * 1024 * 1024;
|
1209 |
if (($handle = fopen("php://temp/maxmemory:$fiveMBs", 'r+')) !== FALSE) {
|
1210 |
fputs($handle, $input);
|
1217 |
|
1218 |
$option = get_option('easy_table_plugin_option');
|
1219 |
$limit = !empty($option['limit']) ? (int)$option['limit'] : 2000;
|
1220 |
+
while (($data = @fgetcsv($handle, $limit, $delimiter, $enclosure, $escape)) !== FALSE) {
|
1221 |
$num = count($data);
|
1222 |
for ($c=0; $c < $num; $c++) {
|
1223 |
$line++;
|
1224 |
$data[$c] = str_replace('NLINEBREAK',"\n",$data[$c]);
|
1225 |
$data[$c] = str_replace('RLINEBREAK',"\r",$data[$c]);
|
1226 |
+
$data[$c] = str_replace('_ESCAPED_SEPATATOR_',$delimiter,$data[$c]);
|
1227 |
$return[$line] = $data[$c];
|
1228 |
}
|
1229 |
}
|
languages/easy-table-id_ID.mo
CHANGED
Binary file
|
languages/easy-table-id_ID.po
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: easy-table 1.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2013-05-13 04:14+0700\n"
|
6 |
-
"PO-Revision-Date: 2013-08-
|
7 |
"Last-Translator: takien <contact@takien.com>\n"
|
8 |
"Language-Team: takien.com <contact@takien.com>\n"
|
9 |
"Language: id_ID\n"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: easy-table 1.3\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2013-05-13 04:14+0700\n"
|
6 |
+
"PO-Revision-Date: 2013-08-20 09:28+0700\n"
|
7 |
"Last-Translator: takien <contact@takien.com>\n"
|
8 |
"Language-Team: takien.com <contact@takien.com>\n"
|
9 |
"Language: id_ID\n"
|
languages/english.mo
CHANGED
Binary file
|
languages/english.po
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: easy-table 1.
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2013-05-13 04:13+0700\n"
|
6 |
-
"PO-Revision-Date: 2013-08-
|
7 |
"Last-Translator: takien <contact@takien.com>\n"
|
8 |
"Language-Team: takien.com <contact@takien.com>\n"
|
9 |
"Language: en_US\n"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: easy-table 1.3\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2013-05-13 04:13+0700\n"
|
6 |
+
"PO-Revision-Date: 2013-08-20 09:28+0700\n"
|
7 |
"Last-Translator: takien <contact@takien.com>\n"
|
8 |
"Language-Team: takien.com <contact@takien.com>\n"
|
9 |
"Language: en_US\n"
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://takien.com/donate
|
|
4 |
Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.6
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -24,6 +24,10 @@ Easy Table using standard CSV format to generate table data, it's easiest way to
|
|
24 |
* Fancy table design (using Twitter CSS bootstrap)
|
25 |
* WYSIWYG safe, I mean you can switch HTML/View tab in WordPress editor without breaking the table data.
|
26 |
|
|
|
|
|
|
|
|
|
27 |
= Example usage =
|
28 |
|
29 |
* Basic table
|
@@ -179,6 +183,24 @@ row3col1,row3col2,row3col3|
|
|
179 |
row4col1,row4col2,row4col3|
|
180 |
[/table]`
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
* Table with no heading
|
183 |
`[table th="0"]some data here[/table]`
|
184 |
|
@@ -225,6 +247,9 @@ No
|
|
225 |
|
226 |
== Changelog ==
|
227 |
|
|
|
|
|
|
|
228 |
= 1.2 =
|
229 |
* Added: `align` parameter is now back. (Previously removed on version 1.1)
|
230 |
|
4 |
Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.6
|
7 |
+
Stable tag: 1.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
24 |
* Fancy table design (using Twitter CSS bootstrap)
|
25 |
* WYSIWYG safe, I mean you can switch HTML/View tab in WordPress editor without breaking the table data.
|
26 |
|
27 |
+
= Known bugs =
|
28 |
+
* Enclosure will not work on first cell of a row
|
29 |
+
* Chinese characters (and others?) usually stripped down on first cell of a row
|
30 |
+
|
31 |
= Example usage =
|
32 |
|
33 |
* Basic table
|
183 |
row4col1,row4col2,row4col3|
|
184 |
[/table]`
|
185 |
|
186 |
+
* Table with comma in cell using enclosure
|
187 |
+
`[table]
|
188 |
+
head1,head2,head3
|
189 |
+
row1col1,row1col2,"this, should, in, one cell, because, enclosured, with, doublequote"
|
190 |
+
row2col1,row2col2,row2col3
|
191 |
+
row3col1,row3col2,row3col3
|
192 |
+
row4col1,row4col2,row4col3
|
193 |
+
[/table]`
|
194 |
+
|
195 |
+
* Table with comma in cell using escape (since 1.3)
|
196 |
+
`[table]
|
197 |
+
head1,head2,head3
|
198 |
+
row1col1,row1col2,this\, should\, in\, one cell\, because\, commas \,escaped \,with \,backslash
|
199 |
+
row2col1,row2col2,row2col3
|
200 |
+
row3col1,row3col2,row3col3
|
201 |
+
row4col1,row4col2,row4col3
|
202 |
+
[/table]`
|
203 |
+
|
204 |
* Table with no heading
|
205 |
`[table th="0"]some data here[/table]`
|
206 |
|
247 |
|
248 |
== Changelog ==
|
249 |
|
250 |
+
= 1.3 =
|
251 |
+
* Fixed: `escape` is now working, you can use escape to skip `delimiter`s (also `terminator`s if they're not \r or \n) using escape (default escape character is backslash)
|
252 |
+
|
253 |
= 1.2 =
|
254 |
* Added: `align` parameter is now back. (Previously removed on version 1.1)
|
255 |
|