Mini Avatar di Chat
Mini Avatar di Chat postato il 03/07/2010 21:16:36 nel forum programmazione, open source e hosting e modificato da gdrmaniac91 il 03/07/2010 21:17:48
Vi spiego immediatamente,ho notato che in alcune land,nelle chat,vengono rappresentati gli Avatar dei PG,sono immagini di 50x50 dimensioni,e i Player li possono cambiare modificando la scheda,quindi ho pensato,non sara poi diverso da come la bacheca in Extreme richiami l'immagine dell'avatar principale del PG,solo che sbagliavo,infatti,ho creato il campo nella scheda3 del PG per inserire il link del mini avatar,ho creato il campo Avatarchat nel DB che è come quello URLImg,poi sono andato in refresh.php e ho messo il link per richiamare $rsAvatarchat ma nulla,mi scompare propio il testo,quindi ci deve essere un errore,qualcuno che mi puo aiutare su questa cosa????Quello che serve a me è che i Player possano scegliere un mini avatar di 50x50 dimensioni da visionare in chat ad ogni loro azioni,affianco dei simboli di Razza,e Gilda!
Premetto utilizzo il GDRCD extreme!
Pagine → 1
04/07/2010 10:12:58
hai chiuso il tag img quando richiami l'immagine? hai controllato che nel DB ci vada un link ben fatto? così senza codice sott'occhio è difficile risponderti!
04/07/2010 15:10:31 e modificato da gdrmaniac91 il 04/07/2010 15:19:15
Ho provato ulteriormente a modificarla,ponendo la query in questo modo!
<?
$MySql = "SELECT URLImg FROM Personaggio WHERE Nome = '$Login'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$URLImg = $rs['URLImg'].'';
$rs->close;
?>
lasciando che trovi l'immagine nella variabile URLImg,ma ancora niente,eppure il link li cè per forza,anche nel DB lo visiona,è quello dell'avatar normale!
ma niente!O_OChe diamine eeeee..!>.<ne sto uscendo pazzo!XDHelp mee genteee!!
04/07/2010 16:24:38 e modificato da gdrmaniac91 il 04/07/2010 16:26:33
<? session_start();
include ('inc/parametri.inc.php');
include ('inc/controllo.php');
include ('inc/open2.php');
include ('inc/replace.php');
$Stanza=$_SESSION['Stanza'];
$op=$_REQUIRE['op'];
$Login=$_SESSION['Login'];
$LastTime=$_SESSION['LastTime'];
function Tempo($tim) {
return(strftime("%H:%M", strtotime($tim)));
}
If (strtoupper($op) == 'ESCI') {header('Location: logout.php', false);};
include('inc/controlloesilio.php');
?>
<HTML><HEAD><link rel="stylesheet" href="mainchat.css" TYPE="text/css"><meta HTTP-EQUIV="Refresh" CONTENT="8"></HEAD>
<body style="background-image: url(img/refresh.jpg);" >
<!---------------------Questo sotto è la Query-----------------!>
<?
$MySql = "SELECT URLImg FROM Personaggio WHERE Nome = '".$Login."'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$URLImg = $rs['URLImg'].'';
$rs->close;
?>
<?
$MySql = "SELECT * FROM Mappa WHERE ID = '".pars($Stanza)."'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$Condizione = $rs['Condizione'].'';
$Invitati = $rs['Invitati'].'';
$rs->close;
if ($Condizione != '') {
$Condizione = str_replace('G', 'IDGilda', $Condizione);
$pos = strpos($Condizione, "$Numero");
if ($pos === false) {
$MySql = "SELECT * FROM Presenti WHERE Nome = '".pars($Login)."' AND ".$Condizione;
} else {
$Condizione = str_replace("$Numero", $Stanza, $Condizione);
$Condizione = str_replace("$Date", "'".strftime("%Y-%m-%d %H:%M:%S")."'", $Condizione);
$MySql = "SELECT * FROM Presenti INNER JOIN Albergo ON Nome = Proprietario AND ".$Condizione." WHERE Nome = '".pars($Login)."'";
}
$Result = mysql_query($MySql);
if (!($rs = mysql_fetch_array($Result))) {
$pos = strpos(strtoupper($Invitati), "!".strtoupper($Login)."!,");
if (($pos === false)&&($_SESSION['Super_S']!=1)) {
exit();
}
}
$rs->close;
}
$MySql = "SELECT * FROM Chat WHERE Stanza = '".pars($Stanza)."' AND ID > ".$LastTime." AND DATE_ADD(Ora, INTERVAL 10 MINUTE) >= NOW()";
$MySql .= " ORDER BY ID DESC LIMIT 0, 20";
$Result = mysql_query($MySql);
echo "<!--$MySql-->";
$Counter = 0;
$newchat = '';
if ($LastTime == 0) {
$Testata .= "<HEAD><link rel="stylesheet" href="mainchat.css" TYPE="text/css"></HEAD><BODY style='background-image: url(img/refresh.jpg); '>";
}
while ($rs = mysql_fetch_array($Result)) {
if ($rs['ID'] > $LastTime) {
$_SESSION['LastTime'] = $rs['ID'];
$LastTime = $_SESSION['LastTime'];
};
#{
switch ($rs['Tipo']) {
case 'M': #Master scritte nere
$rs['Testo']='<span class="Master"> '.$rs['Testo'].'<span>';
$n = '<center><br><TABLE class="Mast"><TR><TD CLASS=Mas align=left> '.$rs['Testo'].'</TD></TR></TABLE><br><br></center>';
break;
case 'C': #Master corporazione scritte blu
$rs['Testo']='<span class="MasterC"> '.$rs['Testo'].'<span>';
$n = '<center><br><TABLE class="Mast"><TR><TD CLASS=Mas align=left> '.$rs['Testo'].'</TD></TR></TABLE><br><br></center>';
break;
case 'H': #Master HTML puro
$n = "<center><img src='".$rs['Testo']."' border=0><br><br></center>";
break;
case 'W': #Master HTML puro
$n = "<EMBED src='".$rs['Testo']."' autostart= true loop= false volume= 100 height= 0 width= 0><br><br>'";
break;
case 'A': #Azione Pubblica
$rs['Testo']='<span class="Azione"> '.$rs['Testo'].'<span>';
# if ($rs['Mittente'] == $Login) {
$n = "<span CLASS="Micro">".Tempo($rs['Ora'])." </span><IMG SRC="img/testamini".strtolower($rs['Sesso']).".gif" width="8" height="8" border="0" Alt="Messaggio privato" onclick="Javascript:parent.chatinput.document.invio.Messaggio.value="@".$rs['Mittente']."@";parent.chatinput.document.invio.Messaggio.focus()"><IMG SRC="img/razze/".$rs['ImgRazza']."" width="8" height="8" border="0"><span class="Nome"> ".htmlspecialchars($rs['Mittente'])."</span>".$rs['Testo']."</span><BR><br>";
#$n = "<B><FONT FACE=Verdana SIZE=1><FONT COLOR='#800000'>".$rs['Mittente']."</FONT> <FONT COLOR='#FF1111'>".$rs['Testo']."</FONT></FONT></B><BR><br>";
# } else {
# $n = "<B><FONT FACE=Verdana SIZE=1 COLOR='#FF1111'>".$rs['Mittente']." ".$rs['Testo']."</FONT></B><BR><br>";
# }
break;
case 'X': #Sistema
$rs['Testo']='<span class=".Master"> '.$rs['Testo'].'</span>';
$n = $rs['Testo'].'<BR><br>';
break;
case 'Y': #Azioni speciali: dadi ecc.
$rs['Testo']='<span class="Y"> '.$rs['Testo'].'<span>';
$n = $rs['Testo'].'<BR><br>';
break;
case 'S': #Sussurro
If (strtoupper($Login) == strtoupper($rs['Destinatario'])) {
$n = "<TABLE WIDTH='100%'><TR CLASS="SussDest"><TD align=left><b>".$rs['Mittente'].' ti sussurra: </b><i> '.$rs['Testo'].'</i></TD></TR></TABLE><br>';
};
If (strtoupper($Login) == strtoupper($rs['Mittente'])) {
$n = "<TABLE WIDTH='100%'><TR CLASS="SussMitt"><TD align=left><b>sussurri a ".$rs['Destinatario'].": </b><i> ".$rs['Testo']."</i></TD></TR></TABLE><br>";
};
If ( (($_SESSION['Admin_S']==1) || ($_SESSION['Super_S']==1)) && (strtoupper($Login) != strtoupper($rs['Mittente'])) && (strtoupper($Login) != strtoupper($rs['Destinatario'])) ){
$n = "<TABLE WIDTH='100%'><TR CLASS="SussSpia"><TD align=left style:'color: red;'><b>".$rs['Mittente']." sussurra a ".$rs['Destinatario'].": </b><i> ".$rs['Testo']."</i></TD></TR></TABLE><br>";
};
break;
<!------Qui sotto è il case--------!>
case 'P': #Messaggio Pubblico
$chat = $rs["Testo"];
$chat = replace_action('< >', 'color:#840505; font-weight:bold;', $chat);
$chat = replace_action('[ ]', 'color:#B6BA1F; font-weight:bold;', $chat);
$rs['Testo']='<span class="Testo"> dice: '.$chat.'</span>';
$n = '<table><tr><td><FONT CLASS=Testo><FONT CLASS=Micro>'.Tempo($rs['Ora']).'</FONT> <font color=#840505 face="Arial" size="1">'.htmlspecialchars($rs['Mittente']).'</font> <A href='scheda.php?pg='.urlencode($rs['Mittente']).'' target=palestra Title="'.pars($rs['DescGilda']).' - '.pars($rs['DescRazza']).'"></a></td><td> </td></tr><tr><td> <img src="<?= $rs['URLImg'] ?>" border=0 height=50 width=50></td><td><FONT CLASS=Testo>'.$chat.'</FONT></td></tr><tr><td><IMG SRC='img/testamini'.strtolower($rs['Sesso']).'.gif' width=20 height=20 border=0 Alt="Messaggio privato" onclick="Javascript:parent.chatinput.document.invio.Messaggio.value='@'.$rs['Mittente'].'@';parent.chatinput.document.invio.Messaggio.focus()"><IMG SRC='img/stemmi/'.$rs['ImgGilda']."' border=0 align=bottom title="".pars($rs['DescGilda'])." - ".pars($rs['DescRazza']).'"><IMG SRC='img/razze/'.$rs['ImgRazza']."' border=0 align=bottom title="".pars($rs['DescRazza'])." - ".pars($rs['DescRazza']).'"></td></tr></table><br>';
break;
};
$newchat = $n.$newchat;
$n = '';
#};
}
$newchat = $Testata.$newchat;
$newchat = str_replace("", "", $newchat);
$newchat = str_replace("'", "'", $newchat);
?>
<script>
parent.chattesto.document.write('<?= $newchat ?>');
var h = 0;
try {h = parent.chattesto.document.body.offsetHeight + 1000;} catch(e) {h = 0};
parent.chattesto.scroll (0, h);
</script>
</body></html>
Cosi si dovrebbe capire meglio dove si trova l'inghippo dell'avatar in chat!>.<
04/07/2010 19:31:55
Nessuno sa come risolvere il problema gente????>.<
Discussione seguita da
Pagine → 1
Rispondi alla Discussione Segui Discussione Inoltra Discussione Forum Programmazione, Open Source e Hosting Elenco Forum
Articoli, Interviste e altre Risorse!
Tiles Survive ↗
The Coven ↗
Cafuné ↗