WP-Mix

A fresh mix of code snippets and tutorials

Members-only content via shortcode

Here is a sweet little WordPress shortcode to display content only to logged-in users. Visitors not logged in will see a custom message saying whatever you’d prefer.

Simple Ajax Chat .htaccess whitelist

In general, chat scripts are huge targets for malicious activity. My chat plugin, Simple Ajax Chat is no exception, and includes strong security measures to protect against attack. Aimed at the free version of SAC, this quick tutorial shows a simple Apache/.htaccess technique to further strengthen plugin security.

Superbox replace rel with data-rel

At WP-Tao.com, I use jQuery Superbox to display lightbox-style popup images and screenshots. Here is a quick mod used to replace rel attributes with data-rel.

Structure of $_FILES array

Working with USP Pro involves a lot of $_FILES manipulation. I tend to forget how the array is structured, so I’m posting it here for ez reference.

Quick KB/MB unit conversions

Working with .htaccess for stuff like file uploads, it’s frequently necessary to convert between kilobytes and megabytes.

Lazy Load Tricks

I use Lazy Load for the sweet animated effects at Plugin Planet. Here are some code snippets for future reference.

Display Images with User Submitted Posts

Here is a quick recipe for displaying linked images for images submitted with the User Submitted Posts plugin.

Notes for Plesk Webmail

Recently discovered that emails were not getting thru. Looking into it, turns out that Plesk’s webmail feature was at 100% capacity so it was rejecting all new email. Not good.

PHP String Cleaner

Here is a PHP snippet for cleaning or sanitizing variables.

CSS Target Opera

Here are some nice CSS techniques for targeting old and new versions of Opera.

Remove borders & outlines in IE

For the DigWP redesign, I noticed that some linked images were displayed with an unwanted border (or outline) in IE. After the usual CSS techniques failed to work, I experimented a bit and discovered a simple solution.

Force download WMV with .htaccess

Everyone loves WMV! Not! Jokes aside, here’s what finally worked for me when trying to force download Windows Media Video (WMV) files.