本文整理汇总了PHP中RevSliderOperations::moveOldCaptionsCss方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::moveOldCaptionsCss方法的具体用法?PHP RevSliderOperations::moveOldCaptionsCss怎么用?PHP RevSliderOperations::moveOldCaptionsCss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderOperations
的用法示例。
在下文中一共展示了RevSliderOperations::moveOldCaptionsCss方法的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();
}
}