addendum for AWstats, Plesk 8 and suexec

in the article "AWstats, Plesk 8 and suexec" i showed how to set up AWstats on a Plesk 8 system without all the suexec-trouble. recently one of my servers made another trouble, because the FollowSymLinks was missing. so i wrote this addendum.

in your vhosts.conf and vhost_ssl.conf the changes should be:

vhost.conf:

<Directory /srv/www/vhosts/foo.com/httpdocs>
        Options +FollowSymLinks
</Directory>
ScriptAlias /awstats/ "/srv/www/vhosts/foo.com/httpdocs/awstats/"
<Directory "/srv/www/vhosts/foo.com/httpdocs/awstats/">
        Options none
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

vhost_ssl.conf:

<Directory /srv/www/vhosts/foo.com/httpsdocs>
        Options +FollowSymLinks
</Directory>
ScriptAlias /awstats/ "/srv/www/vhosts/foo.com/httpdocs/awstats/"
<Directory "/srv/www/vhosts/foo.com/httpdocs/awstats/">
        Options none
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

read more/write a comment

Friday, 30. November 2007 • general0 comments/trackbacks

button-tag in MSIE

handgestrickt had to construct a very complex form. it was necessary to transfer several named actions when the user clicks a button. additionally these buttons were embedded in one form-tag.

according to the HTML-specs you can use the following construct:

<form action="foo.php" method="post">
    <input type="checkbox" name="batch[]" value="1" /> value 1<br />
    <input type="checkbox" name="batch[]" value="2" /> value 2<br />
    <input type="checkbox" name="batch[]" value="3" /> value 3<br />
    <input type="checkbox" name="batch[]" value="4" /> value 4<br />
    ...
    <button type="submit" name="action" value="edit">Edit</button>
    <button type="submit" name="action" value="copy">Copy</button>
    <button type="submit" name="action" value="delete">Delete</button>
</form>

in all standard compliant browsers, the name-value-pair gets transfered as expected. all Internet Explorers do the following: they pass all buttons at once, with the name as key and the inner HTML of the button-tags...

read more/write a comment

Friday, 07. September 2007 • general0 comments/trackbacks

image nosave with mooTools 1.11

a lot of photographers use FLASH for another good reason: it is impossible to save the images contained in the FLASH.

as an alternative, handgestrickt had the idea to place a completely transparent layer over every image with the rel-attribute of "nosave" or a nosave-attribute set to "nosave". this works in every modern browser, with one limitation in Opera: the images have to have a width and height. otherwise Opera (or mooTools) cannot measure the width and height of the image.

requires: mooTools 1.11 (Window.DomReady, Element.Dimensions)

here is the code:

