SimplePHPMailer – my open source plug-n-play emailing script for PHP newbs – has been updated. It now has required fields – no more blank submissions! Check it out here http://aaronsaray.com/blog/2008/04/24/simplephpmailer/ with the updated download link.
My Blog
contains PHP and other web related content. (Sometimes there are some off topic things - don't freak out!)
Archive for the ‘open source’ Category
SimplePHPMailer: now with required fields
Tuesday, August 10th, 2010Elgg Development Tools – Elgg Plugin
Friday, April 24th, 2009After working some with the open source Community building application Elgg, I found some settings to be irritating. I had to keep hacking my plugins to get these settings activated the way I wanted. Also, I really wanted to put useful settings in the same location.
Enter The Elgg Development Tools Plugin
This plugin has the following functionality:
- Integrates FirePHP
- Quick option to turn off view caching
- Changes Error Reporting/Display
- Copies other useful dev settings to one place
More about this after the file download:
Elgg Dev Tools
Integrates FirePHP
The package includes the latest distribution of FirePHP. When you enable FirePHP in the admin control panel under the Dev tools option, you can now use the FirePHP functionality in your plugins. Sometimes coders remember to turn off the functionality later, but forget to remove all of the FirePHP calls. A mock FB class is created to handle this – it basically accepts any method call and logs an error in the error log that you still have that line in there.
Turn off View Caching
Normally, you have to either run the update.php script or enable/disable your plugin. During development, this got super irritating. Instead, enable this option. It will make the site run a bit slower, but you won’t have to keep enabling/disabling the plugin when you add new views.
Display Errors
By default, Elgg hides the errors in the .htaccess file. This will turn them back on without editing the elgg installation.
Other Useful Dev Settings
I always forgot where simple cache options were. I copied the setting to the plugin as well. It basically does the same thing as under site admin. I find it useful to have all of these settings in one place.
Any feedback is greatly appreciated.
PHP.ini creator
Saturday, January 17th, 2009While listening to someone complain through twitter about their MySQL conf file, I came up with a cool idea: what if I created a PHP.ini creator that would suggest changes to your php.ini file as well as generate an updated version?
Enter PHPIniCreator
As with most of my software, this is just a rough version to get the idea down on paper. I plan to update this as well as give a working example sometime in the future.
(more…)
dtemplate: dynamic template system for static designed files
Tuesday, September 16th, 2008One of the biggest time wasters I deal with is parsing out static web designs given to me by designers. They don’t know programming, so they design it with static HTML in mind. Even if you’re using a tool like dreamweaver, updating static pages can be a hassle. Then, a lot of times, they have to remove their ‘lorem ipsum’ text and send it to me – and then I continue to chop it up. Now, I’m talking about smaller 5 to 10 page sites here, not huge sites like JEMDiary or something. However, that idea birthed…
Welcome dtemplate!
The purpose of dtemplate was to read in an existing design from a designer or a static site that already exists, and make certain parts parse-able for replacement content. This way the designer can give the developer a complete xhtml package and move on. As long as the files are verified as valid xhtml, they’re good to go. Then the developer will write whatever programming/content needs to be replaced. It would be even possible for the designer to put basically all ‘lorem ipsum’ if necessary – and it could all be replaced.
How does it work?
dtemplate takes existing URLs and rewrites them to be used in the template. The template then reads in the xhtml files, looks for any specified IDs or classes, and replaces the content. It finally renders the content out to the screen. Any non .html file gets rewritten to be found in the new directory.
Implementation Steps
Its easy to put dtemplate into use. If all else fails, check out the comments in the files.
Create source directory
In order to have the content be read in by the template file correctly, you must make a new folder at the base of the site called dtemplate_sourcehtml. Move all of the files in the current root into that folder.
Modify .htaccess
The last line of the .htaccess file specifies the real URL of the site. In our example, its http://myrx8.local. You need to change this to be your site. Put this in the root of the site.
Add additional files
Place the dtemplate_controller.php, dtemplate folder and the verify folder in the root of the site.
Verify each xhtml file
Before surfing to the site, you should visit http://yoursite.com/verify and upload each file, and check for any id’s and classes that you’d like to replace. This way you know if the file will parse fine and if the required classes and IDs are located in the file.
Modify the dtemplate_build_content() function in dtemplate_controller.php
This function is made to replace any content for your file. It is commented – plus you can see an example in the download. It is recommended that you create your own class(es) and use this function only for adding the content to the template when needed – don’t place all your logic in this file.
Surf!
You should be good to go! If you want, you can remove the ‘verify’ folder.
Example
I’ve included a really simple frames website as an example with the download. This was originally on http://myrx8.local as a test.
Todo and Known Issues
- make sure you don’t have to edit out the website in .htaccess
- support multiple directories for html files.
- is pretty rewrite intensive.
The download
Timetracker Timeclock
Monday, May 12th, 2008
The 102 Degrees Timeclock software package is a very simple interface for keeping track of time. Instead of purchasing a timeclock, you could resurrect an old laptop and run this software on it. With a very simple clean interface, even beginning computer users will feel comfortable. The timeclock has .csv generation for reporting – which can easily be opened in Microsoft Excel. The entire interface is web based.
The software requires PHP5 with MySQL.
You can download it here:
timetracker – timeclock 0.1
Installation Instructions
After you upload the contents of the zip file to the root of your website (in future releases, I’ll make it be available to any folder..), you can visit your website’s domain. This will launch the install script.
The script will ask for MySQL credentials. You need to have a hostname, user and password, and a database for the software to write to.
Finally, after you submit it and receive a successful message, delete the install.php file.
Then, visit your domain again, and you’re good to go – or follow the directions on the screen to set up your users.
SimplePHPMailer
Thursday, April 24th, 2008
There are a very small amount of really easy to implement PHP mailer scripts in the wild. They usually try to pump so many features into them that it becomes difficult to implement or too large of a file. For those looking for just a quick drop-in solution – that you DON’T need to know PHP to use – SimplePHPMailer was developed. All that is needed is to drop the php file into the same area as your form, open it up, and read the instructions. There are some straight forward configuration options with very easy to understand comments. Download it for your next quick project.
Meta Tag Generator
Thursday, April 24th, 2008Meta Tag Generator uses javascript to generate the proper format for some common meta tags. This was originally just a proof of concept script that I decided to release.
PHP Shared Host – Session File Browser Script
Thursday, April 24th, 2008
PHP stores its session information into flat files unencrypted by default. In shared hosting situations, this can be a big security issue. This script allows easy access to the attributes of these files as well as decoding of the values stored in them. This script can also be used to audit the security of your current configuration. If other users’ session information is available, your information is not secure either!


