Acronym Plugin for ExpressionEngine

Looks like Charles of RippleWeb has developed an Acronym plugin for ExpressionEngine which he’s asking folks to test out. I’ve installed it here and already added a couple of extra acronyms to the list (such as SEB) as I’ve been looking for something like this for awhile now so that my Mom can easily find out what some of the more obscure acronyms I use actually mean. Whenever you see a word with a dashed line underneath it you can hold your mouse pointer over it to see what the acronym stands for. I’m open to taking recommendations for additions to the list if there’s anything you folks think should be included. If you want to try it out on your own EE blog then go download a copy and give it a whirl.

Integrating the TinyMCE WYSIWYG editor into EE.

OS_Andy details in this EE forum post what it takes to integrate the excellent TinyMCE WYSIWYG editing into ExpressionEngine. His initial attempts causes the editor to show up for every text area in the control panel which can slow loading of the CP down quite a bit, but he later managed to come up with a method of specifying which tabs and which text areas you want to affect with the editor. It requires a little hacking of the EE code to pull off, but it seems to be less work than the previously mentioned FCKeditor and a bit simpler in terms of the functions it provides. I’ll probably trying this one out myself.

Avatar Gallery Plugin for Expession Engine.

The Gravatar plugin I wrote is a simple way to add avatars to your site, but some folks prefer not to rely on an external service that might go down unexpectedly or they’d just prefer to have their avatars stored locally similar to many message forums out there. Fortunately Mark Malewski has written a plugin and a tutorial that will allow you to provide your visitors with a means of selecting an avatar from a predefined directory you set up yourself. Go check out his Avatar Gallery Plugin Tutorial Part 1 and Avatar Gallery Plugin Tutorial Part 2 for all the details on how to pull this off yourself.

Some useful new tags in ExpressionEngine 1.1

I’ve had a number of people write in asking me how I’ve done various things with my installation of ExpressionEngine so I thought I’d go ahead and make an entry where I reveal my secrets. If you’re not running an EE blog then chances are this won’t interest you, but if you are then read on.

First off, Rick and the crew have been most gracious about implementing several new variables for use in the Notification Emails that make life a lot easier. The first new addition isn’t actually new as it’s been available in a slightly different form for quite awhile, but was forgotten and never added to the manual and that’s the UNWRAP tags for turning off the automatic word-wrapping in the notification emails. This is useful for the rather lengthy URLs that EE can end up generating in comment notifications as without them EE will wrap the long URL and make it useless for clicking on. Modify your comment notification emails as follows to turn off word-wrapping on the URLS:

{unwrap}
{comment_url}
{/unwrap}

There’s a few other new tags available in the User Comment Notification template that can prove useful as well. Use the {name_of_commenter} variable to list who left the comment in question as opposed to having it just say that “Someone” left a comment. Then {name_of_recipient} can be used to list the name of whom the email is being sent to. And finally {comment_id} can be used to insert the ID number of the comment in question in the email. Now you’re probably wondering what that last item might be useful for. Well, if you’re like me, I prefer to place anchors into my comment templates so I can link directly to the comment in question. EE already generates anchors for comments, but you have no control over where in your template they appear (they’re always the first thing in a comment) and they are numbered relative to the entry itself rather than the actual comment ID number. So I build my anchors by hand by putting in code such as the following:

<a name="c{comment_id}"></a>

And I put that where I want the anchor to go in my comment template. Then in the Comment Notification email I use the handy variable tag to build the URL. Here’s the complete text for my User Comment Notification emails:
Email Title:

[{weblog_name}] New Comment Posted to {entry_title}.

Email Message

{name_of_commenter} just responded to an entry you subscribed to titled: {entry_title}

You can see the comment at
{unwrap}
{comment_url}#c{comment_id}
{/unwrap}
{comment}

To stop receiving notifications for this comment click here.
{unwrap}{notification_removal_url}{/unwrap}

You’ll find that a similar {trackback_id} variable exists for doing something similar with the Admin Trackback Notification emails.

Announcing EEGravatar.

I’ve written my first plugin in PHP for ExpressionEngine called EEGravatar. It’s basically a simple way of allowing for avatars in your entries or comments using a centralized avatar hosting service called, oddly enough, Gravatar. If you’d like an avatar image of your own for the comments, just go to the Gravatar site and register using the same email address you use to post comments here and upload an avatar no bigger than 80×80 pixels. Once it’s approved it’ll start showing up in your comments automatically.

If you’d like to use EEGravatar on your own ExpressionEngine blog you can download a copy by clicking here. There is also a plugin available for MovableType and WordPress. There’s also a hack for TextPattern.

Update: I’ve duplicated the docs included in the plugin in the extended entry.

Updated Update: Here’s a little Gravatar button I made if you want to use it:

Version Update: The plugin has been updated to EE Gravatar 1.2 for use with ExpressionEngine 1.1 and is now a single tag plugin. See the updated docs in the plugin or down below for examples.

Version Update: The plugin has been updated to EE Gravatar 1.3 (the Lisa-Jill version). Minor change to output for XHTML compliance.

