Pages (2):    1 2
Member
Member
antonionardelli   2008-03-12, 11:04
#21
Hi all, yesterday evening i tried to have working the new hacks. It is not working.
Now i've seen the new zenphoto release, i downloaded it and upgraded zenphoto, i deleted the cache folder, and re-inserted 2 videos. Zenphoto is working, but when I call the page with this code
<?php
$images = getImageStatistic($_zp_gallery->getNumImages(), "latest-date");
$x = 1;
foreach ($images as $image) {
if (is_null($image->getVideoThumb())){$x=$x-1;}else{
$imageURL = getURL($image);
$imageURL = str_replace("video",'video/albums',$imageURL);
echo "<a><img src=\"".$image->getThumb()."\"></a>";
}
if ($x++ >=5) {
break;
}
}?>
i get an error:
Zenphoto Error
MySQL Query ( SELECT images.albumid, images.filename AS filename, images.title AS title, albums.folder AS folder, images.show, albums.show, albums.password FROM `zp_images` AS images, `zp_albums` AS albums WHERE images.albumid = albums.id AND images.show=1 AND albums.show=1 AND albums.folder != '' ORDER BY DESC LIMIT 2 ) Failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC LIMIT 2' at line 1
Is mysql version i'm running that generates it?
I think is better if i try on the server, not in local, don't you?
Administrator
Administrator
acrylian   2008-03-12, 12:12
#22
Weird, we didn't change anything on that query...
Member
Member
BertSimons   2008-03-12, 12:19
#23
this code is now working at the bottom of
http://www.bertsimons.nl/zenphoto/contact/comments.jpg.php

5 latest videos ordered by image-date

`<?php

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

$x = 1;

foreach ($images as $image) {

if (is_null($image->getVideoThumb())){$x=$x-1;}else{

$imageURL = getURL($image);

$imageURL = str_replace("zenphoto",'zenphoto/albums',$imageURL);

echo "";

echo "<script type="text/javascript">";

echo "var so = new SWFObject("/zenphoto/zp-core/flvplayer.swf","player","320","240","7");";

echo "so.addParam("allowfullscreen","true");";

echo "so.addVariable("file","".$imageURL ."");";

echo "so.addVariable("displayheight","310");";

echo "so.write("player");";

echo "</script>";

echo "";

}

if ($x++ >=5) {

break;

}

}?>`

note replace the path's by yours
Administrator
Administrator
acrylian   2008-03-12, 12:29
#24
Maybe we should consider making that a template-function. I will see what the others think.
Member
Member
BertSimons   2008-03-12, 12:52
#25
and you can insert

`$preview = substr($imageURL,0,strrpos($imageURL,".")).".jpg";

echo "so.addVariable(\"image\",\"".$preview ."\");";`

to show the preview image of the video.
Member
Member
antonionardelli   2008-03-12, 13:30
#26
sorry for my wrong contain.
now i made hacks in template functions.
with the old code i'm continuing to dipslay only a video that doesn't change when i add others
<p id="player">
<?php
$images = getImageStatistic($_zp_gallery->getNumImages(), "date");$x = 1;
$x = 1;
foreach ($images as $image) {
if (is_null($image->getVideoThumb())){$x=$x-1;}else{
$imageURL = getURL($image);
$imageURL = str_replace("video",'/video/albums',$imageURL);
echo "<script type=\"text/javascript\">";
echo "var so = new SWFObject(\"/video/zp-core/flvplayer.swf\",\"player\",\"320\",\"240\",\"7\");";
echo "so.addParam(\"allowfullscreen\",\"true\");";
echo "so.addVariable(\"file\",\"".$imageURL ."\");";
echo "so.addVariable(\"displayheight\",\"310\");";
echo "so.write(\"player\");";
echo "</script>";
}
if ($x++ >=1) {
break;
}
}
?>
With the new
<?php
$images = getImageStatistic($_zp_gallery->getNumImages(), "latest-date");
$x = 1;
foreach ($images as $image) {
if (is_null($image->getVideoThumb())){$x=$x-1;}else{
$imageURL = getURL($image);
$imageURL = str_replace("video",'video/albums',$imageURL);
echo "<div id=\"player\">";
echo "<script type=\"text/javascript\">";
echo "var so = new SWFObject(\"/video/zp-core/flvplayer.swf\",\"player\",\"320\",\"240\",\"7\");";
echo "so.addParam(\"allowfullscreen\",\"true\");";
echo "so.addVariable(\"file\",\"\".$imageURL .\"\");";
echo "so.addVariable(\"displayheight\",\"310\");";
echo "so.write(\"player\");";
echo "</script>";
echo "</div>";
}
if ($x++ >=2) {
break;
}
}?>
i get this error
MySQL Query ( SELECT images.albumid, images.filename AS filename, images.title AS title, albums.folder AS folder, images.show, albums.show, albums.password FROM `zp_images` AS images, `zp_albums` AS albums WHERE images.albumid = albums.id AND images.show=1 AND albums.show=1 AND albums.folder != '' ORDER BY DESC LIMIT 4 ) Failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC LIMIT 4' at line 1
Bert, i saw your page and now know it's working.
I think it is the mysql server version (..error in your SQL syntax...your MySQL server version for the right...).
I will try on the server and inform you as soon as possible.
Thanks a lot for yours gold help!!!!
Member
Member
BertSimons   2008-03-12, 14:41
#27
don't make hacks in the template- functions file!, with last night nightly build it is not neccesary
Member
Member
antonionardelli   2008-03-12, 20:34
#28
Hi Bert, i haven't touched any file of zp. In a page outside zp folder there is this code:

