Archive for the ‘Code’ Category
Wednesday, January 27th, 2010
I’ve posted before about being a somewhat “late-adopter” of WordPress, but now that over 90% of the sites I run are powered by the wonderful WP, I spend a lot of time in various WP Dashboards. Which is why I love these plugins, made specifically for back-end administrators:

Because of the aforementioned serious amount of time I’m in WordPress, it really helps to be able to keep track of to-dos from within the Dashboard. A widget lets you quickly see your task list, and it’s easy to create and manage tasks for other authors or admins, and write comments on these tasks. Download WP-Task-Manager »

Like most designers, I’m very nitpicky when it comes to typography. This plugin features a host of options for people like me, including proper hyphenation, detailed spacing control (e.g. widow protection, forced internal wrapping, etc.), and smart character replacement for things like quote marks and copyright symbols. Download wp-Typography »

Finally, there’s GD Press Tools. Certainly not for the faint-hearted, this is one powerful plugin, with included options ranging from maintenance operations, to tracking the popularity of your posts and pages, to some very good database tools. Before you dive into using this plugin, make sure you spend some time learning which features work with your version of WordPress. Download GD Press Tools »
Which WordPress plugins make your life easier?

Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Monday, January 25th, 2010
Why optimize your CSS at all? In a nutshell: for faster loading pages. Because, really, anything that can speed up the loading of your site is a good thing. Here, my favorite four tools for CSS optimization and compression:
A free online service, and what a service it is: this tool, based on CSS Tidy, also helps you with CSS shorthand, in case you haven’t got it memorized yet. A worthy bookmark.
CSS Drive’s CSS Compressor does just that: compresses your CSS in either Light, Normal or Super Compact modes. I personally prefer their Advanced Tool (also free), which allows you to get specific (e.g. whether or not to leave spaces between selectors and properties, etc.)
This one not only verifies your CSS with the W3C, it also tests your color contrast. Which, if you read my last post, is pretty awesome.
Finally, because redundancy is just not cool, especially when you’re trying to optimize your CSS, this nifty little tool is quick, easy to use, and simple to understand.
How do you optimize your CSS code?

Tags:CSS Compression, CSS Optimization
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, css, wordpress plugins, wordpress themes | No Comments »
Monday, January 11th, 2010
If you create custom themes for Wordpress, chances are you’ve already used category templates in the past. They usually look like this:
category-x.php
where x corresponds to the ID number of the category, and are extremely useful if you want to give a specific category a certain look. For example, if you wanted to add an “Asides” area to your theme, you’d create a category named Asides, get the numerical ID of that category (e.g. “3″) and create a template file named category-3.php
My problem, of course, was having to find the ID of the category, which could vary from one WP installation to another. The truth is that I usually chose to go the route of conditional queries instead, doing something like this:
if ( is_category(‘asides’) ) {
// what I’d like to show for my asides
}
Wordpress 2.9, however, has added support for slug-based category templates. So instead of naming my template category-3.php, I can go ahead and name it something wonderfully semantic like category-asides.php
The hierarchy in which Wordpress looks for which template to use has been updated as well. Now, it’ll look for the slug-based template first, then the ID-based template, and finally the default template.
Do you use Wordpress category templates in your themes?

Tags:templates
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Wednesday, January 6th, 2010
Ah, snippets: they’re bits of reusable code that you can copy and paste to your heart’s content. Because I definitely fancy myself more of a designer than a developer, when it comes to programming I’m very dependent on code snippets- and I’m so grateful to people who actually take the time to create snippet repositories. Here are five of my favorite:

I’m not sure whether Snipplr’s been around longer than the other sites on my list, but it’s definitely the one I’ve been using the longest. Easy to use, with a really wide library of snippets, Snipplr also has a Wordpress plug-in that I’ve used a few times, and a bundle for TextMate users. I like how Snipplr features both the most recent and the most popular snippets on their front page- it makes for fun browsing when I’m feeling somewhat geeky. Visit Snipplr »

With a tagline that reads “long-term memory for coders”, Snipt is a site I visit over and over again. The snippets are nicely organized and clearly presented, with links for instant embedding or copying at the bottom of each snippet. Visit Snipt »

It seems I’ll never tire of recommending Google products, but the Code Search service from the big G is great because it lets you search the entire web for function definitions and sample code. Be sure to use their recommended syntax to search. Visit Google Code Search »

DevSnippets is no relation to Devlounge- what it is is an awesome gallery for code and design snippets- from CSS to jQuery, Prototype to Mootools. Unlike some of the other sites I mention here, DevSnippets doesn’t host the code- they link to code and tutorials around the web. Visit DevSnippets »

My favorite of all, this one’s almost a daily visit for me. I love how simple it is to find the snippets you need, and appreciate that the Wordpress snippets- which, lets face it, are what I use the most- are just one click away. Visit CSS Tricks’ Code Snippets »
Do you use snippets?