Version Update 10/2/04: EEGavatar is now up to version 1.4. Can now use {name} in addition to email as the one required parameter for use in Member Profiles and other places where the email parameter breaks the plugin. See documentation below for more information.

Version Update 2/19/2009: The ever talented Leevi Graham contributed an update that adds in the parameters of {logged_in_user}, 1 and raw_md5=”“. The plugin also returns the new URL format which allows for .pngs and .jpgs.

Documentation

The EE Gravatar Plugin allows you to easily insert a “globally recognized avatar” image from Gravatar (http://www.gravatar.com/).

This plugin requires at a bare minimum one of two possible parameters depending on where you wish to use it. The first option is a user’s email address and the second option is a user’s screen name. The reason for this is so the plugin can be used in situations where one or the other parameter won’t return the proper result. It is recommended that you use email for comment and entry loops and name for display in member profile templates, but feel free to experiment. Here’s the two minimum required uses:


<img src="{exp:gravatar email="{email}"}" /> -- For use in comment or entry loops.

<img src="{exp:gravatar name="{name}"}" /> -- For use in templates such as Member Profiles where email won't work as expected.

== OPTIONAL PARAMETERS ==

default=“http://www.somesite.com/someimage.jpg”

Defines a default avatar if there isn’t one associated with the email address or if it exceeds the rating.

rating=”[G | PG | R | X]”

Allows you to limit gravatars to the appropriate rating. Anything exceeding the rating will use the default (if supplied) or not display.

size=”[1..80]”

Allows you to define how big the gravatar will be in pixels. Any size other than 80 will cause the original gravatar image to be downsampled using bicubic resampling before output

border=”[hex color]”

Puts a border of the specified color around the gravatar.

== POSSIBLE EXAMPLES ==

Here’s a few examples that you might use:


<img src="{exp:gravatar email="{email}" rating="PG"}" />

Only displays gravatars of PG rating or lower.


<img src="{exp:gravatar email="{email}" rating="R" size="40" border="FF0000"}" />

Displays 40×40 pixel gravatars of R rating or lower with a red border around them.


<img src="{exp:gravatar email="{email}" size="70" default="http://www.somesite.com/someimage.jpg"}" alt="Picture of {name}" title="{name}" class="avatar" />

Displays gravatars of 70×70 pixels or a default graphic for users without a gravatar. Puts the user’s name in the alt and title tags and styles the image using a class called “avatar.”


<div class='profileTitle'><img src="{exp:gravatar name="{name}" size="80" rating="R"}" border="0" style="float: left; margin: 0; padding: 6px;" alt="{name} pic" title="{name}" />{name}</div>
<
p>{lang:member_group}&nbsp; <b>{member_group}</b></p>

The above is a snippet of code from my Public Member Profile template showing how to insert a gravatar into the member listings for your site.

== Change Log ==

V1.5 – Added {logged_in_user} and 1 parameter as alternate to les@stupidevilbastard.com & {name} for times when you just want to show the logged in users gravatar.
    – Added raw_md5=”” parameter to return the raw md5 encoded version of the email and not the whole gravatar url.

V1.4 – Added {name} parameter as alternate to les@stupidevilbastard.com for use in situations where les@stupidevilbastard.com breaks the plugin such as Member Profiles.

V1.3 – Changed & to & for XHTML validation compliance.

v1.2 – Made les@stupidevilbastard.com into a parameter along for single tag usage for EE 1.1 release.

v1.1 – Minor bug fix.

v1.0 – Initial Release

How to implement FCKeditor WYSIWIG editor in EE.

Arnold Jagt has written up a how-to for getting the popular FCKEditor to work with ExpressionEngine. This will basically allow you to switch to a WYSIWYG editor for entering posts into ExpressionEngine merely by double clicking on the textarea field you want to use it on. Implementation will require the hacking of a couple of source files, but if you’ve been looking for a solution like this the changes required appear to be rather minimal and the editor is pretty robust.

Getting slammed with trackback spam.

If you happen to notice any odd trackbacks associated with some of the entries that link to supposed rape or incest porn sites it’s because we’re currently being spammed by some asshole who’s appears to be either testing out a new spam script or trying to build up page rank for the URLs he’s spamming with. I’m cleaning it up as fast as I can and the folks at pMachine are hard at work on some improvements to help make cleanup easier and block known URLs.

If you’re running EE and getting hit by this asshole spammer one thing you can do to limit the damage done is go into your weblog config and set the allowed number pings per hour to 1 from whatever it’s currently set (default is 5). The script is spoofing IP addresses it seems and it’ll use the same one up until EE tells it that it’s been blocked, then it switches to a new one. It seems to be using a small number of different IPs, though, so limiting the number accepted to 1 per hour limits how many trackbacks get through. Paul is working on an update to the trackback module that’ll add a link to the notification emails to take you directly to the trackback in question and delete it as well as cross reference any trackbacks received to the Referrer Blacklist and block anything that it finds listed therein. I’m helping him test it and it’s about half-way working at the moment. Hopefully we’ll have something usable very soon.

Update: Looks like this isn’t just hitting folks running ExpressionEngine as several MovableType users are also reporting an influx of trackback spam. Richy is reporting that it appears these spams may be coming through open/anonymiser proxy servers and he is collecting a list of IP addresses used to spam sites so you can stick them into an Apache .htaccess file and block them if you wish. He’s also done some digging that has turned up an interesting note on who owns the machines the spam is comming from:

Who “owns” those IP addresses and appears to be running insecure machines?

OrgName: The Defense Information Systems Agency
OrgID: DISA
Address: DISA/DSSO/JCLCC
Address: Room BF655A, The Pentagon
City: Washington
StateProv: DC
PostalCode: 20301
Country: US

Yep – I’m getting spammed by The Pentagon!

Which makes me wonder if this is an open proxy issue or a zombified PC problem. Richy doesn’t think so according to his entry, but it wouldn’t surprise me if it that turned out to be the case. According to Richy changing the name of the trackback script in MT doesn’t stop the spam. He’s figuring they must be requesting the page they’re submitting the spam to in order to get the URL.

Anyway, if you want to get some relief by setting up a deny list then stop by Richy’s blog and grab the IP list he’s got there. And give him a great big thanks for taking the time to compile it while you’re there.

Hard coding your ping URL in ExpressionEngine.

As requested, I’ve set up a category on EE tips, tricks, hacks, how-tos and so on that I manage to come up with that other folks would like to know how to do. First up is how to hard-code the URL used to ping services like Blogrolling.com. Why would you want to do this? When you first set up a blog in EE you’re asked to define the URL for the blog. The assumption most folks make would be you’d use the root domain such as https://stupidevilbastard.com/. The problem is there are a few functions under EE, such as the built-in search engine, that don’t work quite right if you only use the root domain. Any searches with the root domain configured returns links that don’t point to the proper location such as https://stupidevilbastard.com/this_is_an_article/. The fix is to put in a URL that includes the index and template category such as https://stupidevilbastard.com/index/seb/ and then the search function will return proper links.

However, now when your blog pings services such as weblogs.com or blogrolling.com it uses this longer URL so anyone who has your site blogrolled with the shorter URL (https://stupidevilbastard.com/) won’t see a notification that you’ve updated because the URL you pinged with is the longer version (https://stupidevilbastard.com/index/seb/). Rick Ellis has said that this will be addressed in version 1.1 by allowing you to define what URL are used for various functions. I’m assuming this means there will be at least two configuration options—one for the search function and one for the ping function. Until then, however, there is a work-around you can use:

Open up system/cp/cp.publish.php and look for the function labeled:

//————————————————-
// Send Pings
//————————————————-

Rick says it’s around line 1850 or so. Then add $blog_url = “http://yourdomain.com/”; someplace in the function. I put it right underneath the $sql = line like so:

$sql = “SELECT server_name, server_url, port FROM exp_ping_servers WHERE”;
$blog_url = “http://yourdomain.com/”;

This hard codes what URL is used to ping the various services you’ve defined and it works great, but there is a catch. If you’re running multiple blogs like I am then ALL of them will ping as whatever you’ve hard coded here. So when my sister updates her blog instead of pinging as http://cindy.jenkinsonline.net/ it’ll ping as SEB. If you’re only running one blog then this isn’t an issue, but in my case I’m working on a bit of PHP code that will check for which blog is pinging and shorten the URL accordingly. If I manage to cobble something together before version 1.1 is released then I’ll update this entry.

Couple of quick notes on SEB.

Had a couple of emails from folks asking about different aspects of SEB under ExpressionEngine that I wanted to address:

Q: Is there a way to not have “Notify me of follow-up comments?” checked marked by default when replying to an entry?
A: If you have a registered account then the answer is yes. Click on the “My Profile” link in the left hand bar to go to your personal settings. Then click on “Email Settings” and on the new screen uncheck the box next to the words “Enable email notifications by default when you post messages” and then click the UPDATE button. Now if you want to be notified of new responses on a thread you’ll have to make a point to check the box on the comment form.

Q: Is there a way to subscribe to an entry without leaving a comment?
A: Currently there isn’t, but it has been requested and I believe is planned for a future update to the package.

Q: Why do I have to type a word into an extra form field when responding to entries? I’ve never had to do that before.
A: That’s called a captcha and it’s used to prevent bots from leaving comment spam. Currently it’s an either on or off option that affects all users, but we have a feature request in asking that it be made an option for registered members. With any luck that option will be added to a future version of EE and you’ll have one more good reason to register an account.

Q: What do you do with the data you collect when we register?
A: Nothing much. We don’t collect the data for purposes of marketing nor for profit. We won’t be selling your name and email address to any third parties and the only emails you should receive from us will be comment notifications that you have subscribed to. On very rare occasions we might send out a mailing to all our registered members over important issues, but I can’t think of what such an occasion might be at this point in time. Beyond your account having a valid email address so you can validate yourself, we’re not particularly concerned how much of the rest of the info you fill out. It’s there if you want to use it, you don’t have to.

Any other questions or concerns feel free to drop me a line.