Category Archives: Uncategorized

When a directory becomes a subdomain

Quand on veut que chaque sous-répertoire devienne directement un sous-domaine : voici le “virtualhost” a ajouté dans le fichier Apache :

<VirtualHost XXX.XXX.XXX.XXX>
DocumentRoot /home/domain/www ServerName
ServerAlias *
VirtualDocumentRoot /home/domain/%-3.0
UseCanonicalName off
CustomLog /home/domain/logs/access_logs combined
ScriptAlias /cgi-bin/ /home/domain/cgi-bin/
User domain Group users

cpg_picture quickfix

Well, I was too fast to deliver the psnGallery2…In the sql, included in the “package”. There is a “(” too much !

In order to fix the issue. Execute the following sql (eg, from phpMyAdmin) :

UPDATE wp_psnGallery SET value = 'CPGPicture($elems[ 0 ], $elems[ 1 ], $elems[ 2 ], $elems[ 3 ], $elems[ 4 ], $elems[ 5 ], $elems[ 6 ]);' WHERE "kind" = 'TAG' AND "key" = 'picture' LIMIT 1 ;

And here is sample of the display of one specific picture via the tag <cpg_picture>759|1</cpg_picture>


PHP Tag within a post

Based on the work of Stevarino and to answer to WordPress Forum, here is another version :

I found the problem….It comes the formatting functions which convert few “special” characters into more fancy one….

function run_phpinpost($data) {
$PHPTag = "phpcode";
$data = str_replace(array("rn","r"), "n", $data);
while (false !== strpos($data, "< ".$PHPTag .">")) {
$Before= substr($data, 0, strpos($data, "< ".$PHPTag.">"));
$After = substr($data, strpos($data, "")+(strlen($PHPTag)+3));
$Evaluate = substr($data, strpos($data, "< ".$PHPTag.">")+(strlen($PHPTag)+2));
$Evaluate = substr($Evaluate,0,strpos($Evaluate, "")-1);
$Evaluate = str_replace(array("’","‘"),"'", $Evaluate);
$Evaluate = str_replace(array("”","“"),'"', $Evaluate);
ob_start(); // run that data and grab what comes out
$data = $Before.ob_get_clean().$After;
} // end of while
return $data;
} // end of run_phpinpost

add_filter('the_content', 'run_phpinpost');

to use it, simply put the code above in “my-hacks.php”, and in your post use the tags :
<phpcode>php executable code </phpcode>

By the way if you are using an “old” PHP version, the function ob_get_clean() is not existing so :

// To add compatibility with earlier PHP version...(before 4.3.0)
if (!function_exists("ob_get_clean")) {
function ob_get_clean() {
$ob_contents = ob_get_contents();
return $ob_contents;

psnGallery2 1.2.1 changes overview

Well, I know it is always annoying to wait for news…. So here are some… 🙂

The most important addition/change with the release is the fact that all the configuration parameters are now stored in a table in the “wordpress” database (see below to have further information).

Here are the differents news functionnalities available with psnGallery2 1.2.1 :

  • User Defined tags for posting where you associate a tag to php code
  • Coppermine Albums viewer within WP-Admin area
  • Coppermine Pictures viewer within WP-Admin area
  • psnGallery2 parameters viewer within WP-Admin area
  • Fix of few bugs
  • etc…

In the future versions, I will add a “online” configuration of psnGallery2.

Continue reading psnGallery2 1.2.1 changes overview

psnCPGAdmin preview (psnGallery2 admin page)

According the WordPress Support forum, several requests appeared..about having a way to found out the albumid, the pictureid, etc…

So, my answer is :

Here is a preview of the Administration page for psnGallery2 plugin.

psnCPGAdmin Overview

psnCPGAdmin Overview

The new psnGallery2 will be out soon. In fact, I am reviewing the way of handling the “customized” tags and as you can imaigne in the preview above, a management of the plugin parameters is done now via another way (a configuration table). This is in test phase since yesterday.

If I have enough time, the new release (including the admin page) will be available for download tomorrow night (GMT+2).

George W. Bush quotes…

I have gathered few quotes from George W. Bush….

The vast majority of our imports come from outside the country.” – George W. Bush

If we don’t succeed, we run the risk of failure.” – George W. Bush
One word sums up probably the responsibility of any Governor, and that one word is ‘to be prepared’.” – George W. Bush

I have made good judgments in the past. I have made good judgments in the future.” – George W. Bush

The future will be better tomorrow.” – George W. Bush

We’re going to have the best educated American people in the world.” – George W. Bush

I stand by all the misstatements that I’ve made.” – George W. Bush

We have a firm commitment to NATO, we are a part of NATO. We have a firm commitment to Europe. We are a part of Europe.” – George W. Bush

Public speaking is very easy.” – George W. Bush

A low voter turnout is an indication of fewer people going to the polls.” – George W. Bush

We are ready for any unforeseen event that may or may not occur.” – George W. Bush

For NASA, space is still a high priority.” – George W. Bush

Quite frankly, teachers are the only profession that teach our children.” – George W. Bush

It isn’t pollution that’s harming the environment. It’s the impurities in our air and water that are doing it.” – George W. Bush

It’s time for the human race to enter the solar system.” – George W. Bush

Cortech ‘2004

Sunday afternoon,in Antoing, the “Cortech” took place for the second time. It is a parade in the streets of the town.

My wife, as she works for the “Foyer Culturel d’Antoing” , and I gave a hand to the organisation of the event.

She participated more than me, she had to sew the costume of the new “Madame Chat” giant.

It was fun and the streets were crowded !

Dimanche après-midi, à Antoing, the “Cortech” a eu lieu pour la deuxième fois. Il s’agit d’une parade dans les rues de la ville.

Ma femme, qui travaille pour le “Foyer Culturel d’Antoing”, et moi avons donné un coup de main au déroulement de l’évènement.

Elle a participé plus que moi, elle a dû coudre le costume du nouveau géant “Madame Chat”.

C’était amusant et les rues étaient pleines de monde.