2012-12-08 00:44:30 +00:00
|
|
|
<?php
|
2013-07-17 05:48:05 +00:00
|
|
|
|
2013-10-01 22:04:14 +00:00
|
|
|
// Get the UID of the channel owner
|
2013-07-17 09:01:35 +00:00
|
|
|
$uid = get_theme_uid();
|
|
|
|
|
|
|
|
if($uid)
|
|
|
|
load_pconfig($uid,'redbasic');
|
2013-03-20 22:57:08 +00:00
|
|
|
|
2013-10-01 22:04:14 +00:00
|
|
|
// Nav colours are mess. Set $nav_colour as a single word for the sake of letting folk pick one
|
|
|
|
// but it actually consists of at least two colours to form a gradient - $nav_bg_1 and $nav_bg_2
|
|
|
|
// A further two - $nav_bg_3 and $nav_bg_4 are used to create the hover, if any particular scheme
|
|
|
|
// wants to implement that
|
|
|
|
$nav_colour = get_pconfig($uid, "redbasic", "nav_colour");
|
2013-02-20 20:30:47 +00:00
|
|
|
|
2013-10-10 17:39:28 +00:00
|
|
|
// Load the owners pconfig
|
2013-10-11 00:02:52 +00:00
|
|
|
$schema = get_pconfig($uid,'redbasic','schema');
|
2013-10-10 18:18:33 +00:00
|
|
|
$bgcolour = get_pconfig($uid, "redbasic", "background_colour");
|
2013-10-01 22:04:14 +00:00
|
|
|
$background_image = get_pconfig($uid, "redbasic", "background_image");
|
|
|
|
$item_colour = get_pconfig($uid, "redbasic", "item_colour");
|
|
|
|
$item_opacity = get_pconfig($uid, "redbasic", "item_opacity");
|
|
|
|
$font_size = get_pconfig($uid, "redbasic", "font_size");
|
|
|
|
$font_colour = get_pconfig($uid, "redbasic", "font_colour");
|
|
|
|
$radius = get_pconfig($uid, "redbasic", "radius");
|
2013-10-10 17:39:28 +00:00
|
|
|
$shadow = get_pconfig($uid,"redbasic","photo_shadow");
|
2013-02-20 20:30:47 +00:00
|
|
|
|
2013-10-10 17:39:28 +00:00
|
|
|
// Now load the scheme. If a value is changed above, we'll keep the settings
|
|
|
|
// If not, we'll keep those defined by the schema
|
|
|
|
// Setting $scheme to '' wasn't working for some reason, so we'll check it's
|
|
|
|
// not --- like the mobile theme does instead.
|
|
|
|
|
|
|
|
if (($schema) && ($schema != '---')) {
|
|
|
|
$schemefile = 'view/theme/' . current_theme() . '/schema/' . $schema . '.php';
|
|
|
|
require_once ($schemefile);
|
2013-10-10 18:22:28 +00:00
|
|
|
}
|
2013-10-10 18:18:33 +00:00
|
|
|
// If we haven't got a schema, load the default. We shouldn't touch this - we
|
|
|
|
// should leave it for admins to define for themselves.
|
|
|
|
if (! $schema) {
|
|
|
|
if(file_exists('view/theme/' . current_theme() . '/schema/default.php')) {
|
|
|
|
$schemefile = 'view/theme/' . current_theme() . '/schema/' . 'default.php';
|
|
|
|
require_once ($schemefile);
|
|
|
|
}
|
|
|
|
}
|
2013-10-10 18:22:28 +00:00
|
|
|
|
2013-10-10 17:39:28 +00:00
|
|
|
|
2013-10-03 01:39:49 +00:00
|
|
|
//Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting
|
|
|
|
//individually. If we don't, we'll have problems if a user has set one, but not all options.
|
|
|
|
|
|
|
|
if (! $nav_colour) {
|
|
|
|
$nav_colour = "red";
|
|
|
|
$nav_bg_1 = "#f88";
|
|
|
|
$nav_bg_2 = "#b00";
|
|
|
|
$nav_bg_3 = "#f00";
|
|
|
|
$nav_bg_4 = "#b00";
|
|
|
|
}
|
2013-10-10 18:18:33 +00:00
|
|
|
if (! $bgcolour)
|
|
|
|
$bgcolour = "fff";
|
2013-10-03 01:39:49 +00:00
|
|
|
if (! $background_image)
|
|
|
|
$background_image ='';
|
|
|
|
if (! $item_colour)
|
|
|
|
$item_colour = "fff";
|
|
|
|
if (! $item_opacity)
|
|
|
|
$item_opacity = "1";
|
|
|
|
if (! $font_size)
|
|
|
|
$font_size = "12";
|
|
|
|
if (! $font_colour)
|
|
|
|
$font_colour = "000";
|
|
|
|
if (! $radius)
|
|
|
|
$radius = "5";
|
2013-10-03 05:59:58 +00:00
|
|
|
if (! $shadow)
|
|
|
|
$shadow = "0";
|
2013-10-11 03:17:41 +00:00
|
|
|
if(! $active_colour)
|
|
|
|
$active_colour = '#FFFFFF';
|
2013-10-03 01:39:49 +00:00
|
|
|
|
2013-10-11 16:36:02 +00:00
|
|
|
|
2013-02-20 20:30:47 +00:00
|
|
|
|
2013-10-11 16:36:02 +00:00
|
|
|
// Nav colours have nested values, so we have to define the actual variables
|
|
|
|
// used in the CSS from the higher level "red", "black", etc here
|
|
|
|
if ($nav_colour == "red") {
|
|
|
|
$nav_bg_1 = "#f88";
|
|
|
|
$nav_bg_2 = "#b00";
|
|
|
|
$nav_bg_3 = "#f00";
|
|
|
|
$nav_bg_4 = "#b00";
|
|
|
|
$search_background = '#FFDDDD';
|
|
|
|
$active_colour = '#444444';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($nav_colour == "black") {
|
|
|
|
$nav_bg_1 = $nav_bg_3 = "#000";
|
|
|
|
$nav_bg_2 = $nav_bg_4 = "#222";
|
|
|
|
$search_background = '#EEEEEE';
|
|
|
|
$active_colour = '#AAAAAA';
|
|
|
|
}
|
|
|
|
if ($nav_colour == "silver") {
|
|
|
|
$nav_bg_1 = $nav_bg_2 = $nav_bg_3 = $nav_bg_4 = "silver";
|
|
|
|
$search_background = '#EEEEEE';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-01 22:04:14 +00:00
|
|
|
// Apply the settings
|
2013-02-08 03:23:21 +00:00
|
|
|
if(file_exists('view/theme/' . current_theme() . '/css/style.css')) {
|
2013-03-06 23:13:54 +00:00
|
|
|
$x = file_get_contents('view/theme/' . current_theme() . '/css/style.css');
|
2013-02-21 22:45:56 +00:00
|
|
|
|
2013-10-01 22:04:14 +00:00
|
|
|
$options = array (
|
|
|
|
'$nav_bg_1' => $nav_bg_1,
|
|
|
|
'$nav_bg_2' => $nav_bg_2,
|
|
|
|
'$nav_bg_3' => $nav_bg_3,
|
|
|
|
'$nav_bg_4' => $nav_bg_4,
|
2013-10-03 09:20:09 +00:00
|
|
|
'$search_background' => $search_background,
|
2013-10-10 18:18:33 +00:00
|
|
|
'$bgcolour' => $bgcolour,
|
2013-10-01 22:04:14 +00:00
|
|
|
'$background_image' => $background_image,
|
|
|
|
'$item_colour' => $item_colour,
|
|
|
|
'$item_opacity' => $item_opacity,
|
|
|
|
'$font_size' => $font_size,
|
|
|
|
'$font_colour' => $font_colour,
|
2013-10-03 05:59:58 +00:00
|
|
|
'$radius' => $radius,
|
2013-10-11 03:17:41 +00:00
|
|
|
'$shadow' => $shadow,
|
|
|
|
'$active_colour' => $active_colour
|
2013-10-01 22:04:14 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
echo str_replace(array_keys($options), array_values($options), $x);
|
2013-02-20 20:30:47 +00:00
|
|
|
|
2013-10-01 22:04:14 +00:00
|
|
|
}
|