var nosave = new Class({
    initialize: function() {
        window.addEvent('domready',this.prepare.bindAsEventListener(this));
        return true;
    },

    prepare: function() {
        var imgs = $$('img');
        for(var a=0;a<imgs.length;a++) {
            if(
                imgs[a].getProperty('nosave') ||
                (imgs[a].getProperty('rel') && imgs[a].getProperty('rel').match(/(?:^|;)nosave(?:$|;)/i))
        ...

read more/write a comment

Tuesday, 28. August 2007 • general0 comments/trackbacks

smarty modifier for FLASH Videos

a handgestrickt customer uses the "Free Video to Flash Converter" for converting his videos to FLV-format. this program also provides a FLASH-file with a very basic player, called player.swf.

this modifier is designed to take a link to an FLV-file and convert it to an HTML-snippet including a FLASH-plugin, with the player.swf, the link as the file-argument and the link-text as the player-title. this modifier is highly configurable.

basically this modifier can also be used for other FLASH-Video-players. only tiny modifications have to be made.

the code:

<?php
function identify_modifier_flvlink2flash () {
        return array (
                'name' => 'flvlink2flash',
                'type' => 'smarty_modifier',
                'nicename' => 'FLV-Link to FLASH',
                'description' => 'Converts a Link to an FLV-Video to a fully FLASH.',
                'authors' => 'Stefan Jelner <info@handgestrickt.biz>',
                'licence' => 'GPL',
                'help' => ''
     ...

read more/write a comment

Friday, 24. August 2007 • general0 comments/trackbacks

unobtrusive scrolltext with mooTools

recently handgestrickt is really crazy for mooTools. we developed a whole bunch of unobtrusive scripts, we will publish in the future.

yesterday we had a quite simple task: we needed a scrolltext. unlike the 5 million DHTML solutions out there, where you have to fiddle your scrolltext into the JavaScript code, we wanted a scrolltext that changes any normal element with the classname "scroller" and a CSS-overflow to a scrolltext.

in mooTools this is very easy. we did the same trick as in old C64-days. first we measured the whole width of the scroller plus the width of the element. then we copied the same text at the end of the scrolltext, to make it look infinite. when the scrolltext reached the point, where it starts over, we just reseted it to zero.

following mooTools dependencies: mooTools 1.11 (Fx.Scroll, Fx.Transitions, Window.DomReady, Element.Selectors)

tested in: Internet Explorer 6.1 and 7, Firefox 1.5 and 2.0.0.6, Opera 9.01, Safari 3.0.3, Konqueror 3.4, Galeon 1.3, Mozilla...

read more/write a comment

Friday, 24. August 2007 • general1 comments/trackbacks

PHP 4 and 5 and UTF-8 BOM issues

handgestrickts favourite source-code-editor is Ultraedit 32. this editor, like many other modern editors, has a good feature to mark files as UTF-8 encoded. this mark is called BOM (byte order mark) and is a 2-4 bytes mark in the beginning of a file, that indicates which Unicode-type is used. what a brilliant idea.

unfortunately PHP 4 and 5 send these marks as output to the browser. so if later you use a session_start()- or header()-function somewhere, you end up with the error message "headers already sent in ...".

after searching the web, we found the solution: PHP 5.2.0 introduces the configure-switch --enable-zend-multibyte. this switch enables PHP to recognize the BOM as what it is. unfortunately you have to recompile PHP.

for people using PHP on windows or others hosting on a shared public webserver, there are other workarounds: the first line in your PHP code should be a comment with a Unicode-character inside, like german "Umlaute", for example. then you save this file as UTF-8...

read more/write a comment

Thursday, 26. July 2007 • general1 comments/trackbacks

relaunch of mp3.de

for the cologne agency tigavision GmbH, handgestrickt is making the AJAX-functionalities for the relaunch of the german well-known music-platform mp3.de. todays topic was the common search-input functionality, to suggest possible values based upon some characters the user typed in. one interesting task was the "loose" or tolerant phonetic search for entries. this is done by the MySQL and PHP-function soundex. this function calculates some phonetic key for every word, that can be matched against nearly matching words. for performance we splitted the result of soundex into varchar and bigint pieces and stored them in the database with indexes. the result was a lightining fast phonetically tolerant suggestion algorithm.

as a developing enviroment we used a Windows 2000 with a XAMPP-installation. Apache, MySQL, PHP5 is installed in minutes. unbelievable! for versioning we use TortoiseSVN.

read more/write a comment

Monday, 23. July 2007 • jobs0 comments/trackbacks

newbie-Ruby

just for fun and to provide a very new service to our customers, handgestrickt learned Ruby recently. the syntax is simple, highly structured, clearly readable, yet powerful. for people who are used to read cryptic Perl-scripts, Ruby is a real delight.

in the next weeks we will have a look at Ruby On Rails.

inspite of using the Apache mod_ruby to make our Ruby-scripts running on the webserver, we just run them as CGI-scripts by adding the following to the Apache-configuration:

<IfModule mod_mime.c>
    AddHandler cgi-script .cgi .rb
</IfModule>

we do not want to hide our first efforts. the following script reads out the current folder and outputs it to the browser. you can click on a file or folder to open it.

#!/usr/bin/ruby

class Folderview
        #requiring and including necessary modules
        require "erb"
        include ERB::Util
        require "cgi"

        #constructor
        def initialize(folder = nil)
                #default values
                @folders = []...

read more/write a comment

Saturday, 21. July 2007 • general0 comments/trackbacks

kochlip.de, typo3 and first typoscript

handgestrickt is very proud of the first complex typoscript using automaketemplate, a barrier-free complex tree-menu called cron_accessiblemenus and the HTTPS-enforcer https_enforcer. this template is still very simple, but already providing a lot of great functionality. i wrote it for my customer kochclip.de. the designer is using dreamweaver and the HTML-templates are made, using the barrier-free-features of it plus the JavaScript-spryMenu. this typoscript is using all the naming conventions of dreamweaver. and it works well! in the next weeks, i want to have a look at templavoila.

typoscript:

config {
        locale_all = de_DE
        language = de
        htmlTag_langKey = de
        doctype = xhtml_strict
        metaCharset = iso-8859-1
        xhtml_cleaning = all
        simulateStaticDocuments = 1
        simulateStaticDocuments_addTitle = 1
        noPageTitle = 2
}

meta {
        keywords.field = keywords
        description.field = description
        language = de
}

plugin.tx_automaketemplate_pi1
...

read more/write a comment

Saturday, 21. July 2007 • jobs0 comments/trackbacks

musikfabrik and litebox-bugfix

handgestrickt finished the customer musikfabrik. the website was created with Contenido. we integrated a FLASH-slideshow and a litebox-module. litebox had a bug in Internet Explorer 7 that had to be fixed. when the image pops up, the screen is blurred out. unfortunately in Internet Explorer 7 the screen is only blurred out partly. if you scroll down, the page is not blurred. i fixed this bug, including an algorithm, that tries all properties to find the document-height. in the end it takes the highest value. the real hard work was moving the customer from one server to another. because Contenido is lacking of a client-export-feature, i had to write a script that does this. all the foreign-keys had to be retrieved an reconnected. additionally some keys were hardcoded into templates. all of the templates had to be rewritten with search and replace. finally this thing is running cleanly on a new server.

litebox bugfix:

function getPageSize(){
        var windowWidth, windowHeight;
       ...

read more/write a comment

Saturday, 21. July 2007 • jobs9 comments/trackbacks

page navigation