andreaslinde.com

Sometimes interesting, sometimes boring

FAlbum into K2 with Wordpress 2 update

Jan 7th 2006
Internet
45 Comments
respond
trackback

This is an update for integrating flickr Albums into the Wordpress Mod K2. This version is based on falbum version 0.5.6 and includes all my previous adjustments as described in my previous post. But since the release of Wordpress 2.0 some problems regarding handling of rewrite rules came up. These are solved with this update.

After downloading, installing and configuring falbum version 0.5.6 plugin, you can continue with the following steps.

1. Download the moficiations

Download version 0.5.6 zip file of my modifications and extract it into your wordpress folder. It will replace the following original files of falbum v0.5.6:

  • /wp-content/plugins/falbum/falbum-plugin.php
    Changes:
    1. Commented line 145+ 233 and added a new rewrite rule in line 146 + 235 which will makes the photos page menu highlighted in the header all the time when using friendly urls
    2. Moved lines 622-625 up to line 599 so the rewrite rule is always at the beginning of the .htaccess file
    3. Commented lines 610-614 because it is obsolute with the above change
    4. Added a new filter function to register the falbum rewrite rule in Wordpress in lines 635-640
      (Note: Hardcoded to “photos” path, replace the string in line 637 with you choose another name in chapter 2 below!)
  • /wp-content/plugins/falbum/falbum.php
    Changes:
    1. Load falbum_mod.php code in line 23.
  • /wp-content/plugins/falbum/falbum.css.php
    Changes:
    1. Commented line 140 so the text in the sidebar is not moved to the bottom of the page
  • /wp-content/themes/k2/falbum-wp.php
    Changes:
    1. Using the new falbum sidebar function instead of the default
    2. Can be used as a page template

The package also contains the following new file:

  • /wp-content/plugins/falbum/falbum_mod.php
    Content:
    1. Sidebar function to control what to display in the sidebar on the different pages.
    2. Function to display the album description which is used in the sidebar of the album main pages.

2. Update Rewrite rules

Now go to the falbum options submenu in Wordpress admin and press the Update options button. Before that make sure the options Use friendly links is set to true.

3. Get a “Photos” menu and page

Go into Wordpress Admin and create a new page and assign it to the template with the name “Photo Album Page template”. The page title and page slug can be assigned to “photos” (Same value you used in falbum configuration for the URL root value without the slashes). All other fields of the page entry do not have to be entered (they wouldn’t appear on the page anyway).

4. Done

Now you should have a working and integrated falbum plugin in a K2 based blog. Any further questions or did I miss out something? Just ask.

Known problems:

  • Known FAlbum v0.5.6 problems (I hope the falbum author will find a solution for these):
    • Permalinks not working for pictures without a title
    • Permalinks not always working for pictures with special characters in the title, like .,;:
  • One hint for the image alignment problems in some cases: in style.css change in .primary img
    margin-left: -5px;

    into

    margin-left: 0px;

Enjoy ;-)

