Stylehack

Wordpress Hack :: WP-Mail 0.2

Filed under:
Something that became fairly apparent to me early on (think MT 2.x blog) was that I don’t like having to use a web interface to post an entry; it’s futzy and frustrating to me. So the developments in the last year+ in moblogging have been of great interest to me. I figure the more functionality for someone posting an entry via email on their cellphone, the better my options will be for plain old-fashioned (!) computer-based email posting. The ability to email in a post was one of the things that weighed in favor of Wordpress during my research. The fact that it is already built-in (as of version 1.2.1 at least) is nice! It’s not quite “there” though, in terms of every bell and whistle. [This is not to say it won't be, but I'm addressing the "now" and available solutions.] Overview Enter WP-MAIL 0.2… and it’s a HACK! Oh be still my beating heart! “-) The first thing you need to keep clear is the difference between a “hack” and a “plugin”:
hack    1. modification to a base WP script; 2. a modification (perhaps variables or a function) added to “my-hacks.php”. When you upgrade WP the new version will overwrite hacked scripts, so be sure to keep notes of what you are using and modifying! plugin    modular piece of PHP code that is written using the base WP system; managed via the Plugin admin function. Note: There are now two versions of plugins you might run into out there — the old form and the new form which are auto-updating.
Let me give you a piece of advice: Plugins and Hacks are not controlled by the WP development team so don’t assume that just because it is listed on the Wordpress Wiki that it is the latest and most stable version! Hopefully there will be a link to the author’s site where you can check for updates; if not, download the file and read the documentation or the credit section of the script and look for the author’s site link. I learned this the hard way. sigh.

Styleswitcher Mod to WP

Ed. Note: I removed my complaining because I found a   k i l l e r   plugin called the iG:Syntax Hiliter that uses the GeSHi Highlighter. I am thrilled! There are just a couple of things I need to work out, probably “user error”, but I’m going to contact the author for help while singing praises galore! By the way, if you aren’t familiar with GeSHi, be sure to check it out! [rev 9:56 pm CST] Ok, I’ve done a bit of fiddling this morning even though I swore I was “grounded” off the computer all weekend. Fiddling means adding a PHP Styleswitcher to this installation of WP, based on the one found at ALA. Proviso: If you try the Plain Jane style, it actually loads the print.css file for right now which means no navigation! The only way to get back is to use the back button on your browser. First thing to report: I added the runPHP plugin and activated; don’t bother, it not only didn’t work it actually prevented me from editing or deleting a test post including PHP. Since it was just a test of the switcher link, it’s no big deal and I didn’t bother to see what or why. Just deactivated it. Second thing to report: I hate that friggin’ Quicktags and that is the first thing I am going to shut off. What kind of idiots want that formatting their posts??? Just one more thing to slow me down and mess things up. Ok, here’s “How I did it’ re Styleswitcher: 1. Create the switchter.php file (repeated here as a courtesy - see ALA link above for details): [php][/php] 2. Create a my-hacks.php file to declare the stylesheet variables I wanted to use (don’t forget to activate this legacy feature in your admin panel: [php][/php] What I wanted to do here was not only define the stylesheets available to use, but also assign a Title that can be used for linking and even in the header tags if so desired. 3. Ok, here’s the clunky part… I had to change 3 (4) files…
  1. index.php (two of these if you installed WP in a directory under your site root but have index.php in your root)
  2. wp-comments-popup
  3. wp-comments-reply
Ok, those last two didn’t actually need changing right now because I’m not using them… but just in case I figured I’d get it out of the way. I replaced the two existing lines in the header that declare the stylesheets for screen and print with this: [css] /switcher.php?set=“> (print) [/php] …..results in something like: [html] [/html] Aw gee, I is so clever. Caution: This switcher uses a cookie; if you have your browser dumping cookies when it is closed your selection will not be saved for the next time you grace this site with your presence. And now I really AM grounded off the computer for the day. If I left anything out of this explanation, or really did something terrible with my PHP… well, you know the drill. ** Edit: Trackbacks, pings, comments turned off for this post because I am sick of the freaking poker spammers hitting it. 12/05 **

Stylehack © 2008 - Becky Peters :: All Rights Reserved
Powered by WordPress