24 Aug 2012, 12:26am
php:

leave a comment




  • Anzeige
  • Papercite Crashes WordPress

    Just updated Word­Press as well as all the plu­g­ins and sud­denly my résumé page is blank. And just in case some­one else expe­ri­ences a sim­i­lar issue, I took notes of all the steps to fix the issue below.

    Turn­ing off likely plu­g­ins revealed that papercite (a plu­gin used to ren­der pub­li­ca­tions in the BIB for­mat as HTML) was the reason.

    To under­stand­ing the prob­lem I turned on error mes­sages to actu­ally see what was going on by
    edit­ing index.php in wp-content/themes/ / and added fol­low­ing line to the begin­ning of the file:

    <?php ini_set('display_errors',1); error_reporting(E_ALL); ?>

    From that I could under­stand that papercite was unable to load a PEAR mod­ule due to the strong restric­tions that my web space provider had set up (which is also why I can not edit the php.ini file directly to turn on error messages).

    Solu­tion: Go to Set­tings -> papercite plu­gin and change the parser to OSBiB parser (which does not depend on PEAR), et voilà my résumé with pub­li­ca­tions is back! :)

    Finally, let’s remove the PHP line I added in the begin­ning from the index.php file.

    2 Feb 2010, 7:13pm
    jobs projects:

    leave a comment




  • Anzeige
  • How to Make Jquerymenu for Drupal Keep its State on Page Reload

    While set­ting up the web­site for my new project “Glo­cal” www.glocal-project.eu), I came across the prob­lem of find­ing a proper menu mod­ule. Some­thing easy to use, sta­ble and effi­cient in the same time for the com­plex intranet struc­ture (there­fore, sorry, but you will not be able to see my solu­tion there unless you are a project mem­ber). Some­thing with a high usabil­ity in the end. Active­menu is still quite buggy and DHTML Menue requires a dou­ble click to actu­ally open a page — unbear­able in a non-doulbe-click envi­ron­ment like the Inter­net — who is sup­posed to guess, that this menu requires a dou­ble click?? Leav­ing me with JQuery­menu.

    First impres­sion: per­fect! Open and close branches by click­ing (+) or (-) — view page by click­ing menu item label. Even the few styling issues could be fixed eas­ily by using CSS. But as soon, as some­one clicks a label, the menu col­lapses to its default sta­tus. It does not remem­ber its last sta­tus after load­ing a dif­fer­ent page with the same menu.

    Is this it? All mod­ule have crit­i­cal down­sides like this? I was quite dis­ap­pointed! :(

    But I taught JQuery­menu to remember!

    As it is quite some code, I will not post it here directly, but added it to the tracker page for this “fea­ture request” or you can down­load the two updated files (jquerymenu.js and jquerymenu.module) here and replace the once in your /sites/all/modules/jquerymenu folder.

    But please be care­ful, it should be con­sid­ered an alpha ver­sion, there are quite some weak­nesses (see tracker page). Any feed­back or sug­ges­tions are very wel­come!

    5 Aug 2009, 1:12pm
    php:

    leave a comment




  • Anzeige
  • Simple redirection using PHP and HTML meta tag

    Some­thing every­one needs once in a while… maybe you moved a file on your server or you did not install word­press in the root folder of your web­server — like I did nei­ther ;) — a redi­rec­tion or for­ward­ing can be an easy answer.

    The script is rather sim­ple — it redi­rects in three ways to pro­vide a rea­son­able fall back if any of the auto­matic redi­rect­ing fails. To use it on your server, just enter the URL/address/file name/folder you would like the user to be redi­rected to in the sec­ond line of the page/script.

    Put the whole code and markup in a file with file exten­sion “.php”.
    In my case, every user end­ing up at “www.svenbuschbeck.net” should to be for­warded to “www.svenbuschbeck.net/wordpress/home”. So I adjusted the script below like “$url = ‘wordpress/home’”, named the file “index.php” and put it in the root folder. Done :) .
    <?php
    $url = 'put your URL between the parenthesis';
    header("Location: $url");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
    <meta http-equiv="refresh" content="0;url=<?php echo $url; ?>"/>
    <title>You will be redirected... </title>
    </head>
    <body>
    If you are not redirected automatically, please click <a href="<?php echo $url; ?>">here</a>.
    </body>
    </html>