Very flexible image gallery with Alchemy CMS

Die Aufgabe:
Entwicklung eines Bildergalerie-Rasters, in das unterschiedlich breite und hohe Bilder einfließen können.
Es sollen möglichst viele Anordnungsmöglichkeiten der Bilder im Raster ausgeschöpft werden.
Die Bilder werden von einem Redakteur im Alchemy CMS eingepflegt, der die Wartung möglichst einfach haben soll und dabei keine Fehler machen können soll.

Die Lösung:
Das Raster ist insgesamt 910px breit.
Jedes darin enthaltene Bild hat einen Außenabstand von 10px zum Nächsten.

Die möglichen Bilder haben fünf verschiedene vordefinierte Größen, sodass sie in das Raster passen:
1.) “105px x 160px”
2.) “220px x 160px”
3.) “220px x 330px”
4.) “450px x 330px”
5.) “450px x 500px”

Die Bilder floaten alle links.

Problematik:
Da HTML einen Textfluss von links oben nach rechts unten hat, gerät man schnell in das Problem dass die großen Bilder links neben den kleineren stehen müssen. Ansonsten entstehen Lücken im Raster die nicht gefüllt werden können.

Die Lösung dazu:
Die Bilder floaten nicht im gesamten Raster, sondern das Raster wird in weitere unterschiedlich breite Spalten aufgeteilt in denen die Bilder jeweils floaten:
1.) ⅛ Spalte
2.) ¼ Spalte
3.) ½ Spalte
4.) das gesamte Raster

Diese Spalten habe ich in Alchemy CMS als Elemente angelegt, sodass sie vom Redakteur in beliebiger Reihenfolge platziert werden können.

In diese Spalten können jeweils die Bilder eingefügt werden.
In der ⅛ Spalte können logischerweise nur die “105px x 160px” Bilder platziert werden.
In den anderen Spalten entsprechend die Bildgrößen, die dort maximal passen.

Dieser Zusammenbau des Rasters mit Hilfe der unterschiedlichen Spalten lässt z.B. solche Strukturen zu die sehr einfach zu pflegen sind:

Permission denied: /var/www/xx/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Sometimes I got this Error Message in Apache error.log

Permission denied: /var/www/xx/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

I am using Parallels Confixx Software for managing the virtual hosts.
When creating a new RootDirectory for a Domain via Confixx, it will be create with wrong ownerships.
Setting ownerships via console will solve that error:

confixx created it with webX:webX

You need to set it to User and Apache-user:
chown webX:www-data my-Root-Dir

This should help.

libMagick (ImageMagick cannot open shared object file: No such file or directory)

On Debian 5 (Lenny) after installing ImageMagick and rmagick, when testing my rails application:
libMagickCore.so.2: cannot open shared object file: No such file or directory – /usr/lib/ruby/gems/1.8/gems/rmagick-2.8.0/lib/RMagick2.so
Missing these required gems: rmagick ...

At first I thought it must be a problem of rmagick because apaches module passenger raises up an error about missing rmagick…

But if you look closer into the problem, youll see that the libraries of Imagemagick arent found in that folders where they are excepted to be.

So what can you can do now?

1. The easiest way is to type this into the console, so the libs are getting found: ldconfig /usr/local/lib
2. compile Imagemagic again with explicitly setting the libpath to /usr/lib where the libraries are excepted.

Alchemy CMS (Content Management System)

Alchemy is a full featured Content Management System (CMS) with a gorgeous Userinterface.

Nearly every content management system stores the content of a page in a body column in the pages table. This is easy to develop and the user manages the content inside one of the fancy new Javascript based wysiwyg processors. Formatting, image placement, styling and positioning of the content is in the hand of the end-user.

We think this is completly wrong!

The content manager mustn‘t be able to change anything but the content and some basic text formatting. The content manager shouldn‘t care about headline formatting, image positioning or resizing. The developer should take care of this!

Alchemy is different!

We split the page into logical parts like headlines, paragraphs, images, etc. The only thing we store in the database is text: ids of images and richtext content. Nothing else. No markup (besides basic text formatting inside the richtext elements), no styling, no layout. Pure content!

