]> git.nbdom.net Git - nb.git/commitdiff
wp
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 8 May 2016 00:41:46 +0000 (01:41 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 8 May 2016 00:41:46 +0000 (01:41 +0100)
lib/php/db/index.php
lib/php/db/table.php
lib/php/db/wp.php

index 78f33fcef144381cceb26aee7e1b1e0a3eb2f4b0..c330117ea3bffbac499df8dbcab6626649cb15b7 100755 (executable)
@@ -8,9 +8,7 @@
 */
 require_once(realpath(dirname(__FILE__).'/../config.php'));
 require_once(realpath(dirname(__FILE__).'/../db.php'));
-/*
-# TODO - NB 08.04.16
-*/
+
 Db::paliases(array(
   'd' => 'db',
   't' => 'table',
index 6df7f78552f7315788fd541a1d1c7311176e95d4..5cf1e431c53f832adfd4b4826882e47970639ad8 100644 (file)
@@ -2,7 +2,6 @@
 require_once(realpath(dirname(__FILE__).'/../db.php'));
 require_once(realpath(dirname(__FILE__).'/../db/field.php'));
 require_once(realpath(dirname(__FILE__).'/../out.php'));
-if (class_exists('WP_List_Table')) require_once(realpath(dirname(__FILE__).'/wp.php'));
 #$a = array('a','b','c'); $b = array('c','a'); debug(array_diff($a,$b));
 
 define('TABLE_INDENT',NB_EOL ? "\t" : "");
@@ -639,7 +638,7 @@ Class Table extends nb {
     if ($opt_by_val !== null) $opt = $opt_by_val;
 
     $format = $this->p('format');
-    if (!$format) bye("Invalid parameter!");
+    if (!$format) bye("Invalid parameter format!");
 
     list($sql,$where,$limit,$select_count) = $this->rows_sql($opt);
     $st = $this->db()->conn->prepare($sql);
@@ -838,6 +837,7 @@ Class Table extends nb {
     Wordpress
   -----------------------------------------------------------------*/
   public function rows_begin_wp() {
+    require_once(realpath(dirname(__FILE__).'/wp.php'));
     $this->_html_table = new html_table($this);
     return '';
   }
index 4d934e5170f47ccd33b1941bd8c3ccc1a6618a71..a5f70d89dbe3cf96aeb7739220a3dbb9bd84d4c6 100644 (file)
@@ -1,8 +1,4 @@
 <?php
-if (!class_exists('WP_List_Table')) {
-       echo "Hi there! I'm just a plugin, not much I can do when called directly.\n";
-       exit;
-}
 class html_table extends WP_List_Table {
 
   public $_table;