v10.0
This commit is contained in:
@@ -1,32 +1,48 @@
|
||||
<?php
|
||||
|
||||
if(! App::$install) {
|
||||
if(!App::$install) {
|
||||
|
||||
// Get the UID of the channel owner
|
||||
$uid = get_theme_uid();
|
||||
|
||||
if($uid) {
|
||||
load_pconfig($uid,'ussrbasicpub');
|
||||
}
|
||||
// Load the owners pconfig
|
||||
load_pconfig($uid, 'ussrbasicpub');
|
||||
|
||||
// Load the owners pconfig
|
||||
$nav_bg = get_pconfig($uid, 'ussrbasicpub', 'nav_bg');
|
||||
$nav_bg_dark = get_pconfig($uid, 'ussrbasicpub', 'nav_bg_dark');
|
||||
$narrow_navbar = get_pconfig($uid,'ussrbasicpub','narrow_navbar');
|
||||
$link_color = get_pconfig($uid, 'ussrbasicpub', 'link_color');
|
||||
$link_color_dark = get_pconfig($uid, 'ussrbasicpub', 'link_color_dark');
|
||||
$link_hover_color = get_pconfig($uid, 'ussrbasicpub', 'link_hover_color');
|
||||
$link_hover_color_dark = get_pconfig($uid, 'ussrbasicpub', 'link_hover_color_dark');
|
||||
$bgcolor = get_pconfig($uid, 'ussrbasicpub', 'background_color');
|
||||
$bgcolor_dark = get_pconfig($uid, 'ussrbasicpub', 'background_color_dark');
|
||||
$schema = get_pconfig($uid,'ussrbasicpub','schema');
|
||||
$background_image = get_pconfig($uid, 'ussrbasicpub', 'background_image');
|
||||
$background_image_dark = get_pconfig($uid, 'ussrbasicpub', 'background_image_dark');
|
||||
$font_size = get_pconfig($uid, 'ussrbasicpub', 'font_size');
|
||||
$radius = get_pconfig($uid, 'ussrbasicpub', 'radius');
|
||||
$converse_width=get_pconfig($uid,'ussrbasicpub','converse_width');
|
||||
$top_photo=get_pconfig($uid,'ussrbasicpub','top_photo');
|
||||
$reply_photo=get_pconfig($uid,'ussrbasicpub','reply_photo');
|
||||
$custom_bs = get_pconfig($uid, 'ussrbasicpub', 'bootstrap');
|
||||
$nav_bg = get_pconfig($uid, 'ussrbasicpub', 'nav_bg');
|
||||
$nav_bg_dark = get_pconfig($uid, 'ussrbasicpub', 'nav_bg_dark');
|
||||
$narrow_navbar = get_pconfig($uid,'ussrbasicpub','narrow_navbar');
|
||||
$bgcolor = get_pconfig($uid, 'ussrbasicpub', 'background_color');
|
||||
$bgcolor_dark = get_pconfig($uid, 'ussrbasicpub', 'background_color_dark');
|
||||
$schema = get_pconfig($uid,'ussrbasicpub','schema');
|
||||
$background_image = get_pconfig($uid, 'ussrbasicpub', 'background_image');
|
||||
$background_image_dark = get_pconfig($uid, 'ussrbasicpub', 'background_image_dark');
|
||||
$font_size = get_pconfig($uid, 'ussrbasicpub', 'font_size');
|
||||
$converse_width = get_pconfig($uid,'ussrbasicpub','converse_width');
|
||||
$top_photo = get_pconfig($uid,'ussrbasicpub','top_photo');
|
||||
$reply_photo = get_pconfig($uid,'ussrbasicpub','reply_photo');
|
||||
}
|
||||
}
|
||||
|
||||
$site_bs_path = 'vendor/twbs/bootstrap/dist/css/bootstrap.min.css';
|
||||
|
||||
if (file_exists('view/theme/ussrbasicpub/css/bootstrap-custom.css')) {
|
||||
// Compiled custom site bootstrap from sass
|
||||
// Run this script from the document root for an example:
|
||||
// php vendor/bin/pscss view/theme/ussrbasicpub/css/sample.scss view/theme/ussrbasicpub/css/bootstrap-custom.css
|
||||
|
||||
$site_bs_path = 'view/theme/ussrbasicpub/css/bootstrap-custom.css';
|
||||
}
|
||||
|
||||
$bs = $custom_bs ?: file_get_contents($site_bs_path);
|
||||
|
||||
if (file_exists('view/css/bootstrap-red.css')) {
|
||||
$bs = $bs . file_get_contents('view/css/bootstrap-red.css');
|
||||
}
|
||||
|
||||
if(file_exists('view/theme/ussrbasicpub/schema/' . $schema . '.css')) {
|
||||
$schemecss = file_get_contents('view/theme/ussrbasicpub/schema/' . $schema . '.css');
|
||||
}
|
||||
|
||||
// Now load the scheme. If a value is changed above, we'll keep the settings
|
||||
@@ -71,50 +87,16 @@ if ((!$schema) || ($schema == '---')) {
|
||||
|
||||
//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_bg)
|
||||
$nav_bg = 'rgba(248, 249, 250, 1)';
|
||||
|
||||
if (! $nav_bg_dark)
|
||||
$nav_bg_dark = 'rgba(43, 48, 53, 1)';
|
||||
|
||||
if (! $link_color)
|
||||
$link_color = '#0d6efd';
|
||||
|
||||
if (! $link_color_dark)
|
||||
$link_color_dark = '#6ea8fe';
|
||||
|
||||
if (! $link_hover_color)
|
||||
$link_hover_color = '#0a58ca';
|
||||
|
||||
if (! $link_hover_color_dark)
|
||||
$link_hover_color_dark = '#9ec5fe';
|
||||
|
||||
if (! $bgcolor)
|
||||
$bgcolor = '#fff';
|
||||
|
||||
if (! $bgcolor_dark)
|
||||
$bgcolor_dark = '#212529';
|
||||
|
||||
if (! $background_image)
|
||||
$background_image = '';
|
||||
|
||||
if (! $background_image_dark)
|
||||
$background_image_dark = '';
|
||||
|
||||
if (! $font_size)
|
||||
$font_size = '0.875rem';
|
||||
|
||||
if (! $radius)
|
||||
$radius = '0.375rem';
|
||||
|
||||
if (! $converse_width)
|
||||
$converse_width = '52'; //unit: rem
|
||||
|
||||
if(! $top_photo)
|
||||
$top_photo = '2.3rem';
|
||||
|
||||
if(! $reply_photo)
|
||||
$reply_photo = '2.3rem';
|
||||
$nav_bg = $nav_bg ?: 'rgba(248, 249, 250, 1)';
|
||||
$nav_bg_dark = $nav_bg_dark ?: 'rgba(43, 48, 53, 1)';
|
||||
$bgcolor = $bgcolor ?: '#fff';
|
||||
$bgcolor_dark = $bgcolor_dark ?: '#212529';
|
||||
$background_image = $background_image ?: '';
|
||||
$background_image_dark = $background_image_dark ?: '';
|
||||
$font_size = $font_size ?: '0.875rem';
|
||||
$converse_width = $converse_width ?: '52'; //unit: rem
|
||||
$top_photo = $top_photo ?: '2.9rem';
|
||||
$reply_photo = $reply_photo ?: '2.9rem';
|
||||
|
||||
// Apply the settings
|
||||
if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
|
||||
@@ -140,16 +122,11 @@ if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
|
||||
$options = array (
|
||||
'$nav_bg' => $nav_bg,
|
||||
'$nav_bg_dark' => $nav_bg_dark,
|
||||
'$link_color' => $link_color,
|
||||
'$link_color_dark' => $link_color_dark,
|
||||
'$link_hover_color' => $link_hover_color,
|
||||
'$link_hover_color_dark' => $link_hover_color_dark,
|
||||
'$bgcolor' => $bgcolor,
|
||||
'$bgcolor_dark' => $bgcolor_dark,
|
||||
'$background_image' => $background_image,
|
||||
'$background_image_dark' => $background_image_dark,
|
||||
'$font_size' => $font_size,
|
||||
'$radius' => $radius,
|
||||
'$converse_width' => $converse_width,
|
||||
'$top_photo' => $top_photo,
|
||||
'$reply_photo' => $reply_photo,
|
||||
@@ -158,8 +135,12 @@ if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
|
||||
'$right_aside_width' => $right_aside_width
|
||||
);
|
||||
|
||||
echo strtr($x, $options);
|
||||
|
||||
$o = strtr($x, $options);
|
||||
|
||||
header('Cache-Control: max-age=2592000');
|
||||
|
||||
echo $bs . $o;
|
||||
}
|
||||
|
||||
// Set the schema to the default schema in derived themes. See the documentation for creating derived themes how to override this.
|
||||
|
||||
Reference in New Issue
Block a user