[RESOLVIDO] Jfusion, integrando phpBB3.0.10 com Joomla2.5.3

  • magnunwebdesign
  • Avatar de magnunwebdesign Autor do Tópico
  • Offline
  • JCB! Junior
  • JCB! Junior
Mais
12 anos 1 mês atrás #67003 por magnunwebdesign
magnunwebdesign replied the topic: Re: Jfusion, integrando phpBB3 com Joomla
FEITO! tá resolvido, aqui o tutorial para quem passar pelo mesmo problema!

Encontrei em:
http://www.jfusion.org/forums/viewtopic ... 5&start=20

Pegue o codigo abaixo e salve como redeclare_fix.php
coloque uma copia em dentro da pasta do seu site joomla e outra copia dentro da pasta do seu phpBB3

exemplo: se seu site estiver dentro de public_html, largue este aquivo la dentro via ftp. e acesse via brownser http://www.seusite.com.br/redeclare_fix.php escolha opcao Joomla e click em install

depois largue o mesmo arquivo dentro da pasta do seu phpBB, que normalmente é
/forum/phpbb
acesse via browser novamente escolha opcao de php e install.

pronto, problemas resolvidos...

codigo:
<?php
// redeclare_fix.php v1.00 by fade2gray January 2012
$joomla="libraries/phputf8/mbstring/core.php";
$phpbb3="includes/utf/utf_tools.php";
if(!isset($_POST&#91;'submit'&#93;)){
	?>
	<form method="post" action="<?php echo $_SERVER&#91;'PHP_SELF'&#93;; ?>">
	Script to fix "Cannot redeclare utf8_xxx" errors.<br /><br />
	Select Joomla or phpBB3.<br /><br />
	<input type="radio" value="Joomla" name="choice" checked>Patch: your_Joomla_installation/<?php echo $joomla; ?><br />
	<input type="radio" value="phpBB3" name="choice">Patch: your_phpBB3_installation/<?php echo $phpbb3; ?><br /><br />
	<input type="submit" value="Click To Apply" name="submit">
	</form>
	<?php
}else{
	if($_POST&#91;'choice'&#93;=="Joomla"){
		$file=$joomla;
	}else if($_POST&#91;'choice'&#93;=="phpBB3"){
		$file=$phpbb3;
	}
	$reminder="Don't forget to remove this script after use.";
	if(!file_exists($file)){
		die("<strong>".$file."</strong> does not exist!<br /><br />Did you upload this script to the correct location?<br /><br />Did you select the correct radio button?<br /><br />".$reminder);
	}
	$test=fopen($file,"r");
	while(!feof($test))
  {
  	if(preg_match("/if.*?function_exists.*?utf8_.*?\)/i",fgets($test))){
  		fclose($test);
  		die("<strong>".$file."</strong> may already be patched.<br /><br />Please check before running this script again.<br /><br />".$reminder);
  	}
  }
	fclose($test);
	copy($file,$file.".bak");
	if(!file_exists($file.".bak")){
		die("Backup file not created!<br \><br \>Check file/folder permissions.");
	}else{
		echo "<strong>".$file.".bak</strong> backup file created.<br \><br \>";
	}
	$array=file($file);
	$fn_prefix="function utf8_";
	$condition_prefix="if(!function_exists('utf8_";
	$condition_suffix="')){";
	$a=$b=$i=0;
	
	// Wrap function in conditional statement
	foreach($array as $line){
		$i++;
		$line2=$line;
		if(preg_match("/(?<=".$fn_prefix.").*(?=\()/i",$line,$fn_suffix)){
			preg_match("/^.*(?=".$fn_prefix.")/i",$line,$indent);
			$line=$indent&#91;0&#93;.$condition_prefix.$fn_suffix&#91;0&#93;.$condition_suffix."\n".$line;
			$a++;
		}
		if($a && !$b && !preg_match("/^.*\{/i",$line2)){
			preg_match("/^\s+/i",$line2,$indent2);
			$b++;
		}
		if($a && preg_match("/^".$indent&#91;0&#93;."}/i",$line2)){
			$line=$line2.$indent&#91;0&#93;."}\n";
			$a=0;
		}
		$new_array2&#91;$i-1&#93;=$line;
	}
	if(!file_put_contents($file,$new_array2)){
		die("Failed to patch <strong>".$file."</strong><br \><br \>Restore your backup file and check file/folder permissions.<br \><br \>".$reminder);
	}
	$a=$i=0;
	$array=file($file);
	
	// Fix indentation
	foreach($array as $line){
		$line2=$line;
		$i++;
		if(stristr($line,$fn_prefix)){
			$pos=strpos($line,$fn_prefix);
			$line=$indent2&#91;0&#93;.$line;
			preg_match("/^.*(?=".$fn_prefix.")/i",$line,$indent);
			$a++;
		}
		if($a && !stristr($line2,$fn_prefix)){
			$line=$indent2&#91;0&#93;.$line2;
			if(stristr($line2,"}") && $pos==strpos($line2,"}")){
					$pos=$pos2="";
					$a=0;
			}
		}
		$new_array3&#91;$i-1&#93;=$line;
	}

	if(file_put_contents($file,$new_array3)){
		echo "<strong>".$file."</strong> patched successfully.<br \><br \>".$reminder;
	}else{
		echo "Failed to patch <strong>".$file."</strong><br \><br \>Restore your backup file and check file/folder permissions.<br \><br \>".$reminder;
	}
}
?>

Please Entrar ou Registrar to join the conversation.

Mais
12 anos 1 mês atrás #67004 por Uriel
Uriel replied the topic: Re: Jfusion, integrando phpBB3 com Joomla
melhor vc usar outro componente!!

http://extensions.joomla.org/search?q=PHPBB

abraço

Please Entrar ou Registrar to join the conversation.

  • magnunwebdesign
  • Avatar de magnunwebdesign Autor do Tópico
  • Offline
  • JCB! Junior
  • JCB! Junior
Mais
12 anos 1 mês atrás #67005 por magnunwebdesign
magnunwebdesign replied the topic: Re: [RESOLVIDO] Jfusion, integrando phpBB3.0.10 com Joomla2.5.3
Ta resolvido,
funciona 100%.

O erro ocorre (pelo que li) o Joomla e o phpBB usam as mesmas configuracoes para acessar seus dados, as tais configuracoes que li nao sei explicar ao certo pois nao sei php, mas com o arquivo que disponibilizei funciona.

Abs

Please Entrar ou Registrar to join the conversation.

  • magnunwebdesign
  • Avatar de magnunwebdesign Autor do Tópico
  • Offline
  • JCB! Junior
  • JCB! Junior
Mais
12 anos 1 mês atrás #67102 por magnunwebdesign
magnunwebdesign replied the topic: Re: [RESOLVIDO] Jfusion, integrando phpBB3.0.10 com Joomla2.5.3
lembrando, o script que citei acima funcionou (pelo menos foi no que eu testei aqui) com as seguintes configuracoes

Joomla 2.5.3
Banco de dados mysql
Jfusion1.6.0 stable
phpBB3

Please Entrar ou Registrar to join the conversation.

Mais
12 anos 1 mês atrás #67112 por Trorram
Trorram replied the topic: Re: [RESOLVIDO] Jfusion, integrando phpBB3.0.10 com Joomla2.5.3
Parabéns pelo desenrolar do tópico. Vai ajudar muita gente.

ABs, Trorram <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Rindo" /><!-- s:lol: --> <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Rindo" /><!-- s:lol: -->

Please Entrar ou Registrar to join the conversation.