Jump to content


  • Posts

  • Joined

  • Days Won


Community Answers

  1. teraßyte's post in Nexus money JSON was marked as the answer   
    array( 'USD' => array( 'amount' => 44, 'currency' => 'USD' ) ); This is the array format you need to get that JSON string.
    Based on your code above I think you can simply do:
    $item->price = json_encode( array( \IPS\nexus\Customer::loggedIn()->defaultCurrency() => $price ) );  
  2. teraßyte's post in Add condition to theme hook was marked as the answer   
    That being the case you cannot use the attribute to add a container. Try instead what I mentioned in your other topic about exporting the hook manually and then modifying it to add only the opening/closing HTML tags separately.
  3. teraßyte's post in Encapsulate tags in theme hook was marked as the answer   
    Unfortunately that's how IPS coded the hook to work, if you have an open HTML tag it closes it. It's been that way since 4.0 even thought I've seen multiple complaints about it.
    That said, after creating/exporting the hook you may be able manually edit the file to work the way you want. I am not sure if importing it would again add the closing HTML tags but it's worth a shot at least.
  4. teraßyte's post in Testing - Documentation - API - PHP Files was marked as the answer   
    Try with this code (not tested):
    <?php // This gets the framework require 'init.php'; // This is now required for calls external to the framework \IPS\Dispatcher\External::i(); // Print the logged in member's name print \IPS\Member::loggedIn()->name;  
  5. teraßyte's post in Several Issues with the Menu Manager was marked as the answer   
    I guess you are trying to report a bug? If so you need to create a new ticket in your client area: https://www.invisionpower.com/clientarea/support/
    This forum is used by 3rd party developers to ask IPS developers to make code changes in order to retrieve data previously unavailable, or other code related problems.
  6. teraßyte's post in Where is I can find Documentation on \IPS\Helpers\Table\? was marked as the answer   
    Yeah, we have been waiting for that only for a few years now
    For anyone else interested in it, have a look at this link (it is for the latest version): https://codingjungle.com/phpdoc/
  7. teraßyte's post in Issues with form helpers & wizard was marked as the answer   
    1) There is no need to add an hook, rather it adds an unnecessary step. You can create your own PHP class that extends \IPS\Helpers\Form\Radio. From there simply define your new html() function to return the template you want.
    Let's say you name it MyCustomRadioList and place the file inside \applications\dvstats\sources\Form:
    namespace IPS\dvstats\Form; /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } /** * Custom Radio input helper for Form Builder */ class _MyCustomRadioList extends \IPS\Helpers\Form\Radio { /** * Get HTML * * @return string */ public function html() { # Your code here, be sure to add the same checks the original file has! } }  
    Then in your form you simply call your own form helper:
    $form->add( new \IPS\dvstats\Form\MyCustomRadioList( ... ) );  
  8. teraßyte's post in jslang.php - how to use? was marked as the answer   
    Yes, the strings get added to the language pack and you can translate them just like usual.
  • Create New...