Jump to content

The Old Man

Clients
  • Posts

    3,958
  • Joined

  • Last visited

  • Days Won

    11

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Everything posted by The Old Man

  1. Hi Brandon, Actually its a normal Upload type configured as here: which produces this in the AdminCP for the end user: It works but the if you have enabled Pixaby, the option to choose a Stock Photo doesn't appear. So I tried the Other/Manual type, which fills in the PHP code for you to presumably to get you started: It inserts a Text field form helper so I tried changing it to an Upload field, thinking that as its using the form helpers, and Pixabay is enabled, it would detect and show the Pixabay stock photo option: <?php return new \IPS\Helpers\Form\Text( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, array(), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] ); After changing the form helper from text to upload, it saves okay, but when you go to view the Theme Settings I get: InvalidArgumentException: (0) #0 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1772) : eval()'d code(1): IPS\Helpers\Form\_Upload->__construct('core_theme_sett...', '', false, Array, NULL, NULL, NULL, 'theme_setting_u...') #1 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1772): eval() #2 C:\xampp\htdocs\dev\ips4\system\Theme\Theme.php(1733): IPS\_Theme->getCustomSettingField(Array) #3 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(489): IPS\_Theme->form(Object(IPS\Helpers\Form)) #4 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(388): IPS\Node\_Controller->_addEditForm(Object(IPS\Theme)) #5 C:\xampp\htdocs\dev\ips4\system\Dispatcher\Controller.php(90): IPS\Node\_Controller->form() #6 C:\xampp\htdocs\dev\ips4\system\Node\Controller.php(62): IPS\Dispatcher\_Controller->execute() #7 C:\xampp\htdocs\dev\ips4\applications\core\modules\admin\customization\themes.php(59): IPS\Node\_Controller->execute() #8 C:\xampp\htdocs\dev\ips4\system\Dispatcher\Dispatcher.php(152): IPS\core\modules\admin\customization\_themes->execute() #9 C:\xampp\htdocs\dev\ips4\admin\index.php(14): IPS\_Dispatcher->run() #10 {main} this didn't work either: <?php if ( $form === null ) { $form = new \IPS\Helpers\Form; } if ( \IPS\Settings::i()->pixabay_enabled ) { $options['allowStockPhotos'] = TRUE; } return new \IPS\Helpers\Form\Upload( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, array($options), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] );
  2. Hi, basically that's the full code, but I had to give up the idea so I could try and get my Halloween theme into the market ASAP. The code snippet above I found inside a method in the pixabay class. The dev docs about the 4.5 changes mention a setting has been added to the form upload helper so you can toggle the facility on/off, so I thought I would just need to put the 'allowStockPhotos' option inside the the check if the feature is available, as per the snippet above and then it would appear as an option in the upload type of custom theme setting. I think it may not have been added yet, possibly an oversight.
  3. Thanks @Ehren I really appreciate that insight also because I've been working on my first theme with custom theme settings and being unfamiliar is the enemy! I thought it was meI So I wonder what purpose it actually serves then as a conditional field? Re adding a descriptive label, I found it's difficult to keep the label short and so I wondered if there a way to add a description under the custom theme setting like you can when you do a form for say a plugin's settings? In a plug-in form, you would append _desc to your language key and your description appears neatly under the field. I tried this yesterday and got an error message whilst in theme builder mode, it didn't like the _desc appendage on my custom form field at all, which seems odd as supposedly it's a form helper.
  4. According the docs, the Upload Helper form has a setting to toggle on Stock Photos to uploads, but it doesn't appear to be available when using an Upload image custom theme setting. if ( \IPS\Settings::i()->pixabay_enabled ) { $options['allowStockPhotos'] = TRUE; } I tried using a Code/Other type Theme Setting, but it kept throwing errors about the method not being allowed. How do I get it to show this optional stock photo picker in my image custom field setting? Many thanks!
  5. For your consideration... Would speed things up if you could quickly copy an existing Custom Theme Settings in Designer's Mode then edit the relevant fields withough having to duplicate everything else manually. Similar to copying an existing forum or other setting to give a head start.
  6. Is it possible to get this to also apply to Designers Mode? It only seems to work in Dev Mode // Disable ACP session timeout? // Disables the ACP session timeout check. Useful for developing where you may // get logged out of the ACP in between requests while working. // Has no effect if IN_DEV is FALSE 'DEV_DISABLE_ACP_SESSION_TIMEOUT' => FALSE, Many thanks! 😞
  7. If anyone comes across this issue in the future, opening the page a new window as suggested by the browser doesn't work, it hammered my server until I got a Cloudflare 524 error. However I managed to bypass this issue by selecting the X-frame option as the update completed normally. I usually have it set to none, because I set it up on the server via an HTTP.conf that was recently updated.
  8. I've found a little more about this, using my PC I can see there is actually a security message that can't be seen on an iPad: which leads you to: https://support.mozilla.org/en-US/kb/xframe-neterror-page?as=u&utm_source=inproduct
  9. Thanks for the new 4.5 version @HeadStand much appreciated. Test email works fine.
  10. Thanks Brandon, I'm trying to use the Condition field here, it inserts an opening PHP tag for you and says its for raw PHP, I didn't use a closing PHP tag: At the bottom it says you can make it (this custom setting) condition. I tried so many variations yesterday for over 8 hrs, I actually dreamt about it overnight! Basically, I just want to this custom setting to be displayed in the theme settings form depending upon the previous setting which is a select box containing line-gradient and radial-gradient. This field (site_title_color_gradient_direction) has no relevance if the user chooses the radial-gradient option in the first gradient-type setting site_title_color_gradient_type in my styles.css file and I have got it working on the front end with this: #elSiteTitle { background-image: {theme="site_title_color_gradient_type"}( {{if theme.site_title_color_gradient_type === 'linear-gradient'}} {theme="site_title_color_gradient_direction"} {{endif}} {hextorgb="site_title_color_gradient_start" opacity="1"}, {hextorgb="site_title_color_gradient_finish" opacity="1"}); -webkit-text-fill-color: transparent; background-clip: text; -webkit-background-clip: text; font: 400 {theme="site_title_font_size"}px Creepster, Helvetica, sans-serif; color: #fff; transition: all 300ms ease; } So for now, because I can't get the Condition field working, I've just added a note to this custom theme setting that says its ignored for radial gradients. Hope this makes sense! PS. Does this apply to custom theme settings as well as default? Thanks.
  11. I spoke too soon! I thought this would show the custom theme setting B to the Admin dependant on the setting of a preceding custom setting A but it doesn't work. The custom theme setting it applies to (B) seems to show no matter if it returns a true or false Boolean.
  12. AdminCP > Commerce > Subscriptions > Subscribers The info seems to break the response layout, you can't see the expiry dates when using an Safari iPad, the table goes off the page without scroll bars or wrapping. Happens in landscape and portrait modes.
  13. This format with one set of curly double braces seems to work in the Conditional field: <?php {{if ( theme.my_other_custom_setting == 'value' ) return FALSE;}}
  14. Thanks, that's a good idea, I'll try next time I'm on my localhost. The info underneath that Condition field says to insert raw PHP. I've tried using the double curly brackets shown in the help guidance docs. There are a lot of examples of theme conditions but no example of what to use in this box.
  15. Hi, I have a custom theme setting that works and I want to use the Condition field to only display if a previous custom (select type) theme setting isn't set to one of its key values, but I can't seem to get the right syntax: <?php if ( theme.my_other_custom_setting == 'value' ) return FALSE; I've tried with double curly brackets too. Also an ELSE returning TRUE. Many thanks.
  16. Hello, Is it possible to prevent In_Dev Theme and Designer's Mode ACP sessions from timing out on localhost? I go off to read or check something switch tabs back and I can't save my changes as the session has ended. Many thanks!
  17. I was getting a lot of these with previous releases but now also with 4.5.4: [22-Oct-2020 22:00:34 UTC] PHP Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /home/username/public_html/ forumname/applications/calendar/widgets/upcomingEvents.php on line 153
  18. Just tried updating to 4.5.4 and the upgrader is stuck at Step 4 again. Blasted thing.
  19. Hello @HeadStand Any decisions on the future of this handy plugin? Many thanks!
  20. Thanks for this. Just had a final notice email too!
×
×
  • Create New...