Schonhose

Home | PP Addons| Gallery | Photoblog

Actions based on url parameters

October 2, 2007
php.png

Just the other day I finished rewriting the whole comments section in the administration panel of Pixelpost. I’ve been fed up by the numerous options, buttons and all the other stuff I’ve banned from my mind. So I opted for a WordPress like approach instead and it turned out quite nicely.

With the new Defensio addon I was able to use the new features I implemented but soon I got stuck. Whenever I clicked a button or a hyperlink I returned to a different page then the page I was on. Pretty frustrating and certainly not user-friendly. I dug in a little deeper and found the offending code.

The “a href” code of the links (there were multiple forms in Pixelpost) were hardcoded like this:
index.php?view=comments&page=$newpage

In the old situation there was only one comments view, but now we have subviews and the possibilities of special views created by addons. Some change was in order and I found it quickly:
$_SERVER['PHP_SELF']?$_SERVER['QUERY_STRING']&page=$newpage

This way the url is aware of the settings it had. So subviews are retained as well as possible other options by the addons. This approach is 1) far better and 2) more flexible then the old approach of hardcoding the url.

As for Defensio, it has truly amazed me thus far. :D

Categories
Miscellaneous
Tags
PHP, update

« Defensio; outsmarting evil spam Template update »

Navigation

  • Miscellaneous
  • Photography
  • Programming
  • Website

Countdown:

    No dates present

Tagcloud

3g addon allergic rhinitis backup basketball battery replacement Bob Marley budweiser bug Defensio design ebay exposition googlemaps HDR King layout update Lightroom Miscellaneous music paypal personal photoblog Photography Photoshop PHP Pixelpost pollens preview quote rant Touch UNC update videoclip vote Website Wordpress youtube

Flickr: latest uploads

Dutch landscape (HDR)Bottles and milk storage"Screaming Eagles"Douglas C-47 SkytrainDouglas C-47 Skytrain"De Toekomst"FireworksAppartment building by night.BumblebeeMoon over deserted rail road station
 

Paypal Donations

Why donate? Any donation will be considered a motivation to continue providing support and writing more plugins.

Please remember: it is not the amount but the thought that counts!
Amount: $

Twitter:

No public Twitter messages.

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox