Hi, i have a Joomla website. i would like to code something to load latest images and if possible latest images from specific categories...
I will after iframe it in Joomla. If somebody could help me with this i will after creat a module for Joomla to aumatically do this... But first i need help in taking latest images to an external normal file.
Bye
Comments
Anyway, i just need to know how to load LATEST IMAGES FROM SPECIFIC CATEGORY IN AN EXTERNAL FILE.
For example:
www.example.com
www.example.com/zenphoto
I want to load latest images here: "www.example.com/latestmoviepics.php" < The file isnt in zenphoto's directory.
Bye
Im tryng with this:
<? define('WEBPATH', 'fotos');
require_once(WEBPATH . "/zp-core/template-functions.php"); ?>
<?php printLatestImages(21); ?>
"fotos" is the folder path... but i get
Fatal error: Call to undefined function printLatestImages() in /home/duelodehinchadas/ar.duelodehinchadas.com/latest.php on line 3
Bye
http://www.zenphoto.org/support/topic.php?id=2165#post-12785
I've never used Joomla, but here's what I use to print text links for my latest Zenphoto images in my Wordpress footer:
`
function show_latest_image_links($number) {
$sql = "SELECT * FROM zp_images WHERE albumid <> 65 ORDER BY id DESC LIMIT $number";
$result = mysql_query($sql);
while($r = mysql_fetch_array($result)) {
$id=$r['albumid'];
$sql="SELECT * FROM zp_albums WHERE id = $id";
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
echo '';
echo '';
$title=$r['title'];
echo $title;
echo '';
echo '';
}
}
`
If you want to only show the latest from a specific folder, change "albumid <> 65" in the second line as appropriate. This example only produces text links, but there should be a similar example here in the forum that returns the image thumbnails. Oh, I see I hardcoded my Zenphoto folder "gallery" in this code example, you would need to change that. This code would go in your theme's functions.php file and then you can just use `<?php show_latest_image_links(5); ?>` wherever you want them to be displayed.
Surely you are not a bad person, but since we have a site with a "user guide" it should be obvious that just searching the forum is not enough.
You get the error because you also need to include the `image_album_statistics.php` plugin which has the `printLatestImages()` function.
`
<? define('WEBPATH', 'gallery');
require_once(WEBPATH . "/zp-core/template-functions.php");
require_once(WEBPATH . "/zp-core/zp-extensions/image_album_statistics.php"); ?>
<?php printLatestImages(21); ?>
`
where gallery is the subfolder from which this code was called.
but it shows the error:
MySQL Error: Zenphoto could not connect to the database server.Check your zp-config.php file for the correct host, user name, and password.Note that you may need to change the host from localhost if your web server uses a separate MySQL server, which is common in large shared hosting environments like Dreamhost and GoDaddy.Also make sure the server is running, if you control it.
Am using ZP 1.2.7
Please take a look at this thread where you can download a simple function to get the latest image directly that you can use as a guide to extend. Read the in file comments carefully: http://www.zenphoto.org/support/topic.php?id=6622
Feel free to provide a bridge script for integration. Open source is dependend on contributions for special features.