phpWebLog

 
find
story index | search | archive | submit story | downloads | contact
 
Topics
  • General (829)
  • Announcements (20)
  • Development (497)
  • Mods & Hacks (16)


  • phpWebLog
  • Latest Release - 0.5.3 (BETA)
  • ChangeLog
  • TODO / Roadmap
  • Known Bugs
  • The latest unstable is available from CVS and as a tarball as well.

    For development discussions and for general support, join the phpWebLog mailing list

    phpWebLog needs active developers to help fix bugs. If you are interested, send me your SourceForge login information for CVS access.


    Last 5 Comments
  • Polls problems!! (Alberto Ferrer)
  • apache 2 and php 4.2 (stan rawrysz)
  • Polls problems!! (Lukas Razik)
  • apache 2 and php 4.2 (Anonymous)
  • Error installing (Bob)


  • phpWebLog Addons
  • Bug fix in pwlPhpWiki
  • How do you install addons?
  • Bug fix in Calendar
  • Bad arguments to join()
  • Bug fix in links addons
  • Help for addon for fetching Urls of pages
  • Links error?
  • pwlPhpWiki
  • Mailing list feature in 0.5.3 doesn't strip html tags
  • FQDN/IP support in comments?


  • date(), include blocks and parameters
    Posted by Andreas Banze
    Topic: Development
    Sunday July 30 2000 @ 03:51AM EDT
    Development I would prefer the usage of strftime() and locale() over date(), some of us are living in countries where time format differs and month/daynames differ. It's not that difficult to translate text but the date string is not enough to translate the time format as well.

    I noticed that the "include block" feature is missing in the latest unstable release. That is quite odd because I used it for including php3-Files like a calendar and server status for my quake3-servers. Will it come back or is there an oversight on my behalf?

    Last question: some scripts (like the above mentioned calendar) will require parameters to work. As a newbie in php-includes I wonder how to get the parameter through phpweblog or vice versa (keep the phpweblog parameters when calling another calender month for example). Anyone around who could enlighten me how to achieve this?


    < Image dimensions | Setup.sh Question >

    Andreas Banze writes on Monday July 31 2000 @ 03:48PM EDT: [ reply | parent ]
    concerning the include block:

    I did a rather rude hack to be able to use include files (sorry, I'm not very good in php).
    Basically it was done by defining a Block Type 2 using the URL that is used for RDF as well and the following in common.inc.php (F_drawBlock):

    $templatefile = "$G_PATH/backend/template/block.tmpl";
    $vars = "\$heading, \$date, \$content";
    $template = implode(file($templatefile), "");
    $template = addslashes($template);
    print "\n\n";
    if ($A["Type"]==2) {
    list ($tmp1 , $tmp2) = explode ("\$content",$template);
    $tmp1 = "print \"" . $tmp1 . "\";";
    $tmp2 = "print \"" . $tmp2 . "\";";
    print eval($tmp1);
    include ($A["URL"]);
    print eval($tmp2);
    } else {
    $tmp = "print \"" . $template . "\";";
    print eval($tmp);
    }

    I told you, it is ugly... ;)

    If someone could do a better approach I would gladly accept it and ask for inclusion into the sourcecode (be warned if you want to try above snippet out yourself, there are changes in admin/edit.php and admin/blocks.php needed as well - at least if you want to use the admin interface to edit it)
    jason writes on Monday July 31 2000 @ 04:39PM EDT: [ reply | parent ]
    Actually, instead of using include() or implode(file()), I used fsockopen to introduce a URL type block. This is also cached on the server end to only fetch it every hour, and insert the content into the database. I will be making this time span configurable as well. The admin/edit parts are complete for this as well.
    Andreas Banze writes on Monday July 31 2000 @ 05:15PM EDT: [ reply | parent ]
    damned, two hours of fiddling with "eval (include(some file));" wasted... ;)

    Now I only need to rewrite some scripts to put the files into a path that is accessible by the webserver...


    Thanks.
    jason writes on Monday July 31 2000 @ 07:18PM EDT: [ reply | parent ]
    yah, i did the exact same thing with trying forever to get include to work. i finally gave up, and went this route which effectively works the same.
    jason writes on Monday July 31 2000 @ 07:19PM EDT: [ reply | parent ]
    Also, this way, you can pass parameters into the URL unlike using file() or include()...

    Post a Comment

    Name:
    Email:
    URL:
      Remember my information (uses cookies)
      I would rather be anonymous
    Comment:
    * Your email will not be made public.
    Save As:


    Copyleft © 2001 phpWebLog // web news management with adolescent sexist humor
    All trademarks and copyrights on this page are owned by their respective owners