tipsandtricks

  • 289
Featured Channels
  •  · 51 followers
  •  · 60 followers
  •  · 79 followers
Timeline
Forum's Comments
  • 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
        • It's possible to set custom visibility for "Guests" menu item for the Event to allow only event admin to view it this by executing the following SQL statement (for example in phpMyAdmin for your UNA database):

          UPDATE `sys_menu_items` SET `visibility_custom` = 'a:3:{s:6:"module";s:9:"bx_events";s:6:"method";s:8:"is_admin";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}' WHERE `name` = 'event-fans' AND `set_name` = 'bx_events_view_submenu' LIMIT 1;

          0 0 0 0 0 0
          • To give menu icon a different color in template where all icons have the same color add sys-colored class to Icon field in menu builder, for example:

            0 0 0 0 0 0
            • Now cover images use the whole area without any gaps. but image can be cut from some or it's sides depending on browser window size, if you want to show whole image all the time in cover on such pages like groups/spaces/etc, then you can add the following additional style in Studio > Designer > Injections > Head 

              <style>
              img.bx-base-pofile-cover-image {
                  background-size: contain !important;
              }
              </style>

              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

                In Rocket.Chat custom oauth that I created it states:

                When setting up your OAuth Provider, you'll have to inform a Callback URL. Use 

                https://chat-domain.tld/_oauth/custom_outh_name

                Is this put in the oauth2 server; or where?

                I am getting unexpected end of json input.

                0 0 0 0 0 0
                • Some more tips to increase site load speed and speed score in google analytics

                  1) disable 3rd-party copy&paste codes or at least use copy&paste code that can be inserted at the end of the page (before closing tag) instead of inserting it into tag

                  2) don't install Fontawesome Pro module, it increases page load time by adding bigger font files, default free Fontawesome fonts aren't such big like Pro version

                  3) use the latest PHP version, PHP 7.0 twice faster than PHP 5.6, PHP 7.2 faster than PHP 7.0 and 7.1, PHP 7.3 faster than 7.2 and 7.1, PHP 7.4 significantly faster than PHP 7.3, and of cause use PHP OpCache 

                  4) enable Caches in UNA

                  5) make number of items per page for Timeline as small as possible

                  6) set cache control for 1 year instead of 30 days for files (mostly images) uploaded to UNA

                  UPDATE `sys_objects_storage` SET `cache_control` = 31536000 WHERE `cache_control` = 2592000

                  Then clear UNA DB cache

                  0 0 0 0 0 0
                  • Leonid was investigating and found that the cron jobs were not working. Now they work, however the problem with some notifications continues.

                    If your cron jobs wasn't working for a long time, it maybe you have long queue of emails and/or notifications, please try to clear these queues so new notifications will be sent straight away, to do it clear the following tables: sys_queue_email, sys_queue_push, bx_notifications_queue

                    0 0 0 0 0 0
                    • I've just upgraded your membership to allow to post links.

                      You can add block in Studio Pages Builder into content adding page with the following JS code (please modify it for your needs), it will disable needed values:

                      <script>
                      $("select option[value='your_value_here']").prop('disabled', 1);
                      </script>

                      However it will apply to UNA 10 and below.

                      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: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 :)
                      • 613
                      Interesting, what blocks were used for this layout?
                      • 351
                      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.👍
                      • 354
                      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?
                      • 538

                      UNA - Social Media Software Framework

                      Close