Tags:code snippets, snippets
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Friday, December 11th, 2009
When WordPress 2.5 was introduced in Spring 2008, one of the biggest innovations and additions was the WordPress Shortcode API. Shortcodes have become a regularly used feature by designers and can help to reduce the number of plugins used. In this post we look at some shortcodes you can implement and use to enhance your WordPress themes.
Getting Started With Shortcodes
A shortcode is a php function which you can add to the function.php of your theme. Via the trigger add_shortcode() you can define the name of your shortcode and how to call the function in the editor. Add this code immediately under the php function in your function.php.
1. Adding A Generic Link
The easiest use for shortcodes is probably to use a shortcode for content you publish regularly like a link to your subscription page.
Sample Code
function subscribe() {
return ‘<a href="http://www.devlounge.net/subscribe">Subscribe to Devlounge</a>’;
}
add_shortcode(’sub’, ’subscribe’);
What we did in this example was to define the shortcode sub and link it to the function subscribe. Now if you use the shortcode [sub] in the text editor it will automatically replace it with the link Subscribe to Devlounge in the entry.
2. Adding Pullquotes To Your Theme
Pullquotes are a well known design element in print design but often forgotten online. Especially when posting long entries, choosing an ad rem quote can highly improve the readability and interest. The screenshot on the right is a perfect example of the visual effect pullquotes have.
It is very simple to add pullquotes to entry with a simple shortcode, similar to BBCode.
Sample Code
function pullquote( $atts, $content = null ) {
extract(shortcode_atts(array(
‘float’ => ‘$align’,
), $atts));
return ‘<blockquote class="pullquote ‘ . $float . ‘">’ . $content . ‘</blockquote>’;
}
add_shortcode(‘pull’, ‘pullquote’)
You can now use the shortcode [pull]your quote here[/pull] in the editor when writing entries.
Do not forget to style the new code in your theme’s CSS. In this example the shortcode [pull] returns <blockquote class="pullquote">.
Sample Code
blockquote.pullquote { width: 220px; padding: 5px 0; border: 0; font-size: 18px; line-height: 150%; }
As you can see in this example, shortcodes can easily be used to use different styling in your entries without having to write HTML. This can be very handy for multi-authored blogs, not every author knows HTML, and makes shortcodes a genuine alternative for bbcode. It is very easy to provide a shortcode to use @font-face in your entries.
3. Adding A ‘Twit This’ Image/Link
Twitter is very practical to promote your entries and there are several methods to implement buttons or links to submit your entries. But sometimes you want an additional method to quickly add a button or submit link.
When entries start to become popular sometimes it can make sense to add a link at the top right or left of your entry, without having this submit link in every entry. This can easily be done with a shortcode and is also handy on multi-authored blogs and without the need to allow your authors the add code, scripts to their entries.
Sample code
function twitt
() {
return
‘<div id="twitit"><a href="http://twitter.com/home?status=Currently reading ‘.
get_permalink($post->
ID).
‘" title="Click to send this page to Twitter!" target="_blank"><img src="link to your twitter-button image" alt="Twit This image" /></a></div>’;
}
add_shortcode(‘twitter’, ‘twitt’);
You can now easily style the id="twitit" in your CSS, all the authors have to do to display the link is use the shortcode [twitter] in their entry.
If you want to add buttons to other social networks you can find the code needed for the submission process here.
4. Adding Previous Entries From The Same Category
Displaying related entries is a very popular on many blogs but some bloggers might prefer to show previous entries from the same category instead. This is very handy when you only have few categories and want to randomly display previous entries from that category.
Sample Code
function prev_related($atts, $content = null) {
extract(shortcode_atts(array(
“num” => ‘5′,
“cat” => ”
), $atts));
global $post;
$myposts = get_posts(‘numberposts=’.$num.‘&order=DESC&orderby=random&category=’.$cat);
$retour=‘<ul>’;
foreach($myposts as $post) :
setup_postdata($post);
$retour.=‘<li><a href="’.get_permalink().‘">’.the_title(“”,“”,false).‘</a></li>’;
endforeach;
$retour.=‘</ul> ‘;
return $retour;
}
add_shortcode(‘related’, ‘prev_related’);
In this example the shortcode [related] will randomly display 5 entries from the same category.
5. Using Shortcodes To Hide Content From The Public
Shortcodes can also be used to hide content from non-logged in members. This can be very handy when you regularly publish paid content and still want to show a teaser to your entries. Additionally it can be smart to show only not-logged in users a certain text, fe. ‘This content is only visible to members, subscribe here to get access to all our awesome tips or log in here if you are already a member‘.
Creating The Shortcode For Guests
function guest_check_shortcode
( $atts, $content = null
) {
if
( ( !is_user_logged_in
() && !is_null
( $content
) ) || is_feed
() )
return $content;
return
”;
}
add_shortcode( ‘guest’, ‘guest_check_shortcode’ );
Creating The Shortcode For Members
function member_check_shortcode
( $atts, $content = null
) {
if
( is_user_logged_in
() && !is_null
( $content
) && !is_feed
() )
return $content;
return
”;
}
add_shortcode( ‘member’, ‘member_check_shortcode’ );
With both shortcode functions added to the functions.php it now is very easy to add the teaser line, with link to your subscription or login page, and the content for members only.
An Example Entry
A small teaser paragraph here.
[guest]This content is only visible to members, subscribe here to get access to all our awesome tips or log in here if you are already a member[/guest]
[member]Your awesome tip and member-only content comes here[/member]
Continue with your regular scheduled program.
Sources
Tags:coding, Shortcodes
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, Themes, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Wednesday, December 2nd, 2009
With hundreds of free and premium Wordpress themes out there, you want the one you create not only to stand out, but to be as useful as possible to as many people as possible. One way to do this is to “internationalize” it. By doing this, you’re making your Wordpress theme ready for translation into any of the languages that Wordpress supports. It’s also easier than you think. Here’s how:
Find the functions.php file. This is located in the same directory of your theme (it’s where you set up your widgetized areas as well). If it doesn’t exist, create one.
Put this text into the functions.php file:
load_theme_textdomain ($domain);
You need to change “textdomain” to a word of your choice, something that signifies your theme. For example, if your theme is called The Black Labrador Theme, you might want to select blacklab as your textdomain. Also, make sure you put it inside php tags.
After editing your functions.php file, begin looking through the other templates in your theme. What you’re looking for is text that needs to be internationalized. For example, within the loop on an index.php page, you probably have something like this:
<?php endwhile; else: ?>
<p><strong>Not Found. Please look elsewhere.</strong></p>
<?php endif; ?>
That’s text you’ll want to internationalize. To do that, you need to use either of two functions:
The _e function, for text not within a PHP function, or
The __ function, for text within PHP tags.
So for our example, you’d do this:
<?php endwhile; else: ?>
<p><strong><?php _e(”Not Found. Please look elsewhere.”, “blacklab”); ?></strong></p>
<?php endif; ?>
For text that’s already within PHP tags, such as this common Wordpress tag:
<?php the_content((’Keep reading’));?>
You’ll want to use the double underscore function. Like so:
<?php the_content(__(’Keep reading’, “blacklab”));?>
And that’s it! If you want to learn more about internationalizing your Wordpress themes, I recommend the I18n for Wordpress Developers page at the Codex, and visit other excellent guides and tutorials on how to do it.
Do you internationalize your Wordpress themes?
Tags:Wordpress theme internationalization, Wordpress theme translation
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Friday, November 20th, 2009