45 Comments

  1. Thanks a lot :P

  2. Thanks!
    I’ve also figured out a very easy way to keep the thumbnail boarders symmetrical when not using the drop shaddow without even touching the css. Keep the shaddow turned on in the options and just delete the shadow.gif from the falbum folder. I couldn’t get the falbum css to look right, but doing it this way made it perfect.

  3. Followed the steps but not sure why my album is not displaying correctly… i.e. album titles to the side (http://jpleeman.com/photos/) and in a vertical list (http://jpleeman.com/photos/album/henrys-friends/).

    Thanks for the help!

  4. @Peter: The album titles are supposed to be on the sides and in a vertical list. I don’t see your problem there. Compare it with my page. What do you expect to happen instead?

  5. @ANDREAS: That works great! You’re amazing! Thanks for the great mod!

  6. On my main photo page the album titles and descriptions are appearing under each image. On the resulting album pages they are all appearing in a vertical row, not in a checkerboard pattern. I hope this explains my issue better. Thank you – Peter

  7. @Peter: Your installation seems strange. The problem only occurs in Firefox, not in Safari. Safari Action Log tells that falbum.css.php cannot be found.
    - Did you remove the sidebar information which I added in my mod?
    - Is there still a falbum.css file present in /plugins/falbum/ ?
    - Did you update the options in falbum options subpage?
    - In Safari I see drop shadows for your pictures, in Firefox I don’t.
    I don’t think this is a problem related to my modifications. The main page will appear anyway and it should look better. Add my modifications and you should go fine.

  8. Andreas,

    I copied your falbum.css information into k2/styles.css and it resolved my issues. I am not sure where the bug is with how K2 or WP2 is handling css but it works now with this simple hack. Thank you for all your help. BTW, I have seen this issue across all other installs of WP2 and K2 Beta Two r157.

  9. i still have this problem this is since from the last update and until now i still have it. please help. thanks

    Fatal error: Call to undefined function: fa_show_photos_sidebar() in /home/thanthan/public_html/wp-content/themes/k2/falbum-wp.php on line 19

  10. @Peter: Oh, didn’t know that. Great it works now.

    @arman: Either you did not copy all the files into your installation (the function is in /plugins/falbum/falbum_mod.php) or you did not overwrite the file /plugins/falbum/falbum.php with the one in my .zip package.

  11. yeah you’re right. working fine now. thanks a lot. and more power to you.

  12. Hi thanks for this mod, I try to put the module in a sidebar block but it seems that i failed with the integration (you can this that on the web site index.php)

    I put this code into my sidebar.php :

    Recent Photos

    Thanks for your advices

    Henri

  13. The code seems to not be allow in the comments…

    I replace the

  14. andreas – i upgraded to WP2 and K2160. downloaded the new mod and i am getting this error:

    Warning: fa_parsexpath(XPath.class.php): failed to open stream: No such file or directory in /vservers/plastichippo/htdocs/wp-content/plugins/falbum/falbum.php on line 1407

    Fatal error: fa_parsexpath(): Failed opening required ‘XPath.class.php’ (include_path=’.:/usr/share/pear’) in /vservers/plastichippo/htdocs/wp-content/plugins/falbum/falbum.php on line 1407

    not sure if you can assist me in making sense of this. thanks! -wynn

  15. andreas – nvm. i fixed my problem. like an idiot i forgot to upload the “additional” files.

  16. ok. well, i have the album working – somewhat. when i click on one of the photo sets i get a 404 error with this message:

    The requested URL /wp-content/plugins/falbum/falbum-wp.phpalbum/trip-to-the-pyramids/ was not found on this server.

    i have not deviated from your install instructions. http://www.plastichippo.com

  17. @andreas – ok. fixed my errors. but i cannot get the changes i made to the falbum.css to stick. if you go to my site you’ll see what i mean. when you open up FF and use the web developers tool to “EDIT CSS” you can see my changes. but that is about it because in normal viewing mode i get the images with no borders, no drop shadow…

    HELP PLS!!

  18. I can’t wait to see how this can work with falbum 0.6.1. ;)

  19. @andreas – ok. i fixed all my problems.

  20. hallo andreas,
    ich habe alles gemacht wie du sagst, aber ich habe keine tags und immer noch meine sidebar. was habe ich falsch gemacht?
    gr?šsse,
    philippe

  21. hi andreas,
    everything works perfectly after i installed your mod. i am displaying recent photos in my sidebar, but for some reason there’s a big gap between the text “Recent Photos” and the photos themselves. do you know of any easy way to fix this issue? thanks! -leevin

  22. @wynn – I have the exact same problem as you described, I’ve downloaded the falbum version from the link in this post. What do you mean with downloading the additional files ???

  23. @Andreas: Do you plan to release a version of this mod that works with FAlbum 0.6.3? I can’t confirm that it doesn’t, but I don’t want to install the new version of FAlbum until I know this mod will work. Thanks for your hard work!

  24. After following all of the instructions, I end up with a “/photos” page that displays my albums. If I click on an album thumbnail I get the standard K2 404 page.

    “Error 404 – Not Found

    Search bar and other tools go here! If you’re reading this, it needs to be implemented, remind me!”

    You can see at:

    http://www.hijinksensue.com/photos

  25. I narrowed down the problem to something wrong with the rewrite rules. If I turn on friendly url’s the plugin works as it should. Any idea what I am doing wrong?

  26. Andreas, I recently upgraded to WordPress 2.0.1 and K2 beta 1.67. I formerly used on old version of FAlbum on my blog, but had to upgrade because of the WordPress upgrade. I downloaded FAlbum 0.5.6 and your mod for that version of FAlbum, but when I install it according to your instructions, the resulting page, shown here…

    http://www.matthewstinson.net/photos/

    …times out before ever loading the album. In fact, the page’s coding is so messed up that it exceeds my CPU use quota on my web host and results in my account being suspended for a minute or two!

    What I’m wondering is, to the best of your knowledge, does the latest version of K2 break your plugin, or do you think something else is wrong?

  27. Addendum: took the FAlbum page down. It’s killing my server.

  28. Jojo

    Hello,
    After trying the instructions on the falbum plugin wiki, i tryied using your integration method. But i get the same function error as with the standart method:

    Fatal error: Call to undefined function: fa_show_photos() in /home/www/bigtune.org/wp-content/themes/k2/falbum-wp.php on line 16

    am i missing something. Thanks in adance.

  29. Hi everybody, sorry for the late response, but I have been busy ;-)

    Ok, here we go:
    @philippe: Die neue Sidebar kommt durch meine modifizierte falbum-wp.php, wie oben beschrieben. Schau ob die installiert ist! /wp-content/themes/k2/falbum-wp.php

    @leevin: do not use div within ul tags, because .secondary div has margin 20px top setting!

    @tiryaki: download my .zip archive linked in my post and follow all the steps. But your gallery seems to look fine to me.

    @Joel: FAlbum former to version 0.6.0 has problems with rewrite rules and wordpress 2.0. I fixed them in my mod, but you have to follow all the steps I mentioned above. I mainly fixed them when using friendly url, but did not test if it works without friendly urls.

    @Matthew: Since I did not test the plugin with the new wordpress, I can’t say what is going wrong. But timeouts sound very weired to me. Sorry, no idea right now. But be careful applying my files to another falbum version, that might screw up everything!

    @Jojo: well, you just didn’t follow my steps carefully enough I would say. Go through them once again and make sure all files in the zip archive are in place.

  30. Does this hack work with the newest version of falbum (0.6.4) and and the newest vesion of K2 (163)?

  31. Seth

    Andreas,

    Before I get into the falbum install, I want to be sure I understand. I have a new WP2 install and I plan on running the latest revision of K2. I also want to include flickr albums, so my googling lead me to your tutorials.

    You reference the falbum version 0.5.6 plugin, but RandomByte is currently listing v0.6.4. Should I get the plugin from there, or from here?

  32. I answered some of my own questions, but now I have a new problem. I got everything installed and there is now a photos page at my site. :) I even got the FlickRSS into my sidebar.

    BUT.

    When you visit my Photos page and click on one of the images to see it larger… you’re brought back to the main Blog page.

    What did I do wrong?

    Issue #2
    ———

    Is there a way to control *which* of my flickr photos are included and displayed, other than by marking some private?

  33. @Seth: When looking at your page everything looks fine. Regarding issue #2: No, there is no other way.

    @All: you cannot take my mod and use it as is with other version of falbum! Either do the changes by yourself, or wait until I make it some day (don’t know when) ;-)

  34. I am trying to wrap some images around my falbum page, but the second I try, the sidbar jumps to the main portion of the page…do you know how I can fix this? Thanks for the help.

  35. I already did everything tol in your post, but when I go to page photos it appears this, you can check going to my blog clicking my nick:

    Fatal error: Call to undefined function: fa_show_photos() in /home/molaflex/public_html/wp-content/themes/k2/falbum-wp.php on line 16

    Tks and good qork.

  36. I used these (http://www.randombyte.net/wiki/falbum/k2) directions to get falbum and K2 to work. Everything seems to be working fine but my photo page displays funny and the sidebar is down on the bottom. Check it out at http://edsmiley.com/?page_id=22. I have read through some of your multiple posts and posted to the falbum and k2 forums to no avail. Thanks for any help!

    Ed

  37. dcf

    Hi andreas, i used the same randombytes k2-falbum 0.64 script as Ed. I finally got it work after shifting the falbum header code. It works ie, photos show up etc, but the titles don’t show up unless you mouse over them. This seems to have affected the front page post title too.There has to be a simple fix around this. Any help would be much appreciated andreas, as im at a loss with it. Thanks.

    DCF

  38. Hi Andreas,
    I have been struggling over the last few weeks to get falbum to work…I am trying to use it with wordpress and K2, but so far cannot even get it to correctly load the photos regardless of whether I am using default or K2 theme. I know my problem is probably very rudimentary, but wondering if you or any other experienced people might be able to take a look and perhaps tell something by the source code or whatever other info I can provide? Thanks very much…

    Scott

  39. Hi Scott,

    sorry for the very late response. I haven’t done anything with K2 or falbum in the last months. I saw that ther are some updates for falbum which changed quite some code, but didn’t look at it. Sorry.