The following warnings occurred:
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/printthread.php(287) : eval()'d code 2 errorHandler->error_callback
/printthread.php 287 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
Theme Settings - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: Theme Settings (/showthread.php?tid=6565)

Pages: 1 2


Theme Settings - mvlcek - 2014-07-12

I created a generic theme settings plugin which makes it very easy to provide configurable themes.

Theme Settings version 0.1:
  • Just provide a short PHP settings.php with the configuration input fields, and
  • Replace references to these settings in your template file(s) with get_theme_setting('nameOfSetting', 'defaultValue').
  • The schema support allows you to easily define multiple settings in *.properties files and enables the user to switch multiple settings at once.
  • Using the LESS plugin it is also easy to make your CSS files configurable.

Version 0.4:

  • It now supports the I18N plugin for multilanguage sites: just add class "i18n" to input fields in settings.php to mark fields that might have different values in different languages.

An example theme can be found here.

For more information and usage instructions see http://mvlcek.bplaced.net/get-simple/theme-settings.


RE: Theme Settings - shawn_a - 2014-07-12

That was fast


RE: Theme Settings - Carlos - 2014-07-12

Impressive.

Just a couple issues with the demo theme:
- it requires the I18N plugin (directly calls get_i18n_component in <title>)
- if you leave the Tag Line field empty or enter something like "..." (without quotes) the site is broken (Less fatal error)


RE: Theme Settings - mvlcek - 2014-07-12

(2014-07-12, 17:32:34)Carlos Wrote: Impressive.

Just a couple issues with the demo theme:
- it requires the I18N plugin (directly calls get_i18n_component in <title>)
- if you leave the Tag Line field empty or enter something like "..." (without quotes) the site is broken (Less fatal error)

Thank you for testing. I updated the theme and both the Theme Settings and the LESS plugin to avoid these errors.


RE: Theme Settings - Oleg06 - 2014-07-13

thanks for plugin and theme with tips


RE: Theme Settings - Tzvook - 2014-07-15

Very useful !!
can give a lot of power to the theme now, getting closer to the way it's done in Wordpress

A few feature requests if I may ...

