Forum Moderators: coopster

Message Too Old, No Replies

I cant figure this out

         

cripplertd

2:27 pm on Sep 29, 2007 (gmt 0)

10+ Year Member



Doesnt help that the original coding isnt english ;/

//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();
}


I // out the links I dont want to appear.

//$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 ;/

Habtom

5:16 am on Sep 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

cripplertd

5:27 am on Sep 30, 2007 (gmt 0)

10+ Year Member



so I have to try differnt array values till it matches what I need?

Habtom

5:44 am on Sep 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so I have to try differnt array values till it matches what I need?

I was trying to give you a bit of a hint there. You can put it in the following mannger,

str_replace($viejo[$x],$nuevo[$x],$this->modelo[2]);

. . . and then increment the value of $x++; somewhere on the loop.

cripplertd

5:48 am on Sep 30, 2007 (gmt 0)

10+ Year Member



str_replace($viejo[5],$nuevo[5],$this->modelo[2]);

i've tried each value 1-5 for each of them, nothing happens?

Habtom

6:02 am on Sep 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



nothing happens?

Did you print out the value of this array: $this->PAGINAS?
Have you checked if $this->modelo[2] contains any value?
Have you printed the output?

cripplertd

6:14 am on Sep 30, 2007 (gmt 0)

10+ Year Member



im totally new to thi. thats why my brilliance thought commenting out the parts I dont want would work.

I want to do

print_r ($this->PAGINAS);

to print the value of that right?

Habtom

7:51 am on Sep 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yea, print_r [php.net] is used to print arrays, usually for a test purpose.

cripplertd

5:58 am on Oct 1, 2007 (gmt 0)

10+ Year Member



print_r ($this->PAGINAS);
Returns:
Array ( [0] => {STATS} [1] => {BROWSER} [2] => {SITE_OF_THE_MOMENT} [3] => {PODIUM_TEXT} [4] => {PODIUM} [5] => {TOPLIST} [6] => {TITLE} [7] => {JOIN} [8] => {EDIT} [9] => {ADMIN} [10] => {NOTICE} )

cripplertd

6:17 am on Oct 1, 2007 (gmt 0)

10+ Year Member



sorry that was $viejo

$this->modelo[2]
and $paginas returned nothing on the print_r test.

Also, is there a reason that when I save a page it takes upto 5 mins for the new changes to load in the browsers correctly?

cripplertd

6:26 am on Oct 1, 2007 (gmt 0)

10+ Year Member



apprently - viejo = "old" nuevo = "new"

these varribles are used sevral times through out the page and 'unset' in each new occurance.

what that means ( nothing to me cause i'm tarded! ) but hopefully some more for u guys that are helping me (thanks btw)

Habtom

8:34 am on Oct 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



. . .'unset' in each new occurance.

what that means . . .

Unset [php.net] is to destroy the value of the variables.

cripplertd

12:03 am on Oct 2, 2007 (gmt 0)

10+ Year Member



right I read up on that, I meant what does that mean in comparison to your other post