Problema al crear página manualmente

Started by ArgentinaIRC, October 16, 2014, 01:12:35 AM

Previous topic - Next topic

ArgentinaIRC

Hola a todos!

Bueno quiero poner un botón y una página de noticias en mi Foro, he seguido al pié de la letra estos 2 tutoriales:

[Tutorial] Agregar páginas manualmente a SMF:
http://www.simplemachines.org/community/index.php?topic=371329.0


[Aporte] Cómo agregar botón en Foro SMF 2.0 o superior:
http://www.simplemachines.org/community/index.php?topic=494494.0

Pero hay algo que está mal explicado que es esto:

QuoteLuego abran el archivo index.[idiomadelforo].php que se encuentra en foro/Themes/default/ (a menos que tengas una configuración distinta en el tema de tu foro, deberás buscarlo allí).

en realidad, ese archivo está dentro de la carpeta languages, deben corregir eso por favor.

Hice todo lo que explican los tutoriales, el botón funciona bien, se visualiza, apunta a donde debe dirigir, pero la página, no ingresa en donde debe ingresar, es decir, que al pulsar el botón Noticias, se redirecciona al inicio del Foro, no se porque sucede esto, hice todo tal cuál pero no anda, osea me lleva al inicio del Foro al pulsar el botón.

Dejo los pasos que hice:

Para el botón hice esto:

/Foro/Sources/Subs.php

'Noticias' => array(
'title' => $txt['Noticias'],
'href' => $scripturl . '?action=Noticias',
'show' => true,
'sub_buttons' => array(
),
),


/Foro/Themes/default/languages/index.spanish_es-utf8.php

$txt['Noticias'] = 'Noticias';



Ahora para la página hice así:

/Foro/index.php


'noticias' => array('Noticias.php', 'Noticias'),

/Foro/Sources/Noticias.php

<?php
if (!defined('SMF'))
die(
'Hacking attempt...');

function 
Noticias() {
    global 
$context;
    
$context['page_title'] = 'Noticias Actuales!';
    
loadTemplate('Noticias');
}
?>


/Foro/Themes/default/Noticias.template.php



<?php

function template_main()
{
global 
$context$settings$options$txt$scripturl;

echo 
'
<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td>'
theme_linktree(), '</td>
</tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td align="center" >mi pagina</td>
</tr><tr>
<td class="windowbg">'
;
 
echo 
'<table border="0" cellpadding="0" cellspacing="3" width="100%">
         <tr>
           <td width="100%" valign="top">
 aqui va mi contenido
</td></tr></table>'
;
echo 
'
</td>
</tr>
</table><br /><br />
'
;
}

?>



Como ven, todo parece estar bien, pero algo seguramente no estoy haciendo del todo bien, por eso no me funciona, mi Foro es:

www.argentinairc.net/Foro

Muchas gracias desde ya!! :)

Suki

Cambia esto:

'href' => $scripturl . '?action=Noticias',

por esto:

'href' => $scripturl . '?action=noticias',


Si definiste la acción como "noticias" esa es al misma palabra que tienes que utilizar, para el servidor las palabras "Noticias" y "noticias" son dos palabras distinas.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ArgentinaIRC

Muchas gracias por tu ayuda, tenías razón, había que cambiar eso.

PHP como muchos lenguajes, son Case Sensitive.

Saludos y gracias!

Advertisement: