php if function_exists register_sidebar sidebar1 register_sidebar arra

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
if ( function_exists('register_sidebar') ){
// sidebar1
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}
$thescenery_defaultsettings = array(
backgroundType => 'keepratio', //stretch, keepratio, original //original will not use flash
//backgroundImage => get_bloginfo('template_url') . '/11670011000.jpg',
blur => 'false',
blurRate => '5',
// options for keepratio backgroundType
backgroundHorizontalAlign => 'left',
backgroundVerticalAlign => 'top',
pageList => 'true',
searchBox => 'true'
);
$thescenery_settings = null;
function thescenery_getsettings($force_reload = false){
global $thescenery_defaultsettings, $thescenery_settings;
if(!$thescenery_settings || $force_reload){
if(!get_option('thescenery_settings_initialized')){
add_option('thescenery_settings_initialized', '1');
foreach($thescenery_defaultsettings as $k => $v)
add_option("thescenery_$k", $v);
}
$thescenery_settings = array();
foreach($thescenery_defaultsettings as $k => $default_value){
$value = get_option("thescenery_$k");
if(!is_string($value))
$value = $default_value;
$thescenery_settings[$k] = $value;
}
}
$thescenery_settings['backgroundImage'] = get_bloginfo('template_url') . '/11670011000.jpg';
return $thescenery_settings;
}
function thescenery_updatesettings($settings){
global $thescenery_defaultsettings, $thescenery_settings;
foreach($thescenery_defaultsettings as $k => $default_value)
if(is_string($settings[$k]))
update_option("thescenery_$k", $settings[$k]);
thescenery_getsettings(true);
}
function thescenery_getsetting($name, $default=''){
$settings = thescenery_getsettings($name);
$value = $settings[$name];
if(!is_string($value))
return $default;
return $value;
}
include_once 'theme-options.php';
?>