Latest image copied to fixed place on server?

m_c

Joined: 2008-03-07
Posts: 4
Posted: Sun, 2008-05-11 17:54

I've been trying to get a latest image block to work on vBulletin/vBadvanced for a while, but no combination of modules/code I've tried so far works.

So, I've been thinking about it for a while, and was wondering if a module/option exists that would copy the thumbnail of the latest uploaded pic to a fixed location/name on the server?
That way, when you want to display the latest image on a page, you just need to directly link to the file, rather than have to go through the imageblock module.

Login or register to post comments
alecmyers

Joined: 2006-08-01
Posts: 973
Posted: Sun, 2008-05-11 21:31
Quote:
was wondering if a module/option exists that would ...

This module should satisfy. Install it ("lastuploaded") and use it as follows (barring typos)

http://yourdomain.com/main.php?g2_view=lastuploaded.LastUploaded
will give you the thumbnail of the last photo item in the db, and
http://yourdomain.com/main.php?g2_view=lastuploaded.LastUploadedLink
will give you a link to the item page for that item.

So you should be able to include html like this:

<a href="main.php?g2_view=lastuploaded.LastUploadedLink"><img src="main.php?g2_view=lastuploaded.LastUploaded"></a>
to include the thumbnail *and* make it a link to the item page.

Let me know if there are any problems.

AttachmentSize
lastuploaded.zip3.65 KB
Login or register to post comments
m_c

Joined: 2008-03-07
Posts: 4
Posted: Mon, 2008-05-12 11:13

That's done the trick for now.
Although I just linked to the latest uploads dynamic album, as the gallery runs in embedded mode, and that code supplies the a link to the unembedded version.

I now just need to find someway to get a random image using a similar method, as vBa doesn't like the image block way (the @readfile won't work in vBa modules).
Would it be possible to modify the lastupload plug-in to select a random pic instead?
I've just had a quick look, and it looks as though it's just the query part that would need to be altered.

Login or register to post comments
floridave
floridave's picture

Joined: 2003-12-22
Posts: 10113
Posted: Mon, 2008-05-12 13:45

I have created a codex page: http://codex.gallery2.org/Gallery2:Modules:lastuploaded
please feel free to update. Documentation for the users, by the users.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Login or register to post comments