Buongiorno. Ho inserito una chat in php nel mio sito web, e vorrei aggiungere un'immagine di sfondo in modo che i messaggi degli utenti compaiano sopra quell'immagine. Dopo il login viene caricata la seguente pagina index.htm (cioè la finestra in cui si chatta). Domanda: dove inserire il codice per l'immagine jpg di sfondo e come scrivere l'espressione? Grazie
index.php
<?php
include("../header.inc.php");
include("../config.inc.php");
include("../functions.inc.php");
$pcpin_my=pcpin_getdatafromsid($pcpin_sid);
IF($pcpin_my["user"]=""){
die();
}
include("../shared/language/".$pcpin_my["language"].".inc.php");
$template_normal=str_replace("\"","'",$pcpin_param eters["template_normal"]);
$template_system=str_replace("\"","'",$pcpin_param eters["template_system"]);
$tv="<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$pcpin_lang["charset"]."\">\r\n";
$tv.=generateCSS();
$tv.="</head><body class='message_window'>\r\n";
$tv=str_replace("\n", chr(92)."n", $tv);
$tv=str_replace("\"", chr(92)."\"", $tv);
$tv=str_replace("<", chr(92)."<", $tv);
$tv=str_replace(">", chr(92).">", $tv);
$tv=str_replace(chr(10),"",str_replace(chr(13),"", $tv));
mysql_query("UPDATE pcpin_users SET sound_time = '$curr_time' WHERE sid = '{$pcpin_my["sid"]}'");
$frameset="*,1,30,30,1";
IF($pcpin_parameters["banner_top"]&&$pcpin_parameters["banner_top_height"]&&$pcpin_parameters["banner_top_img_url"]){
$frameset=$pcpin_parameters["banner_top_height"].",".$frameset;
$top_banner=true;
}
IF($pcpin_parameters["banner_bottom"]&&$pcpin_parameters["banner_bottom_height"]&&$pcpin_parameters["banner_bottom_img_url"]){
$frameset.=",".$pcpin_parameters["banner_bottom_height"];
$bottom_banner=true;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
</HEAD>
<script language="JavaScript">
// This function prepares the Message window and plays a sound
function prepareMsgWindow(){
var allow_sounds = <?php echo $pcpin_parameters["allow_sounds"];?>;
m.document.write("<?php echo $tv;?>");
if(allow_sounds == 1){
m.document.write("<embed src='../sounds/enter.mid' autostart='true' loop='false' volume='100' width='0' height='0' hidden='true' mastersound >");
}
}
// Normal message
function n(c,u,ptxt,s){
sptxt=ptxt.split(" ");
ptxt="";
for(i=0;i<=sptxt.length-1;i++){
if(sptxt[i].indexOf("http://")==0){
ptxt=ptxt+""+sptxt[i]+""+" ";
}else{
if(sptxt[i].indexOf("www.")==0){
ptxt=ptxt+""+sptxt[i]+""+" ";
}else{
<?php
$result=mysql_query("SELECT * from pcpin_smilies");
WHILE($a=mysql_fetch_array($result)){
?>
sptxt[i]=sptxt[i].split("<?php echo $a["text_equiv"];?>").join("[img]<?php echo "../pic/smilies/".$a["file_name"];?>[/img]");
<?php
}
?>
ptxt=ptxt+sptxt[i]+" ";
}
}
}
var msg="<?php echo $template_normal;?>";
msg=msg.split("{color}").join(c);
msg=msg.split("{user}").join(u);
msg=msg.split("{message}").join(ptxt);
msg=msg.split("{sendtime}").join(s);
m.document.write(msg);
m.window.scroll(1,400000);
}
// System message or System command
function s(v,k){
var sid="<?php echo $pcpin_sid;?>";
if(v=="kick"){
document.location="../logout.php?r=2&logout=true&pcpin_sid="+sid;
}
var msg="<?php echo $template_system;?>";
msg=msg.split("{message}").join(v);
msg=msg.split("{sendtime}").join(k);
m.document.write(msg);
m.window.scroll(1,400000);
}
// Roomlist refresh
function r(){
var sid="<?php echo $pcpin_sid;?>";
roomlist.document.location="../shared/roomlist.php?pcpin_sid="+sid;
}
// Userlist refresh
function u(){
var sid="<?php echo $pcpin_sid;?>";
users.document.location="../shared/userlist.php?pcpin_sid="+sid;
}
// Normal message sound
function ns(){
m.document.write("<embed src='../sounds/normal.mid' autostart='true' loop='false' volume='100' width='0' height='0' hidden='true' mastersound>");
}
// System message sound
function ss(){
m.document.write("<embed src='../sounds/system.mid' autostart='true' loop='false' volume='100' width='0' height='0' hidden='true' mastersound>");
}
</script>
<title>
<?php echo $pcpin_parameters["title"];?>
</title>
</head>
<frameset rows="<?php echo $frameset;?>" border="0" framespacing="no" frameborder="0" marginwidth="0" marginheight="0">
<?php
IF($top_banner){?>
<frame name="top_banner" src="../top_banner.php?pcpin_sid=<?php echo $pcpin_sid;?>" scrolling="no" noresize marginwidth="0" marginheight="0">
<?php
}
?>
<frameset cols="*,20%" border="0" framespacing="no" frameborder="0" marginwidth="0" marginheight="0">
<frame name="m" src="about:blank" scrolling="auto" noresize marginwidth="0" marginheight="0" onload="prepareMsgWindow();">
<frame name="users" src="../shared/userlist.php?pcpin_sid=<?php echo $pcpin_sid;?>&pcpin_enter=true" scrolling="auto" noresize marginwidth="0" marginheight="0">
</frameset>
<frame name="empty" src="../shared/empty.php" scrolling="no" noresize marginwidth="0" marginheight="0">
<frame name="input" src="chatinput.php?pcpin_sid=<?php echo $pcpin_sid;?>" scrolling="no" noresize marginwidth="0" marginheight="0">
<frame name="roomlist" src="../shared/roomlist.php?pcpin_sid=<?php echo $pcpin_sid;?>" scrolling="no" noresize marginwidth="0" marginheight="0">
<frame name="msg" src="chatmsg.php?pcpin_sid=<?php echo $pcpin_sid;?>" scrolling="no" noresize marginwidth="0" marginheight="0">
<?php
IF($bottom_banner){?>
<frame name="bottom_banner" src="../bottom_banner.php?pcpin_sid=<?php echo $pcpin_sid;?>" scrolling="no" noresize marginwidth="0" marginheight="0">
<?php
}
?>
</script>
</frameset>
<noframes>
Sorry, this chat needs a browser that understands framesets.
</noframes>
</html>