All computer students and programming geeks might like to look up CodeChef and maybe even take part in a competition they have for programmers. 
CodeChef hosts competitions for programmers with cash prizes for people residing in India and the US. Currently they have two upcoming contests the CodeChef Campus SnackDown on November 21st and another one called CodeChef December Challenge which is from Dec 1st to Dec 11th. Registration for SnackDown contest is already over but you can still look up the contest at the CodeChef website.
- First prize winner for winner from India is Rs 22,000/- and for the US is $440/-.
- CodeChef’s December challenge will consist of 6-8 problems of varying difficulty.
- The contest website has problems visible on the website on 1st December, 15.00 IST.
- Visit CodeChef website for registering your entry.
- If you solve the problem you get one point regardless of the level of difficulty.
- You can submit your solutions as many times as you would like as there are no penalties for incorrect submissions.
About CodeChef
Code Chef is a competition started by Directi as a way to engage the developer community and give them a forum. CodeChef hosts monthly online competitions for programmers in 35 programming languages. The winner gets a prize and also recognition. The winner is also then eligable to take part in CodeChef Cup which is a live event held yearly.
Win $150 Every Month in “Bloggers$ of The Month” Award

Writing for Devils Workshop and other blogs in our network just got better!
Now you can be “Blogger$ of The Month” and win from $150 cash prizes, in addition to direct 100% AdSense revnue from your post.
Read More…
Related posts:
Tags:Code Chef, contest, Events, Misc, Programming Language
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Developers, Gravatar, Internet, PollDaddy, Polls, Programming, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Monday, November 16th, 2009
I’ve recently moved to WordPress an active community site which is run and moderated by several editors and administrators. Each post gets dozens of comments, and I wanted to highlight those made by staff members.
What not to do
If you’ve googled a bit for a solution on how to identify authors’ or admins’ comments, you’ve probably seen several explanations on how to implement this by comparing emails. Something like:
CODE:
-
<?php
-
if( $comment->comment_author_email == ‘admin@blog.com’ ) {
-
$class = ‘admin’;
-
}
-
?>
While this is sort of OK for a single author weblog, it’s totally inconvenient and not scalable for a community site run by several editors and administrators: you would need to edit the template file whenever there’s a new member in the staff, and nothing prevents an unlogged user from commenting using your well known email address.
So, what to do instead?
(…)
Read the rest of How To Style Editor (Or Any Role) Comments in WordPress (283 words)
(cc) Ozh for planetOzh, 2009. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Code, Comments, WordPress
Related posts
Feed enhanced by Better Feed from Ozh

