Forum Moderators: coopster
//Añadimos los bloques restantes aplicando el layout general.
foreach($TOPLIST as $key => $value) {
unset($viejo); unset($nuevo);
$viejo[0]='{STATS}';$nuevo[0]=$this->ESTADISTICAS;
$viejo[1]='{BROWSER}';$nuevo[1]=$this->NAVEGADOR;
$viejo[2]='{SITE_OF_THE_MOMENT}';$nuevo[2]=$this->SITIODELMOMENTO;
$viejo[3]='{PODIUM_TEXT}';$nuevo[3]=$GLOBALS['_Podium_'];
$viejo[4]='{PODIUM}';$nuevo[4]=$this->PODIUM;
$viejo[5]='{TOPLIST}';$nuevo[5]=$value;
$viejo[6]='{TITLE}';$nuevo[6]=$titulo;
$viejo[7]='{JOIN}';$nuevo[7]='<a href="#" target="_blank">'.$GLOBALS['_Join_'].'</a>';
$viejo[8]='{EDIT}';$nuevo[8]='<a href="#" target="_blank">'.$GLOBALS['_EditSite_'].'</a>';
$viejo[9]='{ADMIN}';$nuevo[9]='<a href="#" target="_blank">'.$GLOBALS['_Webmaster_'].'</a>';
if($GLOBALS['gAviso']) {
$fp=fopen('data/notice.htm','r');
$aviso=fread($fp,filesize('data/notice.htm'));
fclose($fp);
$viejo[10]='{NOTICE}';$nuevo[10]=$aviso;
} else {
$viejo[10]='{NOTICE}';$nuevo[10]='';
}
$this->PAGINAS[$key]=str_replace($viejo,$nuevo,$this->modelo[2]);
}//Volcamos el código al disco
$this->_Guardar();
}
//$viejo[7]='{JOIN}';$nuevo[7]='<a href="#" target="_blank">'.$GLOBALS['_Join_'].'</a>';
//$viejo[8]='{EDIT}';$nuevo[8]='<a href="#" target="_blank">'.$GLOBALS['_EditSite_'].'</a>';
//$viejo[9]='{ADMIN}';$nuevo[9]='<a href="#" target="_blank">'.$GLOBALS['_Webmaster_'].'</a>'; Gives me a result of no links but still this text: [ {JOIN} ¦¦ {EDIT} ¦¦ {ADMIN} ]
ideas? I've searched every included file for {JOIN}, {EDIT} etc and have had no luck ;/
str_replace($viejo,$nuevo,$this->modelo[2]);
$viejo and $neuvo are arrays. I don't think you can just put them that way.
You need to find a way to put the array in such a way that the right $viejo array values are replaced by the right $nuevo array values. For Example:
str_replace($viejo[5],$nuevo[5],$this->modelo[2]);
I hope you got my point.
Habtom
. . .'unset' in each new occurance.what that means . . .
Unset [php.net] is to destroy the value of the variables.