Versión phpBB: phpBB3 (3.0.

MODs Instalados: Dicemod
Plantilla(s) usada(s): Prosilver
Servidor: gratuito
Actualización desde otra versión: No
Conversión desde otro sistema de foros: No
Bueno, lo intenté una vez pero me salió mal el mensaje por lo que pido disculpas y espero haberlo hecho bien esta vez.
La cuestión es que ya solo al abrir el foro tengo mensajes de error en la cabecera, los mensajes son estos:
Código: Seleccionar todo
/* BEGIN DICE MOD */ $lang = array_merge($lang, array( 'DICE_CHAR' => 'd', /*char used in the [dice]3d6[/dice], e.g.: DICE_CHAR = 'w' -> [dice]3w6[/dice]*/ 'INVALID_DICE_CODE' => 'C�digo de Dado inv�lido!', 'INVALID_DICE_MODES' => 'Modos o modo de combinaci�n inv�lido!', 'INVALID_DICE_ROLL' => 'Tirada de dados inv�lida!', 'MUST_HAVE_DICE_CODE' => 'No puedes eliminar el c�digo de los dados. Si deseas eliminar este c�digo de dados, por favor, ponte en contacto con un moderador o administrador.', 'MAKE_REMOVABLE' => '[Hacer removible]', 'MAKE_UNREMOVABLE' => '[Hacer irremovible]', 'NO_DOUBLE_DICE_CODE' => 'No puede publicar m�s de un tirada de dados en el mensaje original, sin una etiqueta de citar.', 'ON_A_DIE' => ' en un d', 'PATTERN_ROLL_TOTAL' => ' y obtiene un total de [%t]', 'PATTERN_ROLL_STRING' => '[%u] ha lanzado [%n] dados de [%s] caras ', 'PATTERN_ROLL_STRING_SINGLE_DIE' => '[%u] ha lanzado [%s] caras', 'ROLLS_ORIGINAL_POST' => 'Post original', )); /* END DICE MOD */ */
Código: Seleccionar todo
/* BEGIN DICEMOD */ function encodediceBBCode($dice_mode, $dice_roll_req, $post_id){ global $db, $user, $config; //check if dice modes are valid $dice_info = array(); $dmode_total = false; $dmode_totalonly = false; $dmode_bullshit = false; $modes = ltrim($dice_mode, "="); if($modes != ''){ $mode_array = explode(",", strtolower($modes)); if(count($mode_array)>2){ $dmode_bullshit = true; } else{ $modes = '='; foreach($mode_array as $current_part){ switch($current_part){ case "total": if($dmode_total||$dmode_totalonly){$dmode_bullshit=true;} $dmode_total = true; break; case "totalonly": if($dmode_total||$dmode_totalonly){$dmode_bullshit=true;} $dmode_totalonly = true; break; default: $dmode_bullshit = true; break; } } } } if(preg_match('/([1-9][0-9]*)'.($user->lang['DICE_CHAR']?$user->lang['DICE_CHAR']:'d').'([1-9][0-9]*)/i' , $dice_roll_req, $dice_info) AND !$dmode_bullshit){ $modes.= ($dmode_total?"total":"") . ($dmode_totalonly?"totalonly":""); $modes = rtrim($modes, ","); //second if() to prevent issues (perhaps not neccessary) $real_dice = explode(":", $config['dice_real_dice']); if(($config['dice_real_dice_only'] && !empty($real_dice) && !in_array($dice_info[2],$real_dice)) || ($dice_info[2] > 255) || (($dice_info[1] > $config['dice_max_dice']-1) && ($config['dice_max_dice']!=0)) || ($dice_info[1] < 1)){ return '[dice' . $dice_mode . ']' . $dice_roll_req . '[/dice]'; } //this is a valid dice roll, add it to the database and encode it (1 => numdie(not directly stored in database anymore) , 2 => diesides) //generate the rolls $dice_roll = ''; $totalroll = 0; $numdice = 0; for($i=0 ; $i<(int) $dice_info[1] ; $i++) { $singleroll = rand(1,(int) $dice_info[2]); $dice_roll .= $singleroll . ':'; $totalroll += $singleroll; $numdice++; } $dice_roll = rtrim($dice_roll,":"); //generate the roll_id $i=-1; do { $i++; //ensure that this code is not already taken $sql = 'SELECT * FROM ' . DICE_TABLE . ' WHERE post_id=' . $post_id . ' AND roll_id=' . $i . ' AND user_id=' . $user->data['user_id']; $result = $db->sql_query($sql); }while($db->sql_fetchrow($result)); //check if number of allowed rolls per post isn't exceeded; if(($i > ($config['dice_max_rolls']?$config['dice_max_rolls']-1:255)) OR ($i > 255)){ return '[dice' . $dice_mode . ']' . $dice_roll_req . '[/dice]'; } //insert into the database $sql = 'INSERT INTO ' . DICE_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'post_id' => $post_id, 'dice_roll' => $dice_roll, 'numsides' => (int) $dice_info[2], 'numdice' => $numdice, 'totalroll' => $totalroll, 'can_remove' => 0, 'roll_id' => $i, 'user_id' => $user->data['user_id'])); $db->sql_query($sql); //return the new code so that it may be processed by the BBCode parser return '[dice' . $modes . ']' . /*($post_id?"":$user->data['user_id'] . 'ID') .*/ $i . '[/dice]'; } else{ return '[dice' . $dice_mode . ']' . $dice_roll_req . '[/dice]'; } } /* END DICEMOD */ /* BEGIN DICEMOD */ function decodedice($roll_code, $modes) { global $db, $user, $auth, $forum_id, $row, $config; if($row['post_id']){ //identify dice roll if(substr_count($roll_code, ":") > 0) { $pos = strrpos($roll_code, ":"); $post_id = (int)substr($roll_code, 0, $pos); $roll_id = (int)substr($roll_code, $pos +1); } else { $post_id = $row['post_id']; /*if($rollcode === ""){ return $user->lang['INVALID_DICE_CODE']; } else{ $roll_id = (int)$roll_code; }*/ $roll_id = (int)$roll_code; if(($roll_id == 0) AND ($roll_code!='0')){ return $user->lang['INVALID_DICE_CODE']; } } //get the dice roll from the database $sql = 'SELECT * FROM ' . DICE_TABLE . ' WHERE (post_id =' . $post_id . ' AND roll_id =' . $roll_id . ')'; $result = $db->sql_query($sql); $dice_roll = $db->sql_fetchrow($result); if(!$dice_roll){ return $user->lang['INVALID_DICE_CODE']; } //get the dice modes $dmode_total = false; $dmode_totalonly = false; $dmode_quote = false; $dmode_bullshit = false; $mode_array = explode(",", strtolower($modes)); if($modes != ""){ if(count($mode_array)>2){ $dmode_bullshit = true; } else{ foreach($mode_array as $current_part){ switch($current_part){ case "total": if($dmode_total){$dmode_bullshit=true;} $dmode_total = true; break; case "totalonly": if($dmode_total){$dmode_bullshit=true;} $dmode_total = true; $dmode_totalonly = true; break; case "quote": if($dmode_quote){$dmode_bullshit=true;} $dmode_quote = true; break; default: $dmode_bullshit = true; break; } } } } if($dmode_bullshit){ return ($user->lang['INVALID_DICE_MODES']); } //get display mode $carry_disp_opts = explode(":", $config['dice_themes']); $carry_disp = $user->data['user_dice_disp']; $dice_disp = (count($carry_disp_opts)>$carry_disp?$carry_disp_opts[$carry_disp]:$carry_disp_opts[0]); //get the dice roll, create dice roll text for the roll itself $offset = -1; $roll = ''; global $phpbb_root_path; if($dice_disp == 'text'){ $roll = preg_replace('#([0-9]+)[:]?#', "lang['ON_A_DIE']}{$dice_roll['numsides']}\">\$1, ", $dice_roll['dice_roll']); $roll = rtrim($roll, ", "); } else{ $roll = preg_replace('#([0-9]+)[:]?#', "\"\$1,\"lang['ON_A_DIE']}{$dice_roll['numsides']}\" /> ", $dice_roll['dice_roll']); $roll = rtrim($roll); $pos = strrpos($roll, '," title="'); $roll = substr($roll, 0, $pos) . substr($roll, $pos+1); } $roll = ''.$roll.''; $haystack = ($numdice-1?$user->lang['PATTERN_ROLL_STRING']:$user->lang['PATTERN_ROLL_STRING_SINGLE_DIE']) . ($dmode_total?$user->lang['PATTERN_ROLL_TOTAL']:'') . ($dmode_totalonly?'.':(':
'.$roll)); //get username of the roll's owner $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id=' . $dice_roll['user_id']; $result = $db->sql_query($sql); $dice_roller = $db->sql_fetchrow($result); //create entire replacement text if($dmode_quote OR $dice_roll['post_id']!=$row['post_id']){ $urllink = 'viewtopic.php?p='.$dice_roll['post_id'].'#p'.$dice_roll['post_id']; $needles = array('>','<','[%u]','[%n]','[%s]','[%t]','[%l]'); $replace = array('>','<',$dice_roller['username'],$dice_roll['numdice'],$dice_roll['numsides'],$dice_roll['totalroll'],$urllink); //parse the dice roll with the dice values $dice_roll['disproll'] = str_replace($needles , $replace , ''. $user->lang['ROLLS_ORIGINAL_POST'] .': ' . $haystack); } else{ $needles = array('[%u]','[%n]','[%s]','[%t]','[%l]'); $replace = array($dice_roller['username'],$dice_roll['numdice'],$dice_roll['numsides'],$dice_roll['totalroll']); $dice_roll['disproll'] = str_replace($needles , $replace , $haystack); //if this is the original post (checked above) and the user is a moderator, add a removability link if($auth->acl_get('m_edit', $forum_id)){ $urllink = 'viewtopic.php?p='.$dice_roll['post_id']; if($dice_roll['can_remove']){ $dice_roll['disproll'] .= ' ' . $user->lang['MAKE_UNREMOVABLE'] . ''; } else{ $dice_roll['disproll'] .= ' ' . $user->lang['MAKE_REMOVABLE'] . ''; } } } return '
' . $dice_roll['disproll'] . '
'; } else { return $user->lang['INVALID_DICE_CODE']; } } /* END DICEMOD *//* BEGIN DICE MOD */ $lang = array_merge($lang, array( 'DICE_CHAR' => 'd', /*char used in the [dice]3d6[/dice], e.g.: DICE_CHAR = 'w' -> [dice]3w6[/dice]*/ 'INVALID_DICE_CODE' => 'C�digo de Dado inv�lido!', 'INVALID_DICE_MODES' => 'Modos o modo de combinaci�n inv�lido!', 'INVALID_DICE_ROLL' => 'Tirada de dados inv�lida!', 'MUST_HAVE_DICE_CODE' => 'No puedes eliminar el c�digo de los dados. Si deseas eliminar este c�digo de dados, por favor, ponte en contacto con un moderador o administrador.', 'MAKE_REMOVABLE' => '[Hacer removible]', 'MAKE_UNREMOVABLE' => '[Hacer irremovible]', 'NO_DOUBLE_DICE_CODE' => 'No puede publicar m�s de un tirada de dados en el mensaje original, sin una etiqueta de citar.', 'ON_A_DIE' => ' en un d', 'PATTERN_ROLL_TOTAL' => ' y obtiene un total de [%t]', 'PATTERN_ROLL_STRING' => '[%u] ha lanzado [%n] dados de [%s] caras ', 'PATTERN_ROLL_STRING_SINGLE_DIE' => '[%u] ha lanzado [%s] caras', 'ROLLS_ORIGINAL_POST' => 'Post original', )); /* END DICE MOD */ */[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:667)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:667)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:667)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:667)
Espero que sepais perdonar mi falta en el anterior post y me ayudeis a solucionarlo.
Muchas gracias.