Archive for July, 2007

Sebastian Bergmann’s Blog: Wanted: PHP Implementation of Unified Diff

Monday, July 30th, 2007

Sebastian Bergmann has posted a wanted sign over on his blog he’s looking for a PHP function to do two things:

takes two strings as its input and
returns a string with the differences between the two string in the same format as GNU diff would return for diff u for two files that contain the respective strings.

Think you can help him out? Drop him a line…

Vulnerabilities Found in Joomla! and Drupal

Monday, July 30th, 2007

Elizabeth Naramore writes: Recent Secunia security reports include Drupal and Joomla! CMS's, so if you're using these packages, you might want to listen up. While both security exploits are considered “less critical” by Secunia, you still will want to patch your install. You can go to Secunia to read more about these vulnerabilities:

  • Joomla! Multiple Vulnerabilities
  • Drupal Multiple Cross-Site Scripting and Request Forgery Vulnerabilities

And to get your vendor patches or upgrades, you'll need to go to the Joomla! site or the Drupal site respectively.

Sara Golemon’s Blog: Fun with unicode

Monday, July 30th, 2007

Sara Golemon, being interested in Unicode as she is, decided to investigate further when she saw a recent post about issues with Unicode math symbols:

Being a whimsical sort, I decided that actually implementing his request would be more fun than simply pishposhing it. I’m not suggesting this be part of PHP6 (I still don’t personally think it’s a good idea), but it’s a fun exercise and good for a conversation starter…

There’s several things she can now do with the special characters including dumping out the results of divisions, comparisons and fractions natively.

Stefan Mischook’s Blog: Object Oriented PHP Videos are now out!

Monday, July 30th, 2007

Stefan Mischook has taken the time to come up with some new video tutorials for PHP covering an introduction to and the use of object oriented programming in your PHP applications.

With the release of php5 (in 2004,) php programmers finally had the power to code with the ‘big boys’. Like Java and C#, php finally had a complete OOP infrastructure. In these videos, you will be guided (stepbystep) through the process of building and working with objects using php’s builtin OOP capabilities

There’s two videos currently:

Introduction to Object Oriented PHP
Why learn Object Oriented PHP

As well as a PDF file to accompany the Why OOP? video for more reference information.

Community News: Latest PEAR Releases for 07.30.2007

Monday, July 30th, 2007

Latest PEAR Releases:I18N_UnicodeNormalizer 1.0.0RC3PHP_DocBlockGenerator 1.1.0PhpDocumentor 1.4.0Net_LDAP 1.0.0RC3File_Fortune 1.0.0Services_Digg 0.2.0I18N_UnicodeNormalizer 1.0.0RC4Services_W3C_HTMLValidator 1.0.0RC1Services_Digg 0.2.1pearweb 1.16.2Translation2 2.0.0RC1Pager 2.4.4Services_SharedBook 0.1.0Services_Compete 0.1.0XML_RPC2 1.0.2

Debugging HTML and CSS

Monday, July 30th, 2007

“Thought this might be useful to a few people here when trying to track down problems with their layout. It’s the process I use to hunt down issues when people post problems on here so hope it helps give people and idea of how to breakdown…”

Find unused CSS selectors with “Dust-Me Selectors”

Monday, July 30th, 2007

Regular readers will be well aware of the work we’ve been doing over the last few months to improve the SitePoint Contests and Marketplace. My role in all of that has been to improve the front-end — better semantics and accessibility, more efficient code, no unecessary scripting, and a reconciliation of all the disparate bits of CSS that were styling it.

As you can imagine, I inherited a lot of legacy CSS, both from the old Marketplace, and from the site in general. I needed some way of separating this out, of keeping only the rules we actually needed.

If you’ve ever worked on a large project — especially where several people are all working on the same stylesheets — you’ll know how quickly it can get out-of-hand. Styles are added over time, then forgotten about, and coming back on a stylesheet months (or in this case, years) later can be a scary experience. How much of that is necessary? You don’t always know, but you fear deleting anything, in case something, somewhere is using it.

I needed a tool that could work this out for me — something I could run in the background during development that would build up a profile of which rules are not being used anywhere. And since there wasn’t anything out there to do this job (at least, nothing that I or any of my colleagues could find), I wrote my own — initially as a Greasemonkey script, and finally as a full-blown Firefox extension.

And here it is — enjoy!

 

Comments, thoughts, suggestions for the next version? I’d love to hear what you think.


Find unused CSS selectors with “Dust-Me Selectors”

Monday, July 30th, 2007

Regular readers will be well aware of the work we’ve been doing over the last few months to improve the SitePoint Contests and Marketplace. My role in all of that has been to improve the front-end — better semantics and accessibility, more efficient code, no unecessary scripting, and a reconciliation of all the disparate bits of CSS that were styling it.

As you can imagine, I inherited a lot of legacy CSS, both from the old Marketplace, and from the site in general. I needed some way of separating this out, of keeping only the rules we actually needed.

If you’ve ever worked on a large project — especially where several people are all working on the same stylesheets — you’ll know how quickly it can get out-of-hand. Styles are added over time, then forgotten about, and coming back on a stylesheet months (or in this case, years) later can be a scary experience. How much of that is necessary? You don’t always know, but you fear deleting anything, in case something, somewhere is using it.

I needed a tool that could work this out for me — something I could run in the background during development that would build up a profile of which rules are not being used anywhere. And since there wasn’t anything out there to do this job (at least, nothing that I or any of my colleagues could find), I wrote my own — initially as a Greasemonkey script, and finally as a full-blown Firefox extension.

And here it is — enjoy!

 

Comments, thoughts, suggestions for the next version? I’d love to hear what you think.

This article provided by sitepoint.com.

SimpleGraph

Sunday, July 29th, 2007
Package: SimpleGraph
Summary: Generate bar chart graphs
Groups: Graphics
Author: Vlad
Description: This class can be used to generate bar chart graphs.

It generates an image with a vertical bars graphs. It takes as parameters the height of each bar and the respective names.

The scale of each bar can be automatically adjusted.

The bar graph image is generated in the PNG format and is served as the current script output.

dynamic graph

Text to image with selected font

Saturday, July 28th, 2007
Package: Text to image with selected font
Summary: Generate an image with a given text
Groups: Graphics, PHP 5
Author: Taslim Mazumder Sohel
Description: This class can be used to generate an image with a given text.

It creates an image with a given width and height and renders a given text string in a specific position.

The text font, size, foreground and background colors are configurable.

The image can be saved to a server side file or generated as the current script output in the JPEG, PNG or GIF formats.