Interaction design • webdevelopment • web art • photography
The PHP WTF
Here's a quick (and probably incomplete) how-to on making public your feed on feeds view script while still hiding your admin scripts in a protected dir:
include_once("init.php");
to point to the original dir: include_once("../protected_dir/init.php")
is_writable( "cache" )
to is_writable( dirname(__FILE__)."/cache" )
milov.nl/feeds/
This is a custom view script I wrote for my feed on feeds [2252] install, removing a bunch of details/options I don't need. Most importantly: I have no desire to read people's weblog entries in anything other than the original design, so descriptions are out.
It's still basically a flat listing of recent items sorted by date, except I made it so adjacent items are grouped together in one block if they happen to be from the same feed; resulting in something that would look quite nice in a narrow side frame or searchpane (IE-users can click here to open it in theirs--can't wait for Firebird to support this).
Source (script, template and stylesheet):
view-mv.php
view-mv.inc.html
view-mv.css
(Update: I have since totally changed the look of my /feeds/ page so don't be surprised if these templates make it look rather different)
"funky caching" is what I usually try to do too on templated php-powered sites; generating static pages on access rather than on saving of data simply makes a lot more sense once you're used to it.
Although the concept of using a custom 404 php-script hadn't occured to me yet: checking if the appropriate static copy exists and the optional generating occurs in one main index.php. [via kryogenix.org]
42 slides of PHP tips by Rasmus Lerdorf (.pdf) [via php.weblogs.com]
Announcing PHP Tools version 1.0 - Rasmus Lerdorf, 1995. [via Henso.com]
Another Secure Programming in PHP article; these are always worth the read. [via php.weblogs.com]
phpMyAdmin 2.2.2 heeft weer wat meer leuke dingetjes dan 2.2.0 al had. Oeh, checkboxes voor de tables! Onderstreepte primary keys!
Adjusted my script to ping weblogs.com using the www.yaysoft.com/pingweblogs.php XML-RPC function. More bandwidth-friendly than the simulated form-submit.
phpMyAdmin 2.2.0 is out. < print 'cool!'; ?>
[via elrado.nl]
Sometimes, you just can't help but name a variable '$usertopicmenulistitem'...
Another 'Security flaws in PHP' article, somewhat more accessible than this one I mentioned two days ago.
[via drop.org]
Exploiting Common Vulnerabilities in PHP. Read this and learn. [via lgf]