本文整理汇总了PHP中RevOperations::importCaptionsCssContentArray方法的典型用法代码示例。如果您正苦于以下问题:PHP RevOperations::importCaptionsCssContentArray方法的具体用法?PHP RevOperations::importCaptionsCssContentArray怎么用?PHP RevOperations::importCaptionsCssContentArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevOperations
的用法示例。
在下文中一共展示了RevOperations::importCaptionsCssContentArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTable
/**
*
* craete tables
*/
public static function createTable($tableName)
{
global $wpdb;
$parseCssToDb = false;
//check if database is empty
$result = $wpdb->get_row("SELECT COUNT( DISTINCT id ) AS NumberOfEntrys FROM " . self::$table_prefix . GlobalsRevSlider::TABLE_CSS_NAME);
if ($result->NumberOfEntrys == 0) {
$parseCssToDb = true;
}
if ($parseCssToDb) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
$revOperations->updateDynamicCaptions(true);
}
/*
//if table exists - don't create it.
$tableRealName = self::$table_prefix.$tableName;
if(UniteFunctionsWPRev::isDBTableExists($tableRealName))
return(false);
$charset_collate = '';
if(method_exists($wpdb, "get_charset_collate"))
$charset_collate = $wpdb->get_charset_collate();
else{
if ( ! empty($wpdb->charset) )
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
if ( ! empty($wpdb->collate) )
$charset_collate .= " COLLATE $wpdb->collate";
}
switch($tableName){
case GlobalsRevSlider::TABLE_SLIDERS_NAME:
$sql = "CREATE TABLE " .self::$table_prefix.$tableName ." (
id int(9) NOT NULL AUTO_INCREMENT,
title tinytext NOT NULL,
alias tinytext,
params text NOT NULL,
PRIMARY KEY (id)
)$charset_collate;";
break;
case GlobalsRevSlider::TABLE_SLIDES_NAME:
$sql = "CREATE TABLE " .self::$table_prefix.$tableName ." (
id int(9) NOT NULL AUTO_INCREMENT,
slider_id int(9) NOT NULL,
slide_order int not NULL,
params text NOT NULL,
layers text NOT NULL,
PRIMARY KEY (id)
)$charset_collate;";
break;
case GlobalsRevSlider::TABLE_SETTINGS_NAME:
$sql = "CREATE TABLE " .self::$table_prefix.$tableName ." (
id int(9) NOT NULL AUTO_INCREMENT,
general TEXT NOT NULL,
params TEXT NOT NULL,
PRIMARY KEY (id)
)$charset_collate;";
break;
case GlobalsRevSlider::TABLE_CSS_NAME:
$sql = "CREATE TABLE " .self::$table_prefix.$tableName ." (
id int(9) NOT NULL AUTO_INCREMENT,
handle TEXT NOT NULL,
settings TEXT,
hover TEXT,
params TEXT NOT NULL,
PRIMARY KEY (id)
)$charset_collate;";
$parseCssToDb = true;
break;
case GlobalsRevSlider::TABLE_LAYER_ANIMS_NAME:
$sql = "CREATE TABLE " .self::$table_prefix.$tableName ." (
id int(9) NOT NULL AUTO_INCREMENT,
handle TEXT NOT NULL,
params TEXT NOT NULL,
PRIMARY KEY (id)
)$charset_collate;";
break;
default:
UniteFunctionsRev::throwError("table: $tableName not found");
break;
}
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
*/
}
示例2: sds_caption_css_init
public static function sds_caption_css_init($parseCssToDb)
{
if ((bool) $parseCssToDb === true) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
$revOperations->updateDynamicCaptions(true);
return TRUE;
}
}
示例3: createTable
/**
*
* craete 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 (UniteFunctionsWPRev::isDBTableExists(self::$table_prefix . GlobalsRevSlider::TABLE_CSS_NAME)) {
//check if database is empty
$result = $wpdb->get_row("SELECT COUNT( DISTINCT id ) AS NumberOfEntrys FROM " . self::$table_prefix . GlobalsRevSlider::TABLE_CSS_NAME);
if ($result->NumberOfEntrys == 0) {
$parseCssToDb = true;
}
}
}
if ($parseCssToDb) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
//$revOperations->updateDynamicCaptions(true);
}
//if table exists - don't create it.
$tableRealName = self::$table_prefix . $tableName;
if (UniteFunctionsWPRev::isDBTableExists($tableRealName)) {
return false;
}
$charset_collate = '';
if (method_exists($wpdb, "get_charset_collate")) {
$charset_collate = $wpdb->get_charset_collate();
} else {
if (!empty($wpdb->charset)) {
$charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";
}
if (!empty($wpdb->collate)) {
$charset_collate .= " COLLATE {$wpdb->collate}";
}
}
switch ($tableName) {
case GlobalsRevSlider::TABLE_SLIDERS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t title tinytext NOT NULL,\n\t\t\t\t\t\t\t alias tinytext,\n\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_SLIDES_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t slider_id int(9) NOT NULL,\n\t\t\t\t\t\t\t\t slide_order int not NULL,\t\n\t\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t\t layers text NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_STATIC_SLIDES_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t slider_id int(9) NOT NULL,\n\t\t\t\t\t\t\t\t params text NOT NULL,\n\t\t\t\t\t\t\t\t layers text NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_SETTINGS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t general TEXT NOT NULL,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
case GlobalsRevSlider::TABLE_CSS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t handle TEXT NOT NULL,\n\t\t\t\t\t\t\t\t settings TEXT,\n\t\t\t\t\t\t\t\t hover TEXT,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
$parseCssToDb = true;
break;
case GlobalsRevSlider::TABLE_LAYER_ANIMS_NAME:
$sql = "CREATE TABLE " . self::$table_prefix . $tableName . " (\n\t\t\t\t\t\t\t\t id int(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\t\t handle TEXT NOT NULL,\n\t\t\t\t\t\t\t\t params TEXT NOT NULL,\n\t\t\t\t\t\t\t\t PRIMARY KEY (id)\n\t\t\t\t\t\t\t\t){$charset_collate};";
break;
default:
UniteFunctionsRev::throwError("table: {$tableName} not found");
break;
}
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta($sql);
if ($parseCssToDb) {
$revOperations = new RevOperations();
$revOperations->importCaptionsCssContentArray();
$revOperations->moveOldCaptionsCss();
//$revOperations->updateDynamicCaptions(true);
}
}