News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Agregar botones al menu en 2.0RC3, RC4

Started by mirahalo, February 16, 2009, 11:02:18 AM

Previous topic - Next topic

sarigar

Hola, Buenas:

Estoy añadiendo un nuevo botón para enviar emails desde el menú principal y cuando pulso sobre el no se me activa, es decir queda como que inicio es el botón activo. Pego mi código a ver si veis algo que este mal.

'contact' => array(
'title' => $txt['contact'],
'href' => $scripturl . '?action=emailuser;sa=email;msg=2048',
'show' => true,
'sub_buttons' => array(
),
),


La definición de la string:

$txt['contact'] = 'Contactar';

Y este es mi current_action:

if (isset($context['menu_buttons'][$context['current_action']]))
$current_action = $context['current_action'];
elseif ($context['current_action'] == 'search2')
$current_action = 'search';
elseif ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
elseif(empty($context['disable_sp']) && ((isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies', 'recent', 'stats', 'who'))) && in_array($modSettings['sp_portal_mode'], array(1, 3))))
$current_action = 'forum';
elseif ($context['current_action'] == 'contact')
$current_action = 'contact';
elseif ($context['current_action'] == 'register2')
$current_action = 'register';
elseif ($context['current_action'] == 'login2' || ($user_info['is_guest'] && $context['current_action'] == 'reminder'))
$current_action = 'login';
elseif ($context['current_action'] == 'groups' && $context['allow_moderation_center'])
$current_action = 'moderate';


No entiendo por que no se me activa el botón, podéis ayudarme.

He borrado todas las caches imaginables y demás.

Gracias por adelantado.

Un saludo.

delivery


Ibancius

No encuentro el archivo index.tuidioma.php (en nuestro caso español)

Suki

index.spanish_es.php

o

index.spanish_latin.php

o

index.spanish_latin-utf8.php

o

index.spanish_es-utf8.php
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 12:19:53 PM
index.spanish_es.php

o

index.spanish_latin.php

o

index.spanish_latin-utf8.php

o

index.spanish_es-utf8.php
Es muy raro, pero no tengo ninguno de esos archivos en mi ordenador :S

Suki

Themes/default/languages/


los archivos NO están en tu ordenador, están en el servidor donde está alojado  tu foro, usa tu programa de FTP.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 12:34:22 PM
Themes/default/languages/


los archivos NO están en tu ordenador, están en el servidor donde está alojado  tu foro, usa tu programa de FTP.
Yaya, pero esque como tengo la carpeta en el pc por si acaso... bueno, que me he bajado el archivo de la página de SMF en español, y he modificado el archivo tal como dice, y lo he subido, y el menú sigue igual...

Suki

que idioma bajaste...?


que archivo modificaste?


estás seguro de que el idioma es el mismo que tienes en el servidor?


impia el cache de tu foro y limpia el cache de tu navegador.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 12:46:29 PM
que idioma bajaste...?


que archivo modificaste?


estás seguro de que el idioma es el mismo que tienes en el servidor?


impia el cache de tu foro y limpia el cache de tu navegador.
Me descargué el español (archivo es index.spanish_es.php). He pensado y he mirado el código fuente del foro, y el problema es que no sale la palabra Chat, porqué el enlace sí que está:


<li id="button_home">
<a class="active firstlevel" href="http://nadaquehacer.es/foro/index.php">
<span class="last firstlevel">Inicio</span>
</a>
</li>
<li id="button_chat">
<a class="firstlevel" href="http://nadaquehacer.es/foro/index.php?action=chat">
<span class="firstlevel"></span>
</a>


Si ves donde pone <span class="firstlevel"></span> tendría que estar así <span class="firstlevel">Chat</span>

Suki

eso es porque la palabra esta definida en un string de texto dentor de tu archivo index.tuidioma:

$txt['some_chat_word'] = 'Chat';


si tu NO tienes ese string en tu archivo de idioma entonces NO va a salir la palabra...   el tutorial lo explica con claridad...
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 12:58:27 PM
eso es porque la palabra esta definida en un string de texto dentor de tu archivo index.tuidioma:

$txt['some_chat_word'] = 'Chat';


si tu NO tienes ese string en tu archivo de idioma entonces NO va a salir la palabra...   el tutorial lo explica con claridad...
... Haber, te paso una parte de lo que tengo puesto en el Subs.php

'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],

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

Suki

Como dice el tutorial....

abre tu archivo Index.tuidioma.php

al final antes del ?>

pon esto:

$txt['Chat'] = 'Chat';


sube tu archivo y limpia el cache del foro.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 01:07:58 PM
Como dice el tutorial....

abre tu archivo Index.tuidioma.php

al final antes del ?>

pon esto:

$txt['Chat'] = 'Chat';


sube tu archivo y limpia el cache del foro.
Perfecto, ya me funciona! :D
Una pregunta, para hacer que el botón apareza solo si estás registrado? (es decir, que no le salga a los visitantes)

Suki

'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => true,
             'sub_buttons' => array(
        ),

cambialo por

'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => $context['user']['is_logged'],
             'sub_buttons' => array(
        ),
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Ibancius

Quote from: Suki on January 05, 2012, 01:22:59 PM
'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => true,
             'sub_buttons' => array(
        ),

cambialo por

'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => $context['user']['is_logged'],
             'sub_buttons' => array(
        ),
¡Muchas gracias!:)

-Rock Lee-

Muy bueno mirahalo me sirvió perfectamente solo tengo una duda como se debe hacer para que al hacer click esta manda a la pagina pero en otra pestaña nueva para que no la saque de la pagina principal osea en la que esta? por favor alguien me puede decir que debe agregar? iría a subs.php y index.mi_idioma.php?

Desde ya muchas gracias!

Un saludo!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

vicram10

en el subs.php prueba agregando asi


'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => true,
             'target' => '_blank',
             'sub_buttons' => array(
        ),


es solo un ejemplo.. lo unico que se agrego fue

'target' => '_blank',

prueba y dinos luego si te funciono

-Rock Lee-

Quote from: vicram10 on January 23, 2012, 10:33:44 AM
en el subs.php prueba agregando asi


'chat' => array(
             'title' => $txt['Chat'],
             'href' => '?action=chat',
             'show' => true,
             'target' => '_blank',
             'sub_buttons' => array(
        ),


es solo un ejemplo.. lo unico que se agrego fue

'target' => '_blank',

prueba y dinos luego si te funciono

Me funciono perfecto muchas gracias vicram10 y perdona las molestias (lo habia leído en post anterior pero no me di cuenta era para eso  :-[) esto seguro va a marcadores ;)

Un saludo!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

vicram10


Advertisement: