Tag Archives: hacks

Editing Firefox’s Personal Spellcheck Dictionary

“Jean”:http://www.mercuryranch.org/blog posed an “interesting question”:http://open-dialogue.com/blog/2007/01/18/wp-21-rc1/#comment-9585 yesterday – how exactly does one edit their personal spellcheck dictionary in Firefox, particularly if you’ve accidentally added a couple of badly spelled words? It’s a question I’ve wondered about myself but hadn’t had the motivation to look into until now. It took me a few minutes to find the answer, but it’s actually really easy.

Find your profile folder in your Firefox directory (mine’s under FirefoxPortableDataprofile) and locate the file called persdict.dat. This file contains all the words you’ve added to your approved spellcheck list for Firefox. Just open the file in your favorite spreadsheet program and delete the rows containing words incorrectly added to the dictionary, save the file again, and close it. Simple as that!

You can also find a few other ways to modify your dictionary “here”:http://labnol.blogspot.com/2006/11/firefox-2-spelling-dictionary-hacks.html.

WordPress Admin Panel News Hack

I’ve recently discovered “Lorelle’s”:http://lorelle.wordpress.com/ blog on all things WordPress and decided that I wanted to follow her entries on a more regular basis. However, I have been reluctant to add her feed to any of the categories currently in my Thunderbird reader, since her site topics don’t really easily fit into any one of those categories. And I don’t like creating new feed categories until I already have several that fit the category.

It occurred to me this morning, though, that the perfect place to keep tabs on her feed is to add it to my WordPress administration panel, right alongside the other WordPress news feeds that are already piped into there by default. The process of adding her feed was actually a pretty simple matter of copy-paste-modify. Here’s what I did, for anyone interested in doing something similar with their WordPress:

The file I modified was the index.php file in the wp-admin directory. I scrolled all the way to the bottom of the file, looking for the code containing the RSS feeds. There’s actually two blogs of code here, one for the WordPress development blog and one for the Planet WordPress aggregator. The one _I_ was interested in was the Planet WordPress feed, since I already knew that as Lorelle’s site updates I’ll be checking out new articles regardless of what a summary or excerpt might say.

So I copied the block of code for Planet WordPress’s feed:

bq. items) && 0 != count($rss->items) ) {
?>

»

    items = array_slice($rss->items, 0, 20);
    foreach ($rss->items as $item ) {
    ?>

  • '>

and pasted it above the Planet WordPress block for easy scanning through both feeds. A couple of things needed modifying in order to get Lorelle’s feed to show up the way I wanted to. I had to first replace

bq. items) && 0 != count($rss->items) ) {
?>

with

bq. items) && 0 != count($rss->items) ) {
?>

to get it to fetch Lorelle’s feed. Then I had to replace

bq.

»

with

bq.

»

for a quick link to her site so that I could read past entries if I wanted to. The last change was to replace

bq. items = array_slice($rss->items, 0, 20);
foreach ($rss->items as $item ) {
?>

with

bq. items = array_slice($rss->items, 0, 5);
foreach ($rss->items as $item ) {
?>

since I don’t need 20 articles to appear. The five most recent entries are just fine with me. That’s basically the whole process and what I ended up with is this:

Lorelle feed in admin panel

Pretty shnazzy, eh?

Update: One final note of interest that Lorelle “reminded”:http://lorelle.wordpress.com/2006/06/30/feeding-on-lorelle-on-wordpress/ reminded me of – this hack is vulnerable to WordPress upgrades. Essentially, each time you update your software with the latest version, this hack will ‘magically’ disappear. So, in Lorelle’s words (if she doesn’t mind my quoting her):

bq. Make sure you make a copy of the template file, and that you save the instructions on how you did it (copy and paste the text from the article into a text file is one way) in the same directory clearly labeled so you can either restore or add back this hack to your WordPress Dashboard template file.

Thank you. That is all.

Asides

If my previous “aside”:http://open-dialogue.com/blog/?p=247#respond had you a bit confused, I was celebrating my success at _finally_ being able to get a new hack to work. I’ve often had cause to write a quick one-liner, but I hated wasted all that space because once I published it, the metadata takes up more space than does the actual content itself. I hated the way it looked, but I also hated not being able to spiff up my briefer thoughts. So, I found “Matt’s Asides”:http://photomatt.net/2004/05/19/asides/, but I couldn’t get it work. Matt hacked “The Loop”:http://codex.wordpress.org/The_Loop to have it check a specific category and then format it differently when it displayed. This allowed users to take up less space with very short posts while still allowing readers to submit their comments on the content.

The problem was that The Loop in my template’s index was structured differently, rendering Matt’s hacks ineffective when I tried to implement them. In point of fact, trying to put them into my code took my site offline due to syntax errors. Several hours of searching the Web for upgraded hacks yielded nothing helpful, so I resigned myself to not being able to use the hack after all.

The solution came in looking for a reasonable substitute. I’d settled on using a linklog to accomplish a similar function, and in the process I found a plugin called “wp-recent-links”:http://rebelpixel.com/projects/wp-recent-links/. Part of the install process for this plugin involved replacing your templates index with the copy provided in the .zip file. In looking at the code, I realized that The Loop syntax looked very similar to the one that Matt “cited”:http://wiki.wordpress.org/PhotoMatt/index.php in his write-up. So, I tried substituting again Matt’s hack code into The Loop syntax for my new “index”:http://www.open-dialogue.com/blog/files/index.phps file, which actually worked this time. So, I then used a “little snippet of code”:http://www.tamba2.org.uk/wordpress/asides/ ((bottom of the page)) from another source to format the bullet of the aside and hacked my stylesheet to gives my asides a little bit of extra flare.

Since different template authors structure their index files differently, the only problem I had to overcome was finding an index file that was close enough to the original such that it would allow Matt’s Asides hack to actually work. A learning experience, to be sure.

I realize that this has probably bored most of you to tears, and for that I apologize. But in the event that someone else would like to implement this hack and run into similar problems, I share my experience in hopes of reducing the number of headaches that someone else might face. Feel free to “contact”:http://open-dialogue.com/blog/?page_id=220 me if you have any problems or questions.