Archive for the ‘mysql’ Category

Upload plugin für TinyMCE

Dienstag, September 23rd, 2008

TinyMCE hat leider kein Plugin für Upload und alle Plugins, die ich gefunden habe, waren kompliziert. Daher habe ich ein einfaches Plugin geschrieben. Ich habe JQuery und das Multiple Upload plugin verwendet.

This article in english

Download: tinymce_simpleupload.zip
Installation:
1) Verzeichnis entpacken im plugins-Verzeichnis von Tinymce
2) simpleupload zufügen bei den Plugins und bei den Buttons:

plugins : „simpleupload, …“,
theme_advanced_buttons3_add : „simpleupload, …“,

3) Die Datei dialog.php aus der ZIP-Datei konfigurieren. Die Parameter sollten selbsterklärend sein.
4) Dann sollte es so aussehen:

Land eines Besuchers ermitteln

Samstag, August 9th, 2008

Der Browser sendet die IP-Nummer des Besucher-Computers an den Webserver. Diese IP-Nummer ist einem Provider zugeordnet und damit kann man das Land des Besuchers ermitteln.

Listen mit der Zuordnung Land zu IP-Nummer gibt es hier:

http://ip-to-country.webhosting.info/node/view/6
http://ip.ludost.net/

In Mysql werden IP-Nummern am besten als integer gespeichert. Für die Umwandlung von integer zu IP-Nummer gibt es die MySQL-Funktionen INET_ATON und INET_NTOA.

mysql> SELECT INET_ATON('209.207.224.40');
        -> 3520061480

The generated number is always in network byte order. For the example just shown, the number is calculated as 209x2563 + 207×2562 + 224×256 + 40.

mysql> SELECT INET_NTOA(3520061480);
        -> ‘209.207.224.40′

Piwik Web Analytics Software

Montag, Juni 30th, 2008

Piwik ist eine neue Open Source Analytische Software für Websites, wie Google analytics. Piwik schreibt alle Seitenzugriffe in eine Datenbank und erstellt aussagekräftige und schöne Statistiken daraus. Alle Daten sind auf Ihrem privaten Server, also Google (oder andere) haben keinen Zugriff. Es muss lediglich in jede Seite ein kurzes Javascript eingefügt werden. Piwik verlangt PHP 5.1.3 mit PDO und MySQL 4.1.

PDO ist leider bei vielen Webhostern nicht installiert. Piwik verwendet das Zend-Framework. Hier ist eine Anleitung, wie man das Zend-Framework ohne PDO verwenden kann: http://devzone.zend.com/…. Ich habe es selber noch nicht getestet.

SyncTables

Donnerstag, Mai 1st, 2008

There is a new softwaretool to copy and synchronize database tables between different databases (MySQL, MS SQLServer and Access). This tool even has an http-tunnel so synchronizing your local database to your webdatabase is getting very easy!

Have a look at http://SyncTables.com

delete from MySQL with outer join

Montag, Januar 21st, 2008

Here is the code to delete records from a MySQL table with an outer join.

e.g. to delete the records from a products_to_categories table that have no product in the products table:

delete from pc
using products_to_categories as pc
left outer join products p on pc.products_id =p.products_id
where isnull(p.products_id)

UTF8 with PHP and MySQL

Dienstag, Dezember 11th, 2007

There are still a lot of problems when converting a site from latin to UTF8.

Here a some links which describe what has to be done and how:

Unicode Theory:

http://www.joelonsoftware.com/articles/Unicode.html

cheatsheet

http://developer.loftdigital.com/blog/php-utf-8-cheatsheet

unifier

http://www.melody-soft.com/html/unifier.html

MySQL 4.1 und Zeichensätze

http://www.hosteurope.de/faq/index.php?cpid=12229

Using UTF-8 with UltraEdit

http://www.ultraedit.com/index.php?name=Forums&file=viewtopic&t=3511&highlight=unicode

PHP 6/Unicode design document

http://devzone.zend.com/content/summaries/php-unicode-design.txt

Andrei Zmievski’s presentations

http://www.gravitonic.com/talks/

Unicode Consortium reference point

http://www.unicode.org/

The ICU Library at the core of PHP 6

http://www.icu-project.org/

Joel Spolsky’s introduction to Unicode

http://www.joelonsoftware.com/articles/Unicode.html

Handling UTF-8 with PHP

http://www.phpwact.org/php/i18n/utf-8

utf-8-und-die-entity

http://blog.antikoerperchen.de/beitrag/42/utf-8-und-die-entity.html

PHP UTF-8 is a UTF-8 aware library of functions mirroring PHP’s own string functions. Does not require PHP mbstring extension though will use it, if found, for a (small) performance gain.
http://sourceforge.net/projects/phputf8