Right now it will show the name of the random pic in the title like it is supposed to. I am having problems getting the picture to show in the block. I have tried to get it to show many times and different ways. I am really new at this stuff and don't understand any of this at all. So I am reaching out to you guys here.
How do I get the picture to show also? I will post the code here.
CODE
<?
$content = "";
$query = $DB->query("SELECT id FROM ibf_gallery_images");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, caption as titolo, masked_file_name as file FROM ibf_gallery_images LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "tn_$file";
if (!file_exists("$this->sitepath/forum/gallery/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "<td align=\"center\"><a href=\"$mkportals->forum_url/forums/index.php?automodule=gallery&req=si&img=$id\"><img src=\"$mkportals->forum_url/forums/gallery/$file\" border=\"0\" width='$thumb_mes[0]' height='$thumb_mes[1]' alt=\"{$this->lang['gallery_zoom']}\"></a></td></tr>
<tr><td id=\"tdblock\" align=\"center\">$titolo<br></td></tr>";
} else {
$content = "<td align=\"center\"><a href=\"$mkportals->forum_url/forums/index.php?automodule=gallery&req=si&img=$id\"><img src=\"$mkportals->forum_url/forums/gallery/$thumb\" border=\"0\" alt=\"{$this->lang['gallery_zoom']}\"></a></td></tr>
<tr><td id=\"tdblock\" align=\"center\">$titolo<br></td></tr>";
}
if(!$id) {
$content = "<tr>
<td id=\"tdblock\" align=\"center\">
{$this->lang['no_galleryim']}
</td>
</tr>
";
}
if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) {
$content = "<tr>
<td id=\"tdblock\" align=\"center\">
{$this->lang['gallery_noallow']}
</td>
</tr>
";
}
unset($query);
unset($count);
unset($start);
unset($foto);
unset($id);
unset($titolo);
unset($file);
unset($thumb);
?>
$content = "";
$query = $DB->query("SELECT id FROM ibf_gallery_images");
$count = $DB->get_num_rows ($query);
$start = rand(0, ($count -1));
$query = $DB->query("SELECT id, caption as titolo, masked_file_name as file FROM ibf_gallery_images LIMIT $start, 1");
$foto = $DB->fetch_row($query);
$id = $foto['id'];
$titolo = $foto['titolo'];
$file = $foto['file'];
$thumb = "tn_$file";
if (!file_exists("$this->sitepath/forum/gallery/$thumb")) {
$thumb_mes = $this->ResizeImage(120,"$this->sitepath/mkportal/modules/gallery/album/$file");
$content = "<td align=\"center\"><a href=\"$mkportals->forum_url/forums/index.php?automodule=gallery&req=si&img=$id\"><img src=\"$mkportals->forum_url/forums/gallery/$file\" border=\"0\" width='$thumb_mes[0]' height='$thumb_mes[1]' alt=\"{$this->lang['gallery_zoom']}\"></a></td></tr>
<tr><td id=\"tdblock\" align=\"center\">$titolo<br></td></tr>";
} else {
$content = "<td align=\"center\"><a href=\"$mkportals->forum_url/forums/index.php?automodule=gallery&req=si&img=$id\"><img src=\"$mkportals->forum_url/forums/gallery/$thumb\" border=\"0\" alt=\"{$this->lang['gallery_zoom']}\"></a></td></tr>
<tr><td id=\"tdblock\" align=\"center\">$titolo<br></td></tr>";
}
if(!$id) {
$content = "<tr>
<td id=\"tdblock\" align=\"center\">
{$this->lang['no_galleryim']}
</td>
</tr>
";
}
if(!$mkportals->member['g_access_cp'] && !$this->member['g_access_gallery']) {
$content = "<tr>
<td id=\"tdblock\" align=\"center\">
{$this->lang['gallery_noallow']}
</td>
</tr>
";
}
unset($query);
unset($count);
unset($start);
unset($foto);
unset($id);
unset($titolo);
unset($file);
unset($thumb);
?>