Auteur : YouAreWelcom

  • 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
    eval($Evaluate);
    $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();
    ob_end_clean();
    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.

    (suite…)

  • 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).

  • Nicer Archives integrated

    I finally integrated the « nicer archives« .

    Easy, simple, nearly nothing to do to be integrated !

    Click here to view it in action or in the Blog menu, select the option « Archives ».

  • Star Wars Trilogy DVD Details

    As you know now, the Star Wars Trilogy DVD will be out in September 2004 !

    Here is the packaging preview :

    This four disc DVD features the Star Wars trilogy.

    • Disc 1, Episode IV A New Hope: Eighteen years later, Luke Skywalker, a young farmboy on Tatooine, is thrust into the struggle of the Rebel Alliance when he meets Obi-Wan Kenobi, who has lived for years in seclusion on the desert planet. Obi-Wan begins Luke’s Jedi training as Luke joins him on a daring mission to rescue the beautiful Rebel leader Princess Leia from the clutches of the evil Empire. Although Obi-Wan sacrifices himself in a lightsaber duel with Darth Vader, his former apprentice, Luke proves that the Force is with him by destroying the Empire’s dreaded Death Star.
    • Disc 2, Episode V The Empire Strikes Back: Three years later Imperial forces continue to pursue the Rebels. After the Rebellion’s defeat on the ice planet Hoth, Luke journeys to the planet Dagobah to train with Jedi Master Yoda, who has lived in hiding since the fall of the Republic. In an attempt to convert Luke to the dark side, Darth Vader lures young Skywalker into a trap in the Cloud City of Bespin. In the midst of a fierce lightsaber duel with the Sith Lord, Luke faces the startling revelation that the evil Vader is in fact his father, Anakin Skywalker.
    • Disc 3, Episode VI Return of the Jedi: In the epic conclusion of the saga, the Empire prepares to crush the Rebellion with a more powerful Death Star while the Rebel fleet mounts a massive attack on the space station. Luke Skywalker confronts his father Darth Vader in a final climactic duel before the evil Emperor. In the last second, Vader makes a momentous choice: he destroys the Emperor and saves his son. The Empire is finally defeated, the Sith are destroyed, and Anakin Skywalker is thus redeemed. At long last, freedom is restored to the galaxy.
    • A bonus Disc 4 includes the most comprehensive feature-length documentary ever produced on the Star Wars saga; and never-before-seen footage from the making of all three films, and much more.

    Source

  • 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.

  • “Autant en emporte le vent”…Musical Comedy

    Friday, we saw the « Autant en emporte le vent » musical comedy. Wow !

    Everything was…..wow ! Music, lyrics, dancers are very good. Better than « Notre-Dame de Paris ».

    As usual, for that kind of spectacle, no camera allowed 🙁 but here are few pictures from the official site.

  • How to install and use “psnGallery” module

    Here is the draft version of the « how to install » and « how to use » psnGallery module

    (suite…)

  • Tag Gallery added in Posting…

    I have implemented a new tag in any post…

    The tag <gallery>AlbumID|Count|Size</gallery> !

    This in conjunction with the « psnGallery.php » addon allows you to display within a post « Count » random pictures from the Coppermine Album « AlbumID » in the « Size » (1= small, 2=normal).

    For example, to get 4 random small pictures from the Album 6 (Boussole), the following command <gallery>6|4|1</gallery> will give :

    Easy no ? In my-hacks.php, you have to add…
    (suite…)