scriptygoddess

03 Mar, 2003

XHTML

Posted by: kristine In: Bookmarks

As I learn more about web standards, I've been wanting to gain more info on XHTML. Here's a few good overview sites that I bookmarked lately:

WebMonkey's XHTML Overview
W3School's XHTML section
W3C Markup Validator

Comments Off on XHTML

03 Mar, 2003

Site stat tracking…

Posted by: Jennifer In: Bookmarks

Found this cool site tracking software on sourceforge: awstats.

I'm hoping to play with it today, so hopefully I'll have an update to this post with my report. :)

This partially in response to some modification requests to the smilie launch… This script will launch a new window. If/when it looses it's focus (ie. it's in the background) if the person clicks the link again, rather than launching a *new* window, or appearing to do nothing at all, this will bring the (previously launched) window to the front – or launch a new one if it had been closed…
Read the rest of this entry »

02 Mar, 2003

Comment leader (month based)

Posted by: Jennifer In: Scripts

I really liked Girlie's "comment leader board". My only problem was that, I've been blogging for nearly two years. People who commented a lot on my site a year ago, don't neccessarily come by anymore – and there's new people who come by, who comment a lot, and I feel they should be able to get some recognition too… SO, I evened out the score. I modified the code so it will only look at the last month for top commenters.

Read the rest of this entry »

01 Mar, 2003

CSS Color Blender

Posted by: kristine In: Color Tool Bookmarks|CSS

Eric Meyer has a cool new tool/toy on his site — the Color Blender. Enter 2 hex codes and it will give you the colors between it. Very cool!

27 Feb, 2003

Move and resize browser window…

Posted by: Jennifer In: Script snippet

To move a browser window to a specific location on the users screen:

window.moveTo(x,y);

replacing "x,y" with pixel coordinates.

More info here, where they also have the below which will give you the users screen width, height:

screen.width
screen.height

Also, to resize the browser window:

window.resize(width,height)

Now, before you go all crazy on me – I'm not suggesting people do this for sport on their blogs. Messing around with people's browser's sizes, position, etc. will be annoying and NOT very usable. The reason why I needed the code above was to create a "minimize my browser" type effect with a bookmarklet for my mac (aka. "hide! the boss is coming"). The end result is this: mini-me

26 Feb, 2003

Online Tools

Posted by: Jennifer In: Bookmarks

Thanks to a recent trackback ping from this post on electrosketch.org I found this site: onlinetools.org

Among many other cool things, they also have a php counter, and they posted a cool bookmarklet to put a bunch of image info into the "alt" tag, and (this link from electrosketch) a php newsletter manager

Comments Off on Online Tools

26 Feb, 2003

Simple php counter

Posted by: Jennifer In: Bookmarks

I've had a few requests for a simple php counter that doesn't use mySQL. php-princess has one here.

(While you're there – poke around that site – lots of neat stuff there)

26 Feb, 2003

Get first (part of) name

Posted by: Jennifer In: Script snippet

(non blog related post) Needed to use this php function: strchr (alias to strstr).

I had a field that had a person's full name (first and last). 99.999% of the time, the first name and last name were seperated by a space (no Mr. or Mrs. in there) and I needed a script that assumed as such and grabbed what was more than likely the person's first name. I found the script below on that strchr function page.

<?php
$fullname = $row['customername'];
$toFind = " ";
echo str_replace( strchr($fullname, $toFind), "", $fullname );
?>

so if $row['customername'] was "Jane Smith"… the script above would return just "Jane"

Comments Off on Get first (part of) name

25 Feb, 2003

Archive Redirects made (more) simple

Posted by: adam In: MT hacks

A few weeks ago, Kristine posted about Redirects in MT, and this got me thinking. I had already looked at an archive mapping solution which was recently updated, but it required that I have access to the server config files (not just a .htaccess file) because a RewriteMap can only be defined in the server config files.

So tonight when I decided, after a great deal of pondering (about 10 minutes), to change my archiving format to something that didn't produce 1000+ numerically named directories I needed a way to map the archive numbers to their new named location. Here is the solution I came up with, based on some modifications of the pre-existing code.

First download mt-archivefinder.cgi and rename it to mt-archivefinder.cgi (or any other name that suits your purposes). Put it in the MT directory.

You will need to change a couple of the lines at the top of the file to match your server's configuration. Make sure to chmod the file 755.

Next you will need to do some mod_rewrite mojo with a .htaccess file. Create a .htaccess file or edit the existing file in the root of your archives directory. To that file add:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/archive/[0-9]{6}.html
RewriteRule ^(.*).html$ /mt/mt-archivefinder.cgi?$1

You will need to change it to reflect your path structure. If all goes well, you will be automagically redirected from any numbered file like /archives/000001.html to whatever new archiving scheme you enter into the individual archive template in the Weblog Config panel in MT.

For example, I was using

<$MTEntryID pad="1">/index.php

and now I'm using

<$MTArchiveDate format="%Y"$>/<$MTArchiveDate format="%m"$>/<$MTEntryTitle dirify="1"$>/index.php

I used the following mod_rewrite rule to automatically forward all links to the old archive style to the new archive style.

RewriteCond %{REQUEST_URI} ^/history/[0-9]{6}/
RewriteRule ^(.*)/$ /mt/mt-archivefinder.cgi?$1

That's all it takes!

Many thanks to Alex for the inspiration and the code.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements