当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderFunctionsWP::isDBTableExists方法代码示例

本文整理汇总了PHP中RevSliderFunctionsWP::isDBTableExists方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctionsWP::isDBTableExists方法的具体用法?PHP RevSliderFunctionsWP::isDBTableExists怎么用?PHP RevSliderFunctionsWP::isDBTableExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSliderFunctionsWP的用法示例。


在下文中一共展示了RevSliderFunctionsWP::isDBTableExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createTable

 /**
  * create tables
  */
 public static function createTable($tableName)
 {
     global $wpdb;
     $parseCssToDb = false;
     $checkForTablesOneTime = get_option('revslider_checktables', '0');
     if ($checkForTablesOneTime == '0') {
         update_option('revslider_checktables', '1');
         if (RevSliderFunctionsWP::isDBTableExists(self::$table_prefix . RevSliderGlobals::TABLE_CSS_NAME)) {
             //$wpdb->tables( 'global' )
             //check if database is empty
             $result = $wpdb->get_row("SELECT COUNT( DISTINCT id ) AS NumberOfEntrys FROM " . self::$table_prefix . RevSliderGlobals::TABLE_CSS_NAME);
             if ($result->NumberOfEntrys == 0) {
                 $parseCssToDb = true;
             }
         }
     }
     if ($parseCssToDb) {
         $RevSliderOperations = new RevSliderOperations();
         $RevSliderOperations->importCaptionsCssContentArray();
         $RevSliderOperations->moveOldCaptionsCss();
     }
     //if table exists - don't create it.
     $tableRealName = self::$table_prefix . $tableName;
     if (RevSliderFunctionsWP::isDBTableExists($tableRealName)) {
         return false;
     }
     switch ($tableName) {
         case RevSliderGlobals::TABLE_SLIDERS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t  title tinytext NOT NULL,\r\r\n\t\t\t\t\t\t  alias tinytext,\r\r\n\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_SLIDES_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  slider_id int(9) NOT NULL,\r\r\n\t\t\t\t\t\t\t  slide_order int not NULL,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  layers MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_STATIC_SLIDES_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  slider_id int(9) NOT NULL,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  layers MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_CSS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  handle TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  settings MEDIUMTEXT,\r\r\n\t\t\t\t\t\t\t  hover MEDIUMTEXT,\r\r\n\t\t\t\t\t\t\t  params MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             $parseCssToDb = true;
             break;
         case RevSliderGlobals::TABLE_LAYER_ANIMS_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  handle TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  params TEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         case RevSliderGlobals::TABLE_NAVIGATION_NAME:
             $sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\r\r\n\t\t\t\t\t\t\t  id int(9) NOT NULL AUTO_INCREMENT,\r\r\n\t\t\t\t\t\t\t  name VARCHAR(191) NOT NULL,\r\r\n\t\t\t\t\t\t\t  handle VARCHAR(191) NOT NULL,\r\r\n\t\t\t\t\t\t\t  css MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  markup MEDIUMTEXT NOT NULL,\r\r\n\t\t\t\t\t\t\t  settings MEDIUMTEXT NULL,\r\r\n\t\t\t\t\t\t\t  UNIQUE KEY id (id)\r\r\n\t\t\t\t\t\t\t);";
             break;
         default:
             RevSliderFunctions::throwError("table: {$tableName} not found");
             break;
     }
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     dbDelta($sql);
     if ($parseCssToDb) {
         $RevSliderOperations = new RevSliderOperations();
         $RevSliderOperations->importCaptionsCssContentArray();
         $RevSliderOperations->moveOldCaptionsCss();
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:61,代码来源:revslider-front.class.php


注:本文中的RevSliderFunctionsWP::isDBTableExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。