Member
Member
antoxa   2006-07-23, 16:38
#1

hello!
i just wrote a simple function for showing latest images. if someone is interested here it is:

put it at the end of zen/functions.php

function show_latest_images($number) {
$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";
$result = mysql_query($sql);

echo '';

while($r = mysql_fetch_array($result)) {
    echo '';
    if ($conf['mod_rewrite'] == false) {
        echo ').'&image='.$r['filename'].']';
    } else {
        echo ').'/'.$r['filename'].']';
    }
    echo '';
    echo '';
}
echo '';

}

function get_album_name($id) {
$sql = "SELECT * FROM ". prefix("albums") ." WHERE id = $id";
$result = mysql_query($sql);

while($r = mysql_fetch_array($result)) {
    return $r['folder'];
}

}

when edit your theme and put where you want your images to be
working demo can be found here http://lovart.gektoras.lt/

Member
Member
Jasper   2006-07-24, 02:49
#2

hey cool add-on, thanks.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.