diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-04 12:56:51 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-04 12:56:51 +0000 |
commit | ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8 (patch) | |
tree | 28f7b8c6ee585667fc20cd0a6c44af920d742ff4 | |
parent | e2ac95febf5d01ab0321e797fb0c7043b73245af (diff) | |
download | forums-ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8.tar forums-ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8.tar.gz forums-ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8.tar.bz2 forums-ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8.tar.xz forums-ac11ed9e8cf462ee199d01cd37c47323bdb7ffa8.zip |
also use the new bbcode uid generation for the convertor
git-svn-id: file:///svn/phpbb/trunk@8133 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/functions_convert.php | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index a5f78f5c2d..3a572e128c 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Default avatar width/height * @ignore */ @@ -216,7 +224,7 @@ function is_topic_locked($bool) */ function make_uid($timestamp) { - return substr(md5($timestamp), 0, BBCODE_UID_LEN); + return substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN); } /** @@ -372,7 +380,7 @@ function mimetype($filename) * There can be significant network overhead if there are a large number of remote avatars * @todo Look at the option of allowing the user to decide whether this is called or to force the dimensions */ -function remote_avatar_dims() +function remote_avatar_dims() { global $db; @@ -514,14 +522,14 @@ function base64_unpack($string) for ($i = 1; $i <= $length; $i++) { - $pos = $length - $i; + $pos = $length - $i; $operand = strpos($chars, substr($string, $pos, 1)); - $exponent = pow($base, $i-1); + $exponent = pow($base, $i-1); $dec_value = $operand * $exponent; - $number += $dec_value; + $number += $dec_value; } - return $number; + return $number; } function _import_check($config_var, $source, $use_target) @@ -535,7 +543,7 @@ function _import_check($config_var, $source, $use_target) ); // copy file will prepend $phpBB_root_path - $target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target); + $target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target); if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0) { @@ -639,7 +647,6 @@ function import_smiley($source, $use_target = false) } /* -* */ function import_avatar($source, $use_target = false, $user_id = false) { @@ -998,15 +1005,15 @@ function set_user_options() // Key need to be set in row, else default value is chosen $keyoptions = array( - 'viewimg' => array('bit' => 0, 'default' => 1), + 'viewimg' => array('bit' => 0, 'default' => 1), 'viewflash' => array('bit' => 1, 'default' => 1), 'viewsmilies' => array('bit' => 2, 'default' => 1), 'viewsigs' => array('bit' => 3, 'default' => 1), - 'viewavatars' => array('bit' => 4, 'default' => 1), - 'viewcensors' => array('bit' => 5, 'default' => 1), - 'attachsig' => array('bit' => 6, 'default' => 0), - 'bbcode' => array('bit' => 8, 'default' => 1), - 'smilies' => array('bit' => 9, 'default' => 1), + 'viewavatars' => array('bit' => 4, 'default' => 1), + 'viewcensors' => array('bit' => 5, 'default' => 1), + 'attachsig' => array('bit' => 6, 'default' => 0), + 'bbcode' => array('bit' => 8, 'default' => 1), + 'smilies' => array('bit' => 9, 'default' => 1), 'popuppm' => array('bit' => 10, 'default' => 0), ); @@ -1458,7 +1465,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) if (!isset($group_ids[$ug_id])) { $sql = 'SELECT group_id - FROM ' . GROUPS_TABLE . " + FROM ' . GROUPS_TABLE . " WHERE group_name = '" . $db->sql_escape(strtoupper($ug_id)) . "'"; $result = $db->sql_query_limit($sql, 1); $id = (int) $db->sql_fetchfield('group_id'); @@ -1574,7 +1581,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) case ACL_NO: if (isset($cur_auth[$forum][$auth_option_id])) { - $sql_ary['delete'][] = "DELETE FROM $table + $sql_ary['delete'][] = "DELETE FROM $table WHERE forum_id = $forum AND auth_option_id = $auth_option_id AND $id_field = $ug_id"; @@ -1588,10 +1595,10 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) } else if ($cur_auth[$forum][$auth_option_id] != $setting) { - $sql_ary['update'][] = "UPDATE " . $table . " - SET auth_setting = $setting - WHERE $id_field = $ug_id - AND forum_id = $forum + $sql_ary['update'][] = "UPDATE " . $table . " + SET auth_setting = $setting + WHERE $id_field = $ug_id + AND forum_id = $forum AND auth_option_id = $auth_option_id"; } } @@ -1720,7 +1727,7 @@ function add_default_groups() } -/** +/** * Sync post count. We might need to do this in batches. */ function sync_post_count($offset, $limit) @@ -1898,7 +1905,7 @@ function update_dynamic_config() // set_config('record_online_users', 1, true); // set_config('record_online_date', time(), true); - $sql = 'SELECT COUNT(post_id) AS stat + $sql = 'SELECT COUNT(post_id) AS stat FROM ' . POSTS_TABLE . ' WHERE post_approved = 1'; $result = $db->sql_query($sql); |