Hy, i´m new here and i try to figure out how i can realize my theme:
A) Start Page
B) Album view
I figured out how to link directly to the album, where there is now the first image of the album in a big view and the others as thumbnails under it. If i click on thumbs - big image changes. Just as i want.
So here comes my problem:
I wanted this navigation from the startpage (div class=albumdesc) to look exactly he same in the albumview, so the user always can jump directly from the actual album to others without going back to home and than....
I tried just to copy the album-part to the image.php file but i get an error.
How can i realize such a all-over navigation? Also would be nice to show in this text link the currentAlbumTitle in a different way, so the user knows where he is.
Should look like this:
Index.php (Navigation):
Album 1
Album 2
Album 3
Album 4
case: Album 3 selected (-->go to Image.php)
Image.php (Navigation):
Album 1
Album 2
[b]Album 3[/b](selected, not clickable)
Album 4
//Pierre
you can check here:
http://www.uniqrn.com/zenphoto/structure.jpg
I assume you use zenphoto 1.1.5? There is already a function within the zp-core/plugins folder that you could use for your naviagtion. See the file print_album_menu.phpfor the usage description on top of the file.
Since this function leads to the thumbnail page of the album you would have to modify the links within it. This here might be of use for it: http://www.zenphoto.org/support/topic.php?id=752&replies=11 (the post at the bottom by BertSimmons).
For a random image there is a function http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html#functionprintRandomImages
Hy Acrylian,
what i did was the following:
i copied the argument: to my index file and than at one point i wrote the argument. But i get an error that says:
Warning: Missing argument 1 for printalbummenu() in /homepages/xx/xxx/xxx/xx/xx/zp-core/plugins/print_album_menu.php on line 63
while my file ends at line 53?
did i import the plugin wrongly?
Ah, ok, found my mistake:
the "printAlbumMenu" Argument needs some classes to be defined, like:
I got it now, thanx a lot!
i tried that redirect function at top of album.php from simmons, but didn´t work.
in index.php i solved it with writing:
$_zp_current_image->getImageLink
instead of:
$_zp_current_image->getAlbumLink
how can i do that within the print_album_menu.php?
I tried to work on the css style for the menu, but it seems, that it no worky. i wrote:
so by default css is menu, and active it has menuactive style.
my css:
.menu {
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
font-weight:100;
text-decoration:none;
}
.menuactive {
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
font-weight:200;
text-decoration:none;
}
And it looks like "menu" tries to catch normal a:hover etc styles
do i have to work on this css_id?
To get the first image in an album use this:
$firstimage = $_zp_current_album->getImages();
Then replace the ULRs within printAlbumMenu that look like:
.$albumlinkpath.$folder[$top].
with
.$albumlinkpath.$folder[$top]."/".$firstimage[0].
(this assumes that you use mod_rewrite). Haven't tried this you will have to try a little.
2. CSS
You didn't read the instructions correctly. There are two parameters for the top level album list (ths css_id) and for the subalbums (the css_class you used).
printAlbumMenu generates a nested unordered html list. You would have to use .menuplus .menu uland .menu ul li.
ah, where has this "$firstimage = $_zp_current_album->getImages();" to go?
and sorry, but what you meen with .menu plus .menu lu and .menu li lu? should i just paste them in my css? the main and sub css part in the printAlbumMenu i get, but this....
sorry, i feel a bit stupid today (maby just´not today...)
i decided to go like this:
index.php should be main + menu
album. php should be the main file to use. i want to have there the main image and under it the thumbnails that switch the main image above. i also found this description:
"I actually wrote a function for that because I needed it too. My PHP isn't all that great, but this works for me:
`
function getAlbumFirstImageURL() {
global $_zp_current_album, $_zp_current_image;
$firstimage = $_zp_current_album->getImage(0);
if (in_context(ZP_IMAGE) && $_zp_current_image->getAlbumPage() > 1) {
// Link to the page the current image belongs to.
return rewrite_path("/" . urlencode($_zp_current_album->name) . "/page/" . $_zp_current_image->getAlbumPage(),
"/index.php?album=" . urlencode($_zp_current_album->name) . "&page=" . $_zp_current_image->getAlbumPage());
} else {
return rewrite_path("/" . urlencode($_zp_current_album->name) . "/" . urlencode($firstimage->getFileName()),
"/index.php?album=" . urlencode($_zp_current_album->name) . "&image=" . urlencode($firstimage->getFileName()));
}
}
Put this in your template-functions.php and use to access it.
`
but maybe because this is a newer version of zenphoto it doesn´t work
is there something i could use different?
You original idea would work well, we basically use that on our themes page on zenphoto.org. The link you posted only works on image.php. And your new
The thing is I was mistaken (happens even to devs...:-)) "$firstimage = $_zp_current_album->getImages();" of course can't work within the menu, that only works in the album loop...
printAlbumMenu would have to be extended with a db query to get the first image of all albums. This is not that easy if you don't have the knowledge. Telling you how to do this would basically mean doing it for you and I just don't have the time right now.
Your css above does not include any hover setup, so the hover of the general css is taken. You would have to define your own for the menu. Take a look at this theme, the menu is used and styled there:
http://www.zenphoto.org/zp/theme/garland/image.png.php
my index looks like this:
`
and my album:
`
|
So what would you sa is the best way to do it? i coudn´t find any template to realize this. for me it is the easyest way of to think how such a photo-thing should work. i don´t get the regular way of going from a index to an album and than to the image....maybe zenphoto is the wrong thing? hope not, cause it really looks nice to me!
and as far i see, the problem is the following:
case 1: i try to get a loop done in the album.php which allows me to hav thumbnails and the big image, while the thumbnails are looping back to the album.php and changing the actual big image without going to the image.php or
case2: jumping directly from index.php to the image.php without showing the album.php
correct?
the problem in case2 i see is, that my menu is dead, the problem in case 1 is, that i have to write a function that loops the image request from the thumbnails to a big image in the album.php...
and my image.php, where i exactly hav what i want to see:
`
|
Ok, it was easier so I hacked a little. This modification assumes that you use mod_rewrite and the modrewrite suffix ".php" for you image page:
Localte the album query (it's commented). Paste after the line "$title[$number] (....)" following lines:
$image = query_single_row("SELECT filename FROM ". prefix('images') ." WHERE albumid= ".$id[$number]." ANDshow` = 1 ".$passwordcheck." ORDER BY sort_order");
$firstimage[$number] = $image["filename"];`
Then change every link in the menu form this (this is only the toplevel example!):
.$albumlinkpath.$folder[$top].
to
.$albumlinkpath.$folder[$top]."/".$firstimage[$top].".php'
And voila the menu leads to the first image.
ok, i paste:
`// album query
$result = query("SELECT id, parentid, folder, title FROM ". prefix('albums') ." WHERE ```show`` = 1 ".$passwordcheck." ORDER BY sort_order");
while($row = mysql_fetch_array($result)) {
$number++;
$id[$number] = $row['id'];
$parentid[$number] = $row['parentid'];
$folder[$number] = $row['folder'];
$title[$number] = $row['title'];
$image = query_single_row("SELECT filename FROM ". prefix('images') ." WHERE albumid= ".$id[$number]." AND show = 1 ".$passwordcheck." ORDER BY sort_order");
$firstimage[$number] = $image["filename"];.....
and than there are two .$albumlinkpath.$folder[$top]. statments
`
/ link either for list or jump menu display
if($option === "list") {
echo "".$active."
".$strong_start."."]".htmlspecialchars($title[$top])."".$strong_end.$imagecount[$top];
} else if ($option === "jump") {
echo "".htmlspecialchars($title[$top]).$imagecount[$top]."";
}
$sub1_count = 0;`
----> i changed to
`
// link either for list or jump menu display
if($option === "list") {
echo "".$active."
".$strong_start."."/".$firstimage[$top].".php]".htmlspecialchars($title[$top])."".$strong_end.$imagecount[$top];
} else if ($option === "jump") {
echo "".htmlspecialchars($title[$top]).$imagecount[$top]."";
}
$sub1_count = 0;`
---->which gives me an error:
Zenphoto Error
MySQL Query ( SELECT filename FROM zp_images WHERE albumid= 15 AND show = 1 ORDER BY sort_order ) 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 'show = 1 ORDER BY sort_order' at line 1
and strange, i tried to the garland theme and also over the first menu point "id='album_menu'" is showing up. could there be a problem with my print_album_menu.php" file or with the sql data base?