zenphoto forums » Themes

K2 for Wordpress Integrated "Theme"

(37 posts)
  1. dryan

    Member
    Joined: Nov '05
    Posts: 16

    This is less a theme in it's own right that a way to make zenphoto skin itself to WordPress using the K2 theme. If you wanted to make it work with a different Wordpress theme, just edit the header and footer files to match the theme's leaving the lines just above the </head> tag that deal with zenphoto (should be pretty easy to spot: 1 css link, 1 php function, 1 javascript) intact.

    This will work with K2 custom styles as well (although you may need to tweak the zen.css to make it a perfect fit).

    download it at my development site and see it at my gallery.

    Posted 8 years ago #
  2. kennysnipes

    Apprentice
    Joined: Nov '05
    Posts: 4

    I get this error when applying the K2 theme.

    MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE folder='carshow' LIMIT 1; ) Failed. Error: Table 'wordpressdb.albums' doesn't exist

    I'm stuck.

    Posted 8 years ago #
  3. dryan

    Member
    Joined: Nov '05
    Posts: 16

    what site is this on, maybe i can hhelp

    Posted 8 years ago #
  4. kennysnipes

    Apprentice
    Joined: Nov '05
    Posts: 4

    dryan, thanks for the offer to help. I did manage to get your theme to work with the help from this site http://www.noscope.com/journal/2005/09/zenphoto-08-released#comment-4569
    I edited my index file and it worked. Although I switched back to the default ZP theme becuase I'm looking for an easier way to intergrate my album into wordpress. For example a plugin of somesort that would allow ZP to intergrate into a wordpress page.

    Posted 8 years ago #
  5. dryan

    Member
    Joined: Nov '05
    Posts: 16

    i'm not sure how a wordpress page would work since it would have a single address but zenphoto uses the unique url's to determine what photo you're looking for.

    Posted 8 years ago #
  6. dryan

    Member
    Joined: Nov '05
    Posts: 16

    I've updated this theme to use the get_header() and get_footer() functions so any changes made to either one in the WordPress theme will be reflected. Also, took out my gallery description which I hadn't noticed I'd left in the public version. Finally, the version as downloaded makes a call to the EXIF function I wrote. There are instructions in the readme.txt for adding this function to zenphoto or removing it from the theme, your choice. Same link as above applies.

    Posted 8 years ago #
  7. Ilione

    Member
    Joined: Dec '05
    Posts: 22

    Hi there, this is a fantastic thing because I just started using k2 and I've been watching zenphoto for ages!

    I have a really thick question though... Install wise there were no instructions (I didn't see any?) so I'm wondering if I'm just supposed to upload the files into the k2 dir?

    I did this anyway.. and it's all screwy

    I would love if you could have a look if you get chance at http://www.funkypink.com

    I used the original k2 header.php for 5 minutes and got past that error only to receieve another so figured I'm going badly wrong somewhere lol

    help appreciated

    Ilione
    x

    Posted 8 years ago #
  8. qtrc

    Member
    Joined: Nov '05
    Posts: 33

    dryan

    do you have any documentation on how to install? I'm getting errors, check it out.

    http://www.richardcastellanos.com/pictures/

    Do I need mod_rewrite for this work?

    Posted 8 years ago #
  9. Ilione

    Member
    Joined: Dec '05
    Posts: 22

    Well I sorted out my problem, which may have been yours qtrc...

    The header.php in k2 dir needs to be changed from photography/zen/ to your own zenphoto directory! So my own silly fault for not looking a the code I guess

    I have anothe problem now though... lol

    "Error: The 'albums' directory cannot be found or is not readable."

    my zenphoto is working great! Just wish this thing would combine :o/

    x

    Posted 8 years ago #
  10. Ilione

    Member
    Joined: Dec '05
    Posts: 22

    Oh you seem to have sorted yours! Help? LOL

    x

    Posted 8 years ago #
  11. dryan

    Member
    Joined: Nov '05
    Posts: 16

    sorry i didn't make it more clear but this is a theme for zenphoto not wordpress. it goes in the zenphoto themes folder. then you activate it under the zenphoto themes admin.

    qtrc, you don't have anything installed at /pictures. i went to /zenphoto and found a sample gallery, but it doesn't appear to be using my theme. i have not tested it without modrewrite, but off hand i can't think of any code in there that should need it (the actually stuff that loads the photos is the same as the default theme).

    Ilione, your problem is that you installed it in the wrong place. You'll need to reinstall K2 (the WordPress theme) back into /wp-content/themes/ and then put my theme into /zenphoto/themes/

    Posted 8 years ago #
  12. dryan

    Member
    Joined: Nov '05
    Posts: 16

    By the way, it seems that you both my be using the outdated version of the theme, please redownload it. There's a readme included now as well.

    One thing I didn't mention there (which I will add) is to get a tab to automatically show up in the menu, make a new page in wordpress. Make it's page-slug the same as the folder you've installed ZenPhoto. For example, on my site I installed ZenPhoto into a directory (folder, whichever) named "photography" so I made a page titled Photography which has the page-slug "photography". This gives you the tab in the menu. THIS DOES REQUIRE MODREWRITE though. If you're not using it, you will need to manually add a link. Email me for that one.

    Posted 8 years ago #
  13. Ilione

    Member
    Joined: Dec '05
    Posts: 22

    Well that explains where I've been going wrong lol

    Managed to rectify immediately, but now having the same problem that kennysnipes had!

    "MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE folder='nrm-2004' LIMIT 1; ) Failed. Error: Table 'funks_wp.albums' doesn't exist"

    Do I need to manually add this table? :o) I'm having to shout at my host because phpmyadmin has disappeared lol

    I did use the new version of your theme but the readme only mentioned the xif stuff. (Which by the way is another great addition!) Sadly, when I pasted the xif code into my template-functions.php it seems to cause a parse error?

    I'm such a pain, I know :o/

    x

    Posted 8 years ago #
  14. qtrc

    Member
    Joined: Nov '05
    Posts: 33

    dryan,

    I got your theme to work on my blog. You did a great job!!!

    One question, how do I go about changing the album page? I want to seperate the photos just a bit.

    Posted 8 years ago #
  15. spacewalk

    Junior
    Joined: Nov '05
    Posts: 5

    dryan: I get the following 3 errors when I try to use your zenphoto K2 theme (zenphoto is installed at spacewalk.com/zenphoto). Any thoughts? Thanks.

    Warning: main(../photography/zen/Sajax.php): failed to open stream: No such file or directory in /usr/www/users/ralph/spacewalk/zenphoto/themes/k2/header.php on line 12

    Warning: main(): Failed opening '../photography/zen/Sajax.php' for inclusion (include_path='.:/usr/local/lib/php:.:.:.:.') in /usr/www/users/ralph/spacewalk/zenphoto/themes/k2/header.php on line 12

    MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE folder='mit-stata-center' LIMIT 1; ) Failed. Error: Table 'ralph_wordpress.albums' doesn't exist

    Posted 8 years ago #
  16. qtrc

    Member
    Joined: Nov '05
    Posts: 33

    spacewalk: You need to edit the path of the header to your zenphote install. As you can see:

    Warning: main(../photography/zen/Sajax.php):

    is pointing to photography directory. And you installed it in zenphoto so edit the line to:

    /zenphoto/zen/Sajax.php

    I hope that made sense. If not post again and I will give you instructions on what I did to get it working.

    Posted 8 years ago #
  17. spacewalk

    Junior
    Joined: Nov '05
    Posts: 5

    qtrc: Thanks. Editing the path in header.php got rid of the first 2 errors. That leaves me with the MySQL error below (same one that Ilione reported above). You'll see a db named "ralph_wordpress" referenced in this error. That's the name of my WP db, but zenphoto uses an entirely different db called "ralph_zenphoto" -- which of course seems related to the error. Where is the K2 zenphoto theme getting the db name from?

    Also, "mit_stata_center" is the correct name of the only zenphoto album I have defined (so far) in this test installation of zp. So the K2 theme is getting that OK from zp, but is assuming (apparently) that zp uses the same db as WP. If I use the default zp theme, zp works. So I can't imagine why the K2 theme would be having this MySQL error, since I see no SQL queries defined in any of the K2 theme files themselves.

    MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE folder='mit-stata-center' LIMIT 1; ) Failed. Error: Table 'ralph_wordpress.albums' doesn't exist

    Posted 8 years ago #
  18. spacewalk

    Junior
    Joined: Nov '05
    Posts: 5

    Partly answering my own question: The problem is that the K2 theme requires WP's wp-blog-header.php file, which in turn requires wp-config.php, and that's where the db is being set to the WordPress db.

    So, this K2 theme probably works fine if you're putting your zenphoto tables into the WP db. But it doesn't work if you're using a separate db file for zenphoto.

    Is there an obvious way to fix the K2 zp theme code, or do I have to use the WP db for my zp tables?

    Beyond this, are there any other elegant ways to integrate zp and WP? I notice that the zp developers anticipate LOTS of WP integration. But is that going to happen anytime soon?

    Posted 8 years ago #
  19. Ilione

    Member
    Joined: Dec '05
    Posts: 22

    I think I fixed mine in the zen config by setting the db to zp and making a zp db -- then deleting the _wp in the speech marks of this line: $conf['mysql_prefix'] = " ";

    I can't honestly remember now though :o/

    You can see I got it working on http://www.funkypink.org/visual/ though, as now my http://www.funkypink.com site has zenphoto standalone with a mere menu link to it :o)

    I'm also awaiting the integration stuff with excitement!

    x

    Posted 8 years ago #
  20. genosypheus

    Member
    Joined: Oct '05
    Posts: 23

    looks very promising, but does this zp theme works with K2 beta 2 r157 on WP 2.0 ?

    Posted 8 years ago #
  21. cjsimmons

    Member
    Joined: Jan '06
    Posts: 23

    genosypheus - I've got this this theme running with K2 r156. So it will work with r157.

    Posted 8 years ago #
  22. genosypheus

    Member
    Joined: Oct '05
    Posts: 23

    @ cjsimmons: thanks for the confirmation :)

    Posted 8 years ago #
  23. cjsimmons

    Member
    Joined: Jan '06
    Posts: 23

    oh, and it also work with the latest release r160 which was released today.

    Posted 8 years ago #
  24. SoFlaChris

    Member
    Joined: Jan '06
    Posts: 17

    dryan: I'd like to implement your code on my photo page @ http://blog.maltese.net

    I dl'd the code and read the readme, and I'm still a little confused. Will it pick-up the style that I'm currently using (fork)? Or, is there much more that I need to do?

    Regards,
    Chris

    Posted 8 years ago #
  25. vt-equine

    Member
    Joined: Jan '06
    Posts: 14

    Works just as nicely as my K2 thing is working out...there's some thread I created of me trying to get WordPress (also using K2) and ZP playing nicely although when using your way and my way, I get the same errors:


    Warning: Cannot modify header information - headers already sent by (output started at /home2/horseboy/public_html/wp-content/themes/k2/header.php:6) in /home2/horseboy/public_html/photos/zen/template-functions.php on line 67

    Warning: Cannot modify header information - headers already sent by (output started at /home2/horseboy/public_html/wp-content/themes/k2/header.php:6) in /home2/horseboy/public_html/photos/zen/template-functions.php on line 75

    Posted 8 years ago #
  26. Nnyan

    Junior
    Joined: Jan '06
    Posts: 8

    using K2 r163 I get these errors:

    Warning: main(../photography/zen/Sajax.php): failed to open stream: No such file or directory in /home/rdiaz/public_html/zenphoto/themes/k2/header.php on line 12

    Warning: main(../photography/zen/Sajax.php): failed to open stream: No such file or directory in /home/rdiaz/public_html/zenphoto/themes/k2/header.php on line 12

    Warning: main(): Failed opening '../photography/zen/Sajax.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rdiaz/public_html/zenphoto/themes/k2/header.php on line 12

    I don't have a /photography/ directory where can i change this setting?

    Posted 8 years ago #
  27. qtrc

    Member
    Joined: Nov '05
    Posts: 33

    Nnyan, check header.php of the theme. Change that setting and the path to your wordpress, if it's different.

    Just a note of caution, I had trouble running wordpress 2.0 and zenphoto 1.0beta, I think wordpress changed somethings under the hood.

    -richard

    Posted 8 years ago #
  28. pygmalioneffect

    Apprentice
    Joined: Feb '06
    Posts: 1

    Thanks for this "theme" :-)

    I've got it working on the latest svn of wordpress (2.1 alpha 1) and k2 (r171).

    Posted 8 years ago #
  29. EC

    Apprentice
    Joined: Feb '06
    Posts: 1

    dryan, I'm trying to implement this:
    ---
    One thing I didn't mention there (which I will add) is to get a tab to automatically show up in the menu, make a new page in wordpress. Make it's page-slug the same as the folder you've installed ZenPhoto.
    ---

    But I'm having a bit of trouble. I'm new to WP as well as ZP, but I can't seem to find a 'page-slug' anywhere. Is it something relatively obvious that I'm missing?

    Posted 8 years ago #
  30. cjsimmons

    Member
    Joined: Jan '06
    Posts: 23

    EC - I hard coded a new tab into my header.php for K2. Works a charm, and even shows the correct highlighting.

    See a demo at http://www.cjsimmons.net/gallery

    This is the code I have for the first 2 entries for the nav bar.

    EDIT: I think some stuff was chopped out... Sorry.
    <li class="<?php if (((is_home()) && !(is_paged()) && !(strstr($_SERVER['PHP_SELF'], '/gallery'))) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">">Blog

    <li class="<?php if (strstr($_SERVER['PHP_SELF'], '/gallery')) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">Gallery

    The first bit is the the tab called blog, and the second bit is for a tab called gallery.

    I hope that I have explained it properly...

    EDIT: I think some stuff was hidden. Hmm.

    Posted 8 years ago #

RSS feed for this topic

Reply »

You must log in to post.