Dubbio Schede
Dubbio Schede postato il 14/03/2010 13:55:54 nel forum programmazione, open source e hosting
Ciao ragazzi!
Sto avendo un problemino ultimamente nel programmare un gdr, sembrerà pure una cavolata ma non riesco a risolverlo! Allora, praticamente quando uno sta ruolando appaiono tutti gli stemmi (Sesso, Provenienza, Grado) ma c'è uno (Associazione) che non viene visualizzato:
Allora io vado nella scheda e guardo se il pg ha un'associazione o meno, e appare correttamente l'immagine:
Però non si vede, perciò sulle proprietà dell'immagine che non viene visualizzata (dalla chat):
Ed il link è giusto, ho controllato diecimila volte ma non riesco a far visualizzare l'immagine..
Chi sa come devo fare?
Pagine → 1
14/03/2010 14:37:25
Sarò ignorante, ma il link non mi sembra giusto... punta ad una cartella, non ad una immagine.
14/03/2010 19:37:24
Deve puntare ad una cartella, perchè non hanno tutti lo stesso mestiere! E' solo che poi lo script dovrebbe rielaborare il tutto e mettere l'immagine dovuta
14/03/2010 23:44:04
Cosi ad occhio visto che le due immagini provengono da due pagine diverse e quindi da due recuperi diversi dei dati. Sei sicuro di recuperare l'url dell'immagine dell'associazione con una left joinnella query che recupera i dati della chat da visualizzare ?
15/03/2010 17:24:18
<? session_start();
include ('inc/parametri.inc.php');
include ('inc/open2.php');
/*If (($HTTP_GET_VARS["Login"] != "") or ($HTTP_POST_VARS["Login"] != "")) {$Login = "";};*/
$Login=$_SESSION['Login'];
$pg=$_REQUEST['pg'];
$Master=$_SESSION['Master'];
$Modifica=$_POST['Modifica'];
//$pg=$_POST['PG'];
$cognome=$_POST['cognome'];
$gg=$_POST['gg'];
$mm=$_POST['mm'];
$aaaa=$_POST['aaaa'];
$pass=$_POST['pass'];
$PF=$_POST['PF'];
$urlimg=$_POST['urlimg'];
$midi=$_POST['midi'];
$descrizione =$_POST['descrizione'];
$affetti = $_POST['affetti'];
$capacita = $_POST['capacita'];
$pg = trim(urldecode($pg));
//$pg = "Re";
$Modifica = trim($Modifica);
$upd = ((strtoupper($pg) == strtoupper($Login)) and (trim($pg) != "") and (strtoupper($Modifica) == strtoupper($pg)));
if (($_SESSION['Admin_S']=='1') AND ($par_Flag_AdminExt=='1')) {
$_SESSION['AdminExt_S'] = $_GET['AdminExt'];
}
function BottoneGestione($Gst_Titolo, $Gst_Sigla, $Gst_Link) {
return '<tr ><td align=left Title="'.htmlspecialchars($Gst_Titolo).'"><a href="'.$Gst_Link.'"><img border=0 src="img/base.gif">'.htmlspecialchars($Gst_Titolo).'</a></font></td></tr>';
}
function formattadata($tim)
{
return strftime("%d/%m/%Y", strtotime($tim));
}
function barra($valore, $maxvalore)
{
$colore = "5A7150";
$colore1 = "646763";
$bar = '<table cellpadding=0 cellspacing=0 border=0 width="'.$valore.'" height=10>';
$bar .= '<tr><td align=right bgcolor="'.$colore.'" width=';
if ($valore > 100) {
$bar .= '100><font color=black>+</font>';
}
else
{
$bar .= $valore.'><img src='img/spacer.gif' width='.$valore.' height=1>';
};
$bar .= "</td>";
if (($maxvalore - $valore) > 0) {
$bar .= '<td align=right bgcolor="'.$colore1.'" width=';
$bar .= ($maxvalore - $valore).'><img src='img/spacer.gif' width='.($maxvalore-$valore).' height=1>';
$bar .= "</td>";
};
$bar .= "</tr>";
$bar .= "</table>
";
return $bar;
};
#----- pulisci avatar -----
If (($_SESSION['Esilio_S'] == 1) && ($_POST['Pulisci'] != '')) {
$Msg = "<b>L'avatar di ".htmlspecialchars($pg)." è stato pulito!</b>";
$MySql = "UPDATE Personaggio SET URLImg = 'img/spacer.gif', Descrizione='Scheda pulita', ICQ='', Affetti='', Capacita='' WHERE Nome = '$pg'";
mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '".addslashes($Msg)."', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
echo $MySql;
$EsilioP = "";
echo "<font color=red>$Msg</font>";
}
#----- inizio prigione ed esilio -----
$EsilioP = "";
If ((($_SESSION['Super_S'] == 1)||($_SESSION['Admin_S'] == 1)) && ($_POST['Esilia'] != '')) {
$Motivo = $_POST['Motivo_Esilio'];
$EsilioP = "'2037-12-31 00:00:00'";
if ($_POST['IP'] == 'on') {
$Msg = "<b>".htmlspecialchars($pg)." è stato esiliato + IP escluso!</b>";
$MySql = "SELECT * FROM LogEntrate WHERE Nome = '$pg' ORDER BY DataEvento DESC";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$IPEscluso = $rs["IP"];
$rs->close;
$MySql = "INSERT INTO BlackList (IP, Nota, Ora) VALUES ";
$MySql .= "('$IPEscluso', '$pg (escluso da $Login)', Now())";
$Result = mysql_query($MySql);
} else {
$Msg = "<b>".htmlspecialchars($pg)." è stato esiliato!</b>";
}
if ($_POST['Grazia'] == 'on') {
$EsilioP = "'2000-01-01 00:00:00'";
$Msg = "<b>".htmlspecialchars($pg)." è stato graziato!</b>";
}
}
If ((($_SESSION['Super_S'] == 1)||($_SESSION['Admin_S'] == 1)||($_SESSION['Master'] != 0)) && ($_POST['Arresta'] != '')) {
$Motivo = $_POST['Motivo_Arresto'];
$MySql = "SELECT Esilio From Personaggio WHERE Nome = '$pg'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
if ($rs["Esilio"] == '2037-12-31 00:00:00') {
$Msg = "<b>".htmlspecialchars($pg)." è esiliato e non può essere imprigionato!</b>";
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '$Msg', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
$Result = mysql_query($MySql);
$EsilioP = "";
echo "<font color=red>$msg</font>";
} else {
$EsilioP = "DATE_ADD(NOW(), INTERVAL '$gg' DAY)";
$Msg = "<b>".htmlspecialchars($pg)." è stato imprigionato per $gg giorni!</b>";
}
}
if ($EsilioP != "") {
$MySql = "UPDATE Personaggio SET Esilio = $EsilioP";
$MySql .= ", DataEventoEsilio = NOW()";
$MySql .= ", Motivo = '$Motivo'";
$MySql .= ", AutoreEsilio = '$Login'";
$MySql .= " WHERE Nome = '$pg'";
$Result = mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('$Stanza', 'System Op', '$Login', NOW(), '$Msg', '$Sesso_S', '$ImgGilda_S', '$DescGilda_S', '$ImgRazza_S', '$DescRazza_S', 'S')";
$Result = mysql_query($MySql);
echo "<font color=red>$Msg</font>";
}
If ( (trim($pass) != "") AND ( (strtoupper($pg) == strtoupper($Login))||($_SESSION['Master']==1)||($_SESSION['Admin']==1)||($_SESSION['Super']==1) ) )
{
echo('SCHEDA MODIFICATA<hr size=1 color=gold>');
$pass = pars($pass);
$cognome = substr($cognome, 0, 255);
$cognome = trim($cognome);
$descrizione = substr($descrizione, 0, 10000);
$descrizione = trim($descrizione);
$affetti = substr($affetti, 0, 10000);
$affetti = trim($affetti);
$capacita = substr($capacita, 0, 255);
$capacita = trim($capacita);
$email = trim($email);
$icq = trim($icq);
$urlimg = trim($urlimg);
$urlimg = substr($urlimg, 0, 255);
$midi = trim($midi);
#$urlimg = pars($urlimg);
$DataNascita = '';
$gg = 0 + $gg;
$mm = 0 + $mm;
$aaaa = 0 + $aaaa;
$PF= 0 + $PF;
if (($rs["DataNascita"] == "") || ($rs["DataNascita"] == "0000-00-00")) {
if (($gg>0) && ($mm>0) && ($aaaa>0)) {
if ($gg < 10) {
$gg = "0".$gg;
}
if ($gg > 31) {
$gg = 0;
}
if ($mm < 10) {
$mm = "0".$mm;
}
if ($mm > 12) {
$mm = 0;
}
if ($aaaa < 100) {
$aaaa = "19".$aaaa;
}
if (($aaaa > 2000) || ($aaaa < 1900)) {
$aaaa = 0;
}
$DataNascita = "".$aaaa."-".$mm."-".$gg;
}
}
if ($icq == "") {$icq = "nessuno";};
if ($descrizione == "") {$descrizione = "niente";};
if ($affetti == "") {$affetti = "niente";};
if ($capacita == "") {$capacita = "niente";};
if ($email == "") {$email = "nessuna";};
if ($cognome == "-") {$cognome = "-";};
$MySql = "UPDATE Personaggio";
$MySql .= " SET Pass = '".$pass."',";
$MySql .= " Descrizione = '".$descrizione."',";
$MySql .= " Affetti = '".$affetti."',";
$MySql .= " Capacita = '".$capacita."',";
$MySql .= " ICQ = '".$icq."',";
//$MySql .= " MaxMente = '".$PF."',";
$MySql .= " Cognome = '".$cognome."',";
$MySql .= " Midi = '".$midi."',";
$MySql .= " UrlImg = '".$urlimg."'";
If ($DataNascita != "") {
$MySql .= ", DataNascita = '".$DataNascita."'";
}
$MySql .= " WHERE Nome = '".$pg."'";
$Result = mysql_query($MySql);
# mysql_fetch_array($Result);
}
If ((trim($capacita) != "")&&($Master==1))
{
//echo('<font color=gold>SCHEDA MODIFICATA</font><hr size=1 color=gold>');
# $pass = pars($pass);
$capacita = substr($capacita, 0, 255);
$capacita = trim($capacita);
$PF= 0+$PF;
//if ($capacita == "") {$capacita = "Nella norma";};
$MySql = "UPDATE Personaggio";
$MySql .= " SET Capacita = '".$capacita."',";
$MySql .= " MaxMente = '".$PF."'";
$MySql .= " WHERE Nome = '".$pg."'";
$Result = mysql_query($MySql);
# mysql_fetch_array($Result);
}
$MySql = "SELECT Personaggio.*, Razza.Razza, Razza.URLImg AS URLImgRazza, Elemento.Elemento, Elemento.URLImg AS URLImgElemento, Elemento2.Elemento2, Elemento2.URLImg AS URLImgElemento2, Grado.Grado, Grado.URLImg AS URLImgGrado, Gilda.Gilda, Gilda.URLImg AS URLImgGilda, Associazioni.Associazioni, Associazioni.URLImg AS URLImgAssociazioni
FROM Personaggio
LEFT JOIN Razza
ON Personaggio.IDRazza = Razza.IDRazza
LEFT JOIN Elemento
ON Personaggio.IDElemento = Elemento.IDElemento
LEFT JOIN Elemento2
ON Personaggio.IDElemento2 = Elemento2.IDElemento2
LEFT JOIN Grado
ON Personaggio.IDGrado = Grado.IDGrado
LEFT JOIN Gilda
ON Personaggio.IDGilda = Gilda.IDGilda
LEFT JOIN Associazioni
ON Personaggio.IDAssociazioni = Associazioni.IDAssociazioni
WHERE Nome = '$pg'";
$result = mysql_query($MySql);
#echo $MySql;
$rs = mysql_fetch_array($result);
echo "<br>";
if ((trim($pg) == "") or !($rs)) {
$rs->close;
mysql_close;
//echo("<script><!--
history.back();
//-->
</script>");
echo "SON QUI";
exit();
};
#########################################
# Il Recordset non è vuoto #
#########################################
$UrlImg = trim($rs["URLImg"]."");
If ($UrlImg == "")
$UrlImg = "img/sagoma".$rs["Sesso"].".gif";
$UrlImgRazza = trim($rs["URLImgRazza"]."");
If ($UrlImgRazza == "")
$UrlImgRazza = "spacer.gif";
$UrlImgElemento = trim($rs["URLImgElemento"]."");
If ($UrlImgElemento == "")
$UrlImgElemento = "spacer.gif";
$UrlImgElemento2 = trim($rs["URLImgElemento2"]."");
If ($UrlImgElemento2 == "")
$UrlImgElemento2 = "spacer.gif";
$UrlImgGrado = trim($rs["URLImgGrado"]."");
If ($UrlImgGrado == "")
$UrlImgGrado = "D.png";
$UrlImgGilda = trim($rs["URLImgGilda"]."");
If ($UrlImgGilda == "")
$UrlImgGilda = "cittadino.png";
$UrlImgAssociazioni = trim($rs["URLImgAssociazioni"]."");
If ($UrlImgAssociazioni == "")
$UrlImgAssociazioni = "cittadino.png";
$Gilda = trim($rs["Gilda"]."");
if ($Gilda == "") {
if (strtolower($rs["Sesso"]) == "f") {
$Gilda = "cittadina";
} else {
$Gilda = "cittadino";
}
}
$DataUltimaAssociazioni = $rs['DataUltimaAssociazioni'];
$Associazioni = trim($rs["Associazioni"]."");
if ($Associazioni == "") {
if (strtolower($rs["Sesso"]) == "f") {
$Associazioni = "Senza Associazione";
} else {
$Associazioni = "Senza Associazione";
}
}
$DataUltimaAssociazioni = $rs['DataUltimaAssociazioni'];
include ('inc/header.html.inc.php');
$sesso="femmina";
if($rs["Sesso"]=='m') {$sesso="maschio";}
?>
<title>Scheda <?= $pg ?></title>
</head>
<body color: red>
<center>
<table align=center background=Basescheda.jpg border=0 width=600>
<tr><td><p align=center><a href="Tecniche.php?pg=<?= urlencode($pg) ?>"><img border=0 src=Tecnichescheda.png></a></td><td><p align=center><a href="scheda2.php?pg=<?= urlencode($pg) ?>"><img border=0 src=Oggettischeda.png></a></p></td>
</tr>
</table>
<table background=Basescheda.jpg border=0 width=600>
<tr><td height=41 colspan=3></td></tr>
<tr><td>
<embed src="<?= $rs['Midi'] ?>" width=0 height=0 autostart=true loop=true>
<table bgcolor=black border=0 cellspacing=2 cellpadding=0 width=300>
<tr bgcolor=black>
<?
echo '<td background=sfondobase.png align=center><img src="img/testamini'.$rs['Sesso'].'.gif" border=0><font class=Titolo> '.htmlspecialchars($rs["Nome"]).'   '.htmlspecialchars($rs["Cognome"]).'</font>';
echo '';
?></td>
</tr><tr><td background=sfondobase.png align=center valign=top><img width=200 height=* src="<?= $UrlImg ?>" border="2" bordercolor="brown"></td></tr>
<tr ><td background=sfondobase.png align=center> <b>Iscrizione: <?=formattadata($rs["DataIscrizione"])?> Visto il: <?=formattadata($_SESSION['UltimoIngresso'])?></b></td></tr>
<tr><td background=sfondobase.png valign=top align=center><b><a href="scheda8.php?pg=<?=urlencode($pg)?>">Storia</b></a></td></tr>
<tr><td background=sfondobase.png valign=top align=center><b><a href="nuovomessaggio.php?Dest= <?=urlencode($rs["Nome"])?>" target="palestra">Scrivi <?=$par_MessaggiName?> a <?=urlencode($rs["Nome"])?></a></b></td></tr>
</table>
</td><td>
<td width=8></td>
<td valign=top>
<table bgcolor=black border=0 bordercolor=black cellspacing=2 cellpadding=1 width=250>
<tr ><td background=sfondobase.png width=60><b>Villaggio</b></td><td bgcolor=orange>
<? if(intval($rs['IDRazza'])%1000 != 0){
echo '<a href="razza.php?ID='.intval($rs['IDRazza']/10)*10 .'">';
} ?>
<img src="img/razze/<?=$UrlImgRazza?>" border=0 height=20 width=20><b> <?= htmlspecialchars($rs["Razza"]) ?></b>
<? if(intval($rs['IDRazza'])%1000 != 0){
echo '</a>';
} ?>
<?
$MySql = 'SELECT * FROM Razza WHERE IDRazza = '.intval($rs['IDRazza']/10)*10;
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
$Disciplina = Array (
1 => $rs1['Disciplina1'],
2 => $rs1['Disciplina2'],
3 => $rs1['Disciplina3'],
4 => $rs1['Disciplina4']
);
$rs1='';
for ($i=1; $i<=4; $i++) {
if ($Disciplina[$i] != 0) {
$MySql = 'SELECT * FROM Discipline WHERE ID = '.pars($Disciplina[$i]);
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
echo('<br><li>'.htmlspecialchars($rs1['Nome']));
};
};
$rs1->close;
?></td></tr>
<tr ><td background=sfondobase.png width=60><b>Elementi</b></td><td bgcolor=orange>
<? if(intval($rs['IDElemento'])%1000 != 0){
echo '<a href="razza.php?ID='.intval($rs['IDElemento']/10)*10 .'">';
} ?>
<img src="img/elementi/<?=$UrlImgElemento?>" border=0 height=20 width=20><b> <?= htmlspecialchars($rs["Elemento"]) ?></b>
<? if(intval($rs['IDElemento'])%1000 != 0){
echo '</a>';
} ?>
<?
$MySql = 'SELECT * FROM Elemento WHERE IDElemento = '.intval($rs['IDElemento']/10)*10;
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
$Disciplina = Array (
1 => $rs1['Disciplina1'],
2 => $rs1['Disciplina2'],
3 => $rs1['Disciplina3'],
4 => $rs1['Disciplina4']
);
$rs1='';
for ($i=1; $i<=4; $i++) {
if ($Disciplina[$i] != 0) {
$MySql = 'SELECT * FROM Discipline WHERE ID = '.pars($Disciplina[$i]);
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
echo('<br><li>'.htmlspecialchars($rs1['Nome']));
};
};
$rs1->close;
?><? if(intval($rs['IDElemento2'])%1000 != 0){
echo '<a href="razza.php?ID='.intval($rs['IDElemento2']/10)*10 .'">';
} ?>
<img src="img/elementi/<?=$UrlImgElemento2?>" border=0 height=20 width=20><b> <?= htmlspecialchars($rs["Elemento2"]) ?></b>
<? if(intval($rs['IDElemento2'])%1000 != 0){
echo '</a>';
} ?>
<?
$MySql = 'SELECT * FROM Elemento2 WHERE IDElemento2 = '.intval($rs['IDElemento2']/10)*10;
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
$Disciplina = Array (
1 => $rs1['Disciplina1'],
2 => $rs1['Disciplina2'],
3 => $rs1['Disciplina3'],
4 => $rs1['Disciplina4']
);
$rs1='';
for ($i=1; $i<=4; $i++) {
if ($Disciplina[$i] != 0) {
$MySql = 'SELECT * FROM Discipline WHERE ID = '.pars($Disciplina[$i]);
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
echo('<br><li>'.htmlspecialchars($rs1['Nome']));
};
};
$rs1->close;
?></td></tr>
<tr > <td background=sfondobase.png width=60 valign=top><b>Clan</b></td>
<td bgcolor=orange valign=top>
<?/* if(intval($rs['IDGilda']) >= 100){
echo '<a href="" onClick="window.open('corporazioni.php?ID='.intval($rs['IDGilda']/100)*100 .','ext2','toolbar=0, location=0, directories=0, statusbar=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=500, height=645');return(false)">';
} */?>
<img src="img/stemmi/<?= $UrlImgGilda ?>" border=0 heigh=25 width=25><b> <?= htmlspecialchars($Gilda) ?></b> <br>
<?/* if(intval($rs['IDGilda']) >= 100){
echo '</a>';
}*/?>
</td></tr>
<tr > <td background=sfondobase.png width=60 valign=top><b>Corporazione</b></td>
<td bgcolor=orange valign=top>
<?/* if(intval($rs['IDAssociazioni']) >= 100){
echo '<a href="" onClick="window.open('corporazioni.php?ID='.intval($rs['IDAssociazioni']/100)*100 .','ext2','toolbar=0, location=0, directories=0, statusbar=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0, width=500, height=645');return(false)">';
} */?>
<img src="img/associazioni/<?= $UrlImgAssociazioni ?>" border=0 heigh=25 width=25><b> <?= htmlspecialchars($Associazioni) ?></b> <br>
<?/* if(intval($rs['IDAssociazioni']) >= 100){
echo '</a>';
}*/?>
</td></tr>
<tr >
<td background=sfondobase.png width=60 valign=top><b>Riconoscimenti</b></td>
<td bgcolor=orange align=left valign=top><?
switch ($rs["Master"]) {
case 1:
echo '<img src="img/gray-m.gif">';
break;
case 2:
echo '<img src="img/gray-c.gif">';
break;
}
?> <?
$MySql = "SELECT * FROM ClgPersonaggioMostrine";
$MySql .=" LEFT JOIN CodMostrina ON CodMostrina.IdMostrina = ClgPersonaggioMostrine.IdMostrina";
$MySql .=" WHERE ClgPersonaggioMostrine.Nome = '$pg' ORDER BY ClgPersonaggioMostrine.IdMostrina";
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<img src="img/mostrine/'.$rs1['ImgURL'].'" Title="'.$rs1['Descrizione'].'" baseline=top>';
}
$rs1->close;
if($rs['Super']==1) {echo '<img src="img/gestore.gif" width=10 height=10 border=0>';}
elseif($rs['Admin']==1) {echo '<img src="img/staff.gif" width=31 height=20 border=0>';}
?></td>
</tr>
<tr ><td background=sfondobase.png width=60><b><?= $par_Stat1?>:</b></td><td bgcolor=orange width=20> <b><?= $rs["Mente"] + $rs["D1"] ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b><?= $par_Stat2?>:</b></td><td bgcolor=orange width=20> <b><?= $rs["Forza"] + $rs["D2"] ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b><?= $par_Stat3?>:</b></td><td bgcolor=orange width=20> <b><?= $rs["Spirito"] + $rs["D3"] ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b><?= $par_Stat4?>:</b></td><td bgcolor=orange width=20> <b><?= $rs["Arte"] + $rs["D4"] ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b><?= $par_Stat6?>Chakra:</b></td><td bgcolor=orange width=20> <b><?= $rs["Chakra"] + $rs["D5"] ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b>Salute:</b></td><td bgcolor=orange width=20> <b><?= $rs["MaxMente"]?>/<?= $rs["MaxForza"]?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b>Esperienza:</b></td><td bgcolor=orange width=20><b> <?= floor($rs["Esperienza"]) ?></b></td></tr>
<tr ><td background=sfondobase.png width=60><b>Livello:</b></td><td bgcolor=orange width=20> <? if(intval($rs['IDGrado'])%1000 != 0){
echo '<a href="razza.php?ID='.intval($rs['IDGrado']/10)*10 .'">';
} ?>
<img src="img/grado/<?=$UrlImgGrado?>" border=0 height=20 width=20>
<? if(intval($rs['IDGrado'])%1000 != 0){
echo '</a>';
} ?>
<?
$MySql = 'SELECT * FROM Grado WHERE IDGrado = '.intval($rs['IDGrado']/10)*10;
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
$Disciplina = Array (
1 => $rs1['Disciplina1'],
2 => $rs1['Disciplina2'],
3 => $rs1['Disciplina3'],
4 => $rs1['Disciplina4']
);
$rs1='';
for ($i=1; $i<=4; $i++) {
if ($Disciplina[$i] != 0) {
$MySql = 'SELECT * FROM Discipline WHERE ID = '.pars($Disciplina[$i]);
$Result1 = mysql_query($MySql);
$rs1 = mysql_fetch_array($Result1);
echo('<br><li>'.htmlspecialchars($rs1['Nome']));
};
};
$rs1->close;
?></td></tr>
<tr ><td background=sfondobase.png colspan=2>
<b>Status:</b><br> </td></tr>
<tr><td bgcolor=orange colspan=2><b><?= $rs["Capacita"]?></b>
</td></tr>
<tr ><td background=sfondobase.png colspan=2 align=center> <a href="scheda6.php?pg=<?= urlencode($pg) ?>">Abilitá</a>
<?
if (isset($Login)) {
if ($Login == $pg) {
echo(' <a href="scheda5.php?pg='.urlencode($pg).'">PX</a>');
echo(' <a href="scheda4.php?pg='.urlencode($pg).'">Transazioni</a>');
echo(' <a href="scheda3.php?pg='.urlencode($pg).'">Modifica</a>');
}
if ($Login != $pg && $Master==1) {
echo(' <a href="scheda4.php?pg='.urlencode($pg).'">Transazioni</a>');
echo(' <a href="scheda3.php?pg='.urlencode($pg).'">Status</a>');
}
};
?></td></tr>
</table><br>
</table>
</td></tr></table>
<table background=Basescheda.jpg border=0 cellspacing=0 cellpadding=2 width=600>
<?
if ($rs["Esilio"] == '2037-12-31 00:00:00') {
#gmdate("d M Y H:i:s", mktime (0,0,0,12,31,9999))) {
echo '<tr bgcolor=red><td colspan=5><font color=white>Cacciato il '.formattadata($rs['DataEventoEsilio']).' per sempre dalle libere terre.<br>Motivazione: '.htmlspecialchars($rs["Motivo"]).' ('.htmlspecialchars($rs["AutoreEsilio"]).')</font></td></tr>';
} elseif ($rs["Esilio"] > date("Y-m-d H:i:s")) {
#gmdate("d M Y H:i:s", mktime (0,0,0,12,31,9999))) {
echo '<tr class=tTitolo><td colspan=5><font class=Warning>Imprigionato il '.formattadata($rs['DataEventoEsilio']).'.<br>Motivazione: '.htmlspecialchars($rs["Motivo"]).' ('.htmlspecialchars($rs["AutoreEsilio"]).')</font></td></tr>';
}
#----- Strumenti di Esilio o Prigione $_SESSION['Esilio_S']-----
if ( ($_SESSION['Admin_S']==1)||($_SESSION['Super_S']==1)) {
echo '<form onSubmit="return Conferma();" action="scheda.php" method=Post><tr><td >Motivo Esilio <input name="Motivo_Esilio" size=30 maxlength=255> <input Name="Esilia" type=submit value="Esilia" style={color:white;background:red}> <input type=checkbox Name=IP style={background:red}> blocco IP <input Name="Grazia" type=checkbox style={background:green}> Grazia</td></tr><input type=hidden Name=pg value="'.$pg.'"></form></td></tr>';
}
if (($_SESSION['Prigione_S'])|| ($_SESSION['Admin_S']==1)||($_SESSION['Super_S']==1)) {
echo '<form onSubmit="return Conferma();" action="scheda.php" method=Post><tr><td >Motivo Arresto <input name="Motivo_Arresto" size=30 maxlength=255> <input Name="Arresta" type=submit value="Arresta" style={background:yellow}> per giorni <select Name=gg><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option></select><input type=hidden Name=pg value="'.$pg.'"></form>';
//echo '<input Name="pg" type=hidden value="'.$pg.'"> <input Name="Pulisci" type=submit value="Pulisci scheda" style={color:black;background:white}>';
echo '</form></td></tr>';
}
/*if if ($_SESSION['LogDoppi_S']) {
echo BottoneGestione('Log Doppi', 'D', 'gstLogDoppi.php?Nome='.urlencode($pg));
}
if ($_SESSION['LogFinanza_S'] == '1')
{
echo BottoneGestione('Log Traffici Finanziari', 'F', 'gstLogFinanza.php?Nome='.urlencode($pg));
echo BottoneGestione('Log Oggetti', 'O', 'gst_LogOggetti.php?Nome='.urlencode($pg));
}
(($_SESSION['Admin_S']=='1') AND ($_SESSION['AdminExt_S']=='1') AND ($par_Flag_AdminExt=='1')) {
echo BottoneGestione('Chiudi Gestione Estesa', '', 'scheda.php?AdminExt=0&pg='.urlencode($pg));
#----- Controlla gli ultimi 10 IP di entrata
echo BottoneGestione('Log Entrate', '', 'gstLogEntrate.php?Nome='.urlencode($pg));
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT IP FROM LogEntrate WHERE Nome = ''.addslashes($pg).'' ORDER BY DataEvento DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<a href="gstLogEntrate.php?IP='.$rs1['IP'].'">'.$rs1['IP'].'</a><br>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
#----- Controlla gli ultimi 10 messaggi di chat -----
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT Chat.*, Mappa.Breve FROM Chat LEFT JOIN Mappa ON Chat.Stanza=Mappa.ID WHERE Mittente=''.addslashes($pg).'' ORDER BY ID DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '<b>'.strftime("%H:%M", strtotime($rs1['Ora'])).' '.htmlspecialchars($rs1['Breve']).' ['.$rs1['Tipo'].'] ['.htmlspecialchars($rs1['Mittente']);
if ($rs1['Destinatario'] != '') {
echo '>><a href="scheda.php?pg='.urlencode($rs1['Destinatario']).'">'.htmlspecialchars($rs1['Destinatario']).'</a>';
}
echo ']</b><br>'.$rs1['Testo'].'<br>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
#----- Controlla le ultime 10 missive -----
echo '<tr class=tScuro><td colspan=5>';
$MySql = 'SELECT * FROM Messaggi WHERE Mittente=''.addslashes($pg).'' ORDER BY ID DESC LIMIT 0,10';
$Result1 = mysql_query($MySql);
while ($rs1 = mysql_fetch_array($Result1)) {
echo '</b></i><b>'.strftime("%d/%m/%Y %H:%M", strtotime($rs1['Spedito'])).' ['.htmlspecialchars($rs1['Mittente']).'>><a href="scheda.php?pg='.urlencode($rs1['Destinatario']).'">'.htmlspecialchars($rs1['Destinatario']).']</a></b><br>';
echo str_replace("
", "<br>", substr($rs1['Testo'],0,200)).'<hr>';
}
mysql_free_result($Result1);
$rs1->close;
echo '</td></tr>';
}
//if (($_SESSION['Admin_S']=='1') AND ($_SESSION['AdminExt_S']!='1') AND ($par_Flag_AdminExt=='1')) {
//echo BottoneGestione('Apri Gestione Estesa', '', 'scheda.php?AdminExt=1&pg='.urlencode($pg));}*/
if (($_SESSION['Admin_S']=='1') AND ($_SESSION['AdminExt_S']!='1') AND ($par_Flag_AdminExt=='1')) {
echo BottoneGestione('Apri Gestione Estesa', '', 'scheda9.php?AdminExt=1&pg='.urlencode($pg));
}
?>
<tr><td height=41 colspan=5></td></tr>
</table>
<? $rs->close; ?>
<script language="JavaScript">
function Conferma(){
if (confirm('Sei sicuro?'))
return true;
else
return false;
}
</script>
</body>
</html>
Questa è della scheda
<?
session_start();
include ('inc/version.inc.php');
include ('inc/parametri.inc.php');
include ('inc/controllo.php');
include ('inc/open2.php');
#echo "-".$HTTP_SESSION_VARS["Login"]."-<br>";
$Dir = trim($_REQUEST['Dir']);
if ($Dir != "") {
#$Luogo = $Dir;
$jumpScript = "SI";
}
//include ("inc/cambiastanza.php");
function cambiastanza($stf, $pgf)
{
$stf = 0 + $stf;
if ($stf == 0) {
$stf=1;
};
if ($pgf != '') {#($HTTP_SESSION_VARS['Login'] == $pgf) and ($pgf != ''))
$_SESSION['Stanza'] = $stf;
$stApparente = $stf;
$MySql = "SELECT StanzaApparente FROM Mappa WHERE ID = $stf";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
if (mysql_num_rows($Result) != 1) {
$stApparente = $rs["StanzaApparente"];
}
$rs->close;
mysql_free_result($Result);
$MySql = "SELECT * FROM Presenti WHERE Nome = '".pars($pgf)."'";
$Result = mysql_query($MySql);
if (mysql_num_rows($Result) == 0) {
$MySql = "INSERT INTO Presenti (Nome, Stanza, StanzaApparente, OraEntrata, OraUscita, UltimoRefresh)";
$MySql .= " VALUES ('".pars($pgf)."', $stf, $stApparente, NOW(), '2037-12-31 00:00:00', NOW())";
mysql_query($MySql);
} else {
$MySql = "UPDATE Presenti SET Stanza = $stf, StanzaApparente = $stApparente, UltimoRefresh = NOW(), OraUscita = '2037-12-31 00:00:00' WHERE Nome = '".pars($pgf)."'";
mysql_query($MySql);
};
};
$MySql = "UPDATE Presenti";
$MySql .= " SET OraUscita = NOW(), Stanza=0, StanzaApparente=0";
$MySql .= " WHERE DATE_ADD(UltimoRefresh, INTERVAL 6 MINUTE) < NOW()";
$MySql .= " AND OraUscita = '2037-12-31 00:00:00'";
mysql_query($MySql);
$MySql="DELETE From Presenti";
$MySql .= " WHERE (DATE_ADD(OraUscita, INTERVAL 12 MINUTE) < NOW()";
$MySql .= " AND NOT(OraUscita = '2037-12-31 00:00:00')";
$MySql .= ") OR Nome = ''";
mysql_query($MySql);
}
If ($Dir != "") {
cambiastanza($Dir, $_SESSION['Login']);
}
if ($Dir == "") {cambiastanza("1", $_SESSION['Login']);}
if ($_SESSION['Gattabuia']!=0){cambiastanza("100", $_SESSION['Login']);}
$MySql = "SELECT Pagina, Par, Chat FROM Mappa WHERE ID = ".pars($_SESSION['Stanza']); #Luogo);
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$Link = $rs["Pagina"]."?Par=".$rs["Par"];
$Par = $rs["Par"];
$Chat = 0 + $rs["Chat"];
$rs->close;
mysql_free_result($Result);
$Link =$rs["Pagina"];
if ($Chat==1) {
$Link = 'palestra.php';
}
include ('inc/controlloesilio.php');
//If ($Luogo == "") {$Luogo = "1";}
include ('inc/header.html.inc.php');
?>
<title><?= htmlspecialchars($par_SiteName) ?> - [<?= htmlspecialchars($glob_EngineName.' '.$glob_EngineVersion) ?>]</title>
</head>
<frameset COLS="200,*,200" border="0" frameborder="NO" framespacing="0" marginheight="0" marginwidth="0">
<frame SRC="mappa.php" NAME="mappa" SCROLLING="NO">
<frameset ROWS="130,*" border="0" frameborder="NO" framespacing="0" marginheight="0" marginwidth="0">
<frame SRC="stato.php" NAME="stato">
<frame SRC="<?= $Link ?>" NAME="palestra">
</frameset>
<frame SRC="mappa2.php" NAME="presenti" SCROLLING="NO">
</frameset>
</html>
Questa della Main (Chat)
E in caso metto anche l'input:
<?session_start();
include ("inc/parametri.inc.php");
include ("inc/controllo.php");
include ("inc/open2.php");
$Login = $_SESSION['Login'];
$Sesso_S = $_SESSION['Sesso_S'];
$DescGilda = $_SESSION['DescGilda_S'];
$ImgGilda = $_SESSION['ImgGilda_S'];
$ImgRazza_S = $_SESSION['ImgRazza_S'];
$DescRazza_S = $_SESSION['DescRazza_S'];
$Messaggio=$_POST['Messaggio'];
$Stanza=$_SESSION['Stanza'];
$op=$_REQUEST['op'];
//$Msg=$_REQUEST['Msg'];
$Tipo=$_REQUEST['Tipo'];
//$StanzaCambia="";
$nome=$_POST['nome'];
$caccia=$_POST['caccia'];
$elenco=$_POST['elenco'];
$invita=$_POST['invita'];
$Tag=$_SESSION['Tag'];
if($_POST['Tag']!=""){$Tag=$_POST['Tag'];}
$_SESSION['Tag']=$Tag;
include ("inc/controlloesilio.php");
?>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style>
BODY {font-size:10px; text-decoration: none; font-family:verdana; color:gold; font-weight:normal;}
TD {font-size:10px; text-decoration: none; font-family:verdana; color:gold; font-weight:normal;}
TABLE {font-size:10px; text-decoration: none; font-family:verdana; color:gold; font-weight:normal;}
</style>
</head>
<body topmargin=0 leftmargin=0 bgcolor=#000000 background="/input2.png">
<?
$CarDefault = '';
$Msg = stripslashes($Msg);
$Msg = substr($Msg, 0, min(strlen($Msg), 500));
$Msg = addslashes($Msg);
If ((strtoupper($op) == "CANCELLACHAT") && ($_SESSION['Master'] == 1)) {
$Msg = "Stanza $Stanza cancellata";
$MySql = "DELETE FROM Chat WHERE Stanza = '".$Stanza."' AND DATE_ADD(Ora, INTERVAL 10 MINUTE) >= NOW()";
mysql_query($MySql);
if ($ImgGilda == "") {
$ImgGilda = "nessuno.gif";
$DescGilda = "cittadino";
}
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('".addslashes($Stanza)."', 'System Op', '".addslashes($Login)."', NOW(), '".$Msg."', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
}
#############################
# GESTIONE STANZE RISERVATE #
#############################
$MySql = "SELECT * FROM Mappa WHERE ID = '".addslashes($Stanza)."'";
$Result = mysql_query($MySql);
$rs = mysql_fetch_array($Result);
$Condizione = $rs["Condizione"]."";
$Invitati = $rs["Invitati"]."";
mysql_free_result($Result);
if ($Condizione != "") {
$_SESSION['Mappa']=4;
$Condizione = str_replace("G", "IDGilda", $Condizione);
$pos = strpos($Condizione, "$Numero");
if ($pos == false) {
$MySql = "SELECT * FROM Presenti WHERE Nome = '".addslashes($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 = '".addslashes($Login)."'";
}
$Result = mysql_query($MySql);
if ($rs = mysql_fetch_array($Result)) {
mysql_free_result($Result);
#Permesso Gestione Stanza
if ($invita != "") {
$pos = strpos(strtoupper($Invitati), "!".strtoupper($nome)."!,");
if ($pos === false) {
$MySql = "SELECT Nome FROM Personaggio WHERE Nome = '$nome'";
$Result = mysql_query($MySql);
if ($rs = mysql_fetch_array($Result)) {
$Nome2=$rs["Nome"];
mysql_free_result($Result);
$MySql = "UPDATE Mappa SET Invitati = CONCAT(Invitati, '!".addslashes($Nome2)."!,') WHERE ID = '".addslashes($Stanza)."'";
mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(), '".addslashes($Nome2)." è stato invitato.', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'Y')";
mysql_query($MySql);
} else {
mysql_free_result($Result);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(), '".htmlspecialchars($nome)." non esiste', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
}
} else {
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(), '".$nome." è già stato invitato.', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
}
}
# ********** NON CACCIA!!! *******
if ($caccia != "") {
$pos = strpos(strtoupper($Invitati), "!".strtoupper($nome)."!,");
if ($pos === false) {
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(), '".$nome." non era stato invitato.', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
} else {
$MySql = "SELECT Nome FROM Personaggio WHERE Nome = '$nome'";
$Result = mysql_query($MySql);
if ($rs = mysql_fetch_array($Result)) {
$Nome2 = $rs["Nome"];
mysql_free_result($Result);
$MySql = "UPDATE Mappa SET Invitati = REPLACE(Invitati, '!$Nome2!,', '') WHERE ID = '".addslashes($Stanza)."'";
mysql_query($MySql);
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(),";
$MySql .= " '".addslashes("L'invito di ".htmlspecialchars($Nome2)." è stato revocato.")."', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'Y')";
mysql_query($MySql);
} else {
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(),";
$MySql .= " '".$nome." non esiste.', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
}
}
}
if($elenco != "") {
$Msg = $Invitati;
If ($Msg == "") {$Msg = "nessun invitato,";};
$Msg = substr($Msg, 0, strlen($Msg)-1);
$Msg = str_replace(",", ", ", $Msg);
$Msg = str_replace("!", "", $Msg);
$Msg = addslashes("elenco degli invitati: ".htmlspecialchars($Msg));
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= " VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Login)."', NOW(), '$Msg', '$Sesso_S', '$ImgGilda', '$DescGilda', '$ImgRazza_S', '$DescRazza_S', 'S')";
mysql_query($MySql);
}
} else { #controllo permesso tra gli invitati: non è un gestore della stanza
mysql_free_result($Result);
$pos = strpos(strtoupper($Invitati), "!".strtoupper($Login)."!,");
if ($pos === false) {
echo "stanza riservata";
exit();
}
}
}
$Messaggio = stripslashes(trim($Messaggio));
$Msg = substr($Messaggio, 0, min(strlen($Messaggio), 500));
$Msg = addslashes($Messaggio);
$CharAdd = "";
$Tipo = "";
if ($Msg != "") {
if ((substr($Msg, 0, 1) == "§") && ($_SESSION['Master'] == 1) && ($Tipo == "")) {
$Msg = substr($Msg, 1);
$Msg = htmlspecialchars($Msg);
$Tipo = "M";
$CarDefault = '§';
}
if ((substr($Msg, 0, 1) == "§") && ($_SESSION['Master'] == 2) && ($Tipo == "")) {
$Msg = substr($Msg, 1);
$Msg = htmlspecialchars($Msg);
$Tipo = "C";
$CarDefault = '§';
}
if ((substr($Msg, 0, 1) == "*") && ($_SESSION['Master'] == 1) && ($Tipo == "")) {
$Msg = substr($Msg, 1);
$Tipo = "H";
}
if ((substr($Msg, 0, 1) == "-") && ($_SESSION['Master'] == 1) && ($Tipo == "")) {
$Msg = substr($Msg, 1);
$Tipo = "W";
}
if ((substr($Msg, 0, 1) == "$") && ($Tipo == "")) {
if (strtoupper(substr($Msg, 1, 4)) == "DADI") {
$maxnum = min(floor(abs(0 + substr(trim($Msg), 5))), 1000);
if ($maxnum == 0) {$maxnum = 6;};
mt_srand((double)microtime()*1000000);
$num = mt_rand(1, $maxnum);
$Tipo = "Y";
$Msg = $Login." tira $num/$maxnum";
$Msg = htmlspecialchars($Msg);
#$Msg = "[Y]<ORA:" & tempo() & "><MITT:" & Session("Login") & "><MSG:" & server.htmlencode(Session("Login")) & " tira " & num & "/" & maxnum & ">"
}
}
if (((substr($Msg, 0, 1) == "+") || (substr($Msg, 0, 1) == "#")) && ($Tipo == "")) {
$Msg = substr($Msg, 1);
$Msg = htmlspecialchars($Msg);
if($Tag!=""){$Msg=" [".htmlspecialchars($Tag)."] ".$Msg;}
$Tipo = "A";
}
if ((substr($Msg, 0, 1) == "@") && ($Tipo == "")) {
$Pos = strpos(substr($Msg, 1), "@");
if (($Pos === false) || ($Pos > 20)) {
$Msg = htmlspecialchars($Msg);
$Tipo = "P";
} else {
$MsgTemp = substr($Msg, $Pos+2);
$Dest = substr($Msg, 1, $Pos);
$MySql = "SELECT * FROM Presenti WHERE Nome = '".addslashes($Dest)."'";
$Result = mysql_query($MySql);
if ($rs = mysql_fetch_array($Result)) {
$Msg = $MsgTemp;
$Msg = htmlspecialchars($Msg);
$Dest = trim($rs["Nome"]);
$Tipo = "S";
} else {
$Tipo = "S";
$Msg = $Dest." non è presente";
$Msg = htmlspecialchars($Msg);
$Dest = $Login;
}
mysql_free_result($Result);
}
}
if (($Msg != "") && ($Tipo == "")) {
$Msg = htmlspecialchars($Msg);
if($Tag!=""){$Msg=" [".htmlspecialchars($Tag)."] ".$Msg;}
$Tipo = "P";
}
#$Msg = substr($Msg, 0, min(strlen($Msg), 1000));
if ($Tipo != "") {
$MySql = "INSERT INTO Chat (Stanza, Mittente, Destinatario, Ora, Testo, Sesso, ImgGilda, DescGilda, ImgRazza, DescRazza, Tipo)";
$MySql .= "VALUES ('".addslashes($Stanza)."', '".addslashes($Login)."', '".addslashes($Dest)."', NOW(), '".$Msg."', '$Sesso_S', '$ImgGilda', '".addslashes($DescGilda)."', '$ImgRazza_S', '".addslashes($DescRazza_S)."', '$Tipo')";
mysql_query($MySql);
# mysql_query($MySqlBackup); #BACKUP DELLA CHAT
# mysql_query($MySqlBackup2); #CANCELLA I MESSAGGI PIU VECCHI DI 20 MINUTI
$PXRegalati=0.01;
$MySqlREG = "UPDATE Personaggio SET Esperienza = Esperienza + ".$PXRegalati.", Explibera = Explibera + ".$PXRegalati." WHERE Nome = '".$_SESSION['Login']."'";
mysql_query($MySqlREG);
}
#echo "<script>parent.chatrefresh.document.location.href ='refresh.php'</script>";
};
$Msg = "";
?>
<center>
<table cellpadding=0 height="60" cellspacing=0 border=0>
<tr>
<td background="img/spacer.gif" width=55></td>
<td width=38><a href="main.php?Dir=<?=$Stanza?>" target="_top"><img border=0 src="img/reload1.gif"> </a></td>
<td valign=top align=left background="img/spacer.gif">
<form name=invio action="input.php" method=POST>
<br><input type=Text Name=Tag size=10 style="font-weight:normal;font-family:Verdana;font-size:8pt;color=333333" maxlength="30" value="<?= $Tag ?>">
<input type=Text Name=Messaggio class=txtbox size=40 style="font-weight:normal;font-family:Verdana;font-size:8pt;color=333333" maxlength="2000" value="<?= $CarDefault ?>">
<br><font color=white>Luogo Messaggio/Azione <a href="#" onClick="Javascript:window.open('helpinput.php','_new','height=400,width=600,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=yes')">
</a>
</td>
<td valign=top align=left width=40 background="img/spacer.gif">
<br><INPUT TYPE=Submit VALUE=Invia style="font-weight:bold;font-family:Verdana;font-size:8pt"></form>
<SCRIPT LANGUAGE="Javascript">document.invio.Messaggio.focus()</SCRIPT>
<? if ($_SESSION['Master'] == 1) { ?>
</td>
<td valign=top align=center width=40 background="img/spacer.gif">
<form name=comandimaster2 action="input.php" target=chatinput method=POST>
<input type=hidden name=op value=CancellaChat><br><INPUT TYPE=submit VALUE="Pulisci" style="font-weight:normal;font-family:Verdana;font-size:8pt"></form>
<? } else {echo "<td width=137></td>";} ?>
</font>
</td>
<?if ($_SESSION['Master']==1){?> <td valign=top background="img/spacer.gif">
<form action="mappa.php" method=POST target="mappa" Title="Cambio Stato del Luogo">
<br><input type= text Name="StatoStanza" size=15 maxlength=40><br>
<input type=hidden name=op value="CambioStato">
<font color=white>Stato stanza</a>
</form>
</td><?}?>
<td background="img/spacer.gif" width=55></td>
</tr></table>
</center>
</body>
</html>
Io non vedo errori O_O
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!
The Coven ↗
CRSED: F.O.A.D. ↗
Raja Dunia ↗
AlterEgo ↗