本文整理匯總了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();
}
}