Jump to content

Martin A.

Clients
  • Posts

    4,231
  • Joined

  • Last visited

  • Days Won

    21

Community Answers

  1. Martin A.'s post in Task run times was marked as the answer   
    Unless this is a distributed application, not running in CiC, just make an executable file that you run with crontab at 5:00. 
  2. Martin A.'s post in Expired License - Can It Be Sold? was marked as the answer   
    Nope.
    https://invisioncommunity.com/legal/standards/#transfers
     
  3. Martin A.'s post in Update a search index for a Pages record? was marked as the answer   
    \IPS\Content\Search\Index::i()->index( $record ); This will add or update the item.
  4. Martin A.'s post in Uncaught ReferenceError: $ is not defined, Invision 4.6.12.1 was marked as the answer   
    Wait for DOM to be loaded before doing anything in your JS. jQuery is loaded at the end of the document, which is why it isn't available at the time your PHP block is executed.
    Loading a second set of jQ libraries is not the solution here.
  5. Martin A.'s post in What 's wrong with this query? was marked as the answer   
    What's your reason for adding all the entries to an array and then use that in a custom table, instead of 
    $table = new \IPS\Helpers\Table\Db( 'customtable_log', $url, $where ); $table->selects = [ 'customtable_log.device', 'MAX(customtable_log.user_id) AS user_id']; $table->joins = [ [ 'select' => 'GROUP_CONCAT(DISTINCT core_members.name SEPARATOR ", ") AS shared_by', 'from' => 'core_members', 'where' => 'customtable_log.user_id = core_members.member_id' ] ]; $table->groupBy = 'COUNT(customtable_log.user_id) > 1';  ?
    I haven't tested this, but you should be able to use the Db class even if you need to use a query out of the ordinary.
  6. Martin A.'s post in ambiguous column in getItemsWithPermission was marked as the answer   
    $recordClass::getItemsWithPermission( [ [ "`cms_custom_database_{$record::$customDatabaseId}`.`category_id`=?",$record->container()->id ] ], ... ) This should work
  7. Martin A.'s post in How to use ips.ui.menu with events was marked as the answer   
    $( '#elMyMenu' ).on( 'menuOpened', function( elemID, originalEvent, menu ) { }); $( '#elMyMenu' ).on( 'menuClosed', function( elemID, menu ) { });  
  8. Martin A.'s post in JS does not work on production mode! was marked as the answer   
    \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'admin_scriptfile.js', 'myAppName', 'admin' ) );  
  9. Martin A.'s post in csrfCheck question was marked as the answer   
    But nothing here stops me from creating and sharing a regular URL for these methods, creating a GET request for it.
    So I'm gonna say you do need it in every method. Or you need all state changing methods in its own controller where you run the csrfCheck regardless of request method.
×
×
  • Create New...