Jump to content

Community

Ryan Ashbrook

Invision Community Team
  • Posts

    12,388
  • Joined

  • Days Won

    11

Community Answers

  1. Ryan Ashbrook's post in Help with phrase and strings (%s) was marked as the answer   
    Yes, you should be able to specify the positioning of the parameters. Try this (of course adjust for your language):
    <a href='%2$s'>%3$s</a> %1$s's in <a href='%4$s'>%5$s</a> was marked as the answer The parameters should be able to follow PHP's sprintf() function identifier rules.
  2. Ryan Ashbrook's post in Converting from vBulletin 3.8.11 does not convert BB Code was marked as the answer   
    Posts are rebuilt in the background after the conversion has completed.
  3. Ryan Ashbrook's post in Converting from vBulletin 3.8.11 forum permissions was marked as the answer   
    Yes, go to your Admin CP > Members > Groups - click the Padlock (titled "Permissions") next to a group, and you can set permissions across the whole suite. Repeat for each group.
  4. Ryan Ashbrook's post in What does the Void Account button do in Commerce? was marked as the answer   
    It does a number of things:
    Cancel all invoices. Resolve all support requests. Ban the account. Add a note indicating why the account was voided. Void or refund all transactions. Cancel all billing agreements. Cancel all purchases. All of these are elective, so you decide what happens when you void an account.
  5. Ryan Ashbrook's post in Image in front of Group Formatting was marked as the answer   
    What kind of icon? You can include really any HTML in there - for your prefix, you would either do this, for an actual image:
    <img src='/path/to/image.png' alt='Group Name'><span style='color:white; background:#cd7f32; font-weight: bold; padding: 3px 8px; border-radius: 3px; text-shadow: #000 2px 2px 4px ;'> Or for a Font Awesome icon, you would do this (in this case, you can also control the color - if you want it to match the rest of the group name, then you would place it inside the span rather than outside):
    <i class='fa fa-ICON'></i><span style='color:white; background:#cd7f32; font-weight: bold; padding: 3px 8px; border-radius: 3px; text-shadow: #000 2px 2px 4px ;'>  
  6. Ryan Ashbrook's post in Why is this hook causing ICS to have a parse error in ACP? was marked as the answer   
    A fix for this should be forthcoming in 4.5.2.
  7. Ryan Ashbrook's post in Theme codage documentation was marked as the answer   
  8. Ryan Ashbrook's post in Widget cacheExpiration was marked as the answer   
    Yes, it is still valid.
  9. Ryan Ashbrook's post in delete content item directly without go to Deleted Content was marked as the answer   
    In your Content model, do something like this:
    /** * Do Moderator Action * * @param string $action The action * @param \IPS\Member|NULL $member The member doing the action (NULL for currently logged in member) * @param string|NULL $reason Reason (for hides) * @param bool $immediately Delete Immediately * @return void * @throws \OutOfRangeException|\InvalidArgumentException|\RuntimeException */ public function modAction( $action, \IPS\Member $member = NULL, $reason = NULL, $immediately = FALSE ) { if ( $action === 'delete' ) { $immediately = TRUE; } return parent::modAction( $action, $member, $reason, $immediately ); }  
  10. Ryan Ashbrook's post in Why new versions are resetting default_theme on init.php? was marked as the answer   
    You should be using constants.php to set that value, not editing init.php directly. init.php is especially important to be updated because it regenerates a few keys to allow caches to clear without requiring the user to do anything.
  11. Ryan Ashbrook's post in Elastic Search errors indexing profile status update replies was marked as the answer   
    Known issue, fixed in 4.4.8.
  12. Ryan Ashbrook's post in Request Proper File Storage Handler Extension was marked as the answer   
    We're actually aware of this and are looking for a solution.
  13. Ryan Ashbrook's post in Condition for reputation - Pages was marked as the answer   
    {{if \IPS\IPS::classUsesTrait( $record, 'IPS\Content\Reactable' ) and settings.reputation_enabled AND \count( $record->reactions() )}} Has had at least one reaction {{endif}}  
  14. Ryan Ashbrook's post in Altering auto-increment ID columns in core tables? was marked as the answer   
    I would not recommend altering the table in that way, and cannot stress enough how much of a problem it will likely cause - most of the software requires and expects that value to truly be an incrementing integer, not a string. If you are going to be generating a unique ID, such as that, then I recommend using a custom profile field that the user cannot alter, and a plugin to automatically fill it in when the user registers.
  15. Ryan Ashbrook's post in Creating a topic was marked as the answer   
    \IPS\Content\Item::create() (which \IPS\forums\Topic inherits) creates the form for output, and handles it's submission. If you are trying to create a topic programmatically, then this is the process:
    /* Create the topic */ $topic = \IPS\forums\Topic::createItem( $author, $ipAddress, $date, $forum ); $topic->title = $title; $topic->save(); /* Create the post */ $content = \IPS\Text\Parser::parseStatic( $content, TRUE, NULL, $author, 'forums_Forums', TRUE, !(bool) $author->group['g_dohtml'] ); $post = \IPS\forums\Topic\Post::create( $topic, $content, TRUE, NULL, \IPS\forums\Topic\Post::incrementPostCount( $forum ), $author, $date ); /* Update the topic */ $topic->topic_firstpost = $post->pid; $topic->save();  
  16. Ryan Ashbrook's post in Making external request was marked as the answer   
    $response = \IPS\Http\Url::external( "url" ) ->request() ->setHeaders( array( 'Content-type' => 'application/json' ) ) ->login( 'username', 'password' ) ->post( array() ) ->decodeJson(); $response = \IPS\Http\Url::external( "url" ) ->request() ->setHeaders( array( 'Authorization' => "Bearer {$this->token['access_token']}", 'Content-type' => 'application/json' ) ) ->post( array() ) ->decodeJson(); I would really suggest going over our developer documentation - it's all covered there. 🙂
     
     
  17. Ryan Ashbrook's post in \IPS\Log::log() was marked as the answer   
    They are two different things - the Error Logs are errors that are shown to end users, and have a severity of 1-5. What actually gets logged depends on what the community has configured.
    See here: 
    The System Logs, however, are for debugging purposes. You'll almost always want to use \IPS\Log::debug() as that will only log when DEBUG_LOG is set in constants.php. \IPS\Log::log() will always log, and should be used sparingly, so as to avoid filling it up unnecessarily:
     
  18. Ryan Ashbrook's post in Time Frame Form Field was marked as the answer   
    You can also specify the type of field when using \IPS\Helpers\Form\Text.
    $form = new \IPS\Helpers\Form; $input = new \IPS\Helpers\Form\Text( 'my_field', $value, TRUE ); $input->formType = 'time'; $form->add( $input );  
  19. Ryan Ashbrook's post in Trouble with \IPS\Lang::load() was marked as the answer   
    \IPS\Lang::load() is meant to load an entire language pack. If you want to load an individual string, you need to do:
    \IPS\Member::loggedIn()->language()->addToStack( 'my_key' );  
  20. Ryan Ashbrook's post in Which is run first? Upgrade or queries.json? was marked as the answer   
    queries.json is always run first. See /applications/core/sources/setup/Upgrade.php - step1().
  21. Ryan Ashbrook's post in MemberSync on Rest API (members) was marked as the answer   
    Yes, they should, as they are run centrally in \IPS\Member::save() (which the API ultimately calls).
  22. Ryan Ashbrook's post in Is there a GeoIP rate limit on requests? was marked as the answer   
    Not currently - the GeoIP data is cached for twelve hours, to the local database. That being said, however, I would definitely investigate alternative methods specifically for performance reasons, depending on the nature of the calls (thousands of calls to the database per hour, for instance, isn't great either).
  23. Ryan Ashbrook's post in 4.3 and Codepen was marked as the answer   
    Yes, it was removed because of security concerns with the pen actually executing JavaScript from inside the embed.
  24. Ryan Ashbrook's post in Loading member was marked as the answer   
    Try using \IPS\Dispatcher\External::i(); instead of \IPS\Session\Front::i();
  25. Ryan Ashbrook's post in Resp API in my resources was marked as the answer   
    This is a bug. I will fix for 4.3. Your workaround is sufficient.
×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy