Raised This Month: $51 Target: $400
 12% 

Motd muestra una web en localhost?


  
 
 
Thread Tools Display Modes
Author Message
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 08-19-2011 , 01:41   Motd muestra una web en localhost?
#1

Bueno, tenía un servidor que guardaba datos y luego los mostraba en mi web y en un motd dentro del server.

Pero como la web no estaba junto con la maquina, lo que hice ahora fue colocar la web junto con la maquina, el problema es que no me funciona el motd.

coloco show_motd(id, "http://localhost/kz/top15.php", "Top 15") , pero el motd me abre una pantalla en blanco diciendo que no encontró la página y que debo revisar si estoy conectado a internet y/o otras soluciones típicas de cuando no encuentra la página.

Saludos.
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
p4rp4d30
Veteran Member
Join Date: Mar 2007
Old 08-19-2011 , 01:57   Re: Motd muestra una web en localhost?
#2

Quote:
Originally Posted by gladius View Post
Bueno, tenía un servidor que guardaba datos y luego los mostraba en mi web y en un motd dentro del server.

Pero como la web no estaba junto con la maquina, lo que hice ahora fue colocar la web junto con la maquina, el problema es que no me funciona el motd.

coloco show_motd(id, "http://localhost/kz/top15.php", "Top 15") , pero el motd me abre una pantalla en blanco diciendo que no encontró la página y que debo revisar si estoy conectado a internet y/o otras soluciones típicas de cuando no encuentra la página.

Saludos.
Primero proba en ves de localhost pone 127.0.0.1

Despues fijate si entrando a http://127.0.0.1/kz/top15.php desde el navegador entra... y por ultimo lo que podes hacer es

show_motd(id, "<frame src=http://127.0.0.1/kz/top15.php marginwidth=0 marginheight=0 scrolling=no width=100% height=100% >", "Top 15")

salu2
p4rp4d30 is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 08-19-2011 , 08:33   Re: Motd muestra una web en localhost?
#3

Eso no te va a funcionar, show_motd abre la pagina que le dices desde el cliente, entonces ese localhost es el localhost del cliente, no el que tienes en le servidor.
__________________
Javivi is offline
p4rp4d30
Veteran Member
Join Date: Mar 2007
Old 08-19-2011 , 13:47   Re: Motd muestra una web en localhost?
#4

Quote:
Originally Posted by Javivi View Post
Eso no te va a funcionar, show_motd abre la pagina que le dices desde el cliente, entonces ese localhost es el localhost del cliente, no el que tienes en le servidor.
No... Show_motd neceitas pasarle HTML y lo que le allas puesto en HTML... por eso le dije el uso de iframe... frame es 1 propiedad de HTML donde podes abrir una web dentro de la web... de esa manera le deberia funcionar...

salu2
p4rp4d30 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-19-2011 , 15:13   Re: Motd muestra una web en localhost?
#5

De ultima proba poniendo tuip/kz/kztop.php
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 08-19-2011 , 16:31   Re: Motd muestra una web en localhost?
#6

Quote:
Originally Posted by p4rp4d30 View Post
No... Show_motd neceitas pasarle HTML y lo que le allas puesto en HTML... por eso le dije el uso de iframe... frame es 1 propiedad de HTML donde podes abrir una web dentro de la web... de esa manera le deberia funcionar...

salu2
No... el problema es lo que yo dije, ese localhost que le indicas, no es el localhost del servidor, si no el del cliente, ya que el que renderiza el html es el cliente, no el servidor.
__________________
Javivi is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 08-19-2011 , 23:58   Re: Motd muestra una web en localhost?
#7

concuerdo con javi...
y porque no pones la web en algun puerto raro (si no queres usar el 80) y usas la ip para mostrar el motd
http://xxx.xxx.xxx.xxxxxx/kz/top15.php

pero pregunto si el server es el que tiene el top, no es mas facil tomar los valores directamente desde mysql, yo lo tengo hecho asi en mi ZP mira:

PHP Code:
public clcmd_top(id)
{
    new 
motd[3000], lenName[33], LevelResetAPs
    len 
0

    len 
+= formatex(motd[len], charsmax(motd) - len"<body><table cellspacing=1 class=^"table^">")
    
len += formatex(motd[len], charsmax(motd) - len"<tr><td width=^"230^">Personaje</td>\
    <td width=^"
120^">Ammopacks</td><td width=^"80^">Nivel</td><td width=^"60^">Resets</td></tr></table><table cellspacing=1 class=^"table^">")

    
g_query SQL_PrepareQuery(g_hTuple"SELECT `Nombre`, `Level`, `Resets`, `Ammopacks` FROM `pjs_zp` ORDER BY `Resets` DESC, `Ammopacks` DESC LIMIT 10")
    if (
SQL_Execute(g_query))
    {
        while(
SQL_MoreResults(g_query))
        {
            
SQL_ReadResult(g_query0Name32)
            
Level SQL_ReadResult(g_query1)
            
Reset SQL_ReadResult(g_query2)
            
APs SQL_ReadResult(g_query3)
            
            
len += formatex(motd[len], charsmax(motd) - len"<tr><td width=^"230^">%s</td><td width=^"120^">%d</td><td \
                                    width=^"
80^">%d</td><td width=^"60^">%d</td></tr>"NameAPsLevelReset)
                                    
            
SQL_NextRow(g_query)
        }
    }
    
    
len += formatex(motd[len], charsmax(motd) - len"</table></body>")
    
show_motd(idmotd"top"

La unica limitacion que tenes con esto (no se si pasara lo mismo mostrandolo con un iframe o directamente desde la web) es que tenes limitada la cantidad de caracteres que se pueden mostrar en el motd.
PD: Le borre el style...
__________________

Last edited by Neeeeeeeeeel.-; 08-20-2011 at 00:02.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
p4rp4d30
Veteran Member
Join Date: Mar 2007
Old 08-21-2011 , 23:43   Re: Motd muestra una web en localhost?
#8

Quote:
Originally Posted by Javivi View Post
No... el problema es lo que yo dije, ese localhost que le indicas, no es el localhost del servidor, si no el del cliente, ya que el que renderiza el html es el cliente, no el servidor.
No javi el problema es como yo dije lee el wiki y vas a ver que el message que se le pasa en

show_motd(index, MESSAGE)

Es 1 texto en HTML

Code:
player is a player index from 1 to 32. 

message can either be a filename or a string formatted message. With VGUI2, the message can be HTML formatted. 

You can supply an optional title bar for the window. If not supplied, it will default to the server name. 

The length of the message should not be more than around 1,200 characters - going over this limit could potentially crash the client.
ocea que le pasas una url no lo va a tomar porue el message tiene que ir en formato HTML no es un navegador el MOTD como para pasarle 1 URL y que te abra el sitio.

Por eso le dije que ponga esto

PHP Code:
show_motd(id"<frame src=http://127.0.0.1/kz/top15.php marginwidth=0 marginheight=0 scrolling=no width=100% height=100% >""Top 15"
Porque de esta manera va a generar en el cliente un HTML con la etiqueta frame donde dentro de 1 frame si podes abrir 1 URL en el cliente.
p4rp4d30 is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 08-22-2011 , 07:09   Re: Motd muestra una web en localhost?
#9

Bueno, dejemos que pruebe y nos diga el si funciona o no.
__________________
Javivi is offline
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-22-2011 , 15:02   Re: Motd muestra una web en localhost?
#10

PHP Code:
new const link2[] = "http://www.zombie-evil.com.ar/server/top20.php"

public plugin_init()
{
    
register_clcmd("say /top15""top20")
    
register_clcmd("say /top20""top20")
}

public 
top20(id)
    
show_motd(idlink2"top 20"
Es lo que uso yo.
__________________
Destro- is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode