Pages (2): 1 2   
Member
Member
asherwood   29-08-2006, 16:26
#1

Is there a way of displaying the most recent images on the index page?

Thanks
Scott

Member
Member
Member
bbish007   02-11-2006, 22:55
#3

Has anyone details of this post as the link appears to be broken?

I really need a way to display recent images.

Member
Member
koffee   03-11-2006, 08:19
#4

``

this should work, I hope..

Member
Member
koffee   03-11-2006, 08:35
#5

It work only with mod rewrite enabled. And ZP version 1.0.2 for sure, don't know if in 1.0.3 too

Member
Member
bbish007   03-11-2006, 21:20
#6

Thanks for the reply koffe.

I am using 1.0.3 and it works to a point. It seems that in 1.0.3 they changed the naming of the thumbs so they no longer are 'filesnames_thumb.jpg' but the filesname and then some dimensions.

e.g.

filename.jpg_100_cw85_ch85.jpg
filename.jpg_119_w119_cw119_ch96.jpg
filename.jpg_595.jpg

Any thoughts? Your help would be appreciated.

Member
Member
thinkdreams   03-11-2006, 22:30
#7

bbish007-

I have a function that seems to work well for me. You can see it in operation Here.

/ Show Latest Images /

`function show_latest_images($number) {

$iw = $cw = zp_conf('thumb_crop_width');

$ih = $ch = zp_conf('thumb_crop_height');

$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";

$result = mysql_query($sql);

while($r = mysql_fetch_array($result)) {

$id=$r['albumid'];

$sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id";

$album = mysql_query($sql);

$a = mysql_fetch_array($album);

echo '

[*]';

echo '';

echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&s=thumb[/img]';

// echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&w='.$iw.'&h='.$ih.'&cw='.$cw.'&ch='.$ch.'[/img]';

echo '';

echo '

';

}

}```

Member
Member
thinkdreams   03-11-2006, 22:31
#8

`/ Show Latest Images /

function show_latest_images($number) {

$iw = $cw = zp_conf('thumb_crop_width');

$ih = $ch = zp_conf('thumb_crop_height');

$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";

$result = mysql_query($sql);

while($r = mysql_fetch_array($result)) {

$id=$r['albumid'];

$sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id";

$album = mysql_query($sql);

$a = mysql_fetch_array($album);

echo '

[*]';

echo '';

echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&s=thumb[/img]';

// echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&w='.$iw.'&h='.$ih.'&cw='.$cw.'&ch='.$ch.'[/img]';

echo '';

echo '

';

}

}`````

Member
Member
thinkdreams   03-11-2006, 22:32
#9

Sorry if the code got mangled. If it doesn't seem to come through right for you, let me know at craig (at) thinkdreams.com and I can email it to you.

Member
Member
bbish007   06-11-2006, 00:03
#10

Thats great, thanks Craig..... just what I was looking for.

Member
Member
EduardoMercovich   10-03-2008, 18:09
#11

Hello Thinkdreams, kofee and bbish.

This is just a suggestion.

Since this function could make the home page more like a photoblog, which is a relatively widespread use of galleries, could it be inserted in the default theme available with a theme option? ("show last photos in the home page" and "how many photos to show in the home page?").

Should I post this in the Trac wiki to see if it is a popular desire?

Best regards...

Administrator
Administrator
acrylian   10-03-2008, 19:10
#12

That function is already a template function (this thread is a little old). You can do that simply by yourself. Just add `` on your index.php where you want them to be shown.

Please take a look at our functions guide in the user guide section of our site, too.

Member
Member
EduardoMercovich   10-03-2008, 21:02
#13

Hello Acrylian.

Thanks a lot for your precise help. I have managed to find where to put it, and it works great. :-)

However, I have no php or coding knowledge, and I don't know how to read/use the functions guide to create the paging (previous/next) links.

If I manage to do it, which is the right place to document this how-to? The trac wiki?

Thanks a lot and best regards...

--
EM

Administrator
Administrator
acrylian   10-03-2008, 21:51
#14

The trac wiki is more or less a place for users to add things, all important stuff is on the normal site. Regarding the pagelist the best would be you look at one of the standard themes how it's done there.

The functions guide not that hard to read actually, you just need to get into it once. Example:
printPageListWithNav( string $prevtext, string $nexttext, [bool $oneImagePage = false], [string $nextprev = true], [string $class = 'pagelist'], [string $id = NULL] )
All that options next to the function are describe above it. "string" means there is text to be added for example.

Member
Member
EduardoMercovich   11-03-2008, 12:12
#15

Thanks Acrylian.

After some trial and error, I could understand the syntax. However, it still doesn't print the page navigator (take a look @ http://eduardo.mercovich.net/fotos/ if you like).

This is the code I inserted in the index.php:
`

Útimas fotos...

`

The latest 50 images are shown, but I have 77, so at least there should be a link with "siguiente".

What am I doing wrong?

Thanks a lot... :-)

PS: maybe a hint... in the markup, the class is pagelist disabled_nav. Why?


EM

Administrator
Administrator
acrylian   11-03-2008, 14:01
#16

Re: pageslist
`
That can't work. It should be;

Re: latest images
The latest images function shows only the number of latest images and is working as it's meant. There is no next button supposed to be. Its not meant to show all images you have like on a photoblog and the pagelist is for the list of albums. You see how zenphoto works if you try a standard theme. The structure is Album index -> Thumbs -> Bigger Pictures. You probably want to use zenphoto as a photoblog?

Member
Member
EduardoMercovich   11-03-2008, 14:31
#17

Hi Acrylian.

``

Ah, sorry, I had a syntax problem...

Regarding ZP use, I want to use it as it is and with a navigable list, as a photoblog.

However, I believe there is a workaround... :-)

I am using 1 album ("Todas") with all the photos. The rest are dynamic albums except one specific album that has a password, since it is for the family only.

I can make in the home page a list of the album "todas" that has pagination, and has all the photos except the ones in the family album (that don't have to be listed in the first page).

Now, with your keyword "photoblog" (seems stupid but I didn't thought about that one, my fault) I searched and found a few posts regarding it, and the sigle physical album with N dynamic albums solution seems to have even more sense.

I believe that would work perfectly for me (and for others, I hope). :-)

Best regards...

Administrator
Administrator
acrylian   11-03-2008, 15:06
#18

Ok, I see, it is of course possible to build a theme to use zp as a photoblog. If I recall right there has been an theme for that before I became developer, but that is now not compatible anymore.
Let us know if you manage it!

Member
Member
-Vincent   28-04-2008, 09:24
#19

Hello,

I want to use the function in another page of my website (not on the index of my portfolio).
What must I do ? Code ?

I am a novice, sorry...

Now, an error sentence is appearing : "Fatal error: Call to undefined function: printlatestimages() in /home.10.16/boutsdep/www/portfolio/8photos.php on line 55"

Thanks a lot in advance for your help.

Vincent

Administrator
Administrator
acrylian   28-04-2008, 10:18
#20

I presume you mean a not-zenphoto-page: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.