Pages (2): 1 2   
Member
Member
antonionardelli   09-03-2008, 10:30
#1

hi all, i'd like to display in the index the last zenphoto video.
zenphoto is installed in /zenphoto and the index i'm talking is up of one dir to zenphoto dir. Is it possible?

Administrator
Member
Member
antonionardelli   09-03-2008, 11:51
#3

hi acrylian, thanx for your support.i'm not expert with php.
I understand that i should insert in the page zp connections...
should be this:

then the player js

and then the video and player code
" title="">[b][/b]
but how should i modify it to take the last video (by date)?
i saw the template functions, but i don't know what to do.

Administrator
Administrator
acrylian   09-03-2008, 12:36
#4

You don't need to change those parts you posted. The player is already in zenphoto, no need to call it directly. Zenphoto currently supports Flash Video (.flv), Quicktime (.mov) and 3GP (.3gp). zenphoto is not able to generate a thumbnail of a video, you have to do that manually: http://www.zenphoto.org/support/topic.php?id=2022&replies=3.

The printLastestImages functions prints thumbnails of the latest uploade images. It does not make any difference between images and movies. Just place where on your theme page you want to show the latest images (works on index, image and album.php). Example is for 5 latest images, additionally you can add the name of a specific album you want them from like this)

Member
Member
antonionardelli   09-03-2008, 12:43
#5

Thanks again acrylian, i know that zenphoto supports flv mov and 3gp, i'd like to display the latest video in another page that isn't in the zenphoto directory.
Ex.
tha page is
/index.php
zenphoto is in a subdirectory installed in
/zenphoto/
i'd like to take the last video and display it, with zenphoto player directly in index.php
thank you

Administrator
Administrator
acrylian   09-03-2008, 14:56
#6

Sorry, I just overread that detail with the index.php! Probably this could be helpful for you: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin

I don't know of a way to have the flv player directly on index.php and taking care of the latest stuff from zp. But I haven't tried or thought about that. You probably will have to add that player and the movie manually (which comes from here by the way: http://www.jeroenwijering.com/?item=JW_FLV_Media_Player) to your site.

Member
Member
antonionardelli   09-03-2008, 20:14
#7

don't worry acrylian.
i had a fast look to the link you posted.
Tomorrow i'll try again, the player displays ok, need the php code to get the last video.
thank's for your help!!

Member
Member
BertSimons   10-03-2008, 14:30
#8

you can put this code on your index.php

it will show the latest 5 videos;

``

and if it is not on your zenphoto index off course follow the zenphoto as a plugin guide

Member
Member
antonionardelli   10-03-2008, 17:13
#9

Hi BertSimons!
On a fast look I added this
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
to enable zp functions, it works.
the code you sent is not working, i corrected it to echo "getThumb()."\">";
it displays the last video thumbnails.
I don't know if i should also insert the a href to $image.
I will try later and i will inform you.
Many thanks

Member
Member
BertSimons   10-03-2008, 17:48
#10

code with link, sorry for the bad paste earlier, checked this one

``

Member
Member
antonionardelli   10-03-2008, 20:57
#11

Hi BertSimons, i'm near the solution now!!!
I'm tryng now to display directly the video in the player (the code you send display the thumbnail and the link).
I'm working on this
[code]

[/code]
I took the code in the html result page of a video.
It should work fine.
The player is displayed, but when i click to start the movie, it doesn't load it.
Looking on the code, i found the problem.
[code]$imageURL[/code] returns this path \video\videoname\video.flv but the correct path of the video is \video\albums\videoname\video.flv
it losts \albums.
What can i do?
thank you!!!

Member
Member
BertSimons   10-03-2008, 21:35
#12

Antonio, replace
$imageURL = getURL($image);
with
`$imageURL = getURL($image);

$imageURL = str_replace("video",'video/albums',$imageURL);`
this shoulkd add albums to the imageURL

Member
Member
antonionardelli   11-03-2008, 09:42
#13

Hi Bert, thank you so much for your support!!
Now i can display and see the movie, but there's a think i'm not understanding.
How does zp take the last video?
If i change the date in zp admin, i don't display the last movie (but ordering by date in zp configuration displays them correctly in the zp index).
So i tried to change date on the machine, and for every day i made and then i've inserted a movie. I tried this with 4 movies. All was ok to the third movie, when i inserted the fourth i'm continuing to display the third. I don't know why...
thank you again!!

Administrator
Administrator
acrylian   11-03-2008, 10:08
#14

The latest stuff is fetched by ID, since that is the unique value that is automatically assigned when uploading anything. So it follows the upload order, not any dates.

Member
Member
BertSimons   11-03-2008, 11:48
#15

antonio, what you can do is hack your template-functions.php and around line
2597 in the getimagestatistic function change:

`case "latest":

        $sortorder = "images.id"; break;`

to

`case "latest":

        $sortorder = "images.date"; break;`

this works for my images...

Member
Member
antonionardelli   11-03-2008, 12:31
#16

Hi boys
i'm testing it locally with xampp, by copiyng and pasting (not by ftp).
before working on the date, i had the same problem.
Is possible that the old id were assigned on the new (i didn't rename video folders)?
Bert, hacking the template-funcions.php will modify the normal zenphoto working? I have it working by itslef in the site.
Thanks and sorry for my english!!!

Member
Member
BertSimons   11-03-2008, 14:37
#17

Antonio

you can change this in the template functions;

after the lines:
`case "latest":

$sortorder = "images.id"; break;

`

add:

`case "date":

$sortorder = "images.date"; break;`

so the sort part in the getImageStatistic looks like:

`switch ($option) {

    case "popular":

        $sortorder = "images.hitcounter"; break;

    case "latest":

        $sortorder = "images.id"; break;

    case "date":

        $sortorder = "images.date"; break;

    case "mostrated":

        $sortorder = "images.total_votes"; break;

    case "toprated":

        $sortorder = "(images.total_value/images.total_votes)"; break;

}

`

then on the page where you want the latest video in the code from above use:

$images = getImageStatistic($_zp_gallery->getNumImages(), "date");

by this the function getImageStatistic($number, "latest"); stays intact wherever used on your site.
note..if you upgrade your zenphoto the template-functions file will be overwritten and you'll have to add those lines again..

Member
Member
BertSimons   11-03-2008, 14:46
#18

acryllian.. I believe dates are fetched from the exif or not?
so if latest images get sorted by date they will show up chronolocillay by the date the picture was taken?

Is it an idea to add this the template-functions getimageStatistic in the build?

`case "byimagedate":

$sortorder = "images.date"; break;`

to get an getImageStatistic(50,"byimagedate") show the latest 50 pics in ordere the were shot

or am i missing something?

Administrator
Administrator
acrylian   11-03-2008, 15:12
#19

Bert, that date option makes absolutly sense. Consider it done...:-)

Just to explain why it is missing since I did that function: I do not take photos myself, I am mainly an illustrator and designer, therefore I tend to forget that people want to use the date a photo is taken and not the upload.

Member
Member
BertSimons   12-03-2008, 09:27
#20

thanks acryllian , just saw it's in the build already

Antonio Acryllian added the sort by 'image date' for the to the getImageStatistic() function by adding a case 'latest-date'to the nightly build so you don't have to mess with the templates function

complete code is now

`

`

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