30) { return $output; } $count = 1 << $count_log2; $salt = substr($setting, 4, 8); if (strlen($salt) != 8) { return $output; } if (PHP_VERSION >= 5) { $hash = md5($salt . $password, true); do { $hash = md5($hash . $password, true); } while (--$count); } else { $hash = pack('H*', md5($salt . $password)); do { $hash = pack('H*', md5($hash . $password)); } while (--$count); } $output = substr($setting, 0, 12); $output .= _hash_encode64($hash, 16, $itoa64); return $output; } function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6) { if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) { $iteration_count_log2 = 8; } $output = '$H$'; $output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)]; $output .= _hash_encode64($input, 6, $itoa64); return $output; } function _hash_encode64($input, $count, &$itoa64) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $itoa64[$value & 0x3f]; if ($i < $count) { $value |= ord($input[$i]) << 8; } $output .= $itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) { break; } if ($i < $count) { $value |= ord($input[$i]) << 16; } $output .= $itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) { break; } $output .= $itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } function phpbb_hash($password) { $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; $random_state = unique_id(); $random = ''; $count = 6; if (($fh = @fopen('/dev/urandom', 'rb'))) { $random = fread($fh, $count); fclose($fh); } if (strlen($random) < $count) { $random = ''; for ($i = 0; $i < $count; $i += 16) { $random_state = md5(unique_id() . $random_state); $random .= pack('H*', md5($random_state)); } $random = substr($random, 0, $count); } $hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64); if (strlen($hash) == 34) { return $hash; } return md5($password); } function phpbb_check_hash($password, $hash) { $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if (strlen($hash) == 34) { return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false; } return (md5($password) === $hash) ? true : false; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // DZCP FUNCTIONS function phpbb3_login($dzcpid, $autologin = 0) { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix; $qry = db("SELECT pwd,phpbbid FROM ".$db['users']." WHERE `id` = '".$dzcpid."'"); if($get = _fetch($qry)) { /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qrybb = db("SELECT * FROM `".$table_prefix."config` WHERE `config_name` = 'cookie_name'"); $config = _fetch($qrybb); ///////////////////////////////////////////////////////////////////////////////////////////////// $qryb = db("SELECT user_lastvisit,user_lastpage,user_form_salt FROM `".$table_prefix."users` WHERE `user_id` = '".intval($get['phpbbid'])."'"); if($getb = _fetch($qryb)) { $session_id = md5($pwd.time().$getb['user_form_salt']); phpbb3_set_cookie($config['config_value'].'_sid', $session_id); phpbb3_set_cookie($config['config_value'].'_u', intval($get['phpbbid'])); phpbb3_set_cookie($config['config_value'].'_k', substr(md5(time()),0,16)); db("DELETE FROM `".$table_prefix."sessions` WHERE `session_user_id` = '".intval($get['phpbbid'])."'"); db("INSERT INTO `".$table_prefix."sessions` SET `session_id` = '".$session_id."', `session_user_id` = '".intval($get['phpbbid'])."', `session_last_visit` = '".intval($getb['user_lastvisit'])."', `session_start` = '".time()."', `session_time` = '".(time()+1)."', `session_ip` = '".$_SERVER['REMOTE_ADDR']."', `session_browser` = '".$_SERVER['HTTP_USER_AGENT']."', `session_page` = 'index.php', `session_admin` = '".intval(($dzcpid==1)?1:0)."', `session_autologin` = '".intval($autologin)."' "); } $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); } } function phpbb3_logout($dzcpid) { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix; $qry = db("SELECT pwd,phpbbid FROM ".$db['users']." WHERE `id` = '".$dzcpid."'"); if($get = _fetch($qry)) { /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qrybb = db("SELECT * FROM `".$table_prefix."config` WHERE `config_name` = 'cookie_name'"); $config = _fetch($qrybb); ///////////////////////////////////////////////////////////////////////////////////////////////// $qryb = db("SELECT user_lastvisit,user_lastpage,user_form_salt FROM `".$table_prefix."users` WHERE `user_id` = '".intval($get['phpbbid'])."'"); if($getb = _fetch($qryb)) { phpbb3_set_cookie($config['config_value'].'_sid'); phpbb3_set_cookie($config['config_value'].'_u'); phpbb3_set_cookie($config['config_value'].'_k'); db("DELETE FROM `".$table_prefix."sessions` WHERE `session_user_id` = '".intval($get['phpbbid'])."'"); } ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); } } function phpbb3_register($username, $email, $pass, $dzcpid) { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix,$defaultGroupID; /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qrybb = db("SELECT * FROM `".$table_prefix."config` WHERE `config_name` = 'cookie_name'"); $config = _fetch($qrybb); ///////////////////////////////////////////////////////////////////////////////////////////////// db("INSERT INTO `".$table_prefix."users` SET `username` = '".up($username)."', `username_clean` = '".utf8_clean_string(up($username))."', `user_email` = '".up($email)."', `user_password` = '".phpbb_hash($pass)."', `group_id` = '".$defaultGroupID."', `user_ip` = '".$_SERVER['REMOTE_ADDR']."', `user_lang` = 'de', `user_lastvisit` = '".time()."', `user_lastmark` = '".time()."', `user_regdate` = '".time()."', `dzcpid` = '".$dzcpid."' "); $mysql_insert_id = mysql_insert_id(); db("INSERT INTO `".$table_prefix."user_group` SET `user_id` = '".$mysql_insert_id."', `group_id` = '".$defaultGroupID."', `user_pending` = '0' "); db("UPDATE `".$table_prefix."config` SET `config_value` = config_value+1 WHERE `config_name` = 'num_users'"); db("UPDATE `".$table_prefix."config` SET `config_value` = '".$mysql_insert_id."' WHERE `config_name` = 'newest_user_id'"); db("UPDATE `".$table_prefix."config` SET `config_value` = '".up($username)."' WHERE `config_name` = 'newest_username'"); ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); return $mysql_insert_id; } function phpbb3_update($dzcpid, $username, $email, $pass) { global $db, $userid,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix; $qry = db("SELECT phpbbid FROM ".$db['users']." WHERE `id` = '".$dzcpid."'"); if($get = _fetch($qry)) { /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qrybb = db("SELECT * FROM `".$table_prefix."config` WHERE `config_name` = 'cookie_name'"); $config = _fetch($qrybb); ///////////////////////////////////////////////////////////////////////////////////////////////// if(!empty($pass)) $addpass = " `user_password` = '".phpbb_hash($pass)."',"; db("UPDATE `".$table_prefix."users` SET `username` = '".up($username)."', `username_clean` = '".utf8_clean_string(up($username))."', ".$addpass." `user_email` = '".up($email)."' WHERE `user_id` = '".intval($get['phpbbid'])."' "); if($dzcpid == $userid) { $qryb = db("SELECT user_lastvisit,user_lastpage,user_form_salt FROM `".$table_prefix."users` WHERE `user_id` = '".intval($get['phpbbid'])."'"); if($getb = _fetch($qryb)) { $session_id = md5($pass.time().$getb['user_form_salt']); phpbb3_set_cookie($config['config_value'].'_sid', $session_id); phpbb3_set_cookie($config['config_value'].'_u', intval($get['phpbbid'])); phpbb3_set_cookie($config['config_value'].'_k', substr(md5(time()),0,16)); db("DELETE FROM `".$table_prefix."sessions` WHERE `session_user_id` = '".intval($get['phpbbid'])."'"); db("INSERT INTO `".$table_prefix."sessions` SET `session_id` = '".$session_id."', `session_user_id` = '".intval($get['phpbbid'])."', `session_last_visit` = '".intval($getb['user_lastvisit'])."', `session_start` = '".time()."', `session_time` = '".(time()+1)."', `session_ip` = '".$_SERVER['REMOTE_ADDR']."', `session_browser` = '".$_SERVER['HTTP_USER_AGENT']."', `session_page` = 'index.php', `session_autologin` = '".intval($autologin)."' "); } } ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); } } function phpbb3_unhtmlentities($txt) { $txt = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $txt); $txt = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $txt); $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($txt, $trans_tbl); } function ftopics_phpbb() { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix,$maxftopics,$lftopics,$phpbb3_folder; /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qry = db("SELECT * FROM `".$table_prefix."topics` WHERE `topic_id` NOT IN (select distinct `topic_id` from `".$table_prefix."topics` where `forum_id` ='23') ORDER BY `topic_last_post_time` DESC LIMIT ".$maxftopics); while($get = _fetch($qry)) { $ftopics .= show("menu/forum_topics_phpbb3", array("folder" => $phpbb3_folder, "topic_id" => intval($get['topic_id']), "forum_id" => intval($get['forum_id']), "post_id" => intval($get['topic_replies'] + 1), "titel" => cut(re($get['topic_title']),$lftopics))); } ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); return empty($ftopics) ? '' : ''.$ftopics.''; } function ftopics_userlobby_last() { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix,$phpbb3_folder,$userid,$phpbb3userlobbyposts; /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $qry = db("SELECT * FROM `".$table_prefix."topics` AS s1 RIGHT JOIN `".$table_prefix."forums` AS s2 ON s1.`forum_id` = s2.`forum_id` AND s1.`forum_id` != '23' AND s2.`forum_id` != '23' ORDER BY s1.`topic_last_post_time` DESC LIMIT 10"); while($get = _fetch($qry)) { $ftopics .= show("user/userlobby_forum_phpbb3", array("folder" => $phpbb3_folder, "topic_id" => intval($get['topic_id']), "forum_id" => intval($get['forum_id']), "post_id" => intval($get['topic_replies'] + 1), "kat" => (empty($get['forum_name']) ? '' : re($get['forum_name']).':'), "titel" => cut(re($get['topic_title']),$lftopics))); } ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); return $ftopics; } $phpbb3userlobbyposts = 0; function ftopics_userlobby() { global $db,$dbhost,$dbport,$dbname,$dbuser,$dbpasswd,$table_prefix,$phpbb3_folder,$userid,$phpbb3userlobbyposts,$maxfposts; $user = _fetch(db("SELECT lastvisit FROM ".$db['userstats']." WHERE user = ".$userid."")); /// PHPBB 3 MySQL CONNECT /////////////////////////////////////////////////////////////////////// $phpbb3 = mysql_connect($dbhost.(empty($dbport)?'':':'.$dbport), $dbuser, $dbpasswd); mysql_select_db($dbname, $phpbb3); ///////////////////////////////////////////////////////////////////////////////////////////////// $tmp_kat = ''; $qry = db("SELECT * FROM `".$table_prefix."posts` WHERE `post_id` NOT IN (SELECT DISTINCT `post_id` FROM `".$table_prefix."posts` WHERE `forum_id` = '23') AND `post_time` > '".$user['lastvisit']."' GROUP BY `topic_id` ORDER BY `post_time` DESC LIMIT 150"); while($get = _fetch($qry)) { $phpbb3userlobbyposts++; if($tmp_kat != $get['forum_id']) { $tmp_kat = $get['forum_id']; $f = _fetch(db("SELECT * FROM `".$table_prefix."forums` WHERE `forum_id` !='23' AND `forum_id` = '".$get['forum_id']."'")); $ftopics .= '
'.re($f['forum_name']).'
'; } $date = (date("d.m.")==date("d.m.",$get['post_time'])) ? '['.date("H:i",$get['post_time']).']' : date("d.m.",$get['post_time']).' ['.date("H:i",$get['post_time']).']'; $t = _fetch(db("SELECT * FROM `".$table_prefix."topics` WHERE `topic_id` NOT IN (select distinct `topic_id` from `".$table_prefix."topics` where `forum_id` ='23') AND `topic_id` = '".$get['topic_id']."'")); $count = cnt($table_prefix."posts", "WHERE `topic_id` NOT IN (select distinct `topic_id` from `".$table_prefix."topics` where `forum_id` ='23') AND `topic_id` = '".$get['topic_id']."' AND `post_time` > '".$user['lastvisit']."'", 'post_id'); $lp = cnt($table_prefix."posts", "WHERE `topic_id` NOT IN (select distinct `topic_id` from `".$table_prefix."topics` where `forum_id` ='23') AND `topic_id` = '".$get['topic_id']."'", 'post_id'); if($count == 0) { $cnt = 1; $pagenr = 1; $post = ""; } elseif($count == 1) { $cnt = 1; $pagenr = ceil($lp/$maxfposts); $post = _new_post_1; } else { $cnt = $count; $pagenr = ceil($lp/$maxfposts); $post = _new_post_2; } if($lp == 1) { unset($post); $nthread = _no_new_thread; } else $nthread = _new_thread; $ftopics .= '  '.$date.'  '.$cnt.' '.$post.' '.$nthread.' '.re($t['topic_title']).'
'; } ///////////////////////////////////////////////////////////////////////////////////////////////// $msql = mysql_connect($db['host'],$db['user'],$db['pass']); mysql_select_db($db['db'], $msql); return $ftopics; } function phpbb3_erase() { global $phpbb3userlobbyposts, $erase; return empty($erase) ? (empty($phpbb3userlobbyposts) ? '' : _user_new_erase) : $erase; } ?> Rodriguezzzz Clanbase - News
Wartungsmodus
Die Webseite ist momentan wegen Wartungsarbeiten geschlossen!
Bitte versuche es in ein paar Minuten erneut!