Tags:comments
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, Published, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Monday, October 26th, 2009
If you’re a developer that blogs (and you should) or one that develops websites powered by Wordpress, chances are you already know about my top three favorite plug-ins. Yes, these are the ones I can’t imagine life without:
One of my default plug-in installs, ExecPHP allows you to, yes, “execute” PHP from within Wordpress. That means that chunks of PHP code will work in your pages, posts and widgets- not just in your templates. I previously used runPHP, but switched after running into some problems with the latter- and I’m glad I did. This one just works for me.
Developers know how important it is that the formatting of our code isn’t trifled with. This lovely plug-in makes it so Wordpress (or other plug-ins you’ve got installed) can’t modify your code, while retaining your original whitespace and characters. Simply use <pre> and <code> and the plug-in will take care of the rest.
A gem of a plug-in that allows you to access your MySQL database from within Wordpress- that’s right, without having to fire up phpMyAdmin. Among other things, it performs “select”s and “describe”s, and modifies with “insert”s and “update”s.
What are your favorite Wordpress plug-ins?
Tags:Plug-Ins, Wordpress Plug-Ins
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Monday, October 12th, 2009
Because web browsers are notorious for displaying things differently from each other, for many web designers it sometimes feels like so many browsers, so little control. But there are ways around this- and one of my favorites is a little something called a CSS reset. A CSS reset can be anything from a single definition on your stylesheet to an entirely new stylesheet that you link to. For example, many designs like to add this to the beginning of their existing stylesheets:
* {margin:0;padding:0}
This, a very basic reset, "resets" all elements (signified by the asterisk) to have zero margin and zero padding. Here's an example of a more advanced reset:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
The above is one of the most popular CSS resets out there, made by CSS guru Eric Meyer. You use it the same way- either add it to the top of your existing stylesheet, or put it in a separate "Universal reset" CSS file and link to it from your pages. The advantage of doing the latter is that if you want to make changes in the future, you only have to edit one stylesheet.
It's important when using any CSS resets that you make sure to define certain styles that have been reset. For example, if you don't define padding-bottom and/or margin-bottom for your paragraphs, you won't see any space between your paragraphs.
You can, of course, write your own reset- in fact, if you've done a reasonable amount of web design with CSS, you probably already have a certain baseline framework you work with. When developing your own signature reset, it's a good idea to get to know the various browser defaults that exist, and perhaps the best way to do this is to view your non-css-resetted HTML page in as many browsers as you can get your hands on.
Finally, if you'd like to learn more about the various CSS resets available, and get more tips on rolling your own, here are some links I recommend:
- Reset Reloaded
Eric Meyer's uber-popular reset, with his explanations.
- YUI Reset
If you've used Yahoo!'s YUI grid system, you already know about their reset.css stylesheet. Another very popular one.
- Tripoli
It's called a "CSS Framework", not a reset, but Tripoli essentially does the same thing- and more: it resets everything, then provides definitions according to their idea of "optimal legibility and well-structured text presentation".
- Don't want to use CSS resets? You're not alone. Read Jonathan Snook's No CSS Reset or Warpspire's Why I don't use CSS Frameworks.
Do you use CSS resets?
Tags:CSS frameworks, CSS resets, reset CSS
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Wednesday, October 7th, 2009
So, still no response to my questions regarding the future of WordPress MU, and I don’t expect we’re going to see any any time soon, so I figured that I’d put down my thoughts as to how I’d like to see WordPress MU and WordPress merge.
And ask you to put your thoughts down too… on your blogs, in the comments, anywhere.
Because surely, as this is up to the community, and as a member of the community, I’m hoping that I have a voice here, and I hope that we can have a discussion.
And I’m also hoping that other members of the community like other Incsubbers, WPMU DEV Premium members, WP.MU users readers of WPMU.org would also like that.
Rather than one individual, or a small group of individuals, privately making a decision.
So, for my part, here’s what I’d like to see (in rough order of importance to me, personally):
- That the functionality is still called MU or Multi-User… many of us have build our livelihoods on this and changing it would be like changing ‘Plugins’ to ‘Extras’
- That this is absolutely not rushed… the last thing anyone needs is WP (with MU) version 3.0.9b
- That there is still an wp-content/mu-plugins/ folder and that existing plugins continue to work in that
- That above all, the continuing operation of existing MU plugins and themes that use MU specific code, is placed as a priority where changes are made
- That the process is clear, transparent, and up for discussion
So, what are your points of concern regarding the merge of WordPress MU into WPMU?
What questions do you have? What items do you want addressed?
And then, hopefully, those who would make such decisions will take note of our concerns and opinions and include us in the discussion.
That wouldn’t be too much to ask… would it?
Tags:compatibility, Featured, future, wordpress merge with wpmu, wordpress mu merge
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Community, Gravatar, Plugins, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes, wpmu | No Comments »
Tuesday, October 6th, 2009
While we’re waiting for a response from Matt with either his WordPress.org (voice of the community) or Automattic (voice of the leader) hat on to fill us in on what’s going to be the future of WordPress MU and perhaps answer a few of my questions, I figured I’d jot down some possible answers to a topic that came up quite a bit in the discussions related to that post.
Namely, a fair few people asked – Well, Automattic doesn’t release their code (or themes) for plugins they use of WordPress.com, or VIP sites like GigaOm – and yet they kick up a stink about our themes and plugins being behind a paywall.
What’s up with that?
Well it’s simple really, whether by design or WordPress chose a really great GPL license, namely GPL2 rather than GPL3.
Now, IANAL, but I believe that the fundamental difference between GPL2 and GPL3 is that GPL2 allows you to develop and use integrated code (plugins, themes etc.) as a service with no obligation to share it publicly *unless you distribute it in some way* whereas GPL3 forces you to supply that code to anyone who asks for it.
So, were WordPress GPL3 I could rock up to Automattic’s VIP clients (and Automattic themselves) and demand they provide me with the source code, whereas with GPL2 I can’t because the code hasn’t been released yet.
I’d be more than happy to be proved wrong (and I’m sure there are more erudite readers of this blog than I am – especially in this area) – but I’m pretty sure that’s the answer to the question.
So do let me know if I’ve got it completely wrong!
However, whether that’s ‘ok’ or not is another thing entirely
Personally, I’m fine with it, as it seems to make sense that if a WP user develops their own theme they shouldn’t have to hand it over to anyone who wants it.
Also, I wouldn’t stress too much about things like BuddyPress membership site plugins not being released, as we’ll be making a great one for you down the line at WPMU DEV Premium (we’ll be doing this because the generous members of the site allow us to dedicate time, employ developers and generally make it).
But whether everyone thinks it’s A ok I’m not sure?
It does strike me that some of the more ’strident’ (ahem) open sourcers out there would much prefer a GPL3 license., and apparently there are good reasons to upgrade, but I for one ‘aint clamouring for it.
Tags:gpl2, gpl3
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, Plugins, PollDaddy, Themes, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, automattic, bbPress, buddypress, release, wordpress plugins, wordpress themes | No Comments »
Monday, September 28th, 2009
I’ve posted before about using MAMP or XAMPP to run your own personal webserver on your Mac, allowing you to do very cool things like testing Wordpress themes locally. Both MAMP and XAMPP include phpMyAdmin to manage your MySQL databases, which is perfectly fine of course- and, I should add, it’s always a good idea to know how to use phpMyAdmin anyway- but what if you want a standalone application for this?