This gives the webdeveloper the power and flexibility to implement any kind of layout with the insurance that the content manager is not able to break up the layout.

Resources
Homepage: http://alchemy-app.com
Live-Demo: http://demo.alchemy-app.com
Wiki: http://wiki.alchemy-app.com
API Documentation: http://api.alchemy-app.com
Issue-Tracker: http://issues.alchemy-app.com
Sourcecode: http://source.alchemy-app.com
User Group: http://groups.google.com/group/alchemy-cms

simple and lightweight jquery image gallery

This is a very simple and lightweight image gallery based on the jQuery javascript framework.

The principle of this image gallery is that we dont need to render thumbnails seperatly.
The thumbnails are the big images wich are resized via CSS.

You need the jQuery javascript framework and the jGalight javascript and the css styles for the gallery.




The HTML structure of the gallery is very simple.


You just need to call the jQuery function jGalight() on the object you want.


Example:
http://www.liquidbass.de/demo/jGalight/

MAC Snow Leopard MySQL 32Bit to 64Bit

My MySQL Installation is copied from a 32Bit System to a new Snow Leopard System running with 64Bit.
While Installing some Daemons, i needed to upgrade MySQL to 64Bit.

I downloaded MySQL5 Package from here:


http://www.mysql.com/downloads/mysql/

I ran into some Issues, but at least this worked for me:

First Ive stopped running MySQL-Server:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo gem uninstall mysql

I also had to remove mac ports because it did not work anymore

sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

Then I had to install mysql5-devel

sudo port install mysql5-devel

After that I was able to install the MySQL Gem with explicitly use of 64Bit architecture

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

After that i started MySQL again:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Sphinx on Mac OSX

I ran in the problem, that i could not compile Sphinx correctly.
I got many errors and warnings until make task died.

The first error looked like this:
/usr/include/iodbcunix.h:128: error: conflicting declaration ‘typedef unsigned int DWORD’

The Solution was just adding a little configure parameter:
./configure --without-unixodbc --prefix=/usr/local/

After that it works like a charm!

Transferring Files with rsync and ssh from Server to Server

This rsync Command is really helpful for transferring data to another server.
I need this very often.
rsync -vrlptgoD -e ssh ./yourfile.tar.gz root@XXX.XX.47.73:/root

If you need to change the ssh Port, you can write it as a string:
rsync -vrlptgoD -e 'ssh -p1356' ./yourfile.tar.gz root@XXX.XX.47.73:/root

change owner of files or directories globally by searching for a group

Sometimes, thankfully not very often, I need to change the group or the user of many directories or files in a global way. This could happen owing to unfortunate circumstances, e.g when you switch a Serversystem to another and something went wrong or something happens you did not plan before.

With this command I find all directories inside of /var/www with the group-id 501.
then it will execute the command chgrp for changing the group-id to 33:

find /var/www -gid 501 -type d -exec chgrp 33 ‘{}’ ‘;
(You can also write ‘…chgrp www-data’)

I have to say, this command had saved my life, for more than one time.

Verlag zu Scherzen aufgelegt

Bei der Heimwerker-Zeitschrift “Selber machen” die vom Jahreszeiten Verlag herausgegeben wird, gab es in der diesmonatigen Ausgabe (Mai 2009) einen recht unauffälligen, aber durchaus eindrucksvollen Hingucker zu entdecken!

Das Impressum der Zeitschrift wurde nicht wie gewohnt in den Druck gegeben, sondern wurde scheinbar bewusst umformuliert.
Laut Impressum kann man sich über den Bestellservice an die Heroinherstellung wenden. Desweiteren werden seltsame und nicht internetkonforme E-Mail- und Internetadressen als Kontaktmöglichkeit angegeben.

Es lässt nun Spekulationen offen ob dies ein Scherz oder gar eine art Racheakt eines Mitarbeiters war, oder ob der Verlag bewusst versucht Aufmerksamkeit auf sich zu ziehen. Wie auch immer, aus meiner Sicht ist es gelungen für ein wenig Aufmunterung zu sorgen.