tipsandtricks

  • 468
Timeline
Forum's Comments
  • To add custom API endpoint to UNA, please create an empty module first, I think it's better to rename modules/boonex/api module to your own and delete or replace existing endpoints with yours. 

    To add custom endpoint - add service function, for example to add endpoint which get time you can add something like this:

    public function serviceClock() 
    {
        return ['time' => date('H:i:s')];
    }

    Then declare if you want to use this endpoint with authentication or not, for public endpoint add name of the endpoint to serviceGetPublicServices method:

    public function serviceGetPublicServices()
    {
        $a = parent::serviceGetPublicServices();
        return array_merge($a, array ('Clock' => ''));
    }

    for protected endpoint add it the same way but to serviceGetSafeServices method.

    After above you will be able to call your custom endpoint with the following URL:

    http://example.com/m/oauth2/com/clock?client_id=1234abcd&module=your_modulename

    You will get response in JSON format

    0 0 0 0 0 0
    • Hi ... by clicking     there are errors comming :-(

      Warning:  array_merge(): Expected parameter 2 to be an array, bool given in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

      Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 561

      Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineModule.php on line 4040

      Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

      Warning: array_merge(): Expected parameter 2 to be an array, bool given in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

      0 0 0 0 0 0
      • I am using Rocketchat 2.3.2 which sadly does not have una connect within it.  I could create a custom oauth but have no idea how to fill out most of the fields.....but one thing at a time....I need to be able to open chat.mysite.com and it open mysite.com:3000 or https purposes

        Yes, you can use latest Rocket.Chat and use Custom OAuth, steps are the following:

        1.

        image_transcoder.php?o=bx_froala_image&h=2707&dpx=2&t=1577683413

        2.

        image_transcoder.php?o=bx_froala_image&h=2708&dpx=2&t=1577683427

        3.

        image_transcoder.php?o=bx_froala_image&h=2709&dpx=2&t=1577683437

        image_transcoder.php?o=bx_froala_image&h=2710&dpx=2&t=1577683449

        4. Activate 'Merge Users' setting

        I have done all that and it is not working

        0 0 0 0 0 0
        • 24h format can be enabled in calendar by adding calendar.html & calendar_compact.html files in your template with the following contents:

          for calendar.html:

          <div id="__id__"></div>
          <script>
              var oDefaults = {
                      eventTimeFormat: {
                          hour12: false,
                          hour: 'numeric',
                          minute: '2-digit',
                          omitZeroMinute: true,
                          meridiem: false
                      },
                      headerToolbar: {
                          initialView: 'dayGridMonth',
                          left: 'prev,next today',
                          center: 'title',
                          right: 'dayGridDay,dayGridWeek,dayGridMonth' 
                      },
                      navLinks: true, // can click day/week names to navigate views
              };
              var oOptions = __options__;    
              document.addEventListener('DOMContentLoaded', function() {
                  new FullCalendar.Calendar(document.getElementById('__id__'), $.extend({}, oDefaults, oOptions)).render();
              });
          </script>

          for calendar_compact.html:

          <div id="__id__"></div>
          <script>
              var oDefaults = {
                      eventTimeFormat: {
                          hour12: false,
                          hour: 'numeric',
                          minute: '2-digit',
                          omitZeroMinute: true,
                          meridiem: false
                      },
                      headerToolbar: {
                          initialView: 'dayGridMonth',
                          left: 'prev,next today',
                          center: 'title',
                          right: '' 
                      },
                      navLinks: true, // can click day/week names to navigate views
              };
              var oOptions = __options__;    
              document.addEventListener('DOMContentLoaded', function() {
                  new FullCalendar.Calendar(document.getElementById('__id__'), $.extend({}, oDefaults, oOptions)).render();
              });
          </script>

          0 0 0 0 0 0
          • Hello JPa !

            When it's better to post the content as "public" but use the hashtags there. Like we have here .

            0 0 0 0 0 0
            • Hello KinkyC.com !

              The channel is created automatically if you post something with the hashtag. Like here.

              I have test it but under the Timline and channels is nothing


              0 0 0 0 0 0
              • Hello KinkyC.com !

                The channel is created automatically if you post something with the hashtag. Like here.


                0 0 0 0 0 0
                • We're going to add pre-moderation in the future - https://github.com/unaio/una/issues/2321

                  However most probably it will not happen anytime soon.

                  One possible solution for now to enable pre-moderation in Market is to set status to non-active by default by executing the following query:

                  ALTER TABLE `bx_market_products` CHANGE `status_admin` `status_admin` ENUM('active','hidden') NOT NULL DEFAULT 'hidden';

                  So by default market products will have hidden status, this status can be changed by admin/moderator only, so this could be some sort of pre-moderation.

                  0 0 0 0 0 0
                  • To add a button which will display post to context form for specific content module you can add RAW block with the following content on "Albums in context" page:

                    <button class="bx-btn" onclick="bx_add_custom(this)">Add</button>
                    <script>
                    function bx_add_custom (e) 
                    {
                          var sModuleUri = 'albums';
                          var iContextId = -{profile_id};
                          $.get(
                            sUrlRoot + 'modules/?r=' + sModuleUri + '/get_create_post_form/', {
                                ajax_mode: true,
                                dynamic_mode: true,
                                absolute_action_url: true,
                                context_id: iContextId,
                                custom: {},
                                _t:(new Date).getTime(),
                            },
                            function(oData) {
                                if(!oData || !oData.content) 
                                    return;
                                $(e).parent().html(oData.content);
                            }, 
                            'json'
                        );
                    }
                    </script>

                    To adopt it to some other module replace albums in var sModuleUri = 'albums'; string with another module URI.

                    0 0 0 0 0 0
                    • AJ Fariss to make cover always visible in full you can add the following CSS in Studio > Designer > Injection > HEAD:

                      <style>
                        html .bx-cover-wrapper { background-size: contain; }
                      </style>

                      0 0 0 0 0 0
                      Added a discussion  to  , tipsandtricks

                      There are several factors affecting your page speed. Some of them can be improved by tweaking some settings.

                      First of all we need to use the profiler app to analyze the problems. The profiler app gives us a lot of detailed information about the UNA pages.

                      When you see the details you will notice that there may be something to improve the page speed.

                      If you are having a lot of content for the visitors of your site in the home page, One important and may be less used method could be separating the homepages for members and visitors.
                      When you have the same home page and use the visibility options to show selected blocks to unauthenticated visitors and others to logged in members in fact the page is loading all. So if you have a lot of content in the visitors blocks this will still grap some important amount of time of the page loads for logged in members.
                      Lets go on real world examples:
                      I have 100 medical articles on the visitors index and this block is not shown to the logged in members. When I disable this block it saved me like 2 seconds from the total 5 seconds of server processing time reported by profiler.
                      So I created another home page for unauthenticated site visitors, put this block there. Logged in home page became lighter and dropped to 3 seconds for server proccessing.

                      As Alex explained I retested the above mentioned invisible block effect on loading times and yes it didnt effect the loading times.

                      Another issue I found with the help of profiler app was again releated to the  new posts galery view block which I locete on the right column of the page, it was showing only one new post (blog) and with the arrows you may see the others one by one. (I realized that this block was also loading the 100 blogs due to the settings to show how many blogs in different situations. So I disabled this block. And woooow see the results before and after:

                      zfjsupv4r4ek44fe2dkajgwctzusr4vy.pngjackazymqvpg7qjh9epctt7e4uxjf4fw.png

                      Also notice that all the active modules are loaded they create mysql queries etc. so disable any module you dont use. Any block you left unused and invisible delete.

                      (Compare the query number of each measurement)
                      Now the logged in home page is loaded in less then 1 second :)


                      • 1084
                        • Any good triсs to score homepage after login? Cem 

                          0 0 0 0 0 0
                          • all above are for logged in homepage Rocco

                            0 0 0 0 0 0
                            • Hi ... by clicking     there are errors comming :-(

                              Warning:  array_merge(): Expected parameter 2 to be an array, bool given in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

                              Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 561

                              Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineModule.php on line 4040

                              Notice: unserialize(): Error at offset 195 of 289 bytes in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

                              Warning: array_merge(): Expected parameter 2 to be an array, bool given in /home/unaio/public_html/modules/boonex/timeline/classes/BxTimelineTemplate.php on line 2566

                              0 0 0 0 0 0
                              Not logged in users can't 'Comments Post'.
                              Added a post  to  , tipsandtricks

                              Interesting, what blocks were used for this layout?

                              • 615
                                •  believe this is just a default channel layout for itself... 

                                  0 0 0 0 0 0
                                  Not logged in users can't 'Comments Post'.
                                  Added post  to  , tipsandtricks

                                  I am glad that someone created this channel. I think it is needed so that we can share some of the that we learn along out UNA journey. Thank you.👍

                                  • 611
                                  Added a discussion  to  , tipsandtricks

                                  Is there a way to change default 'time zone' in "Add Events"? At this point I can not find a way to edit the default field.  I want the default time zone to be America/New_York.  Is there a way to limit the time zone to just one selection?

                                  • 816
                                    • It worked, thank  you... is there a way to remove other selections and keep only america/ new york?

                                      0 0 0 0 0 0
                                      • You can add "raw' block to event creation page with the following content to delete all values except one:

                                        <script>
                                        $('select[name="timezone"] option:not([value="America/New_York"])').remove();
                                        </script>
                                        0 0 0 0 0 0
                                        • Thank you, worked perfectly 😎

                                          0 0 0 0 0 0
                                          Not logged in users can't 'Comments Post'.

                                          UNA - Network Infrastructure for Communities

                                          Close