Articles in the PHP Category
PHP »
I noticed with the latest version of WordPress, an older template may not display the sidebar correctly. If you look at the source code, you notice a lot of HTML code is missing in the sidebar div. The easiest fix I found was to update the “sidebar.php” file in the template. A lot of themes should have the !function_exists(‘dynamic_sidebar’) in the sidebar.php file. Read the full entry for instructions.
Frameworks, PHP »
I’ve been noticing that a lot of documentation in CakePHP seems to be spread out onto many different sites. In my opinion, the CakePHP manual isn’t comprehensive enough for learning.
Here’s a list of useful CakePHP resources I’ve used recently:
CakeForge – Great resource for Open Source CakePHP applications. This site has many more applications than the CakePHP Bakery.
http://cakeforge.org/
Bakery – How to use different CSS files in CakePHP
http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp
Giga Promoters – CakePHP tutorials and scripts:
http://www.gigapromoters.com/blog/category/cakephp/
I’ll be updating this list as I find more resources.
PHP »
There appears to be an issue with cookies on Windows Safari that expires at UTC time and not according to the time zone on your machine.
I tested my PHP code
setcookie(“mycookie”, $sample_session_variable, time()+10000,’/mydirectory/’,'mysite.com’);
I verified that the cookie expires at the correct time for the following browsers
* Firefox 3.5
* Internet Explorer 8
* Safari (Apple OS X)
PHP »
WordPress 2.8.2 has been released. This affects both WordPress and WordPress MU. I recommend upgrading your current version since it contains a security fix.
WordPress 2.8.2 fixes an XSS vulnerability. Comment author URLs were not fully sanitized when displayed in the admin. This could be exploited to redirect you away from the admin to another site.
For more details, visit:
http://wordpress.org/development/2009/07/wordpress-2-8-2/
You can automatically upgrade WordPress within your control panel, or manually upgrade via:
http://wordpress.org/download/
WordPress MU download:
http://mu.wordpress.org/download/
Apache, Linux, PHP »
I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called “intranet”. Apache Rewrite takes the “intranet” string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that “Directory” .htaccess parameters don’t work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead. For the solution, read on…
PHP »
Here’s what I currently use to determine how long it takes to generate a page in PHP. Its only 8 lines of code.
MySQL, PHP »
I’ve been working on tuning my Apache/MySQL/PHP configuration lately to see how to improve the performance. Lately, I’ve been noticing some crawlers that have been ignoring my robots.txt file and hitting my server really hard with several page requests every second. So, I decided to run some tests to see where I could speed up my website in the code.
CMS, PHP »
I attended WordCamp SF for the first time in 2009. There was some exciting news at the camp, especially with the news that WordPress MU functionality is going to get integrated with WordPress. This will be nice considering updates for WordPress MU are usually a month or so behind. What will this mean? Hopefully, it will bring a larger community in maintaining and adding new plugins for WordPress (MU). The question will be whether it will be easy to convert an existing WordPress MU install over to the new WordPress. (Possibly WordPress 3.0?)
CMS, PHP »
I have found a really useful plugin in Wordpress MU for making a blog private. Sometimes, committees need a way to share information away from home and they don’t want everything posted to be known by the world. Rather than using the “Password protect post” option, there is a way to only allow registered users that are members of the blog to view the post.
By default, the privacy options in Wordpress MU is limited to 1) Public, allow search engines 2) Public, don’t allow search engines.
http://wpmudev.org/project/More-Privacy-Options
This plugin adds functionality:
3) I would like my blog to be visible only to registered users from blog community
4) I would like my blog to be visible to registered members of this blog
5) I would like my blog to be visible only to administrators
MySQL, PHP »
WordPress introduced a new version of its multi-user blog software in January 2009. I have been using version 2.6 for the past few months and it was working well, although the site management was very confusing to use. Version 2.7 fixes this problem by making the Site Admin menu more uniform with the main dashboard.
