Elar 9000

Developer, support, application patterns coordinator.


Contributuing to WackoWiki since R4.2:


  • Core
  • Formatters
  • Actions
  • Compatabilty fixes
  • Support for WackoWiki users
  • Application patterns

If you got a modified WackoWiki R4.2 or a big website on it you can't just update to a new version of WackoWiki, see some of my ideas how to run WackoWiki with PHP 5.6.37.

MathJax bugs


$$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$	

$$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$
$$ \frac{d}{dx}\left( \int_0^x f(u)\,du\right)=f(x) $$	

$$ \frac{d}{dx}\left( \int_0^x f(u)\,du\right)=f(x) $$

--

Comments

  1. Комментарий 4448

    <?php
    
            function get_user_menu($user_id, $lang = '', $public = false): array
            {
                    $user_menu_formatted = [];
    
                    // avoid results if $user_id is 0 (user does not exist)
                    if ($user_id)
                    {
                            $this->get_user_id() > 1        //can't use $user_id here as the function get_user_menu() called once for registered user, and if he has no menu, called again for system user id = 1. Registered users have id > 1, anonymous users have id = 1.
                                ? $rights = "(a.list = '*' OR a.list = '$')"        // registered users can see read * (public) and $ (for registered users) ACL pages in the default top menu
                                : $rights = "a.list = '*'";                         // anonymous users can see only read * (public) ACL pages in the default top menu
    
                            $user_menu = $this->db->load_all(
                                    'SELECT p.page_id, p.tag, p.title, m.menu_title, m.menu_lang ' .
                                    'FROM ' . $this->prefix . 'menu m ' .
                                            ($public
                                                    ? 'LEFT JOIN ' . $this->prefix . 'acl a ON (m.page_id = a.page_id) '
                                                    : '') .
                                            'LEFT JOIN ' . $this->prefix . 'page p ON (m.page_id = p.page_id) ' .
                                    'WHERE m.user_id = ' . (int) $user_id . ' ' .
                                            ($lang
                                                    ? 'AND m.menu_lang = ' . $this->db->q($lang) . ' '
                                                    : '') .
                                            ($public
                                                    ? "AND a.privilege = 'read' " .
                                                      "AND " . $rights . " " // assumes '*' for anonymous, '*' and '$' for registered users 
                                                    : '') .
                                    'ORDER BY m.menu_position', true);
    
                            foreach ($user_menu as $menu_item)
                            {
                                    $title = $menu_item['menu_title'];
    
                                    if ($title === '')
                                    {
                                            $title = $menu_item['title'];
                                    }
    
                                    // [0] - page_id
                                    // [1] - menu_title
                                    // [2] - menu_item formatted ((tag menu_title))
                                    // [3] - menu_lang
                                    $user_menu_formatted[] = [
                                            $menu_item['page_id'],
                                            (($title !== '')? $title : $menu_item['tag']),
                                            '((' . $menu_item['tag'] .
                                                    (($title !== '')? ' ' . $title : '') .
                                            '))',
                                            $menu_item['menu_lang'],
                                    ];
                            }
                    }
    
                    return $user_menu_formatted;
            }
    • Elar9000
    • 05.10.2024 05:45 edited