1. wysiwyg support for textareas fields
2. photo/files fields support , for easily attaching images to theme (logos, backgrounds, sliders, etc').
3. dedicated data dir ( other/ThemeSettings/.... ) for keeping data tidy in case of multiple themes.


RE: Theme Settings - Tzvook - 2014-07-15

Actually, here is the code for an image picker field (should be in settings.php) :

PHP Code:
<p><label for="sitelogo" >Logo</label>
<
input id="sitelogo" name="sitelogo" class="text" value="<?php get_theme_setting('sitelogo'); ?>" type="url" onClick='window.open("../admin/filebrowser.php?CKEditorFuncNum=1&returnid=sitelogo&type=images","mywindow","width=600,height=500")' /></p

Clicking inside the field opens a new win to choose an image ...


RE: Theme Settings - Tzvook - 2014-07-15

O.k. ...
Here is an easy solution for wysiwyg powered fields :

1. Add the attached ckeditor.php file to the plugin directory ( IE: plugins/theme_settings/ckeditor.php )

2. Add the code below into the settings.php of your theme for your wysiwyg powered textarea (for a field I called "democontent"):

Code:
<div>
  <p>
    <label for="democontent">תוכן נסיוני:</label>
    <textarea class="wysiwygedit" name="democontent" id="democontent" style="width:90%; height?:50px;"><?php get_theme_setting('democontent', $default='', $isHtml=true); ?></textarea>
  </p>
</div>

3. Add this line to the end of your setting.php :

Code:
<?php include(GSPLUGINPATH . 'theme_settings/ckeditor.php'); ?>



RE: Theme Settings - Oleg06 - 2014-07-15

image editor does not add
[code]<img alt=\"\" src=\"http://mydomen/data/thumbs/thumbnail.a75800734.jpg\" style=\"width: 200px; height: 143px;\" />[code]


RE: Theme Settings - Tzvook - 2014-07-15

(2014-07-15, 23:13:45)Oleg06 Wrote: image editor does not add ...

@Oleg06
If you asked me about the image field - it only return the url of the image
in the template.php you should simply call it :

Code:
<img src="<?php get_theme_setting('sitelogo', '', true); ?>" alt="">



RE: Theme Settings - Oleg06 - 2014-07-15

that is, you need to remove the unnecessary buttons from the editor Smile


RE: Theme Settings - Tzvook - 2014-07-15

(2014-07-15, 23:34:09)Oleg06 Wrote: that is, you need to remove the unnecessary buttons from the editor Smile

I was referring to the "image picker field" , not to the wysiwyg textarea.

My wysiwyg is not acting as you described, it embed photos just fine .... weird ...
It's embedded @ my template.php like this:
Code:
<?php get_theme_setting('democontent', '', true); ?>

But - if mvlcek will include it in the plugin, he'll probably take a look
I don't like to add things to someone else new plugins :-) ... those are just a quick suggestions ....


RE: Theme Settings - Oleg06 - 2014-07-16

this happens when the site is installed in the folder


RE: Theme Settings - Tzvook - 2014-07-30

HTML data is not saved as HTML (CData) in the data file.
which makes a lot of problems.


RE: Theme Settings - mvlcek - 2014-07-30

Theme Settings version 0.3:
  • correctly saves HTML to the settings file (@Tzvook thanks for testing)



RE: Theme Settings - Tzvook - 2014-07-30

(2014-07-30, 02:49:59)mvlcek Wrote: Theme Settings version 0.3:
  • correctly saves HTML to the settings file (@Tzvook thanks for testing)

Why not changing line 45 to
PHP Code:
$data->addChild($key)->addCData($value); 

Seems it's working fine, though you probably know better :-) ????


RE: Theme Settings - Tzvook - 2014-07-31

(2014-07-30, 02:49:59)mvlcek Wrote: Theme Settings version 0.3:
  • correctly saves HTML to the settings file (@Tzvook thanks for testing)

mvlcek ???
is my fix ok ?


RE: Theme Settings - mvlcek - 2014-07-31

(2014-07-30, 03:04:02)Tzvook Wrote:
(2014-07-30, 02:49:59)mvlcek Wrote: Theme Settings version 0.3:
  • correctly saves HTML to the settings file (@Tzvook thanks for testing)

Why not changing line 45 to
PHP Code:
$data->addChild($key)->addCData($value); 

Seems it's working fine, though you probably know better :-) ????

Of course this works, too. I just don't like to use CData for everything ;-)


RE: Theme Settings - Oleg06 - 2015-04-08

is it possible to add checkboxes and radio buttons in the settings


RE: Theme Settings - mvlcek - 2015-04-09

(2015-04-08, 19:58:34)Oleg06 Wrote: is it possible to add checkboxes and radio buttons in the settings

Should be possible. But if a checkbox is not checked no value will be saved, so you should make sure to use a default value in get/return_theme_setting.


RE: Theme Settings - Arugula - 2015-12-31

Great idea for a plugin! But question/suggestion:
Is it possible to skip the schema? I'd like to offer the user to choose ANY color they want, rather than my small list of color combinations. Example: I'd use @backgroundColor in LESS, and then have a text input field in settings.php that allows user to enter in any 6-digit hex number for it that they wish. They could get that hex number from one of many online color choosing tools. (Although, even better, a color chooser could be incorporated into the settings.php??).

But what function/code would I need to create that text input field in settings.php to allow user to enter a color hex number?

Thanks.


RE: Theme Settings - mvlcek - 2015-12-31

(2015-12-31, 16:31:18)Arugula Wrote: Great idea for a plugin!  But question/suggestion:
     Is it possible to skip the schema? I'd like to offer the user to choose ANY color they want, rather than my small list of color combinations.   Example:  I'd use @backgroundColor in LESS, and then have a text input field in settings.php that allows user to enter in any 6-digit hex number for it that they wish.  They could get that hex number from one of many online color choosing tools.   (Although, even better, a color chooser could be incorporated into the settings.php??).

But what function/code would I need to create that text input field in settings.php to allow user to enter a color hex number?

You can specify any fields in the settings.php.
To combine extra fields specified in settings.php, but not in the *.properties (e.g. provide a template, but let the user specify the link color), use something like this:

Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', return_theme_settings($additional));
?>

If you don't have schemas, remove the schema select from settings.php and make sure you have a empty default.properties.

You could then also create the css like this (but the above code would still work):

Code:
<?php
$additional = array('f1' => return_theme_setting('f1'), 'f2' => return_theme_setting('f2'));
get_less_css('default.less', $additional);
?>



RE: Theme Settings - Arugula - 2016-01-01

Thank you! that was quick. I didn't fully understand your directions at first, but I played around with your code and got it working!

One problem though: on the settings page, when user presses the 'Save Settings' button, the data he'd put in the entry fields disappears. It IS sent to LESS/css, because the edit changes show correctly on the pages. But I'd really like the 'current value' for each of those fields to show in the boxes, even when the user logs back in weeks later, so he or I can see the current value, before attempting to change it.

Is there a change in the code, or new functions that could be made, that would allow us to get/see the 'current existing value' for each of these fields? (So when logging in you'd see: 'Background Color: #D3BD29' or some such. )
Thanks so much for your time!


RE: Theme Settings - mvlcek - 2016-01-01

(2016-01-01, 10:23:45)Arugula Wrote: One problem though:   on the settings page, when user presses the 'Save Settings' button, the data he'd put in the entry fields disappears.   It IS sent to LESS/css, because the edit changes show correctly on the pages.   But I'd really like the 'current value' for each of those fields to show in the boxes, even when the user logs back in weeks later, so he or I can see the current value, before attempting to change it. 

Did you include the value="<?php get_theme_setting('fieldname'); ?>" in your input tag (as shown in the example on http://mvlcek.bplaced.net/get-simple/theme-settings)?


RE: Theme Settings - Arugula - 2016-01-02

OK, that worked! I was using the return_theme_setting before. But the change worked. Thanks again so much!