[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/includes/ -> functions_compatibility.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  /**
  15  * @ignore
  16  */
  17  if (!defined('IN_PHPBB'))
  18  {
  19      exit;
  20  }
  21  
  22  /**
  23  * Get user avatar
  24  *
  25  * @deprecated 3.1.0-a1 (To be removed: 3.3.0)
  26  *
  27  * @param string $avatar Users assigned avatar name
  28  * @param int $avatar_type Type of avatar
  29  * @param string $avatar_width Width of users avatar
  30  * @param string $avatar_height Height of users avatar
  31  * @param string $alt Optional language string for alt tag within image, can be a language key or text
  32  * @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
  33  * @param bool $lazy If true, will be lazy loaded (requires JS)
  34  *
  35  * @return string Avatar image
  36  */
  37  function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false, $lazy = false)
  38  {
  39      // map arguments to new function phpbb_get_avatar()
  40      $row = array(
  41          'avatar'        => $avatar,
  42          'avatar_type'    => $avatar_type,
  43          'avatar_width'    => $avatar_width,
  44          'avatar_height'    => $avatar_height,
  45      );
  46  
  47      return phpbb_get_avatar($row, $alt, $ignore_config, $lazy);
  48  }
  49  
  50  /**
  51  * Hash the password
  52  *
  53  * @deprecated 3.1.0-a2 (To be removed: 3.3.0)
  54  *
  55  * @param string $password Password to be hashed
  56  *
  57  * @return string|bool Password hash or false if something went wrong during hashing
  58  */
  59  function phpbb_hash($password)
  60  {
  61      global $phpbb_container;
  62  
  63      $passwords_manager = $phpbb_container->get('passwords.manager');
  64      return $passwords_manager->hash($password);
  65  }
  66  
  67  /**
  68  * Check for correct password
  69  *
  70  * @deprecated 3.1.0-a2 (To be removed: 3.3.0)
  71  *
  72  * @param string $password The password in plain text
  73  * @param string $hash The stored password hash
  74  *
  75  * @return bool Returns true if the password is correct, false if not.
  76  */
  77  function phpbb_check_hash($password, $hash)
  78  {
  79      global $phpbb_container;
  80  
  81      $passwords_manager = $phpbb_container->get('passwords.manager');
  82      return $passwords_manager->check($password, $hash);
  83  }
  84  
  85  /**
  86  * Eliminates useless . and .. components from specified path.
  87  *
  88  * Deprecated, use filesystem class instead
  89  *
  90  * @param string $path Path to clean
  91  * @return string Cleaned path
  92  *
  93  * @deprecated
  94  */
  95  function phpbb_clean_path($path)
  96  {
  97      global $phpbb_path_helper, $phpbb_container;
  98  
  99      if (!$phpbb_path_helper && $phpbb_container)
 100      {
 101          $phpbb_path_helper = $phpbb_container->get('path_helper');
 102      }
 103      else if (!$phpbb_path_helper)
 104      {
 105          global $phpbb_root_path, $phpEx;
 106  
 107          // The container is not yet loaded, use a new instance
 108          if (!class_exists('\phpbb\path_helper'))
 109          {
 110              require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx);
 111          }
 112  
 113          $request = new phpbb\request\request();
 114          $phpbb_path_helper = new phpbb\path_helper(
 115              new phpbb\symfony_request(
 116                  $request
 117              ),
 118              new phpbb\filesystem(),
 119              $request,
 120              $phpbb_root_path,
 121              $phpEx
 122          );
 123      }
 124  
 125      return $phpbb_path_helper->clean_path($path);
 126  }
 127  
 128  /**
 129  * Pick a timezone
 130  *
 131  * @param    string        $default            A timezone to select
 132  * @param    boolean        $truncate            Shall we truncate the options text
 133  *
 134  * @return        string        Returns the options for timezone selector only
 135  *
 136  * @deprecated
 137  */
 138  function tz_select($default = '', $truncate = false)
 139  {
 140      global $template, $user;
 141  
 142      return phpbb_timezone_select($template, $user, $default, $truncate);
 143  }
 144  
 145  /**
 146  * Cache moderators. Called whenever permissions are changed
 147  * via admin_permissions. Changes of usernames and group names
 148  * must be carried through for the moderators table.
 149  *
 150  * @deprecated 3.1
 151  * @return null
 152  */
 153  function cache_moderators()
 154  {
 155      global $db, $cache, $auth;
 156      return phpbb_cache_moderators($db, $cache, $auth);
 157  }
 158  
 159  /**
 160  * Removes moderators and administrators from foe lists.
 161  *
 162  * @deprecated 3.1
 163  * @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
 164  * @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
 165  * @return null
 166  */
 167  function update_foes($group_id = false, $user_id = false)
 168  {
 169      global $db, $auth;
 170      return phpbb_update_foes($db, $auth, $group_id, $user_id);
 171  }
 172  
 173  /**
 174  * Get user rank title and image
 175  *
 176  * @param int $user_rank the current stored users rank id
 177  * @param int $user_posts the users number of posts
 178  * @param string &$rank_title the rank title will be stored here after execution
 179  * @param string &$rank_img the rank image as full img tag is stored here after execution
 180  * @param string &$rank_img_src the rank image source is stored here after execution
 181  *
 182  * @deprecated 3.1.0-RC5 (To be removed: 3.3.0)
 183  *
 184  * Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
 185  */
 186  function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
 187  {
 188      global $phpbb_root_path, $phpEx;
 189      if (!function_exists('phpbb_get_user_rank'))
 190      {
 191          include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
 192      }
 193  
 194      $rank_data = phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts);
 195      $rank_title = $rank_data['title'];
 196      $rank_img = $rank_data['img'];
 197      $rank_img_src = $rank_data['img_src'];
 198  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1