www.julianstricker.com

Programmierer, Maker, DIYer

Wir haben uns vor einigen Jahren ein relativ großes aufblasbares Schwimmbecken zugelegt. Im Sommer haben wir uns darin praktisch jeden Tag abgekühlt. Nur leider ist es in dem Becken mit 3,5m Durchmesser und ca. 80cm Tiefe unmöglich zu schwimmen. Und am Ende der Saison hatten wir dort wo...

Continue Reading...

29 Oct

Neustart

grav

Nach Jahren der Vernachlässigungen ist es an der Zeit die Seite julianstricker.com neu zu starten: Neues Layout, neues System, neues CMS, neue Themen, neue Inhalte.

Neue Blogeinträge gibt’s jetzt nur mehr auf Deutsch. Inhaltlich werde ich zusätzlich zu den Themen Programmierung, PHP und...

Continue Reading...

To improve the workflow sometimes it may be better to redirect the user back to the list after the Save-action. This tutorial shows how to implement this in Symfony 1.3 and 1.4

First copy the "processForm"-function from the action.class.php in your cache-directory (...

Continue Reading...

During my work on the new AIE Ajax Image Editor, I have done some experiments with the new HTML5 features, especially the new Canvas tag. This script is basically a new implementation in JavaScript of a old Director-Movie which I have made about 10 years ago.


Simply move over the image to...

Continue Reading...

The sfValidatorFile has no options to check the size of a image in pixel. For that I have written a simple validator that extends the sfValidatorFile-class.

Create the file jsValidatorImage.php in your /lib directory:

class jsValidatorImage extends sfValidatorFile
{
  protected function configure($options = array(), $messages = array())
  {
    parent::configure($options, $messages);

    $this->addOption('minx', false);
    $this->addOption('miny', false);
    $this->addOption('maxx', false);
    $this->addOption('maxy', false);

    $this->addMessage('not_a_image', 'The file is not a image…

Continue Reading...

Increasing the diversity of fonts on the web using the Google Font API, the Google Font Directory and the Webfont Loader. The selection of fonts used on the Web is very small. This has changed with the new in CSS3 defined @font-face. This allows fonts to be loaded from the web, which works in all modern browsers. This mechanism requires appropriate fonts and the right to make them available on the web or to download from other sources. For this Google has created his Google Font Directory and the Google Font API.

Continue Reading...

Some time ago I wrote an article about filtering the admin-list in Symfony 1.0 and Propel. Now in Symfony 1.4 and Doctrine the steps to do this are completely different:

First we have to change the auto-generated file in apps/[APP]/modules/[MODULE]/actions/actions.class.php and to add a function "buildQuery()" to the [module]Actions-class:

class hotelActions extends autoHotelActions
{
  protected function buildQuery()
  { 
    $query = parent::buildQuery();
    //Here you can extend your $query to filter the result.
    return $query;
  }
}

So if we have a "creator_id"-field in our schema and we want to filter the result to show only the entries created by the current user, we have to add the following code:

class hotelActions extends autoHotelActions
{
protected function buildQuery()
{
$query = parent::buildQuery();
$rootAlias = $query->getRootAlias();
$query->andWhereIn($rootAlias…

Continue Reading...

Web applications can access local files and upload multiple files. The current fourth beta of Firefox 3.6 comes with support for the File API. The relevant W3C draft specification is from Mozilla developer Arun Ranganathan. The File API provides different objects. This includes FileList containing an array of individually responsive files. It should be integrated over an input tag in HTML 5 pages. Several files can be uploaded at once.

This allows Firefox to upload via drag and drop, so that files can be moved easily from the desktop into a corresponding area in a website…

Continue Reading...

Flash CS3 has a Bug when creating multilanguage projects using the Strings-Panel with String-replacement-setting set to "Automatically at Runtime".

A Bug description can be found at http://www.kirupa.com/forum/showthread.php?t=281170

I spend a lot of time on trying to find a solution for that problem:

Assuming you have a dynamic textbox linked to a Strings-Panel-ID in Frame 1 - 5 you will receive a TypeError #1009 if the Player comes to frame 6.

TypeError: Error #1009: Cannot access a property or method of a null object reference…

Continue Reading...

Its a good way to allways rename uploaded files using something like a MD5-hash and store the original filename in a database. If for some reason you dont want to rename it using a hash, you should filter the filename using some code like this one:

$filename = strip_tags($_FILES["upload"]["name"]); $filename = str_replace(array('|','<','>','"','\'',':','\','/','*','?'),'',$filename);

It's a good idea to deny the execution of all uploaded files: place a .htaccess file in your upload-directory:

RemoveHandler .cgi .shtm …

Continue Reading...