AndreyPhoto Theme Problem

When I set the Andreyphoto Theme in Zenphoto and go to view it I get this Messege:

MySQL Query ( SELECT DISTINCT zp_images.filename, zp_images.title, zp_albums.folder FROM zp_images INNER JOIN
zp_albums ON zp_images.albumid = zp_albums.id GROUP BY zp_images.title ORDER BY RAND() LIMIT 1 ) Failed. Error: Table 'zen.zp_images' doesn't exist

When I use the other themes everthing is allright

Any Help? PLEASE....

Thanks Itay

Comments

  • Itay-

    What is your database prefix. Looks like the andreyphoto theme is using a hardcoded DB prefix, which you will probably need to change to match your own, or modify it so it works with whatever prefix you have. I'll post an example shortly of what I mean.
  • thinkdreams -

    I am looking forward for your example

    Thanks,

    Itay
  • Itay-

    OK. Here's a snippet from the show latest images script I use:

    $images = query_full_array("SELECT images.albumid, images.filename AS filename, images.title AS title, albums.folder AS folder FROM ".prefix('images')." AS images, ".prefix('albums')." AS albums WHERE images.albumid = albums.id AND images.show = 1 ORDER BY images.id DESC LIMIT $number");

    Note the ".prefix('images')." section (quotes and periods are important!)

    What you'll need to do is structure your query using the prefix('images') portion
    OR
    you can hardcode your query for your specific prefix. The DB prefix is what is prefaced before your database table reference, i.e. zen_images, zp_images. This varies per database.

    I hope that helps.
  • Andrey Wrote me by e-mail:

    Do you have a prefix on your tables "zp_"? If they don't or have a
    different one, change the table names in the getRandomImage() function in
    index.php to suit your table structure.

    Hope this works.

    Cheers,
    Andrey.
  • thinkdreams -
    Thanks for your replay!!!
    I deleted all _zp prefix that appeared index.php (inside the theme folder) in function getRandomImageLinkURL section
    It WORKED!!!!
    I can see now the HOME page... but
    One solution made new problem:
    Now I can't see the image pages.
    I thought it is relative to mod_rewrite...
    I found a section of it at the same page (index.php)
    but I don't have a clue what to do....
    Thanks in advance!!!

    Itay
  • Itay, could you post a link to your site so I can look at it?

    Also:

    Double check that cache and images folders are set to chmod 777 permissions.
    You can try turning off mod_rewrite and see if that doesn't make things work better.
    You may also want to "disable" the random image function for a test to see if it works without the function in the way.
  • Thing is I am working OFFLINE with xampp (http://www.xampp.com).

    After all that tests I Upload it and send A link to this post chain...

    Do I need to set permission offline too?

    Where can I Disable random image function?

    Thanks

    Itay
  • Hi Itay,

    To temporarily disable the random image function, just comment out these two variables:

    // $randomImage = getRandomImage();
    // $randomImageLinkURL = getRandomImageLinkURL($randomImage);

    I'll add the auto-prefix for random image function on the TODO list.

    Cheers,
    Andrey.
  • I had this issue with other theme as well, but I dont remember which one. It had the exact line # to change.

    Just delete zp_ from the random images part. Lines 18-25 in index.

    I think when Zen newbies start using it, the pros think we know more than we do lol. Line #'s is the easiest way for us to understand.
  • I have installed the theme and changed the random image variables and all looks to be working fine.

    I have a small problem in that the theme background images are not showing, ie the guitar in the description cell or the header image and the thumbnail background on the index page. Any ideas how to sort this out please.

    My site is at http://www.whiteflyer.f2s.com/zenphoto/

    Thanks Mark
  • acrylian Administrator, Developer
    Whiteflyer:
    I think there is something wrong in your code. In the source code it looks like
    `/images/photography_background.gif');"> /images/main_table_background.jpg');background-repeat: no-repeat">`

    The "%3c" and "&gt" seem the point that the php code is not executed. And I think there is a ";" missing after the $_zp_themeroot. It should read: <?php echo $_zp_themeroot; ?>
    Does that help?
  • Got it sorted now thanks, For some reason I had to put the full URL to the images.
Sign In or Register to comment.