logout o salir fuera del foro (en web)

Started by SICKBOY, October 24, 2005, 04:57:48 AM

Previous topic - Next topic

SICKBOY

hola,
bueno pues tengo una web la cual muestra las seccion dentro de un iframe, mismo donde tambien se muestra el foro.
La web tiene un menu ke tiene un enlace al login o ingresar del foro (se muestra la pagina de ingreso dentro del iframe) .... pero lo ke kiero hacer es crear un enlace en el menu para ke cuando hagan clic en el el usuario logeado cierra su sesion del foro y ke al momento de hacer eso se muestre el foro en el iframe ya como visitante

Este es el codigo del menu de la web (es un menu hecho con dhtml y javascript, creado con el programa DHTML Menu Builder)

menu.js
Quote
stm_bm(["menu390d",600,"","blank.gif",0,"","",0,0,19,19,1000,1,0,0,"","",83886139,0,1,0,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,3,2,7,7,100,"",-2,"",-2,91,0,0,"#999999","#0084C4","",3,4,2,"#FF6600"]);
stm_ai("p0i0",[0,"Menu/Navegaciòn","","",-1,-1,0,"#","_self","","","","",7,13,0,"","",0,0,0,1,1,"#cccccc",1,"#006699",0,"","",2,3,0,0,"#999999","#e5e5e5 #e5e5e5 #e5e5e5 #e5e5e5","#FFFFFF","#FFFFFF","bold 11px Verdana","bold 11px Verdana",0,0],150,0);
stm_aix("p0i1","p0i0",[0," Noticias","","",-1,-1,0,"../news/news.php","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",7,7,0,0,1,"#CCCCCC",0,"#FFCC00",0,"dhtml-back1.gif","",2,2,1,1,"#FFCC00","#FFFFFF","#333333","#000099","11px Verdana"],150,0);
stm_bp("p1",[1,2,-10,2,3,1,7,0,100,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=forward,enabled=0,Duration=0.40)",6,"progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0,motion=reverse,enabled=0,Duration=0.40)",7,70,0,0,"#999999","#006699","",3,4,1,"#FFCC00"]);
stm_aix("p1i0","p0i1",[0,"Ver","","",-1,-1,0,"../news/news.php","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0,0,0,1,"#CCCCCC",0,"#FFCC00",0,"dhtml-back1.gif","",2,3,1,1,"#006699"],108,0);
stm_aix("p1i1","p1i0",[0,"Administrador","","",-1,-1,0,"../news/index.php","_blank","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0,0,0,1,"#cccccc"],108,0);
stm_ep();
stm_aix("p0i2","p0i1",[0," Fotos","","",-1,-1,0,"fotos.htm","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_bpx("p2","p1",[]);
stm_aix("p2i0","p1i1",[0," Prepa","","",-1,-1,0,"prepa.htm","panel"],85,0);
stm_aix("p2i1","p1i1",[0," Otras 1","","",-1,-1,0,"otra1.htm","panel"],85,0);
stm_aix("p2i2","p1i1",[0," Otras 2","","",-1,-1,0,"otra2.htm","panel"],85,0);
stm_ep();
stm_aix("p0i3","p0i2",[0," Fiestas","","",-1,-1,0,"fiestas.htm","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_aix("p0i4","p0i3",[0," Musica","","",-1,-1,0,"musica.htm","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_ai("p0i5",[6,1,"#FFCC00","",-1,-1,0]);
stm_aix("p0i6","p0i3",[0," Chat","","",-1,-1,0,"chat.htm","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_aix("p0i7","p0i2",[0," Libro de visitas","","",-1,-1,0,"../libro/index.php","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_bpx("p3","p1",[]);
stm_aix("p3i0","p1i1",[0," Ver firmas","","",-1,-1,0,"../libro/index.php","panel"],106,0);
stm_aix("p3i1","p1i1",[0," Firmar libro","","",-1,-1,0,"../libro/index.php?accion=firmar","panel"],106,0);
stm_ep();
stm_aix("p0i8","p0i3",[0," Foros","","",-1,-1,0,"../foro/index.php","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_bpx("p4","p1",[]);
stm_aix("p4i0","p1i1",[0," Ir al foro","","",-1,-1,0,"../foro/index.php","panel"],106,0);
stm_aix("p4i1","p1i1",[0," Iniciar sesion","","",-1,-1,0,"../foro/index.php?action=login","panel"],106,0);
stm_aix("p4i2","p1i1",[0," Cerrar sesion","","",-1,-1,0,"ENLACE_PARA_CERRAR_SESION","panel"],106,0);
stm_aix("p4i3","p1i1",[0," Buscar","","",-1,-1,0,"../foro/index.php?action=search","panel"],106,0);
stm_aix("p4i4","p1i1",[0," Registro","","",-1,-1,0,"../foro/index.php?action=register","panel"],106,0);
stm_ep();
stm_aix("p0i9","p0i5",[]);
stm_aix("p0i10","p0i3",[0," Contacto","","",-1,-1,0,"contacto.htm","panel","","","dhtml-1.gif","dhtml-1move.gif",7,13,0,"","",0,0],150,0);
stm_ep();
stm_em();

y lo incluyo en la web pormedio de un

Quote<script type="text/javascript" language="JavaScript1.2" src="../../js/menu.js"></script>

...Observe el archivo ssi_examples.php y encontre como hacer con el codigo
Quote<?php ssi_logout(); ?>
y si logro hacer el enlace para ke se realize el logout... pero nose como ponerlo en el archivo menu.js para que se genere el enlace

Podria decirse ke lo unico ke necesito es como poner la direccion del logout correspondiente al usuario ke inicio sesion por ejmplo alguna variable que la contenga para incluirla en el archivo menu.js y despues al ver el menu en el archivo .php se sustituida por la url del logout

se puede? si se podra hacer esto

les agradeceria mucho su ayuda es muy importante y urgente:)
www.FormatoSkate.tk [nofollow] | Skateboard Chihuahua 2005

SICKBOY

bueno pues modifike la funcion ssi_logout en el SSI.php e la nombre como menu_logout y esta me da la url del logout

Quote
// logout link.
function menu_logout($redirect_to = '', $output_method = 'echo')
{
   global $context, $txt, $scripturl, $sc;

   if ($redirect_to != '')
      $_SESSION['logout_url'] = $redirect_to;

   // Guests can't log out.
   if ($context['user']['is_guest'])
      return false;

   echo '', $scripturl, '', $sc, '';
}

y la llamo mediante <?php menu_logout(); ?>
pero lo que no se ahora es como hacer para ke en el archivo menu.js se genere la url. osea que se sustituya el <?php menu_logout(); ?> por hrrp://mipagina.com/foro/index.phpd289732b301f2922818293fee0eaf2cc

alguien sabe como se hace esto?
www.FormatoSkate.tk [nofollow] | Skateboard Chihuahua 2005

[darksteel]




Luis "[darksteel]" Alvarado.
Spanish Support
¿Qué es el repair_settings?
No doy soporte por PM, publica tu duda en el foro y tendras respuestas mas rapidas.
My forum:
www.caamboard.com

SICKBOY

Hola... mmm si me serviria eso si el codigo del "menu" estuviera hecho en html o php. pero el problema es ke lo tego que poner en el archivo menu.js osea lo tengo ke poner forsosamente en el codigo javascript. extactamente aki

stm_aix("p4i0","p1i1",[0," Ir al foro","","",-1,-1,0,"../foro/index.php","panel"],106,0);
stm_aix("p4i1","p1i1",[0," Iniciar sesion","","",-1,-1,0,"../foro/index.php?action=login","panel"],106,0);

-----AKI DEBO DE PONER EL CODIGO PHP EN DONDE DICE ENLACE PARA CERRAR SESION-----
stm_aix("p4i2","p1i1",[0," Cerrar sesion","","",-1,-1,0,"ENLACE_PARA_CERRAR_SESION","panel"],106,0);

stm_aix("p4i3","p1i1",[0," Buscar","","",-1,-1,0,"../foro/index.php?action=search","panel"],106,0);
stm_aix("p4i4","p1i1",[0," Registro","","",-1,-1,0,"../foro/index.php?action=register","panel"],106,0);



...... bueno en contre una funcion en el SSI.php ke da el logout como enlace y lo mofike para ke escribiera solo la direccion sin ser un enlace..
...  bueno mira este es el codigo de la funcion del ssi.php ke modifike


// Show a logout URL.
function url_logout($redirect_to = '', $output_method = 'echo')
{
global $context, $txt, $scripturl, $sc;

if ($redirect_to != '')
$_SESSION['logout_url'] = $redirect_to;

// Guests can't log out.
if ($context['user']['is_guest'])
return false;

echo '', $scripturl, '', $sc, '';
}


cuando la llamo en un archivo php con <?php url_logout(); ?> si me aparece la url del logout , pero cuando pongo eso <?php url_logout(); ?> en el archivo menu.js ( lo pongo donde dice enlace para cerrar sesion) no se genera el enlace.

la prugnta es. como puedo hacer para ke esta funcion se pueda llamar correctamente desde un archivo javascript???

esto es posible???

www.FormatoSkate.tk [nofollow] | Skateboard Chihuahua 2005

Omar Bazavilvazo

no, no es posible, ya que hay que cargar sesiones, para empezar, para autentificar al usuario, y poder hacer un logout correcto




Personal Signature:
HablaJapones
http://hablajapones.org
http://hablajapones.org/tutoriales.php


NO me manden PM para soporte o dudas
...Leo los foros como todos...

Advertisement: