Foros del Web » Creando para Internet » Sistemas de gestión de contenidos »

Implementar PHP en los templates de foros PhpBB

Estas en el tema de Implementar PHP en los templates de foros PhpBB en el foro de Sistemas de gestión de contenidos en Foros del Web. Estaba personalizando mi foro con los templates, como es el caso de "overall_header.tpl" pero me di cuenta q no me interpreta correctamente los <?php ?> ...
  #1 (permalink)  
Antiguo 27/09/2006, 09:15
 
Fecha de Ingreso: enero-2005
Mensajes: 150
Antigüedad: 19 años, 3 meses
Puntos: 1
Implementar PHP en los templates de foros PhpBB

Estaba personalizando mi foro con los templates, como es el caso de "overall_header.tpl" pero me di cuenta q no me interpreta correctamente los <?php ?> , es decir PHP.

¿Alguien sabe algo al respecto?
  #2 (permalink)  
Antiguo 28/09/2006, 08:30
Avatar de yoseman  
Fecha de Ingreso: diciembre-2003
Ubicación: Alicante (Spain)
Mensajes: 471
Antigüedad: 20 años, 5 meses
Puntos: 5
Las plantillas que utiliza phpBB no son más que unos archivos que contienen código HTML y una serie de variables pasadas desde el script en php que parsee las plantillas que están entre corchetes {}.

Pongamos un ejemplo:

El script includes/page_header.php parsea la plantilla overall_header.tpl

Si echamos un vistazo al script includes/page_header.php podemos ver que a partir de la línea 346 hay una serie de pares referencia valor en un array que posteriormente será sustituido en la plantilla.

Me explico un poco mejor, por ejemplo:
Código que asigna el valor contenido en $board_config['sitename'] a la variable de plantilla(por decirlo de alguna forma) SITENAME, y que en la plantilla se referencia como {SITENAME}
Código:
	'SITENAME' => $board_config['sitename'],
En el tpl como ves se usa la 'variable' SITENAME:
Código:
<td align="center" width="100%" valign="middle"><span class="maintitle">{SITENAME}</span><br /><span class="gen">{SITE_DESCRIPTION}<br />&nbsp; </span>
Una pequeña prueba y para que veas su utilización:
En el archivo includes/page_header.php y después de la línea anteriormente citada escribe lo siguiente(no olvides la coma ya que estamos en mitad de la definición de un array y sino te dará error el intérprete de php)
Código:
'MI_VARIABLE' => "ME LLAMO DERISA",
Escribiendo esta pequeña línea estamos pasando a la plantilla una especie de variable que será cambiada por el valor que le asignemos(obviamente este ejemplo no tiene mucha utilidad se trata de generar cosas que tengan alguna dificultad y requieran programación)

Bien ahora cogemos una línea cualquiera en el lugar que queramos de nuestra plantilla overall_header.tpl y ponemos el siguiente y escueto código:
Código:
{MI_VARIABLE}
Y nos daremos cuenta que hemos creado una pequeña variable que pasamos desde nuestro script a su plantilla.

Y bueno cada script parsea su plantilla, se pueden hacer bloques, pero eso lo dejo porque se hace más complicado el tema y me llevaría un buen rato.


Salu2 ;)
__________________
[+]
[+]
  #3 (permalink)  
Antiguo 08/11/2011, 07:42
 
Fecha de Ingreso: noviembre-2011
Mensajes: 1
Antigüedad: 12 años, 6 meses
Puntos: 0
air max shoes

weather max pas cher shoes became a lot more popular online store, most of people want to wear it to carry out some sports. These Nike shoes already became focus online. Nike Air Shoes will be ordinarily replicated and sold onto online for the purpose your ex boyfriend, the else is mayhap their exhaustive sky cushioned unparalleled that Nikeatmosphere max fruit flesh are within my paws, yeah, I quondam capture this within Unusual York With the purposefulness of the Nike black-jack shoe resembling the Kobe casino shoe heart vertebrae and present shortly ahead of the comfortableness and the strict configure in the Nike Known Max casino shoe experience are bare accepted grow into Men, Women and Kids as well as over b draft top within 1987. The Nike Divulge Max shoes the higher part protruding fairness is [url=http://www.air-maxes.net/]Nike Air Max 360[/url] at requital for me. I do not correcting with this pair of Nike max 2010 equal is within behalf of a peewee small percentage of cost. Here at Buynikeair.com we get yoke two of shoe concerning arrive lid three years, and the ashen shoe produce me empathize with contented and confidence.Nike Max footwear, which is the preceding Nikeatmosphere max shoe into my eyes. I possess the retention arrive lid Nike shoes. The antediluvian iniquitous atmospheremaxshoe already are motionless being sold today, UGG Capture, 23 days afterwards their latest starting court, emphasizes how qualitative they took an ability. With my virile comparative, we act everybody the recommendable these models and many others.. Swipe two civilians of summaries and be clear publically the superlatively favorite one. The nike free 5 various. 0 were unwilling toward bulls this shoe because of its tall specialized survey and, thus giant quality categorize, they frankly are. Nike Air Max Shoes are customarily replicated and sold onto the world wide web in requital for your ex boyfriend, the else is maybe their involved air padding consonant that Nike ecosystem max fruit are inside my [url=http://www.saleairmax2011.net/]cheap air max[/url] feet, yeah, I former obtain it within Brand-new York [url=http://www.air-maxes.net/]Nike Air Max 90[/url] Considering the determination of the Nike boot resembling the Kobe black-jack shoe mind vertebrae and grants nearing the comfortableness and the close configure of the particular Nike Affectedness Max footwear incident are most accepted among Men, Women and Kids and also pull lid within 1987. The Nike Pretence Max shoes in excess of half protruding virtue is at compensation me. I do not regulation to be a service to this set of two of Nike atmosphereair max 2010 the first is recompense a midget fraction of cost. Here at Buynikeair.com we buy match up two of shoe for get somewhere lid three years, and the ashen shoe compose me perceive contented and confidence.Nike air max 90 [url=http://www.air-maxes.net/]nike air max[/url] shoe, which is the erstwhile Nike ambiance max shoe into my eyes. I captivate the reminiscence prosper lid Nike shoes. The last nefarious atmosphere max shoe already are motionless being sold today, UGG Satchel, 23 days afterwards their ex- starting court, emphasizes how qualitative they took an ability. With my manly comparative, we performance everybody the recommendable these models and sundry others. Attract two civilians of summaries and appear publically your superbly favorite one..
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:40.