本文整理汇总了PHP中conf_update_param函数的典型用法代码示例。如果您正苦于以下问题:PHP conf_update_param函数的具体用法?PHP conf_update_param怎么用?PHP conf_update_param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了conf_update_param函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['guestbook'])) {
conf_update_param('guestbook', $this->default_conf, true);
} else {
$old_conf = safe_unserialize($conf['guestbook']);
if (!isset($old_conf['guest_can_view'])) {
$old_conf['guest_can_view'] = true;
$old_conf['guest_can_add'] = true;
}
if (!isset($old_conf['menu_link'])) {
$old_conf['menu_link'] = true;
}
conf_update_param('guestbook', $old_conf, true);
}
pwg_query('
CREATE TABLE IF NOT EXISTS `' . $this->table . '` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`date` datetime NOT NULL DEFAULT "0000-00-00 00:00:00",
`author` varchar(255) NOT NULL,
`author_id` smallint(5) DEFAULT NULL,
`anonymous_id` varchar(45) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`website` varchar(255) DEFAULT NULL,
`content` longtext NOT NULL,
`rate` float(5,2) unsigned DEFAULT NULL,
`validated` enum("true","false") NOT NULL DEFAULT "false",
`validation_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
;');
}
示例2: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['AdminTools'])) {
conf_update_param('AdminTools', $this->default_conf, true);
}
}
示例3: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['flickr2piwigo'])) {
conf_update_param('flickr2piwigo', $this->default_conf, true);
}
mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/', MKGETDIR_DEFAULT & ~MKGETDIR_DIE_ON_ERROR);
}
示例4: install
function install($plugin_version, &$errors = array())
{
include dirname(__FILE__) . '/config_default.inc.php';
global $conf;
if (empty($conf['gdThumb'])) {
conf_update_param('gdThumb', $config_default, true);
}
$this->installed = true;
}
示例5: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['sortorders'])) {
conf_update_param('sortorders', $this->default_conf, true);
} else {
$old_conf = safe_unserialize($conf['sortorders']);
conf_update_param('sortorders', $old_conf, true);
}
}
示例6: activate
function activate($theme_version, &$errors = array())
{
global $conf, $prefixeTable;
if (empty($conf['smartpocket'])) {
conf_update_param('smartpocket', $this->default_conf, true);
} elseif (count(safe_unserialize($conf['smartpocket'])) != 2) {
$conff = safe_unserialize($conf['smartpocket']);
$config = array('loop' => !empty($conff['loop']) ? $conff['loop'] : true, 'autohide' => !empty($conff['autohide']) ? $conff['autohide'] : 5000);
conf_update_param('smartpocket', $config, true);
}
$this->installed = true;
}
示例7: GThumb_init
function GThumb_init()
{
global $conf, $user, $page, $stripped;
// new param in 2.4.c
if (!isset($conf['GThumb']['show_thumbnail_caption'])) {
$conf['GThumb']['show_thumbnail_caption'] = true;
conf_update_param('GThumb', serialize($conf['GThumb']));
}
$user['nb_image_page'] = $conf['GThumb']['nb_image_page'];
$page['nb_image_page'] = $conf['GThumb']['nb_image_page'];
$stripped['maxThumb'] = $conf['GThumb']['nb_image_page'];
$conf['show_thumbnail_caption'] = $conf['GThumb']['show_thumbnail_caption'];
}
示例8: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['Fotorama'])) {
$conf['Fotorama'] = serialize($this->default_conf);
conf_update_param('Fotorama', $conf['Fotorama']);
} else {
$new_conf = is_string($conf['Fotorama']) ? unserialize($conf['Fotorama']) : $conf['Fotorama'];
$conf['Fotorama'] = serialize($new_conf);
conf_update_param('Fotorama', $conf['Fotorama']);
}
$this->installed = true;
}
示例9: theme_activate
function theme_activate($id, $version, &$errors)
{
global $conf;
include_once dirname(dirname(__FILE__)) . '/functions.inc.php';
$default_conf = modus_get_default_config();
$my_conf = @$conf['modus_theme'];
$my_conf = @unserialize($my_conf);
if (empty($my_conf)) {
$my_conf = $default_conf;
}
$my_conf = array_merge($default_conf, $my_conf);
$my_conf = array_intersect_key($my_conf, $default_conf);
conf_update_param('modus_theme', addslashes(serialize($my_conf)));
}
示例10: plugin_install
function plugin_install()
{
if (!defined('VIDEOJS_PATH')) {
define('VIDEOJS_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
}
// Remove unused files from previous version
$toremove = array("skin", "js", "include/getid3");
foreach ($toremove as $dir) {
if (is_dir(VIDEOJS_PATH . $dir)) {
vjs_deltree(VIDEOJS_PATH . $dir);
}
}
$toremove = array("language/index.htm", "language/fr_FR/index.htm", "language/en_UK/index.htm", "admin.tpl", "admin.php", "include/README.md");
foreach ($toremove as $file) {
if (is_file(VIDEOJS_PATH . $file)) {
@unlink(VIDEOJS_PATH . $file);
}
}
$default_config = array('skin' => 'vjs-default-skin', 'max_height' => '720', 'preload' => 'auto', 'controls' => true, 'autoplay' => false, 'loop' => false, 'volume' => '1', 'upscale' => false, 'plugins' => array('zoomrotate' => false, 'thumbnails' => false, 'watermark' => false));
/* Add configuration to the config table */
$conf['vjs_conf'] = serialize($default_config);
conf_update_param('vjs_conf', $conf['vjs_conf']);
/* Add a comment to the entry */
$q = 'UPDATE ' . CONFIG_TABLE . ' SET `comment` = "Configuration settings for piwigo-videojs plugin" WHERE `param` = "vjs_conf";';
pwg_query($q);
/* Keep customCSS separate as it can be big entry */
conf_update_param('vjs_customcss', '');
/* Add a comment to the entry */
$q = 'UPDATE ' . CONFIG_TABLE . ' SET `comment` = "Custom CSS used by the piwigo-videojs plugin" WHERE `param` = "vjs_customcss";';
pwg_query($q);
/* Table to hold videos metadata details */
$q = 'CREATE TABLE IF NOT EXISTS `' . videojs_table . '` (
`id` mediumint(8) NOT NULL,
`format` varchar(64) DEFAULT NULL,
`type` varchar(64) DEFAULT NULL,
`duration` varchar(64) DEFAULT NULL,
`overall_bit_rate` varchar(64) DEFAULT NULL,
`model` varchar(128) DEFAULT NULL,
`make` varchar(128) DEFAULT NULL,
`display_aspect_ratio` varchar(8) DEFAULT NULL,
`width` smallint(9) DEFAULT NULL,
`height` smallint(9) DEFAULT NULL,
`frame_rate` varchar(64) DEFAULT NULL,
`channel` varchar(64) DEFAULT NULL,
`sampling_rate` varchar(64) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
;';
//pwg_query($q);
}
示例11: activate
function activate($theme_version, &$errors = array())
{
global $conf, $prefixeTable;
if (empty($conf['smartpocket'])) {
$conf['smartpocket'] = serialize($this->default_conf);
$query = "\n INSERT INTO " . CONFIG_TABLE . " (param,value,comment)\n VALUES ('smartpocket' , '" . pwg_db_real_escape_string($conf['smartpocket']) . "' , 'loop#autohide');";
pwg_query($query);
} elseif (count(unserialize($conf['smartpocket'])) != 2) {
$conff = unserialize($conf['smartpocket']);
$config = array('loop' => !empty($conff['loop']) ? $conff['loop'] : true, 'autohide' => !empty($conff['autohide']) ? $conff['autohide'] : 5000);
conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config)));
load_conf_from_db();
}
$this->installed = true;
}
示例12: plugin_install
function plugin_install()
{
global $prefixeTable;
if (!defined('OSM_PATH')) {
define('OSM_PATH', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
}
// Remove unused files from previous version
$toremove = array("admin.tpl", "admin.php", "admin_boot.php", "leaflet/leaflet.ie.css", "leaflet/MarkerCluster.Default.ie.css", "admin/admin_sync.php", "admin/admin_sync.tpl", "admin/admin_gps.php", "admin/admin_gps.tpl");
foreach ($toremove as $file) {
if (is_file(OSM_PATH . $file)) {
@unlink(OSM_PATH . $file);
}
}
$default_config = array('right_panel' => array('enabled' => true, 'add_before' => 'Average', 'height' => '200', 'zoom' => 12, 'link' => 'Location', 'linkcss' => null, 'showosm' => true), 'left_menu' => array('enabled' => true, 'link' => l10n('OSWORLDMAP'), 'popup' => 0, 'popupinfo_name' => true, 'popupinfo_img' => true, 'popupinfo_link' => true, 'popupinfo_comment' => true, 'popupinfo_author' => true, 'zoom' => 2, 'center' => '0,0', 'layout' => 2), 'category_description' => array('enabled' => true, 'index' => 0, 'height' => '200', 'width' => 'auto'), 'main_menu' => array('enabled' => false, 'height' => '200'), 'gpx' => array('height' => '500', 'width' => '320'), 'batch' => array('global_height' => '200', 'unit_height' => '200'), 'map' => array('baselayer' => 'mapnik', 'custombaselayer' => null, 'custombaselayerurl' => null, 'noworldwarp' => false, 'attrleaflet' => true, 'attrimagery' => true, 'attrplugin' => true), 'pin' => array('pin' => 1, 'pinpath' => '', 'pinsize' => '', 'pinshadowpath' => '', 'pinshadowsize' => '', 'pinoffset' => '', 'pinpopupoffset' => ''));
/* Add configuration to the config table */
$conf['osm_conf'] = serialize($default_config);
conf_update_param('osm_conf', $conf['osm_conf']);
$q = 'UPDATE ' . CONFIG_TABLE . ' SET `comment` = "Configuration settings for piwigo-openstreetmap plugin" WHERE `param` = "osm_conf";';
pwg_query($q);
// Remove previous created db table for GPX entries
$q = "DROP TABLE IF EXISTS " . $prefixeTable . "osm_gps;";
pwg_query($q);
// Remove previous created directory for GPX entries
$gpx_dir = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'gps_track_files/';
if (file_exists($gpx_dir) and is_dir($gpx_dir)) {
osm_deltree($gpx_dir);
}
// Create world map link
$dir_name = basename(dirname(__FILE__));
$c = <<<EOF
<?php
define('PHPWG_ROOT_PATH','./');
if (isset(\$_GET['v']) and \$_GET['v'] == 1)
\tinclude_once( PHPWG_ROOT_PATH. 'plugins/piwigo-openstreetmap/osmmap.php');
else if (isset(\$_GET['v']) and \$_GET['v'] == 2)
\tinclude_once( PHPWG_ROOT_PATH. 'plugins/piwigo-openstreetmap/osmmap2.php');
else if (isset(\$_GET['v']) and \$_GET['v'] == 3)
\tinclude_once( PHPWG_ROOT_PATH. 'plugins/piwigo-openstreetmap/osmmap3.php');
else if (isset(\$_GET['v']) and \$_GET['v'] == 4)
\tinclude_once( PHPWG_ROOT_PATH. 'plugins/piwigo-openstreetmap/osmmap4.php');
else
\tinclude_once( PHPWG_ROOT_PATH. 'plugins/piwigo-openstreetmap/osmmap3.php');
?>
EOF;
$fp = fopen(PHPWG_ROOT_PATH . 'osmmap.php', 'w');
fwrite($fp, $c);
fclose($fp);
}
示例13: upgrade_100_110
function upgrade_100_110()
{
global $conf;
load_language('plugin.lang', PH_PATH);
// Upgrading options - Changing config variables to assoc array
// ------------------------------------------------------------
// Upgrade $conf_PH options
$conf_PH = unserialize($conf['PruneHistory']);
$Newconf_PH = array('PHVersion' => $conf_PH[0], 'AUTOPRUNE' => $conf_PH[1], 'RANGEVALUE' => $conf_PH[2], 'RANGE' => $conf_PH[3]);
// unset obsolete conf
// -------------------
for ($i = 0; $i <= 3; $i++) {
unset($conf_PH[$i]);
}
$update_conf = serialize($Newconf_PH);
conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf));
}
示例14: global_version_update
function global_version_update()
{
global $conf;
// Get current plugin version
$plugin = HIPE_infos(HIPE_PATH);
$version = $plugin['version'];
// Update plugin version
$query = '
SELECT value
FROM ' . CONFIG_TABLE . '
WHERE param = "HistoryIPConfig"
;';
$result = pwg_query($query);
$conf_HIPE = pwg_db_fetch_assoc($result);
$Newconf_HIPE = unserialize($conf_HIPE['value']);
$Newconf_HIPE['Version'] = $version;
conf_update_param('HistoryIPConfig', pwg_db_real_escape_string(serialize($Newconf_HIPE)));
}
示例15: install
function install($plugin_version, &$errors = array())
{
global $conf;
if (empty($conf['oauth'])) {
conf_update_param('oauth', $this->default_conf, true);
} else {
$conf['oauth'] = safe_unserialize($conf['oauth']);
if (!isset($conf['oauth']['allow_merge_accounts'])) {
$conf['oauth']['allow_merge_accounts'] = true;
conf_update_param('oauth', $conf['oauth']);
}
}
$result = pwg_query('SHOW COLUMNS FROM `' . USER_INFOS_TABLE . '` LIKE "oauth_id";');
if (!pwg_db_num_rows($result)) {
pwg_query('ALTER TABLE `' . USER_INFOS_TABLE . '` ADD `oauth_id` VARCHAR(255) DEFAULT NULL;');
}
// move field from users table to user_infos
$result = pwg_query('SHOW COLUMNS FROM `' . USERS_TABLE . '` LIKE "oauth_id";');
if (pwg_db_num_rows($result)) {
$query = '
UPDATE `' . USER_INFOS_TABLE . '` AS i
SET oauth_id = (
SELECT oauth_id
FROM `' . USERS_TABLE . '` AS u
WHERE u.' . $conf['user_fields']['id'] . ' = i.user_id
)
;';
pwg_query($query);
pwg_query('ALTER TABLE `' . USERS_TABLE . '` DROP `oauth_id`;');
}
// add 'total' and 'enabled' fields in hybridauth conf file
if (file_exists($this->file)) {
$hybridauth_conf = (include $this->file);
if (!isset($hybridauth_conf['total'])) {
$enabled = array_filter($hybridauth_conf['providers'], create_function('$p', 'return $p["enabled"];'));
$hybridauth_conf['total'] = count($hybridauth_conf['providers']);
$hybridauth_conf['enabled'] = count($enabled);
$content = "<?php\ndefined('PHPWG_ROOT_PATH') or die('Hacking attempt!');\n\nreturn ";
$content .= var_export($hybridauth_conf, true);
$content .= ";\n?>";
file_put_contents($this->file, $content);
}
}
}