IP to geoLocation

Wednesday, March 11, 2009 Posted by

Our friends at maxmind.com offer a great Database to put a geographic location to an IP adress. And they even offer a testsite … that you might come in handy sometime

Database abstraction Layer MDB2

Monday, February 16, 2009 Posted by

As part of pear MDB2 is quite easy to get

pear install MDB2
pear install MDB2_Driver_$db

Usage is quite straigtforward too:

<?php

$dburl = “mysql://user:password@localhost/databaseName”;
require_once(“MDB2.php”);
$dbconnection = MDB2::factory($dburl);

$sql = “select * from users”;
$resultset = $dbconnection->query($sql);
if(PEAR::isError($resultset)) {
die(‘Failed to issue query, error message : ‘ . $resultset->getMessage());
}

while($row = $resultset->fetchRow(MDB2_FETCHMODE_ASSOC)) {
foreach($row as $field => $value) {
echo “$field / $value “;
}
}

/*************************************
* prepared statements are not to difficult
*************************************/
$sql = “UPDATE table SET column = ? WHERE id = ?”;
$types = array(‘integer’, ‘text’);
$statement = $con->prepare($sql, $types, MDB2_PREPARE_MANIP);
$data = array(5, ‘blah’);
$affected_rows = $statment->execute($data);
if(PEAR::isError($affected_rows)) {
// die etc.
}

?>

Colorblender – passende Komplementärfarben finden

Wednesday, January 28, 2009 Posted by

Wenn man wie ich lange weit weg von Design ist und doch mal wieder ein wenig mit Farben spielen muss – Colorblender kann automagisch passende Farben berechnen.

Ein weiteres nettes Tool für Farbschemas kann die Farbgebung auch einfacher machen.

The tiniest CMS

Wednesday, January 21, 2009 Posted by

It’s NanoCMS

Features:

  • Filebased
  • Easy Integration
  • Easy Installation
  • Tiny
  • Full Templating
  • Simple ( or simplest ) Interface
  • WYSIWYG
  • Automatic Sidebar Linking!!
  • Add Content other than pages also.
  • Easy to Extend
  • Multilingual & Easy to Translate
  • Use PHP Scripting…

Most of the stuff you need for a small website without getting your hands dirty

Obtree database cleanup – list of objects with most instances

Wednesday, January 21, 2009 Posted by

Note for me, do not forget that

select object_id, count(object_id) as x from objpicture group by object_id order by x desc

Replace objpicture with other tables as neeed, but the binaries will make up quite a bit of  content

mod_rewrite and alias or directories

Tuesday, January 20, 2009 Posted by

I have been trying around and i think i got it figuted out why mod_rewrite ignored the directives i gave for a directory. The simplified vhost file should explain

<VirtualHost 143.161.2.140:80>
DocumentRoot d:\Sites\app1
ServerName example.com

RewriteEngine on
RewriteLog logs/mod_rewrite.log
RewriteLogLevel 0

Alias /app2 “d:\Sites\eparcelroot\pages\eParcel”
<Directory d:\Sites\approot\pages\app2>

Options Indexes MultiViews FollowSymLinks
# without FollowSymLinks mod_rewrite does nothing in the direcotry

AllowOverride All
Order allow,deny
Allow from all

RewriteBase /app2
# without RewriteBase you’ll be stuck in the documentroot

RewriteCond   %{THE_REQUEST}   /download/
RewriteRule    download.php/(.*)/(.*)   download.php?id=$1&file=$2 [nocase,last]

</Directory>

</VirtualHost>

Getting Obtree output to be xhtml valid

Monday, January 12, 2009 Posted by

As Obtree dates back in the times before xhtml it takes a few tweaks to get the output to be xhtml conform.

In the StyleDefinition DefaultStyles add the following

<!– convert the sys-break of text objects from <br> to <br /> –>
<styledef sys-break>
<styleheader><br /></styleheader>
<stylefooter></stylefooter>
<stylepreview displayname=”sys-break” font=”sans-serif” size=”12″  color=”black” />
</styledef>

<!– change the <p> that a <sty sys-align-left> creates from<p> to a <div> – so you can use <h1> in it –>
<styledef sys-align-left>
<styleheader><div style=”padding-bottom: 12px”></styleheader>
<stylefooter></div></stylefooter>
<stylepreview displayname=”sys-break” font=”sans-serif” size=”12″  color=”black”/>
</styledef>

Größenangaben in em

Friday, January 9, 2009 Posted by

Ich habe endlich eine verständliche Erklärung der EM-Größenangaben gefunden:

Obtree – list of unreferenced objects

Thursday, January 8, 2009 Posted by

If you need it, and are brave enough, try this:

SELECT
op.object_id,
wo.name,
wo.url,
op.valid_from,
op.updated_date,
op.state,
op.raw_size
FROM
objpicture op
INNER JOIN webobjects wo ON (wo.id = op.object_id)
WHERE
object_id NOT IN (
SELECT
mr.ref_id
FROM
webobjects wo
LEFT JOIN macroref mr ON (mr.ref_id = wo.id)
WHERE
mr.ref_id in (
SELECT object_id FROM objpicture
)
)
AND object_id NOT IN (
SELECT page_id FROM objilink WHERE page_id IN (
SELECT object_id FROM objpicture
)
)
AND wo.type = 5
ORDER BY op.raw_size DESC

Haarverlust

Tuesday, January 6, 2009 Posted by

Haarverlust So, es ist passiert. Eine Veränderung hat stattgefunden.