TGFS - Thank Goodness For Scripting. I love it. I wrote a pair of scripts to rip over 3600 class numbers and names for OurUNO and dump them into my DB. That would have taken forever, but it gives me an awesome head start on the site now. Regex’s rock, you can’t deny it.
You can take a peek at the second hacked together script, here. It’s the beast that does the stripping.
Posted April 12th, 2007 - PermalinkI’ve been going crazy trying to make my new ajaxy review creation tool cross-browser. It isn’t working out at all. IE gets stuck and gives terrible, totally non-helpfull debug information. A line number, but it won’t even specify the script it happened in, or what kind of error it was. Terrible, and I can’t find anything on debugging in IE, a plug-in like firebug would be nice.
I also found out, that as of Opera 9.10, it does not apply the BASE tag to script requests. I don’t know if that’s spec or not, but I had to apply absolute paths to a bunch of XHR’s to get them working in Opera. That one took a while to find, but I found the debugging stuff for Opera, and it’s not terrible.
I haven’t even thought about Safari, I’m kind of scared of it actually. Right now I’m going with a second set of scripts that don’t use all the fancy stuff in them, and I’m using %{HTTP_USER_AGENT} and mod_rewrite to push browsers to the right place.
Good times.
Posted March 26th, 2007 - PermalinkOver the last day or so I’ve spent some time restructuring OurUNO to fix it up in time for the end of the semester. One of the biggest and most visible things I’ve done is to start using mod_rewrite to make super-slick URLs for everything. For example, in the old system to view Robert Fulkerson’s information and get reviews, you would have to go to “http://www.ouruno.com/instructors.php?action=view&id=1″. With the new system you can simply go to “http://www.ouruno.com/instructor/fulkerson/robert/”. mod_rewrite is darn cool.
Along with that is a shift in the design paradigm, setting apart the actions on the site into 3 sets, (View/Edit/Create) and 3 sections (Course/Instructor/Review) with a deeper backend and wiki style rollbacks on edits. Also, at Dave’s suggestion, I’m adding in the ability to generate a review or other content without signing up. You just have to enter it, got to your UNO email, and click through on the link to validate your address. Rad.
Posted March 17th, 2007 - PermalinkGot bored and scratched another itch I’ve had in wordpress for a while. I always wanted a way to list my categories on the sidebar on my terms. The best I had found was the well written and executed Category Visibility-RH but I wanted to choose from all my categories and still limit the number listed.
I added a function to my wp-hacks.php and then dropped it into my sidebar. Does the job, and could easily be edited. I swear someday I’ll learn how to make plug-ins, really.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | function jh_random_cats($howMany) { global $wpdb ; $query = " SELECT cat_ID, cat_name, category_count FROM $wpdb->categories WHERE category_count != '0' "; $categories = $wpdb->get_results($query); shuffle($categories); // Mix 'em up for($howMany; $howMany > 0; $howMany--) { $poppedCat = array_pop($categories); print '<li><a href="'.get_category_link($poppedCat->cat_ID).'">'.$poppedCat->cat_name.'</a> ('.$poppedCat->category_count.')</li>'; } } |
As a super-cool extra I got to use a PHP function I had never gotten to use before, let alone knew existed: bool shuffle ( array &array ). It, you guessed it, shuffles up an array.
Posted February 5th, 2007 - PermalinkTwo big releases in just a few days! First there was BlowPass 0.60 and now my “secret project” is unveiled!
I give you, OurUNO.com! It’s a semi-socially edited site for UNO students to share reviews, news and generally help each other out. It’s a bit crippled in this first “beta” release, but I expect to get it in tip-top shape in no time as the core is very fleshed out.
Go take a look!
Posted January 31st, 2007 - Permalink