Most people have heard of Navicat. It works on Windows, Linux and OSX, with a non-commercial version that costs $179. It is a very powerful tool, has a good GUI, and because it’s cross-platform, this would be a good choice if you use both Macs and PCs for work.

My choice for a MySQL manager, Sequel Pro is easy to use, offers features such as SSH Tunnel and Foreign Key support, and- my favorite- keyboard shortcuts. They claim to be the “best looking MySQL Cocoa app”- and, as you can see from the screenshot I’ve posted, it is pretty great looking. It’s also free.
The Command Line
I’m talking, of course, about using OSX’s built-in Terminal to manage your MySQL. For details on how to compile MySQL using Terminal, see this excellent tutorial for Leopard (a tutorial for Snow Leopard is here), and once you’ve got MySQL installed and running properly, use the the MySQL Reference Manual to help you along with commands.
How do you manage your MySQL databases?
Tags:mysql, MySQL applications, MySQL apps, OSX
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Wednesday, September 23rd, 2009
I’ll admit that I was a little mystified by the <pre> and <code> tags. If you’re not sure which to use and when, here’s a quick guide:
<pre>
- is short for pre-formatted text.
- is displayed in a fixed-width font (such as Courier).
- preserves both spaces and line breaks.
You want to use <pre> when you need to display text exactly as you typed it. Keep in mind that all spaces, tabs, and carriage returns will be preserved- which is why it’s a popular format for publishing poetry. For example, this:
<pre>Hello, I am
pre-formatted
text.</pre>
will show you:
Hello, I am
pre-formatted
text.
<code>
According to the W3C, <code> “designates a fragment of computer code”. This is what to use to display code in HTML- it’s semantically correct.
Here’s an example of using both <pre> and <code> to display a block of code. This:
<pre><code>
code here
and code here
more code
and more code
</code></pre>
will show your visitors this:
code here
and code here
more code
and more code
Styling <pre> and <code>
Now that you know which to use and when, it’s easy to set styles for these tags with CSS. You can, for example, choose to add padding and/or margins with borders around all instances of your <code>, or changing the default fixed-width font for all <pre> elements to something else. When styling <pre>, you might want to add this white-space definition so that your text wraps according to the user’s browser width, like so:
pre {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
Finally, if you’re going to be posting a lot of code snippets using tags, you’ll want to use these characters:
< displays “less than” or <
> displays “greater than”, or >
Do you use <pre> and <code> in your HTML?
Tags:pre
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, HTML, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Friday, September 11th, 2009
Short intro for readers who don’t follow me or this blog’s feed: I’ve been a judge in the annual WordPress Plugin Competition, and as such I have reviewed a number of plugins. Read more about this.
As promised, I’m going to share a list of the most common mistakes, errors, misunderstandings, bad habits or wrong design decisions I’ve encountered while reviewing all these 43 plugins. Some are highly critical stuff (I’ve contacted 3 plugins authors after finding serious security holes in their plugin), some are more potential annoyances than real bugs, or are just causing a waste of server resources that could be avoided, but all have something in common: they’re trivial to fix.

(image reproduced without any permission from anyone because I don’t know who made it)
I’ve classified them in two parts: 10 bad code signs, plus a bonus with design decisions that suck. If you consider yourself a semi experienced coder or better, be sure to skip this article, you’re not going to learn a thing
(…)
Read the rest of Top 10 Most Common Coding Mistakes in WordPress Plugins (2,485 words)
(cc) Ozh for planetOzh, 2009. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Code, Competition, Errors, Plugins, Review, WordPress
Related posts
Feed enhanced by Better Feed from Ozh

Tags:Errors, review
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Competition, Gravatar, Plugins, PollDaddy, Published, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Tuesday, September 8th, 2009
Most of HTML5 seems to be pretty self-explanatory. Unfortunately there are a few things that just aren’t. For example, the complex outlining algorithm, and the section element. It’s confusing as hell and everyone has a their own way. So we may as well dive in head first…
Here’s our working HTML one more time in case you missed it:
HTML:
-
<!DOCTYPE html>
-
-
-
-
-
document.createElement(’header’);
-
document.createElement(’nav’);
-
document.createElement(’section’);
-
document.createElement(’article’);
-
document.createElement(’aside’);
-
document.createElement(’footer’);
-
</script>
-
-
header,nav,section,article,aside,footer {display:block;border:1px solid #bbb;padding:1em;}
-
-
header,nav,section,article,aside,footer {border:1px solid #bbb;padding:1em;}
-
header{background-color:#EFFBFF;}
-
h1,h2,nav li {font-family:helvetica,arial,sans-serif;}
-
nav{margin:1.5em 0;}
-
nav li {display: inline;list-style-type: none;padding-right:1em;}
-
article,aside{float:left;margin-bottom:1.5em;}
-
article {width:60%;}
-
aside {width:28%;margin-left:1em;}
-
footer {clear:both;}
-
.identifier {background-color:#FFF79F;font-style:italic;}
-
</style>
-
</head>
-
-
<header>
-
<p class=“identifier”>header
</p>
-
-
</header>
-
<nav>
-
<p class=“identifier”>nav
</p>
-
-
-
-
-
</ul>
-
</nav>
-
<article>
-
<p class=“identifier”>article
</p>
-
<h2>Terminology and Usage
</h2>
-
<section>
-
<p class=“identifier”>section
</p>
-
-
<li>The header element represents a group of introductory or navigational aids.
</li>
-
<li>The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.
</li>
-
<li>An article element is "independent" in the sense that its contents could stand alone, for example in syndication.
</li>
-
<li>The section element represents a generic document or application section…[it] is not a generic container element.
</li>
-
<li>The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content.
</li>
-
<li>The footer element represents a footer for its nearest ancestor sectioning content.
</li>
-
</ul>
-
</section>
-
</article>
-
<aside>
-
<p class=“identifier”>aside
</p>
-
-
<section>
-
<p class=“identifier”>section
</p>
-
<p>The main article on this page is comprised of excerpts from the HTML 5 draft.
</p>
-
</section>
-
</aside>
-
<footer>
-
<p class=“identifier”>footer
</p>
-
-
</footer>
-
</body>
-
</html>
section
The section element is defined by the W3C as “a generic document or application section…[it] is not a generic container element.” I don’t think one could be any more vague and contradictory. The only saving grace is a couple examples they give, namely tabbed elements, and chapters.
In my opinion this doesn’t necessarily limit you to sticking a section element inside of an article element, or visa versa. It doesn’t have to stand alone, it just has to group elements logically (unlike a div). So while some examples put sections around sets of articles, others put them within, to denote separate portions of the same article.
Our example HTML would be better served to have another section element after the first. That would be a great place to make a snarky comment about the vague and abstract language that only the Consortium can understand.
aside
Fortunately the aside element isn’t nearly as confusing as the section element. Use it as a sidebar with meta information related to the content. Pretty straightforward. You could put quotes, navigation, resources, links etc. inside this little fella. Just keep it related. This isn’t the place for global navigation elements.
footer
The last element in the series is the footer. While typically the last item on a page, a footer could also be used in a section or article. A great example would be all that meta information at the end of a blog post, e.g. categories, dates, tags, etc.
Conclusion
It’s your turn. Mock up your next site in HTML5 and see what happens. It might break, it might not, who knows. The spec is still unstable, but it is starting to gain traction. But definitely try it out. If we all start using it maybe we can have a usable spec in less than 20 years!
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, html5, wordpress plugins, wordpress themes | No Comments »
Friday, September 4th, 2009
Last week we took care of the head of our HTML5 document. If you haven’t checked it out, run over there real quick. It will only take you 5 minutes to get up to speed with a working proof of concept. Here’s the code again in case you forgot:
HTML:
-
<!DOCTYPE html>
-
-
-
-
-
document.createElement(’header’);
-
document.createElement(’nav’);
-
document.createElement(’section’);
-
document.createElement(’article’);
-
document.createElement(’aside’);
-
document.createElement(’footer’);
-
</script>
-
-
header,nav,section,article,aside,footer {display:block;border:1px solid #bbb;padding:1em;}
-
-
header,nav,section,article,aside,footer {border:1px solid #bbb;padding:1em;}
-
header{background-color:#EFFBFF;}
-
h1,h2,nav li {font-family:helvetica,arial,sans-serif;}
-
nav{margin:1.5em 0;}
-
nav li {display: inline;list-style-type: none;padding-right:1em;}
-
article,aside{float:left;margin-bottom:1.5em;}
-
article {width:60%;}
-
aside {width:28%;margin-left:1em;}
-
footer {clear:both;}
-
.identifier {background-color:#FFF79F;font-style:italic;}
-
</style>
-
</head>
-
-
<header>
-
<p class=“identifier”>header
</p>
-
-
</header>
-
<nav>
-
<p class=“identifier”>nav
</p>
-
-
-
-
-
</ul>
-
</nav>
-
<article>
-
<p class=“identifier”>article
</p>
-
<h2>Terminology and Usage
</h2>
-
<section>
-
<p class=“identifier”>section
</p>
-
-
<li>The header element represents a group of introductory or navigational aids.
</li>
-
<li>The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.
</li>
-
<li>An article element is "independent" in the sense that its contents could stand alone, for example in syndication.
</li>
-
<li>The section element represents a generic document or application section…[it] is not a generic container element.
</li>
-
<li>The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content.
</li>
-
<li>The footer element represents a footer for its nearest ancestor sectioning content.
</li>
-
</ul>
-
</section>
-
</article>
-
<aside>
-
<p class=“identifier”>aside
</p>
-
-
<section>
-
<p class=“identifier”>section
</p>
-
<p>The main article on this page is comprised of excerpts from the HTML 5 draft.
</p>
-
</section>
-
</aside>
-
<footer>
-
<p class=“identifier”>footer
</p>
-
-
</footer>
-
</body>
-
</html>
header
One of the first items developers put on the page is a header. Now we have a tag to represent that part of the page. This is the obvious place to put the title of your website, the navigation, and other header-type elements. You can also put a header in other parts of the page. It doesn’t have to go at the top but usually it will. The most common place will be in an article or section tag.
nav
The nav element is just like the header element, except it contains navigational elements, i.e. links to other pages or parts of a page.
article
This is from the HTML5 Draft Spec: An article element is “independent” in the sense that its contents could stand alone, for example in syndication. I think the best way to explain this is with a little example of content that would be good for an article:
- Blog post
- News article
- Tutorials
- Main page content
And here is an example of content that would NOT be good for an article:
- Navigational elements
- Main header content
- Sidebars
- Footer content
Get the difference? One is actual content that can be swiped as-is and does not require any context. The other elements do not necessarily add or detract from the article, but would require context to be understood in a different context.
Part 2 conclusion
One of the great things about HTML5 is that the new elements are simple, few, and needed. The header, nav, and article tags are perfect examples. Next week we’ll hit up a few other elements including the aside and footer tags.
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, html5, wordpress plugins, wordpress themes | No Comments »
Friday, September 4th, 2009
There are a few ways that you can limit signups to your WordPress MU site – via email address or limiting signups to existing members (or just yourself) only.
This plugin adds another way – the ability for you to set a signup code that stops any new visitors from creating a blog unless they know the code!
Introducing the WordPress MU Signup code plugin!
It’s effortless, just drop the plugin into mu-plugins and enter the code you’d like visitors to provide before they can create a blog or username and edit the text you want to appear above it (the ‘branding’).

After this, your sign up field will now be modified (remember to log out to see it in all its glory), and if visitors don’t enter the correct code then no blogs for them!

Download and enjoy here
Tags:limit, new blogs, registration, sign up, signup, users
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, Plugins, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Friday, August 28th, 2009


Over here at Devil’s Workshop, Rahul bro has implemented a cool revenue sharing program, wherein the advertisement that appears on the post belongs to the author itself. For eg. in this post the ad that is displayed below the post title is my ad. Any revenue generated by clicks on the above ad, is paid to my adsense account. But the thing is that with plugins like Advertising Manager, this method is easy to implement in Wordpress. On blogger its a little more extra code. See how you can implement it in Google’s BlogSpot.
Follow these steps to implement this hack in blogger:
- Search for the place that you are going to insert your ad in. For this tutorial I am taking the space after the post title.
- Find <data:post.body/>
- Insert the following code:
<b:if cond=”data:post.author== “Ricky”>
<!– Ricky’s Ad code here–>
</b:if>
<b:if cond=”data:post.author== “Joe”>
<!– Joe’s Ad code here–>
</b:if>
- Done!
The code is pretty self-explanatory. Suppose the authors name is Joel, replace Ricky in the first line of the code. Also don’t forget to insert the ad code in place of <!– Ricky’s Ad code here–> or the place. If you have more authors, just repeat the three lines again and again.
Whats the Advantage of such a thing?
To increase the traffic for a blog the main thing that is required is fresh content that is regularly updated. When you offer a revenue sharing program like this, people get interested quickly, because there is an incentive in it for them.
They will post regularly for you, because the more they post, the more they can earn. And due to the fresh content you get more traffic day by day. Its a win-win situation for everyone at last!
Related posts:
Tags:Ad, author, Blogging, how, Money Makers, Revenue, Sharing, to
Posted in Adsense, Blogger(BlogSpot), BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »
Thursday, August 27th, 2009
It’s time to get to work on our HTML5 chops. We’ve had plenty of theory. Now let’s get to it.
Here is the code that we are going to work with. Take a minute to copy and paste it into a text editor and give it an html extension. Once you’ve done that, go ahead and give it a spin… Looks nice doesn’t it. That’s your proof of concept. It works. Now let’s go through it section by section.
HTML:
-
<!DOCTYPE html>
-
-
-
-
-
document.createElement(’header’);
-
document.createElement(’nav’);
-
document.createElement(’section’);
-
document.createElement(’article’);
-
document.createElement(’aside’);
-
document.createElement(’footer’);
-
</script>
-
-
header,nav,section,article,aside,footer {display:block;border:1px solid #bbb;padding:1em;}
-
-
header,nav,section,article,aside,footer {border:1px solid #bbb;padding:1em;}
-
header{background-color:#EFFBFF;}
-
h1,h2,nav li {font-family:helvetica,arial,sans-serif;}
-
nav{margin:1.5em 0;}
-
nav li {display: inline;list-style-type: none;padding-right:1em;}
-
article,aside{float:left;margin-bottom:1.5em;}
-
article {width:60%;}
-
aside {width:28%;margin-left:1em;}
-
footer {clear:both;}
-
.identifier {background-color:#FFF79F;font-style:italic;}
-
</style>
-
</head>
-
-
<header>
-
<p class=“identifier”>header
</p>
-
-
</header>
-
<nav>
-
<p class=“identifier”>nav
</p>
-
-
-
-
-
</ul>
-
</nav>
-
<article>
-
<p class=“identifier”>article
</p>
-
<h2>Terminology and Usage
</h2>
-
<section>
-
<p class=“identifier”>section
</p>
-
-
<li>The header element represents a group of introductory or navigational aids.
</li>
-
<li>The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.
</li>
-
<li>An article element is "independent" in the sense that its contents could stand alone, for example in syndication.
</li>
-
<li>The section element represents a generic document or application section…[it] is not a generic container element.
</li>
-
<li>The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content.
</li>
-
<li>The footer element represents a footer for its nearest ancestor sectioning content.
</li>
-
</ul>
-
</section>
-
</article>
-
<aside>
-
<p class=“identifier”>aside
</p>
-
-
<section>
-
<p class=“identifier”>section
</p>
-
<p>The main article on this page is comprised of excerpts from the HTML 5 draft.
</p>
-
</section>
-
</aside>
-
<footer>
-
<p class=“identifier”>footer
</p>
-
-
</footer>
-
</body>
-
</html>
DOCTYPE
The doctype is easy now. Just specify the technology that should be used to render the page. For now all you need to use is html. It’s still a pain in the ass to serve a page as xml so forget that.
Script
We don’t need a full script tag anymore either. The default type is Javascript, yay. So what is that big block of Javascript then? It’s for the IE’s go figure. Unfortunately IE won’t recognize those as CSS elements unless we do that. Stupid, I know, but relatively painless.
Style
Did you notice anything different about the style tag? Right. No type. Guess why. Right. The type defaults to CSS. Thank the W3C for making our jobs at least a little more efficient. That first line of CSS is important. You have to set the HTML5 elements to display:block or they will render as inline (at least for now). All that other stuff is just there for your benefit but it isn’t required, so we’ll skip it.
Part 1 Conclusion
The W3C has done a great job of simplifying syntax in HTML5. Apart from the various IE fixes it’s quicker to write than ever before. Now go, go and look at your HTML5 page and be in awe.
Posted in BuddyPress Hosting, BuddyPress Plugins, BuddyPress Themes, Code, Gravatar, PollDaddy, WordPress, WordPress Hosting, WordPress MU Hosting, WordPress MU Plugins, WordPress MU Themes, WordPress Video, Wordpress Mu, bbPress, buddypress, wordpress plugins, wordpress themes | No Comments »