Jump to content

desti

Clients
  • Posts

    248
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by desti

  1. Tried to make a hook on the \IPS\core\modules\front\members\profile, add button before "Edit profile".

    Add button code <li>...<a href='{url="app=core&module=members&controller=profile&do=testform&id=...}" ...</li>, with seo template (defined in furlDefinition()), but get broken link, looks like %7Burl=?

    Ok, replace <li>.. </li> with {template='myProfileButton'  group="plugins" location="global" app="core" params='$member'} , move button code to myProfileButton - everything is fine, correct link.

    I can't use {url=""} template in theme hook?

    clean IPS 4.6.0

  2. //		$where[]  = array( 'member_id=?', $this->member->member_id );
    //		$where[] = array( 'visibility_type=1 OR (visibility_type=2 and member_id=?)',\IPS\Member::loggedIn()->member_id  ) ;
    
    		$where[]  = array( 'member_id=?', $this->member->member_id );
    		$where[] = array( 'visibility_type=1 OR visibility_type=2' ) ;

    I don't want see my own bookmarks in other users' profiles! Or did I get something wrong?

    1.6.1

  3. After attach pdf to post we see attach block:

    In english all ok

    iss_1.jpg.2decc934d5360490b2c808125834c150.jpg

    In russian - problem

    iss_2.jpg.1a12ee68f5f2a1ca5116701694d1295b.jpg

    Fast solution:

    in file system/Lang/Lang.php replace

    $replacement = mb_substr( json_encode( $replacement ), 1, -1 );

    to

    $replacement = mb_substr( json_encode( $replacement, JSON_UNESCAPED_UNICODE ), 1, -1 );

    now all fine

    iss_3.jpg.ac9a1f756ac11d678b3a7b1104d28f8d.jpg

     

  4. Yep, already clone \IPS\Db and IPS\Select, add db selection to IPS\ActiveRecord, move table to another server and it works! :) This will be sufficient to keep the copy up to date and will give the provider the opportunity to honestly answer the question "Are there requests to the database from Germany?".

    But as the bfarber correctly noted, the ips code has a huge number of direct calls and joins to this table, so the question can be considered closed, this is impossible.

    Ilia, only one option: create the illusion of working with remote tables, so I will follow the path you proposed. 

    1 hour ago, Ilya Hoilik said:

    But anyway you should consult with your lawyer and Roskomnadzor before doing this.

    Are you kidding? :) I'm too small for both lawyers and rkn. And certainly I'm not going to let rkn know about my plans.

    Thank you all for your advice.

  5. 49 minutes ago, Mac1 said:

    appTest>dev>front>somthing.js

    appTest>dev>js>front>controllers>folder>ips.folder.function.js

    \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'front_folder.js', 'appTest', 'front' ) );

    // corrected

  6. Helpers - Form - function CustomTemplate() (part)

    		foreach ( $this->elements as $tab => $elements )
    		{
    			$html[ $tab ] = '';
    			foreach ( $elements as $k => $element )
    			{
    				if ( $element instanceof Form\Matrix )
    				{
    					$html[ $tab ] .= \IPS\Theme::i()->getTemplate( 'forms', 'core' )->emptyRow( $element->nested(), $k );
    					continue;
    				}
    				if ( !\is_string( $element ) and $element->error ) { $errorTabs[] = $tab; }
    				$html[ $tab ] .= ( $element instanceof \IPS\Helpers\Form\FormAbstract ) ? $element->rowHtml( $this ) : (string) $element;
    			}
            }
    
    		$templateArguments = array_merge( $args, array( $this->id, $this->action, $this->elements, $this->hiddenValues, $this->actionButtons, 
    			$this->uploadField, $this->class, $this->attributes, $this->sidebar, $this, $errorTabs ) );
    		return $template( ...$templateArguments );
    	}

    Variable $html don't use later.

  7. Perhaps will be useful. 

    JS file

    ;( function($, _, undefined){
    	"use strict";
    	ips.controller.register('app.front.folder.vuemodal', {
    		_vueapp: null,
    		initialize: function () {
    			var jsToGet = [
    				'https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.min.js',
    				'https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.js',
    			];
    			ips.loader.get(jsToGet).then( function () { this.setup(); }.bind(this));
    			$('head').append( 
    				"<link rel='stylesheet' type='text/css' media='all' href='https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css' />",
    				"<link rel='stylesheet' type='text/css' media='all' href='https://cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css'/>" 
    			);
    		},
    
    		setup: function() {
    			Vue.component('my-tooltip', {
    			 	  props: ['message'],
    				  template: `
    					<v-tooltip left :open-on-hover="false">
    					  <template #activator="{ on }">
    					    <v-btn icon @click="on.click" @blur="on.blur" retain-focus-on-click>
    					       <v-icon color="grey lighten-1"> mdi-help-circle-outline </v-icon>
    					    </v-btn>
    					  </template>
    					  <div v-html="message"></div>
    					</v-tooltip>
    				  `
    			});
    		
    			this._vueapp = new Vue({
    			  el: '#vuemodal',
    		      vuetify: new Vuetify(),
    		      template: `
    				<v-app>
                      <v-row justify="center">
                        <v-dialog v-model="showModal" max-width="600">
                          <template v-slot:activator="{ on, attrs }">
    	    	            <v-btn color="primary" dark v-bind="attrs" v-on="on">Open Dialog</v-btn>
                          </template>
                          <v-card class="pa-4 indigo lighten-5">
                            <v-card class="pa-2">
                              <v-toolbar dense color="blue darken-4" dark>
                                <v-toolbar-title class="headline">Popup header</v-toolbar-title>
                                <v-spacer></v-spacer>
                                <my-tooltip message="Help message"></my-tooltip>
                              </v-toolbar>
                              <v-card-title class="pa-2">Useful Content</v-card-title>
                              <v-form>
                                <v-text-field class="ma-1" dense label="Enter your name"></v-text-field>
                                <v-divider></v-divider>
                                <v-card-actions class="pa-2 ma-0">
                                  <v-spacer></v-spacer>
                                  <v-btn small bottom color="success" @click="submit()">Submit</v-btn>
                                </v-card-actions>
                              </v-form>
                            </v-card>
                          </v-card>
      	      	        </v-dialog>
                      </v-row>
    	    	    </v-app>
    				`,
    			    data: { showModal: false },
    			    methods: { submit() { this.showModal = false} }
    			});
    		}
    	});
    }(jQuery, _));

    add to template

    <div data-controller="app.front.folder.vuemodal" style='height:36px !important; overflow: hidden !important;'>
      <div id='vuemodal'></div> 
    </div>

    add to custom css (ips styles break vuetify styles)

    .v-text-field input {
      border:none!important;
      box-shadow:none!important;
      max-width:100%!important;
    }

    vue_ips.jpg.c57e4b0d199c609b2801ac7fa4479f6f.jpg

×
×
  • Create New...