Minor tweaks to TINYIB_DEFAULTSTYLE

This commit is contained in:
Trevor Slocum 2021-06-02 17:17:06 -07:00
parent 32ae4efbcf
commit 2f900306cb
3 changed files with 22 additions and 26 deletions

View File

@ -153,8 +153,10 @@ if (!defined('TINYIB_DEFAULTSTYLE')) {
define('TINYIB_DEFAULTSTYLE', 'futaba');
}
if (!isset($tinyib_stylesheets)) {
$tinyib_stylesheets = array('futaba' => 'Futaba',
'burichan' => 'Burichan');
$tinyib_stylesheets = array(
'futaba' => 'Futaba',
'burichan' => 'Burichan'
);
}
if (!isset($tinyib_hidefieldsop)) {
$tinyib_hidefieldsop = array();

View File

@ -50,19 +50,15 @@ function pageStylesheets() {
$return = '<link rel="stylesheet" type="text/css" href="css/global.css">';
// Default stylesheet
$default_style_value = htmlentities(TINYIB_DEFAULTSTYLE, ENT_QUOTES);
$default_style_name = htmlentities($tinyib_stylesheets[TINYIB_DEFAULTSTYLE]);
$return .= '<link rel="stylesheet" type="text/css" href="css/' . 'test' . '.css" title="' . $default_style_name . '" id="mainStylesheet">';
$return .= '<link rel="stylesheet" type="text/css" href="css/' . htmlentities(TINYIB_DEFAULTSTYLE, ENT_QUOTES) . '.css" title="' . htmlentities($tinyib_stylesheets[TINYIB_DEFAULTSTYLE], ENT_QUOTES) . '" id="mainStylesheet">';
// Additional stylesheets
foreach($tinyib_stylesheets as $value => $display_name) {
if ($value === TINYIB_DEFAULTSTYLE) {
foreach($tinyib_stylesheets as $filename => $title) {
if ($filename === TINYIB_DEFAULTSTYLE) {
continue;
}
$value_html = htmlentities($value, ENT_QUOTES);
$name_html = htmlentities($display_name, ENT_QUOTES);
$return .= '<link rel="alternate stylesheet" type="text/css" href="css/' . $value_html . '.css" title="' . $name_html . '">';
$return .= '<link rel="alternate stylesheet" type="text/css" href="css/' . htmlentities($filename, ENT_QUOTES) . '.css" title="' . htmlentities($title, ENT_QUOTES) . '">';
}
return $return;
@ -653,18 +649,16 @@ EOF;
$txt_delete = __('Delete');
$txt_delete_post = __('Delete Post');
$style_select = '';
$select_style = '';
if (count($tinyib_stylesheets) > 1) {
$options = '<option value="">' . $txt_style . '</option>';
$select_style = '<select id="switchStylesheet">';
foreach($tinyib_stylesheets as $value => $display_name) {
$value_html = htmlentities($value, ENT_QUOTES);
$name_html = htmlentities($display_name);
$options .= '<option value="' . $value . '">'. $display_name . '</option>';
$select_style .= '<option value="">' . $txt_style . '</option>';
foreach($tinyib_stylesheets as $filename => $title) {
$select_style .= '<option value="' . htmlentities($filename, ENT_QUOTES) . '">'. htmlentities($title) . '</option>';
}
$style_select = '<select id="switchStylesheet">'. $options . '</select>';
$select_style .= '</select>';
}
$body = <<<EOF
@ -672,7 +666,7 @@ EOF;
<div class="adminbar">
$cataloglink
$managelink
$style_select
$select_style
</div>
<div class="logo">
EOF;

View File

@ -48,11 +48,18 @@ define('TINYIB_EXPANDWIDTH', 85); // Expanded content size as a percentage o
define('TINYIB_TIMEZONE', 'UTC'); // See https://secure.php.net/manual/en/timezones.php - e.g. America/Los_Angeles
define('TINYIB_CATALOG', true); // Generate catalog page
define('TINYIB_JSON', true); // Generate JSON files
define('TINYIB_DEFAULTSTYLE', 'futaba'); // Default page style
define('TINYIB_DATEFMT', '%g/%m/%d(%a)%H:%M:%S'); // Date and time format (see php.net/strftime)
$tinyib_hidefieldsop = array(); // Fields to hide when creating a new thread - e.g. array('name', 'email', 'subject', 'message', 'file', 'embed', 'password')
$tinyib_hidefields = array(); // Fields to hide when replying
$tinyib_anonymous = array('Anonymous'); // Default name (or names)
$tinyib_capcodes = array(array('Admin', 'red'), array('Mod', 'purple')); // Administrator and moderator capcode label and color
// Stylesheets (located in css)
// Format: File name excluding extension => Title
$tinyib_stylesheets = array(
'futaba' => 'Futaba',
'burichan' => 'Burichan'
);
// Post control
define('TINYIB_DELAY', 30); // Delay (in seconds) between posts from the same IP address to help control flooding [0 to disable]
@ -89,13 +96,6 @@ $tinyib_embeds = array('SoundCloud' => 'https://soundcloud.com/oembed?format=jso
'Vimeo' => 'https://vimeo.com/api/oembed.json?url=TINYIBEMBED',
'YouTube' => 'https://www.youtube.com/oembed?url=TINYIBEMBED&format=json');
// Stylesheets (located in css)
// Format: File name excluding extension => Title
define('TINYIB_DEFAULTSTYLE', 'futaba');
$tinyib_stylesheets = array('futaba' => 'Futaba',
'burichan' => 'Burichan');
// File control
define('TINYIB_MAXKB', 2048); // Maximum file size in kilobytes [0 to disable]
define('TINYIB_MAXKBDESC', '2 MB'); // Human-readable representation of the maximum file size