Firefox HTML Validator plugin fix (Ubuntu Feisty or Gutsy)
Posted on: Nov 8th 2007 | Posted by: Rolan
If you have Ubuntu Feisty or Gutsy with the default Firefox installed (meaning you didn’t manually downloaded/installed your Firefox), you might have some problems making the HTML Validator plugin work even after you followed the fix for Linux. I’ve already encountered this problem when I was still using Ubuntu Feisty and then again this morning after upgrading to Gutsy.
The fix is actually for another Firefox plugin: Colorzilla. I was having some problems making the HTML Validator work back then and decided to install Colorzilla first. It also had some problems but after some Googling, I found a fix that worked. The latest Firefox binaries needed to be downloaded and its libxpcom shared objects (libxpcom*.so) overwrite the current ones found in /usr/lib/firefox.
Feeling that I couldn’t do much without the HTML Validator plugin, I gave it one more try. The thing worked!
After upgrading to Ubuntu Gutsy Gibbon, some of my Firefox plugins went crazy (HTML Validator, Colorzilla and NoScript). Then I remembered having the same problems and fixed it again.
Just wanted to post that- might be able to help someone.
Filed in: Daily,WebDev | | 1 Comment | Tags: colorzilla, feisty, Firefox, gutsy, html validator, ubuntu
1st Philippine PHP Developer’s Conference
Posted on: Oct 10th 2007 | Posted by: Rolan
“Welcome to the 1st ever Philippine PHP Developer’s Conference that will be held this upcoming December 1, 2007 where sharing opensource solutions in the enterprise and schools is the main theme.This is in follow up with last April’s grand meetup which caught the attention of Philippines IT Industry and were looking forward of expanding it’s presence thru this event.”Still accepting event sponsors. For more info, please visit:
Filed in: Reminders,WebDev | | 2 Comments |
Input Elements: disabled vs. readOnly
Posted on: Oct 9th 2007 | Posted by: Rolan
Disabled and readOnly input elements both prevent its data from being changed (at least via the user).
But a disabled input element’s data is not sent with other data when the form is submitted. Could’ve saved me that extra 30-minute debugging time.
Filed in: Daily,Reminders,WebDev | | 2 Comments |
Application Programming Interface
Posted on: May 29th 2007 | Posted by: Rolan
I was just thinking how nice it would be if more open-source PHP applications offer some sort of API for their application. It would really be useful specially when the application is likely to be integrated with another.
For example, I have phpBB2 and Coppermine Gallery. Yes, there’s already a Coppermine-phpBB bridge to tie the forum users to the gallery. But other than that, I have no other means of communication between the two. What if I want to display a link to a user’s gallery in each of his post, along with the usual buttons (profile, ims, etc)? What if I wanted to display randomly picked images from a user’s gallery and display it in his/her profile?
Ways of accessing an application’s functionalities from outside might range from a simple, block copy-paste solution and/or directly talking at another’s DB tables… to hellish insert-here-to-there hacks and conflicting variable hunts that span several files. Some people would find themselves reading and studying in detail how both applications to come up with a way to make them work together. In-depth knowledge is good. But sometimes you don’t have for that and might be an overkill in some cases. I don’t want to see how that cow got in there, I just want my hamburger.
If both had an available API, I don’t have to go through all that trouble. I would already know what it could do and know how to make it do things without dealing with unrelated stuff. And if I ever have to make it do something out of the ordinary, I will know where to look at.
Plugins just crossed my mind (it should… I’m using WordPress). Some apps come with their own plugin system, so you can extend the application and often times import some functionalities from outside the application… kinda like what an API does. But I don’t think they can replace APIs. In fact, they need APIs to exist. The application provides a some sort of a Plugin API for building plugins. Hmmm… using Plugin APIs to build a plugin that communicates to another application via the API the other app provides. Sweet. I don’t have to deal with how the inside works. I just need something to connect them from the outside.
By the way, if anyone reading this knows some open-source projects (in PHP) that have an API available, please do comment. Already found one, SMF, a forum software. The API is just in its pre-release though, but sure looks promising.
I’m sleepy and could no longer think clearly. I hope I made some sense in this post.
Filed in: Daily,PHP,WebDev | | Add Comment |
EXTRACT() not working on phpMyAdmin
Posted on: Mar 3rd 2007 | Posted by: Rolan
I was looking at the MySQL manual for Date and Time functions and stumbled upon a function that I might need for an “experiment” I’m doing. I used the function EXTRACT in my query, having my test run on phpMyAdmin, but it was giving me a syntax error warning. I thought that I might have the wrong syntax for EXTRACT so I tried running a sample query, right straight from the manual.
- SELECT EXTRACT(YEAR FROM ’1999-07-02′);
But it still gave me the same error warning. It should be working since its, after all, it was in the manual… otherwise it would be corrected or removed. I ran the same query, but this time the mysql command line. It worked. I executed the query in PHP, it also worked. Well, I think phpMyAdmin is having some problems with this. I’m using phpMyAdmin – 2.8.1, on MySQL 5.0.21 that comes with XAMPP . Maybe I’ll try to ask somebody to test it in other versions.
CakePHP HTMLPurifier Component
Posted on: Sep 12th 2006 | Posted by: Rolan
I needed to use HMTLPurifier on my CakePHP application. So I just saved it under the vendors folder inside the application folder. This how the directory strucure looked like.
+ myApplication
|-----+ config/
|-----+ controllers/
|-----+ models/
|-----+ plugins/
|-----+ tmp/
|-----+ vendors/
| |----- HTMLPurifier/
| |----- HTMLPurifier.php
|
|-----+ views/
|-----+ webroot/
|-----+ .htaccess
|-----+ index.php
But before including the vendor component, I needed to add the to HTMLPurifier so Cake can find it. So, I added something to HTMLPurifier.php, somewhere before the require_once() statements:
- // START edit -dchx
- //Add the path to the vendors folder where HTMLPurifier is located
- }
- // END edit -dchx
- require_once ‘HTMLPurifier/ConfigDef.php’;
- require_once ‘HTMLPurifier/Config.php’;
- require_once ‘HTMLPurifier/Lexer.php’;
- require_once ‘HTMLPurifier/HTMLDefinition.php’;
- require_once ‘HTMLPurifier/Generator.php’;
- require_once ‘HTMLPurifier/Strategy/Core.php’;
- require_once ‘HTMLPurifier/Encoder.php’;
Now I’m all set. I just need to to include the component using the CakePHP function uses().
UPDATE: Some little update on this. When using HTMLPurifier inside CakePHP (or even in other apps), make sure that the character encoding of the output page is UTF-8. I encountered this little bug where a paragraph tag (p) containing only a non-breaking space was converted into another character. But I checked on my html page and the meta tag Content-type was set to UTF-8 (and of course I’m using XHTML 1.0 Transitional DocType). I fixed it by sending a content-type header. In CakePHP, you can do this inside the beforeFilter() function of your controller.
- class MyController extends AppController {
- //… the usual
- function beforeFilter()
- {
- }
- }
Filed in: PHP,WebDev | | 3 Comments |
HTML Purifier
Posted on: Sep 9th 2006 | Posted by: Rolan
I’m currently doing an article submission application. Wanting to give the users more power over their articles, I’ve planned on using a WYSIWYG text editor for the article submission form. Using that kind of editor, users can format their articles easily, even if they have little experience with html. I tried using TinyMCE, an Open-Source WYSIWYG editor that runs using Javascript and I’m quite happy with the results. It provided some “MS Word”-like interface. It also has some mechanism that filters disallowed html tags like and other potentially dangerous tags that could make the application vulnerable to XSS attacks.
But what if javascript was disabled by the user? Expecting that the input would be processed by TinyMCE, the application won’t be doing some input checking. If javascript is disabled, TinyMCE won’t be able to do its job. The disallowed html code will be freely included and the application will be left open to attacks. PHP’s Built-in input filtering functions isn’t much of use here, since all they do is strip the tags or convert special characters like < and > into their equivalent entities and will no longer be recognized as mark-up. I wanted some PHP functioality that can do the filtering for me.
So I consulted sir Google and after searching some possible solutions, I found HTML Purifier and gave it a test run. Yep, it worked. I tried it with TinyMCE on, and the html fomartting was still intact after purification. Now I tried it with TinyMCE on, but then disabled javascript and inserted some not-so-malicious code and the purifier caught it. Nice! If I have time, I’ll test it further. I just need to make the application fully functional before doing detailed testing and debugging.
Filed in: PHP,WebDev | | 2 Comments |
A love song for Web Standards
Posted on: Sep 8th 2006 | Posted by: Rolan
Rjene gave me a link to a love song about Web Standards. Read more about it at Boagworld.com . Very funny, specially the part with the tables nesting fifteen levels deep.
)
Filed in: Daily,Funny,WebDev | | 2 Comments |
Update screws extensions
Posted on: Aug 31st 2006 | Posted by: Rolan
I was really interested with Joomla as an alternative for web publishing. It was really easy to understand and use (plus the admin panel rocks, imho). Then this update for Joomla came up, related to high-risk security vulnerabilities affecting all the past versions of Joomla. I have read the warnings about the update being incompatible with some extensions but I went on upgrading anyway. All was running smoothly when I stumbled upon the upload part in the admin panel. It was telling me I was not authorized the view/use th upload page (on the pop-up window). What the??? I am the super admin and the only user (I tested it on a localhost to make sure I don’t screw up the site on our test server). Then when I started using other extensions, they we’re giving me several warnings. Some of them I was available to work around, but most of them had something to do with Joomla’s inner workings so I didn’t messed with it (yet). Only two extension were left (barely) working.
Awww… man. Just when everything with Joomla looked promising. Well, I’ll be waiting for more updates and fixes regarding those extensions.
Filed in: PHP,Rant,WebDev | | Add Comment |
3 Options
Posted on: Aug 28th 2006 | Posted by: Rolan
I’ve been handling this project for quite sometime now. It was a construction related forum, where homeowners seek advice from professionals. Our client wanted to add more services/features to the site. When the site was handed down to me there were already some additions. It had a classifieds section and a company directory, that were quite buggy and problematic. I had to take it down and rewrite it, salvaging any parts that I can. I also spiced it up a bit and turned it into a mash-up using Yahoo! Maps . I added a wiki on the site, hoping that users would help contribute and build a useful knowledge base. But I guess th folks there aren’t really ready for that. I was also assigned to create Jobs section, that would pull out related job feeds from another site and display some graphs/stats regarding the jobs. I did it, but got a little attention from the users (though some users got jobs from it). I also added a weather section, since weather was an important factor in their trade and a forecast would be quite helpful. They are also planning to have a product review/rating part, and an encyclopedia/dictionary to replace the wiki. They also want to add a gallery where the works of the contractors can be displayed/featured. They also asked me to install a newsletter application ( PHPlist ) to inform users/partners with lates news and site updates.
Almost all of the requested features are done and are ready to be integrated with the site. The problem is that things are quite unorganized/scattered. I have two versions each for the Classifieds and Directory section, running using CakePHP and another using an OOP approach. The weather section and the Jobs section where done using normal procedural programming. As for the gallery, there’s already a user gallery mod (by the way, we’re using PhpBB or the forums) for the forum, so we I don’t think we need to install Coppermine Gallery. The Review/Ratings and encyclopedia things are yet to be decided, since the folks are still busy with the new site design/layout. I really hate the frequent switch between programming environments ( procedural, OOP, CakePHP framework and PhpBB), and I tend to accidentally mix things up. It’s tiresome and maintenance nightmare. This urge me to look for options on how I can choose an approach and apply it consistently through out the project. I rounded them down to three: PhpBB super mod, CakePHP and by using a CMS like XOOPS or Joomla .










