Kythin's Rants Kythin rants about all kinds of things, but mainly website development, SEO and PC Gaming.

19May/110

Get the first and last days of last month in PHP

Here's a really simple way to get the first and last dates of last month in PHP using strtotime. This'll also format the dates correctly to use in comparisons with MySQL 'TIMESTAMP' fields! Nifty eh?


$lastmonth = strtotime("last month");
$fromdate = date('Ym01 00:00:00',$lastmonth);
$todate = date('Ymt 23:59:59',$lastmonth);

echo($fromdate.' to '.$todate);

Filed under: Code Snippets No Comments
4May/110

Quickmark – Link Saver Gadget for iGoogle & Gmail

Hey hey, I'm still here, just busy as usual. I've got another quick little Google gadget that I wrote to keep track of links that I want to check out but don't have time when I find them to give them any justice. Since I always have a Gmail window open regardless of being home or at work I wanted something that was persistent across both, and in my face enough for me to remember to click on them.

True to style, I didn't look for one that already existed, where's the fun in that? I wrote one myself that works for me!

Essentially, Quickmark is a very cut down version of a task list that builds a list of whatever you've typed in the textbox below. It can be just little text strings, or if it starts with "http" it will treat it as a link when it displays in the list. To remove an item, click the "X" on the left of it.

As with most Google gadgets, it will save persistent data to your Google profile so it's private but safe and will persist across computers. The only thing with this one though is that it uses TWO SEPARATE LISTS if you install it on both iGoogle and Gmail - one set of data for each domain. I call it a feature, because iGoogle will allow much bigger lists anyway and you don't want them being squished into the gmail sidebar.

To add it to iGoogle and try it out, click this thing:
Add to iGoogle

If you want it to show up on the Gmail sidebar you'll need to enable the "Gadgets from URL" Labs feature, then add this URL as a gadget:
http://quickmark-gadget.googlecode.com/svn/trunk/quickmark.xml

(Updated 5/5/2011 with Google Code versions of the XML files)

 

Enjoy!

- K

24Sep/100

I’m working on something.

2 things actually.

I should have more information within a few weeks, but in the meantime, go become a fan of Totalitillion, would ya?

- K

23Jun/105

Wordspinner 2.0 for WP 3.0!

Hiya WordSpinner fans,

I’d like to say thank you to the thousands of people who have downloaded and used WordSpinner. As my first ever WordPress Plugin it means a lot to me that so many people find it as valuable as I do. With the release of WordPress 3.0 earlier this week, I thought something special was in order. So, without further adieu, I give you WordSpinner v2.0 – now fully capable of handeling a pretty much infinite number of levels of spinners (providing you use the correct syntax).

Get it here: http://wordpress.org/extend/plugins/wordspinner/

Enjoy, and please send me feedback or comment on this article if you have questions.

Happy Spinnin’

Love, Kythin.

EDIT: Thanks to XWipeoutX for the performance improvement tweaks in 2.1, you rock!

UPDATE FOR WP 3.1.3: Now with shortcodes! You can now use shortcodes in your template files to spin extra things like Titles, Comments, and anything else you like! Details and syntax are on the settings page when you install / update the plugin.

 

27Oct/090

Upgrading Mootools in Joomla 1.5

I had to figure out how to upgrade Mootools from Joomla 1.5's default, horribly outdated 1.11 to 1.2 in order to use some funky scripts in a new client template today, and after a bit of stress and searching I found this:

http://www.dwightjack.com/diary/2009/02/23/upgrade-mootools-to-v12x-in-joomla-15/

It seems that the admin dropdown menu's stop working if you just overwrite the old Mootools files, so Dwight has come up with a quick and easy frontend solution to keep the admin section loading 1.11 and allow the template to load 1.2 instead!

Thanks Dwight!

27Oct/092

Wordspinner Updated

I spent a bit of time yesterday rolling out a new version of Wordspinner for WordPress. Nothing much really, but now it comes with a widget that you can use to add spinnable text to sidebars without having to make a change to the wordpress text widget manually.

Grab it here: http://wordpress.org/extend/plugins/wordspinner/