Well luckily, thanks to a tutorial on youtube, I got it worked out, now I'm trying to get the the image source tag to become a variable, but I can't get it right, and here's the code:
PHP Code:
foreach ($dir_contents as $file) {
$file_type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($file_type, $file_display) == true) {
echo '<img src="', $dir, '/', $file, '" alt="', $file, '" width="80px;" height="100px" />';
}
}
}
$sql = "SELECT * FROM phpbb_anime";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$name = $row['name'];
$desc = $row['description'];
$template->assign_vars(array(
'ANIME_NAME' => $name,
'ANIME_DESCRIPTION' => $desc,
'ANIME_PIC' => '<img src="', $dir, '/', $file, '" alt="', $file, '" width="80px;" height="100px" />',
)
);
The way it is currently, the image will just display out on the page with no formatting, and I'm working with phpbb, so I'm making it a variable like everything else.
Bookmarks