Перейти к содержанию

odin777

Пользователи
  • Постов

    10
  • Зарегистрирован

  • Посещение

Сообщения, опубликованные odin777

  1. Hi, i am trying to minify html output:

    1. Create a PHP file (minify.php), with code:

    <?php
    function sanitize_output($buffer) {
    $search = [
    '/\>[^\S ]+/s',
    '/[^\S ]+\</s',
    '/(\s)+/s',
    '/<!--(.|\s)*?-->/'
    ];
    
    $replace = [
    '>',
    '<',
    '\\1',
    ''
    ];
    
    $buffer = preg_replace($search, $replace, $buffer);
    
    return $buffer;
    }
    
    ob_start("sanitize_output");
    ?>

    2. in globaltemplate before <!DOCTYPE html>, i added:

    {{require "minify.php";}}

    But it's not working.....

    Please how to Minify html output??

  2. Thank you man, I tried

    Not working
    {{$member = \IPS\Member::loggedIn();}}
    {{if app == 'landingpage'}}
    <script>
    jQuery(location).attr('href', 'http://localhost/test.com/forums/');
    </script>
    {{endif}}
    
    Not working
    {{$member = \IPS\Member::loggedIn();}}
    {{if app == 'landingpage'}}
    <script>
    function myFunction() {
      window.location.href("http://localhost/test.com/forums/")
    }
    </script>
    {{endif}}

    Not working

  3. Hi, I am using the landing page plugin as main home page, and I want to redirect users to forums instead of the index page (if they are logged in).

    I tried to add this code in globaltemplate before header:

    {{$member = \IPS\Member::loggedIn();}}
    {{if app == 'landingpage'}}
    {{header("Location: http://localhost/test.com/forums/");}}
    {{endif}}

    But nothing happened, pls any suggestions?

×
×
  • Создать...