- Home
- Categorie
- Coding e Sistemistica
- Coding
- Aumentare le smiles cliccabili della chat
- 
							
							
							
							
							
Aumentare le smiles cliccabili della chatCiao vorrei aumentare le smiles della mia chat, solo che volgio fare come per quelle di qusto forum, e cioè avere anche un link, nel caso del forum [altro] che cliccando si apre una finestra con tutte le smiles cliccabili, come posso fare? ringrazio fin da ora chi mi aiuta!;) posto la pagina della chat: [php]<? 
 /*
 session_start();
 if(!isset($_SESSION['utente']))
 {
 echo "
 <script>
 alert("Se non sei registrato, non hai i permessi per accedere
 a questa pagina");
 </script>
 ";
 header("Location:logout.php");
 exit;
 }
 /
 ?>
 <html>
 <head>
 <title>Chat meteo globalmeteo</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <script language = "JavaScript">
 function textCounter(field, countfield, maxlimit) {
 if(field.value.length > maxlimit){
 field.value = field.value.substring(0, maxlimit);
 }
 else{
 countfield.value = maxlimit - field.value.length;
 }
 }
 </script>
 <script language="javascript">
 function aggiungi(y)
 {
 espressione=document.form_ins.messaggio.value;
 new_espressione=espressione + y;
 document.form_ins.messaggio.value=new_espressione;
 }
 function checkSubmit() {
 var subValue = document.form_ins.Submit.value;
 if(subValue!="Attendere") { // Se non ha inviato
 subValue = "Attendere";
 document.form_ins.Submit.disabled = "true"; //Disabilito il pulsante
 return true;
 } else {
 return false;
 }
 }
 </script>
 <style>
 .stile {
 background:#FFFFFF;
 font-family:verdana;
 font-size:8pt;
 SCROLLBAR-BASE-COLOR: #0099CC;
 SCROLLBAR-ARROW-COLOR: #FFFFFF;
 }
 </style>
 </head>
 <body bgcolor="#FBBEAA">
 <?
 include("config.php");
 $nick=$_GET['nick'];
 $nick=strtolower($nick);
 $nick=stripslashes($nick);
 $password=$_GET['password'];
 $password=strtolower($password);
 $password_cr=crypt($password,$nick);
 $password_cr=str_replace("|","",$password_cr);if (!(file_exists($file_reg))) 
 {fopen($file_reg,"w");}
 $utente=$nick."|".$password;
 $utente_ok=0;
 $ut_regist=file($file_reg);
 $dim_reg=count($ut_regist);
 for ($i=0;$i<$dim_reg;$i++)
 {
 $dati_ut=explode("|",$ut_regist*);
 $nick_ut=$dati_ut[0];
 $pass_ut=$dati_ut[1];
 if (($nick==$nick_ut) & ($password_cr==$pass_ut)) $utente_ok=1;
 }
 if ($utente_ok==1)
 {
 if (!(file_exists($file_online)))
 {fopen($file_online,"w");}
 $dim_file=filesize($file_online);
 $dim_max=14000; // Dimensione in bytes massima per ricreare il file online
 if ($dim_file>$dim_max)
 fopen($file_online,"w");
 $ar_orario=getdate();
 $ora=$ar_orario['hours'];
 $minuti=$ar_orario['minutes'];
 $secondi=$ar_orario['seconds'];
 if (strlen($minuti)==1) $minuti="0".$minuti;
 if (strlen($secondi)==1) $secondi="0".$secondi;
 $data=date("d/m/Y");
 $orario=$ora.":".$minuti.":".$secondi;
 $utente=$nick."|".$data."|".$orario."\n";
 $ins_online=fopen($file_online,"a+");
 fputs($ins_online,$utente);
 fclose($ins_online);
 }
 else
 {
 echo "<center><b>E' STATO INSERITO<br>UN NICK O UNA PASSWORD<br>NON
 CORRETTI,<br>OPPURE NON SEI<br>ANCORA REGISTRATO.</b><br><b>------------------</b><br><br><i><b>IMPORTANTE:<br> se sei sicuro che i dati sono esatti, prova a verificare che la [REDAZIONE] non abbia inviato una mail, all'indirizzo da te fornito nella registrazione, con i tuoi dati corretti. Fatto questo prova a rientrare. Grazie.<br><br>Se non hai ricevuto nessuna mail allora scrivici a:</i><br><u>[email protected]</u><br><i>ti forniremo tutte le info per entrare. Grazie.</b></i> ";
 echo "<a href="javascript:history.back();"><br><br>TORNA AL LOGIN</a></center>";
 exit;
 }
 ?>
 <table width="177" align="center" bordercolor="#000000"
 bgcolor="#E7E9FA" style="border:1px solid;">
 <tr>
 <td width="177" height="21" colspan="6"><div align="center">
 <div align="center"><iframe src="messaggi1.php" width="177" height="105" scrolling="yes"></iframe>
 </td></tr></table><div align="center"> <br><table width="177" align="center" bordercolor="#000000" bgcolor="#E7E9FA" style="border:1px solid;"> <tr> <td width="177" height="21" bgcolor="#BBC2F2"><div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>PERSONE ON-LINE </strong></font></div></td> </tr> <tr> <td height="21"><iframe width="177" height="45" src="online.php" scrolling="no"></iframe></td> </tr> </table><br> 
 <form method="GET" action="insert.php" name="form_ins" onsubmit="checkSubmit();">
 <table width="185" align="center" bordercolor="#000000" bgcolor="#E7E9FA" style="border:1px solid;">
 <tr>
 <td width="185" height="21" colspan="6" bgcolor="#BBC2F2"><div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>SIMBOLI
 METEO-SMILES</strong></font></div></td>
 </tr>
 <tr><td colspan="4"><div align="center">
 <?
 if ( empty($_['faccina']) ) $faccina = "" ;
 else $faccina = $_GET['faccina'] ;
 echo "
 <select name="faccina" size="1">
 <option value="[em1]" ";
 if ( $faccina == "[em1]" ) echo " selected" ;
 echo ">sole</option>
 <option value="[em2]" ";
 if ( $faccina == "[em2]" ) echo " selected" ;
 echo ">poco nuvoloso</option>
 <option value="[em3]" ";
 if ( $faccina == "[em3]" ) echo " selected" ;
 echo ">nuvoloso</option>
 <option value="[em4]" ";
 if ( $faccina == "[em4]" ) echo " selected" ;
 echo ">luna</option>
 <option value="[em5]" ";
 if ( $faccina == "[em5]" ) echo " selected" ;
 echo ">luna nuvoloso</option>
 <option value="[em21]" ";
 if ( $faccina == "[em21]" ) echo " selected" ;
 echo ">pioggia deb/mod</option>
 <option value="[em6]" ";
 if ( $faccina == "[em6]" ) echo " selected" ;
 echo ">pioggia forte</option>
 <option value="[em7]" ";
 if ( $faccina == "[em7]" ) echo " selected" ;
 echo ">pioggia/neve</option>
 <option value="[em8]" ";
 if ( $faccina == "[em8]" ) echo " selected" ;
 echo ">temporale</option>
 <option value="[em11]" ";
 if ( $faccina == "[em11]" ) echo " selected" ;
 echo ">temporale pioggia</option>
 <option value="[em22]" ";
 if ( $faccina == "[em22]" ) echo " selected" ;
 echo ">grandine</option>
 <option value="[em23]" ";
 if ( $faccina == "[em23]" ) echo " selected" ;
 echo ">pioggia/grandine</option>
 <option value="[em25]" ";
 if ( $faccina == "[em25]" ) echo " selected" ;
 echo ">neve deb/mod</option>
 <option value="[em9]" ";
 if ( $faccina == "[em9]" ) echo " selected" ;
 echo ">neve forte</option>
 <option value="[em24]" ";
 if ( $faccina == "[em24]" ) echo " selected" ;
 echo ">foschia</option>
 <option value="[em10]" ";
 if ( $faccina == "[em10]" ) echo " selected" ;
 echo ">nebbia</option>
 <option value="[em12]" ";
 if ( $faccina == "[em12]" ) echo " selected" ;
 echo ">caldo</option>
 <option value="[em13]" ";
 if ( $faccina == "[em13]" ) echo " selected" ;
 echo ">freddo</option>
 <option value="[em14]" ";
 if ( $faccina == "[em14]" ) echo " selected" ;
 echo ">vento</option>
 </select>
 ";
 ?> </td>
 <td height="21"><div align="center"><a href="" target="_blank"><img
 src="emoticons/emh.gif" width="15" height="15""></div></a></td></tr>
 <tr>
 <td height="21"><div align="center"><img
 src="emoticons/em16.gif" width="15" height="15" onClick="aggiungi('[em16]')"></div></td>
 <td height="21"><div align="center"><img
 src="emoticons/em17.gif" width="15" height="15" onClick="aggiungi('[em17]')"></div></td>
 <td height="21"><div align="center"><img
 src="emoticons/em18.gif" width="15" height="15" onClick="aggiungi('[em18]')"></div></td>
 <td height="21"><div align="center"><img
 src="emoticons/em19.gif" width="15" height="15" onClick="aggiungi('[em19]')"></div></td>
 <td height="21"><div align="center"><img
 src="emoticons/em20.gif" width="16" height="16" onClick="aggiungi('[em20]')"></div></td></tr></table> 
 <br> <table width="185" align="center" bordercolor="#000000"
 bgcolor="#E7E9FA" style="border:1px solid;">
 <tr>
 <td height="21" bgcolor="#BBC2F2"><div align="center"><font
 color="#000000" size="2" face="Verdana, Arial, Helvetica,
 sans-serif"><strong>MESSAGGIO</strong></font></div></td>
 </tr>
 <tr>
 <td ><form method="GET" action="insert.php" name="form_ins" >
 <table width="170" border="0" align="center">
 <tr>
 <td colspan="2"><div align="center">
 <textarea rows="5" onKeyDown="textCounter(this.form.messaggio,this.form.rem,300);" onKeyUp="textCounter(this.form.cjmsg,this.form.rem,300);" cols="18" type="text" name="messaggio"></textarea>
 </div></td>
 </tr>
 <tr>
 <td><div align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Lettere
 rimaste:</font></div></td>
 <td><div align="center">
 <input readonly class="stile" type=text name=rem size=3 maxlength=3 value="300">
 </div></td>
 </tr>
 <tr>
 <td height="26" colspan="2"> <div align="center">
 <?
 echo "<input type="hidden" name="nick" value="$nick">";
 echo "<input type="hidden" name="password" value="$password">"
 ?>
 <input type="submit" name="Submit" value="Invia messaggio">
 <input type="hidden" name="hideSubmit" value="hideGo"></div></td> 
 </tr></table> 
 </form></td>
 </tr>
 </table>
 </body>
 </html>
 [/php]
 
- 
							
							
							
							
							E' javascript più che php... 
 
- 
							
							
							
							
							
@Thedarkita said: E' javascript più che php... eh lo so, se non potete dirmi nulla voi allora magari spostatemi di sezione.:) 
 
- 
							
							
							
							
							
nessuna risposta?  
 
- 
							
							
							
							
							
Semplice, per aggiungerli, idda la textarea e poi metti una funzione javascript che aggiunge del testo (dello smile) alla textarea  
 
- 
							
							
							
							
							
@Jeeves said: Semplice, per aggiungerli, idda la textarea e poi metti una funzione javascript che aggiunge del testo (dello smile) alla textarea  ...iddare un elemento. 
 Bellissima :D.