WordPress: remove category posts from RSS feed
Want to say thanks to jangro.com for having a WordPress function to block a specific WordPress category from appearing in my RSS feed. I just added this to my theme’s function.php file and changed the category number to the number of the category to omit and voila, the RSS feed is now free of the other category.
function myFilter($query) {
if ($query->is_feed) {
$query->set('cat','-5');
}
return $query;
}
add_filter('pre_get_posts','myFilter');
PHP Array output offset by 1?
Today I was writing some code for another site and I was looping through a DB query and outputting the results and I noticed that the output was one index off. If you ever encounter this problem make sure that you do not have your query string followed by $row = mysql_fetch_array($query) and then have $row = mysql_fetch_array($query) in the WHILE statement for your loop.
Google dumps IE6 support
This morning at 12:26AM I received the following email from Google:
*************************************************
Dear Google Apps admin,
In order to continue to improve our products and deliver more sophisticated features and performance, we are harnessing some of the latest improvements in web browser technology. This includes faster JavaScript processing and new standards like HTML5. As a result, over the course of 2010, we will be phasing out support for Microsoft Internet Explorer 6.0 as well as other older browsers that are not supported by their own manufacturers.
We plan to begin phasing out support of these older browsers on the Google Docs suite and the Google Sites editor on March 1, 2010. After that point, certain functionality within these applications may have higher latency and may not work correctly in these older browsers. Later in 2010, we will start to phase out support for these browsers for Google Mail and Google Calendar.
Google Apps will continue to support Internet Explorer 7.0 and above, Firefox 3.0 and above, Google Chrome 4.0 and above, and Safari 3.0 and above.
Starting this week, users on these older browsers will see a message in Google Docs and the Google Sites editor explaining this change and asking them to upgrade their browser. We will also alert you again closer to March 1 to remind you of this change.
In 2009, the Google Apps team delivered more than 100 improvements to enhance your product experience. We are aiming to beat that in 2010 and continue to deliver the best and most innovative collaboration products for businesses.
Thank you for your continued support!
Sincerely,
The Google Apps team
Email preferences: You have received this mandatory email service announcement to update you about important changes to your Google Apps product or account.
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
Linux: Move files and directories up one directory
Here’s a quick answer to a Linux CLI question that I am asked on a regular basis. The scenario goes like this. You just unpacked a gzip’d file and you have a directory full of files and directories now. You don’t want those files and directories in that directory but rather up one directory…what do you do. First thing you can do is to cd into the directory and then you can either:
Copy the files/directories up one directory by running: cp * ../
or you can…
Move the files/directories up one directory by running: mv * ../
Joomla: cannot login to administration
Today Joomla decided it wanted to kick me out as Super Administrator…so I went into the users table and reset the admin password using MD5. No Luck!
After a bit of Googling I found that the Joomla core_acl_aro table gets corrupted from time to time. Fortunately for me I had a backup of this table. For anyone needing the schema for this table you can use the following to at least get back into the admin area:
DROP TABLE IF EXISTS `core_acl_aro`;
CREATE TABLE `core_acl_aro` (
`aro_id` int(11) NOT NULL auto_increment,
`section_value` varchar(240) NOT NULL default ’0′,
`value` varchar(240) NOT NULL default ”,
`order_value` int(11) NOT NULL default ’0′,
`name` varchar(255) NOT NULL default ”,
`hidden` int(11) NOT NULL default ’0′,
PRIMARY KEY (`aro_id`),
UNIQUE KEY `gacl_section_value_value_aro` (`section_value`(100),`value`(100)),
KEY `gacl_hidden_aro` (`hidden`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
INSERT DELAYED IGNORE INTO `core_acl_aro` (`aro_id`, `section_value`, `value`, `order_value`, `name`, `hidden`) VALUES
(10, ‘users’, ’62′, 0, ‘Administrator’, 0);