Tech Tips

Name that offset

This page shows various time values and conversions to other units. I find this useful when programming in PHP and other languages.

Often, I want to run a SQL query to update a time value in a Drupal db table, and I need to know the delta to add to an existing unix timestamp value to push a value out by 24 hours, 90 days, etc. and would rather not whip out a calculator or do the math on paper...

Here's a shortlist of utilities I think are essential for regular users of Windows-based systems.
Most of these are aimed at keeping your system running cleanly, eliminating problems, or checking the status of hard disk drives or memory hardware.
If you have a suggestion or find a broken link, please use our contact page to let us know.

I've been asked how to prevent access to myspace.com on Windows systems without having to purchase or install blocking software. Well, there's a free and simple way to do this.

Here's a quick trick to block myspace.com on a Windows system. Basically, you are editing a text file on your computer, adding an entry to it. This file is known as the 'hosts' file, and it allows you to block sites using a very simple but effective method.

Display the contents of Internet Explorer's index.dat files, including 'lost' and hidden content

Current Version: 1.0.2.0

Overview

Have you ever wondered about the contents of the Internet Explorer ("IE") cache? Wanted to know if the cache is really empty when you tell (or ask) IE to delete temporary files? Want to know what's kept in those INDEX.DAT files that are stored in your user profile?

IECacheList Lite is a command line utility that will examine the contents of Internet Explorer's index.dat files and display them for you. The method used by IECacheList is designed to ensure that no 'hidden' or lost information escapes detection.

Some our our sites that feature free classified ads (amadorable.com, goatseeker.com, and bunnytrade.com) have been hit with a few recurring spammers trying to plant ads for various off-topic products (like cell phones, etc.) I guess this is a good sign; our sites are visible and spammers feel it is worth their time and trouble to post an ad (and no, as far as I can tell, these are not bots - they're human-generated spam.)

In reviewing the referrer logs, I've noticed that in nearly every case, spammers use search engines to find sites that have been spammed previously using known keywords - or just sites that offer free classified ads or open posting capability. For example, I find these google searches in my logs, just prior to the spammer creating an account and attempting to deposit the spam content.

When using event.module with JSCalendar (part of jstools module), you might experience problems with event times being stored incorrectly. This appears to be due to an obscure configuration requirement when using JSCalendar - apparently, the event module must be configured to use 12 hour format. (This one bit me in the behind today, so I thought I'd jot this down somewhere...)

Why can't a Drupal user edit a node they created?

Symptoms: An authorized Drupal user loses "edit" access to nodes they've created, even if they have appropriate node (or other module) access permissions. Or, user cannot edit a node that should be editable by them, based on access control or node access settings. No errors or warnings are presented to the user. Nothing in the Drupal watchdog log.

Possible Cause: The user does not have permission to use the input filter currently assigned to the node. (An administrator or other privileged user may have changed the input filter settings, or, input filter permissions may have been changed to exclude the node author since the node was created. As a result, the user never had, or no longer has permission to use the input filter associated with the node.)

This excerpt from Drupal node.module node_access() function tells the tale:

If you want nodes to appear on a google map provided by the gmap_location module, you need to set up your system correctly.

from gmap_location function gmap_location_node_page() :

$result=db_query("SELECT oid, longitude, latitude FROM {location} WHERE (longitude!=0 OR latitude !=0) AND type='node'");

So, the only nodes that will appear in a gmap_location-provided map are those where the type is 'node' and the longitude or latitude are non-zero in the location table. Ok, how do we get a lat/long value in that table?