Pages (2): 1 2   
Member
Member
PierreSnugg   21-04-2008, 09:36
#1

Hy, i´m new here and i try to figure out how i can realize my theme:

A) Start Page

  • random image from a album, doesn´t matter from which.(i don´t have)
  • the albums are just text links, so this should be my main navigation (i got)

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

Administrator
Administrator
acrylian   21-04-2008, 11:46
#2

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

Member
Member
PierreSnugg   21-04-2008, 12:08
#3

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?

Member
Member
PierreSnugg   21-04-2008, 12:20
#4

Ah, ok, found my mistake:

the "printAlbumMenu" Argument needs some classes to be defined, like:

I got it now, thanx a lot!

Administrator
Administrator
acrylian   21-04-2008, 12:24
#5

The classes are not necesssary if you don't want to use any specific, only the both first parameters("list","count") are mandatory.

Member
Member
PierreSnugg   21-04-2008, 12:50
#6

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?

Member
Member
PierreSnugg   21-04-2008, 13:24
#7

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?

Administrator
Administrator
acrylian   21-04-2008, 14:14
#8
  1. Getting the first image:
    You would have to hack the printAlbumMenu function and change the link within that function. I guess the part I linked to above was a little to complicated. Ok lets try another thing:

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.

Member
Member
PierreSnugg   21-04-2008, 14:31
#9

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...)

Member
Member
PierreSnugg   21-04-2008, 15:02
#10

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?

Administrator
Administrator
acrylian   21-04-2008, 15:09
#11

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

Member
Member
PierreSnugg   21-04-2008, 15:12
#12

my index looks like this:

`

Member
Member
PierreSnugg   21-04-2008, 15:14
#13

and my album:

`

 | 
Member
Member
PierreSnugg   21-04-2008, 15:20
#14

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!

Member
Member
PierreSnugg   21-04-2008, 15:24
#15

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...

Member
Member
PierreSnugg   21-04-2008, 15:46
#16

and my image.php, where i exactly hav what i want to see:

`

 | 
Administrator
Administrator
acrylian   21-04-2008, 15:47
#17

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:

  1. 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"];`
  2. 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.

Member
Member
PierreSnugg   21-04-2008, 16:01
#18

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

Member
Member
PierreSnugg   21-04-2008, 16:11
#19

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?

Administrator
Administrator
acrylian   21-04-2008, 16:16
#20

The show within the query needs to be set within backticks (can't post theme because the forum uses them for code display). Then it should work.

Garland uses it's own older version of the print album menu as far as I remember.

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