Hi ladies and gents! I would like to display recent attachments on a home page. Rather than download links, I would like to display the images themselves, perhaps even linking to the original containing post. I know enough php to be dangerous. :D What would I need to do to make this happen? Thanks!
<?php
require_once('SSI.php');
$attaches = ssi_recentAttachments(10, array(), 'return');
foreach ($attaches as $attach)
{
echo 'something';
}
The something is stuff you can pick from $attach that is an array containing three indexes: member, file, topic. Each of these contains a bunch of info about the attachment, you can use print_r or var_dump to see the content. ;D
I'm doing something very wrong. All I get is the same output as calling ssi_recentAttachments(). Trying to debug, it appears it isn't entering the loop, unless that's wrong too. lol
<?php
require("SSI.php");
$attaches = ssi_recentAttachments(10, array(), 'return');
$i = 1;
foreach ($attaches as $attach)
{
$i++;
}
echo $i;
?>
This yields the table and 1. Let's sit back and laugh at my dumb noob mistake. :D
Darn, it's array....
$attaches = ssi_recentAttachments(10, array(), 'array');
Now why didn't I see that? It's working perfectly now. Thanks emanuele!
Probably for the same reason I didn't see it. xD
You are welcome. ;D