<?php
define('ZENFOLDER', 'zp-core');
define('WEBPATH', 'zenphoto');
require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");
?>
<?php
$images = getImageStatistic($_zp_gallery->getNumImages(), "latest-date");
$x = 1;
foreach ($images as $image) {
if (is_null($image->getVideoThumb())){$x=$x-1;}else{
$imageURL = getURL($image);
$imageURL = str_replace ("zenphoto","zenphoto/albums",$imageURL);
echo "<div id=\"player\">";
echo "<script type=\"text/javascript\">";
echo "var so = new SWFObject(\"/zenphoto/zp-core/flvplayer.swf\",\"player\",\"320\",\"240\",\"7\");";
echo "so.addParam(\"allowfullscreen\",\"true\");";
echo "so.addVariable(\"file\",\"\".$imageURL .\"\");";
echo "so.addVariable(\"displayheight\",\"310\");";
echo "so.write(\"player\");";
echo "</script>";
echo "</div>";
}
if ($x++ >=5) {
break;
}
}?>

I'm always returning the error. I tried on the server. I think i'm losing something...

Zenphoto Error
MySQL Query ( SELECT images.albumid, images.filename AS filename, images.title AS title, albums.folder AS folder FROM `zp_images` AS images, `zp_albums` AS albums WHERE images.albumid = albums.id AND images.show = 1 AND albums.folder != '' ORDER BY DESC LIMIT 26 ) Failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC LIMIT 26' at line 1
Member
Member
BertSimons   2008-03-13, 00:44
#29
what are the paths of your folders? did you now install in /zenphoto ? and are the videos inside an album in zenphoto/albums?
Member
Member
BertSimons   2008-03-13, 01:40
#30
antonio, i maneged to get it working outside the zenphoto directory as you can see at

http://www.bertsimons.nl/testlatestvideo.php

`<?php

define('ZENFOLDER', 'zp-core');

define('WEBPATH', 'zenphoto');

require_once(WEBPATH . "/" . ZENFOLDER . "/template-functions.php");

?>

<head>

<script type="text/javascript" src="/zenphoto/zp-core/js/flvplayer.js"></script>

</head>

<?php

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

$x = 1;

foreach ($images as $image) {

if (is_null($image->getVideoThumb())){$x=$x-1;}else{

$imageURL = getURL($image);

$imageURL = str_replace("zenphoto",'zenphoto/albums',$imageURL);

echo "";

echo "<script type=\"text/javascript\">";

echo "var so = new SWFObject(\"/zenphoto/zp-core/flvplayer.swf\",\"player\",\"320\",\"240\",\"7\");";

echo "so.addParam(\"allowfullscreen\",\"true\");";

echo "so.addVariable(\"file\",\"".$imageURL ."\");";

$preview = substr($imageURL,0,strrpos($imageURL,".")).".jpg";

echo "so.addVariable(\"image\",\"".$preview ."\");";

echo "so.addVariable(\"displayheight\",\"310\");";

echo "so.write(\"player\");";

echo "</script>";

echo "

";

}

if ($x++ >=5) {

break;

}

}?>`

i don't get an mysql error..
but however to get the videos to show up I needed to at this at the top:

`<head>

<script type="text/javascript" src="/zenphoto/zp-core/js/flvplayer.js"></script>

</head>`

this is normally called by zenphoto if inside zenphoto
Member
Member
antonionardelli   2008-03-13, 07:44
#31
Hi Bert, thank you again.
Yesterday i forgot to paste <script type="text/javascript" src="/zenphoto/zp-core/js/flvplayer.js"></script>, but it is in the page.
I made another folder called zenphoto with 5 video.
Nothing to do, i'm always getting the error.
Zenphoto works fine, i can see correctly all pages.
I changed if ($x++ >=5) to if ($x++ >=1) to display only 1 or 2 video but the error persists.
Now i try to clean the database and reinstalling zenphoto.
I will inform you.
Thank you Bert and thanks Acrylian.
Member
Member
antonionardelli   2008-03-13, 07:56
#32
Here i am!!
I made a new database for zenphoto 1.1.5, and during setup i got this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\zenphoto\zp-core\setup.php on line 51
so i deleted the db, created another one and installed zenphoto 1.1.3
Setup was ok, but i can't display the last video.
Any idea?
Administrator
Administrator
acrylian   2008-03-13, 09:28
#33
The recent update "latest-date" for getImageStatistic is NOT in 1.1.3.....
Member
Member
antonionardelli   2008-03-13, 09:56
#34
Ok, on the server i upgraded to 1.1.5, sorry but i can't get it working. It's always displaying the error.
Member
Member
BertSimons   2008-03-13, 10:22
#35
I am out of ideas, I don't know about MYSQL and servers..

Does the example function as on

http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin

work on your external page?
Member
Member
antonionardelli   2008-03-13, 11:21
#36
Hi Bert, I am at working now, if i remember right, it is working!!
Pages (2):    1 2
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.