Se guardi l'immagine vedrai che per ogni giorno del mese (dove è stato inserito) c'è uno o due eventi fino ad un max di 4 eventi al giorno. nella foto ce ne sono solo due ad esempio giorno 1 aprile ce ne sono due e il 14 ce ne sta uno solo. Ora io vorrei che: al posto del titolo dell'evento mi spuntasse un'img (ad es: evento) anche se gli eventi sono due o 4.

Lo script funziona in questo modo:
Inserisco l'evento dall'amministrazione e dopo mi stampa il titolo dell'evento nel giorno in cui è stato messo, se clicco sull'evento mi apre una pop up con quell'evento e gli altri aventi di quel giorno.

Spero di esseremi espresso correttamente stavolta.

codice pop-up:

Codice PHP:
<?php
require("config.php");
require(
"./lang/lang." LANGUAGE_CODE ".php");
require(
"functions.php");

$auth    auth();
$id     $_GET['id'];

mysql_connect(DB_HOSTDB_USERDB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());

$sql "SELECT d, m, y FROM " DB_TABLE_PREFIX "mssgs WHERE id=" $id;
$result mysql_query($sql) or die(mysql_error());
$row mysql_fetch_array($result);

$d             $row["d"];
$m             $row["m"];
$y             $row["y"];
$dateline     $lang['months'][$m-1] . $d$y";
$wday         date("w"mktime(0,0,0,$m,$d,$y));

writeHeader($m$y$dateline$wday$auth);

// display selected posting first
writePosting($id$auth);

// give some space
echo '[img]images/clear.gif[/img]<br clear="all">';

// query for rest of this day's postings
$sql "SELECT id, start_time FROM " DB_TABLE_PREFIX "mssgs ";
$sql .= "WHERE y = " $y " AND m = " $m " AND d = " $d " AND id != $id ";
$sql .= "ORDER BY start_time ASC";

$result mysql_query($sql) or die(mysql_error());

if (
mysql_num_rows($result)) {
    echo 
'<span class="display_header">' $lang['otheritems'] . '</span>';
    echo 
'<br clear="all">[img]/images/clear.gif[/img]<br clear="all">';
    
    
// display rest of this day's postings
    
while ($row mysql_fetch_array($result)) {
        
writePosting($row[0], $auth);
        echo 
'[img]images/clear.gif[/img]<br clear="all">';
    }
}

echo 
"</body></html>";


function 
writeHeader($m$y$dateline$wday$auth)
{
    global 
$lang;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>Eventi</title>
    <link rel="stylesheet" type="text/css" href="css/popwin.css">
<?php if ($auth) { ?>
    <script language="JavaScript">
        function deleteConfirm(eid) {
            var msg = "<?php echo $lang['deleteconfirm'?>";
            
            if (confirm(msg)) {
                opener.location = "eventsubmit.php?flag=delete&id=" + eid + "&month=<?php echo $m ?>&year=<?php echo $y ?>";
                window.setTimeout('window.close()', 1000);
            } else {
                return;
            }
        }
    </script>
<?php    ?>
</head>
<body>


<table cellspadding="0" cellspacing="0" border="0" width="300">
<tr>
    <td><span class="display_header"><?php echo $dateline ?></span></td>
    <td align="right"><span class="display_header"><?php echo $lang['days'][$wday?></span></td>
</tr>
</table>

[img]images/clear.gif[/img]<br clear="all">
<?php
}

function 
writePosting($id$auth)
{
    global 
$lang;
    
    
mysql_connect(DB_HOSTDB_USERDB_PASS) or die(mysql_error());
    
mysql_select_db(DB_NAME) or die(mysql_error());
    
    
$sql "SELECT y, m, d, title, text, start_time, end_time, ";
    
$sql .= DB_TABLE_PREFIX "users.uid, fname, lname, ";
    
    if (
TIME_DISPLAY_FORMAT == "12hr") {
        
$sql .= "TIME_FORMAT(start_time, '%l:%i%p') AS stime, ";
        
$sql .= "TIME_FORMAT(end_time, '%l:%i%p') AS etime ";
    } elseif (
TIME_DISPLAY_FORMAT == "24hr") {
        
$sql .= "TIME_FORMAT(start_time, '%H:%i') AS stime, ";
        
$sql .= "TIME_FORMAT(end_time, '%H:%i') AS etime ";
    } else {
        echo 
"Bad time display format, check your configuration file.";
    }
    
    
$sql .= "FROM " DB_TABLE_PREFIX "mssgs ";
    
$sql .= "LEFT JOIN " DB_TABLE_PREFIX "users ";
    
$sql .= "ON (" DB_TABLE_PREFIX "mssgs.uid = " DB_TABLE_PREFIX "users.uid) ";
    
$sql .= "WHERE id = " $id;
    
    
$result mysql_query($sql) or die(mysql_error());
    
$row mysql_fetch_assoc($result);
    
    
$title        stripslashes($row["title"]);
    
$body        stripslashes(str_replace("\n""
"
$row["text"]));
    
$postedby     $lang['postedby'] . " " $row['fname'] . " " $row['lname'];
    
    if (!(
$row["start_time"] == "55:55:55" && $row["end_time"] == "55:55:55")) {
        if (
$row["start_time"] == "55:55:55")
            
$starttime "- -";
        else
            
$starttime $row["stime"];
            
        if (
$row["end_time"] == "55:55:55")
            
$endtime "- -";
        else
            
$endtime $row["etime"];
        
        
$timestr "$starttime - $endtime";
    } else {
        
$timestr "";
    }
    
    if (
$auth == || ($auth != && $_SESSION['authdata']['uid'] == $row['uid'])) {
        
$editstr "<span class=\"display_edit\">";
        
$editstr .= "[<a href=\"eventform.php?id=" $id "\">edit</a>]";
        
$editstr .= "[<a href=\"#\" onClick=\"deleteConfirm(" $id ");\">delete</a>]</span>";
    } else {
        
$editstr "";
    }
?>
    <table cellspacing="0" cellpadding="0" border="0" width="300">
        <tr><td bgcolor="#000000">
            <table cellspacing="1" cellpadding="1" border="0" width="100%">
                <tr>
                    <td class="display_title_bg"><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>
                            <td width="100%"><span class="display_title"><?php echo $title ?></span></td>
                            <td>[img]images/clear.gif[/img]</td>
                            <td align="right" nowrap="yes"><span class="display_title"><?php echo $timestr ?></span></td>
                    </tr></table></td>
                </tr>
                <tr><td class="display_txt_bg">
                    <table cellspacing="1" cellpadding="1" border="0" width="100%">
                        <tr>
                            <td><span class="display_txt"><?php echo $body ?></span></td>
                        </tr>
                        <tr>
                            <td align="right"><span class="display_user"><?php echo $postedby ?></td>
                        </tr>
                        <tr>
                            <td align="right"><?php echo $editstr ?></td>
                        </tr>
                    </table>
                </td></tr>
            </table>
    </td></tr></table>
<?php
}
?>