posta X gdr CON suono e luci postato il 03/04/2007 02:43:28 nel forum programmazione, gdrcd e open source
ciao, c'è per caso qualcuno che c'ha o conosce dove posso trovare uno script o il codice per fare in modo che quando arriva un missiva al pg la scritta posta si illumini e emetta un qualche suono finchè il pg non apre la pagina delle missive?? plz help è 2 settimane che cerco di trovarlo e di farlo ma con scarsi risultati
03/04/2007 08:57:50
semplicemente fai un controllo nella tabella messaggi (o come l'hai chiamata) sul campo "letto" , campo che identifica se una missiva è stata letta o meno, conteggi il numero di record se è maggiore di 0 fai cambiare immagine con quella che ti pare e attivi il suono che hai scelto.
se guardi su www.html.it sotto la sezione html ti insegna come inserire un file audio e a riprodurlo
03/04/2007 15:55:07
scusa l'ignoranza ma dove la trovo la tabella? ce n'ho 5-6 di file che riguardano la posta :(
03/04/2007 16:42:37
se ti può servire sapere che tipo ho stò lavorando su RPG ENGINE
03/04/2007 17:05:10
allors la tabella cet "missive"
non cpaisco quale parametro sia esattamente ma direi o "stato" o "ml" più "stato" opterei controlli se qualche missiva ha stato 1 che penso sia che non è stata letta e se lo trova fai andare suono e immagine diversa
03/04/2007 18:26:11
tabella: missive
campo: stato
0 = letta
1 = non letta
03/04/2007 19:01:24
mmm ho capito, si nella parte x le missivè c'è scritto stato = 1 aspetta che ti posto il pezzettino di codice
<body>
<p class="title" align="center">Messaggi Ricevuti</p>
<table id="table1" border="0" cellpadding="0" width="100%">
<tr>
<td class="table1" width="31%"><b><font face="Verdana" size="2">Data e ora</font></b></td>
<td class="table1" width="24%"><b><font face="Verdana" size="2">Mittente</font></b></td>
<td class="table1" width="37%"><b><font face="Verdana" size="2">Testo</font></b></td>
<td class="table1" width="7%"><b><font face="Verdana" size="2">Distruggi</font></b></td>
</tr><form name="form1" method="post" action="posta_distruggi.php" target="_self">
<?php
$query=mysql_query("select * from missive WHERE destinatario='$user' ORDER by id DESC");
while($row=mysql_fetch_array($query)){
echo"<tr>";
echo"<td class=\"table3\" height=\"21\"><font face=\"Verdana\" size=\"1\">$row[data]</font></td>";
echo"<td class=\"table3\" height=\"21\"><a target=\"_self\" href=\"posta_leggi.php?id=$row[id]\"><font face=\"Verdana\" size=\"1\">$row[mittente]</font></a></td>";
echo"<td class=\"table3\" height=\"21\"><font face=\"Verdana\" size=\"1\">$row[titolo]</font></td>";
echo"<td class=\"table3\" height=\"21\" align=\"center\"><input type=\"checkbox\" name=\"del[]\" value=\"$row[id]\"></td>";
echo"</tr>";
}
?>
</table>
<p> </p>
<table align="center">
<!-- <td valign="middle" align="center">
<a target="_self" href="precedente.htm"><img src="images/pergamena.gif" border="0"><br>Precedente</a>
</td> -->
<td width="30px"> </td>
<td valign="middle" align="center">
<a target="_self" href="posta_scrivi.php"><img src="images/pergamena.gif" border="0"><br>Scrivi Nuovo</a>
</td>
<?php
if($select[gilda]!="Nessuna"){
$gilda=mysql_fetch_array(mysql_query("select * from gilda where nome='$select[gilda]'"));
if($gilda[ml]=="1"){
echo"<td width=\"30px\"> </td>";
echo"<td valign=\"middle\" align=\"center\">";
echo"<a target=\"_self\" href=\"posta_ml_scrivi.php?gilda=$select[gilda]\"><img src=\"images/pergamena.gif\" border=\"0\"><br>ML Gilda</a>";
echo"</td>";
}}
if($select[mestiere]!="Nessuno"){
$mestiere=mysql_fetch_array(mysql_query("select * from gilda where nome='$select[mestiere]'"));
if($mestiere[ml]=="1"){
echo"<td width=\"30px\"> </td>";
echo"<td valign=\"middle\" align=\"center\">";
echo"<a target=\"_self\" href=\"posta_ml_scrivi.php?gilda=$select[mestiere]\"><img src=\"images/pergamena.gif\" border=\"0\"><br>ML Mestiere</a>";
echo"</td>";
}}
?>
<td width="30px"> </td>
<td valign="middle" align="center" >
<a target="_self" href="#" onclick="document.form1.submit()"><img src="images/pergamena.gif" border="0"><br>Distruggi selezionati</a>
</td></form>
<!-- <td width="30px"> </td>
<td valign="middle" align="center">
<a target="_self" href="successivi.htm"><img src="images/pergamena.gif" border="0"><br>Successivo</a>
</td> -->
</tr>
</table>
<?php
if($user==$gestore_ct){
$query=mysql_query("select * from gilda");
echo"<table align=\"center\">";
while($mlnob=mysql_fetch_array($query)){
echo"<tr>";
echo"<td width=\"30px\"> </td>";
echo"<td valign=\"middle\" align=\"center\">";
echo"<a target=\"_self\" href=\"posta_ml_scrivi.php?gilda=$mlnob[nome]\"><img src=\"images/pergamena.gif\" border=\"0\"><br>ML $mlnob[nome]</a>";
echo"</td>";
}
echo"</tr></table>";
}
?>
questo era posta.php sennò ho questa parte:
//missive
$posta=mysql_num_rows(mysql_query("SELECT * FROM missive WHERE destinatario='$nome' AND stato='1'"));
che però è menu_lat.php
03/04/2007 19:25:21
nella parte del menu_lat.php devi lavorare
04/04/2007 01:02:40
ok e aggiungo li il codice?...sapete mica dove lo posso trovare un esempio?
04/04/2007 13:01:43
-----------------------
//missive
$posta=mysql_num_rows(mysql_query("SELECT * FROM missive WHERE destinatario='$nome' AND stato='1'"));
che però è menu_lat.php
-----------------------
questo è il pezzo che ti interessa
fai un controllo if su $posta e se è 1 fai una echo che carica l'immagine per segnalare la posta arrivata e attivi il suono .
se è 0 fai echo per caricare immagine standard
04/04/2007 14:11:57
no kin :P
if($posta!=0) non if($posta==1)
altrimenti se i messaggi sono due il codice nel controllo non viene stampato :P
Rispondi alla Discussione Aggiungi ai Preferiti Inoltra Discussione Forum Programmazione, GDRCD e Open Source Elenco Forum
Port Royal: Cappe, Gorgiere e Tricorni