Jump to content

BomAle

Members
  • Posts

    817
  • Joined

  • Last visited

  • Days Won

    2

Community Answers

  1. BomAle's post in core.front.core.lightboxedImages and tapatalk was marked as the answer   
    I have edited applications/tapatalk/interface/helper.php replace
    $text = preg_replace_callback('/<img.*?>/si',function($match){ $theImg = TT_GetHtmlEntity($match[0], 'img'); $src = $theImg->getAttribute('src'); into
    $text = preg_replace_callback('/<img.*?>/si',function($match) use ($attachmentBaseUrl){ $theImg = TT_GetHtmlEntity($match[0], 'img'); $src = $theImg->getAttribute('data-imageproxy-source') ?: $theImg->getAttribute('src'); if( \mb_stripos( $src, $attachmentBaseUrl ) !== FALSE AND $theImg->getAttribute('data-fileid' ) ) { $src = TT_fixBaseUrl(\IPS\Settings::i()->base_url . "applications/core/interface/file/attachment.php?id={$theImg->getAttribute('data-fileid')}"); } Hope it help others one
  2. BomAle's post in canReact improve check was marked as the answer   
    /* Protected Groups */ if ( !$owner->inGroup( array_diff( array_keys(\IPS\Member\Group::groups( TRUE, FALSE )), explode( ',', \IPS\Settings::i()->reputation_protected_groups ) ) ) ) { return FALSE; } this is way check only if inside one of groups granted
  3. BomAle's post in ips.ui.dialog setLoading unexpected behavior? was marked as the answer   
    it happen only for matrix table elements, I would suggest to edit ips.ui.matrix as follow
    //change: _submitForm = function (e) { // Remove names from the inputs in the blank row elem.find('[data-matrixrowid]:hidden') .find('input, select, textarea') .attr( 'name', '' ) .prop( 'disabled', true ); //to _submitForm = function (e) { // Remove names from the inputs in the blank row var contentDialog = elem.closest('.ipsDialog').length && elem.closest('.ipsDialog').find( '.ipsDialog_content' ), hiddenDialog = contentDialog && contentDialog.is(':hidden'); hiddenDialog && contentDialog.show(); elem.find('[data-matrixrowid]:hidden') .find('input, select, textarea') .attr( 'name', '' ) .prop( 'disabled', true ); hiddenDialog && contentDialog.hide();  OR check if ips.ui.dialog.setLoading is called true while call _submitForm into ips.ui.matrix
  4. BomAle's post in Queue task return offset bad comparison was marked as the answer   
    string is not equal to object, and also if you do
    $newData !== json_encode($json) it is a no sense, the purpose is another (compare new data with older changed by Reference after "run" is called)
  5. BomAle's post in Identify the bug on ShowTemplate templateTree was marked as the answer   
    1008703
    thanks for details.
    I report it thinking was a common behaviour.
  6. BomAle's post in [Javascript] Multiple invocation was marked as the answer   
    try to change:
    this.on( document, 'click', '[data-action="someAction"]', this.mention ); with
    this.on( 'click', '[data-action="someAction"]', this.mention );
  7. BomAle's post in hook on \IPS\cms\Recordsx was marked as the answer   
    Yes I solved now, spl_autoload_register was bring me crazy
    class advpolls_hook_application extends _HOOK_CLASS_ { public static function afterSPLAutoloads( $class ) { if ( mb_substr( $class, 0, 15 ) === 'IPS\cms\Records' and is_numeric( mb_substr( $class, 15, 1 ) ) ) { \spl_autoload_unregister(['\IPS\cms\advpolls_hook_application','afterSPLAutoloads']); \spl_autoload_call($class); $class::$databaseColumnMap['poll'] = 'poll_state'; } } } \spl_autoload_register( ['\IPS\cms\advpolls_hook_application','afterSPLAutoloads'], TRUE, TRUE); I can continue, if you have any advice, I would appreciate it
  8. BomAle's post in Get member's id from member form helper was marked as the answer   
    yes but id is not what you want because token.add data use id for other purpose...
    inputItem.before( ips.templates.render( options.tokenTemplate, { id: elemID, value: value, title: value })); then to get the member id from results you must edit resultItemTemplate and edit it like:
    ips.templates.set('core.autocomplete.memberItem', " \ <li class='ipsAutocompleteMenu_item ipsClearfix' data-value=\"{{value}}\" role='option' role='listitem'>\ <div data-id=\"{{id}}\" class='ipsPhotoPanel ipsPhotoPanel_tiny'>\ <span class='ipsUserPhoto ipsUserPhoto_tiny'><img src='{{{photo}}}'></span>\ <div>\ <strong>{{{name}}}</strong><br>\ <span class='ipsType_light'>{{{extra}}}</span>\ </div>\ </div>\ </li>\ "); and watch on tokenAdded event like
    $('[data-ipsautocomplete]').on('autoCompleteReady', function(e,data){ $('#' + data.elemID).on('tokenAdded', function (e, datatoken) { var id = $(datatoken.html).attr('data-id'); $('#' + data.elemID + '_inputItem').parent().find('[data-value="' + datatoken.token + '"]').attr('data-id', id); Debug.log(id); }); }); this thanks to dev/js/framework/common/ui/ips.ui.autocomplete.js token.add line 1102-1113
    if( dataSource.type != 'none' ){ html = resultsElem.find('[data-value="' + value.replace("\\", "\\\\") + '"]').html(); } else { html = value; } elem.trigger('tokenAdded', { token: value, html: html, tokenList: tokens.getValues(), totalTokens: tokens.total() });  
  9. BomAle's post in Load form helpers via ajax was marked as the answer   
    try to trigger content change event after you have appended on DOM
    $(document).trigger('contentChange', [$('form')]);
    this permise to run each controller that have tabs and other elements.
  10. BomAle's post in ips.utils.form.serializeAsObject on codemirror and ckeditor was marked as the answer   
    updated with:
    // trigger to interact with form widget instead call ips.ui.form.respond($('#bacalltoactionpopup_template')); $(document).trigger('contentChange', ['#bacalltoactionpopup_template']); try { if( !_.isUndefined( CKEDITOR ) && CKEDITOR != null ){ for( var instance in CKEDITOR.instances ) { CKEDITOR.instances[ instance ].updateElement(); } } } catch (err) { }  
  11. BomAle's post in Fix for statuses item class was marked as the answer   
    THANKS, now i wait fix for:
    /* Work out which profile we are posting too, but only if we are NOT coming from the Create menu or the status updates widget (neither of which allow posting to another profile */ /* @todo The dependency on \IPS\Request here needs to be moved to the controller */ $this->member_id = ( isset( \IPS\Request::i()->id ) AND ( isset( \IPS\Request::i()->controller ) AND \IPS\Request::i()->controller != 'ajaxcreate' ) ) ? \IPS\Request::i()->id : \IPS\Member::loggedIn()->member_id; or I must check for status var for temporary solve. @Matt
    /** * @brief Remember _new status on subsequent calls */ protected $ceNew = NULL; /** * Save Changed Columns * * @see \IPS\Content\Item::save() * * @return void */ public function save() { if( $this->_new ) { $this->ceNew = TRUE; } call_user_func_array( 'parent::save', func_get_args() ); $idColumn = static::$databaseColumnId; /*CHECKs for approval item onUnhide, future date onPublish...*/ if ( !$this->ceNew OR $this->hidden() OR $this->isFutureDate() OR !$this->$idColumn ) { return; } $this->sendToChatbox(); $this->ceNew = FALSE; }  
  12. BomAle's post in \IPS\Content\Search\Query how to edit where clause? was marked as the answer   
    $select = 'core_polls.*'; $join = array(); foreach ( \IPS\Content::routedClasses( FALSE, FALSE, TRUE ) as $class ) { /*FIX, @TODO when __callStatic on IPS\cms\Records1 call the __construct or fix the hook97 "records.php"*/ if(mb_strpos($class,'IPS\cms\Records') !== FALSE and is_numeric( mb_substr( $class, 15, 1 ) )) { if(!in_array('\\IPS\cms\\Records', get_declared_classes())) { new $class; } } if ( in_array('IPS\Content\Polls',class_implements($class)) AND isset($class::$databaseColumnMap['poll'])) { $join[] = array($class::$databaseTable, $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['poll'] . '=core_polls.pid'); $select .= ', CONCAT("'.\IPS\Db::i()->escape_string($class).'") as item_class, '.$class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnId.' as item_id'; } } $query = \IPS\Db::i()->select( $select, 'core_polls' ); foreach($join as $j) { $query->join($j[0],$j[1]); } $results = array(); foreach ($query as $k => $r) { if($r['item_class'] AND $r['item_id']){ $r['item'] = $r['item_class']::load($r['item_id']); }; unset($r['item_class'],$r['item_id']); $results[] = $r; } var_dump($results);exit; solved
  13. BomAle's post in How to show/hide forums without using Group Permissions ? was marked as the answer   
    see this app
    try to contact @Mike John and expose your question to him, i think this request could improve the app ?
    a solution could be to build a menu with each "custom predefined home"  in way to choose what a single option
×
×
  • Create New...