WordPress hack: Show your top contributors without a plugin

Simply paste this code where you want your top contributors to be displayed. Note that this code use the mysql_* functions instead of the $wpdb object. This is not the better way to do this, but it do the trick ;)

<?php
include($_SERVER['DOCUMENT_ROOT']."/wp-config.php");
mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die(mysql_error());
mysql_select_db(DB_NAME) or die(mysql_error());

$sql = "SELECT
".$table_prefix.users.".".user_login.",count(*)\n"
    . "FROM
".$table_prefix.posts.",".$table_prefix.users."\n"
    . "WHERE ".$table_prefix.posts.".".post_parent."=0
and
".$table_prefix.posts.".".post_author."=".$table_prefix.users.".".ID."\n"
    . "Group by
".$table_prefix.users.".".user_login."\n"
 									

Daily Email Newsletters

Weekly Email Newsletters

Subscribe to receive the latest design and creative business news, tutorials, and resources delivered to you via email—either daily (below) or weekly, to your computer, tablet, or mobile phone.

IMPORTANT NOTE: The newsletters and subscription confirmation email will be sent from the address briefing@iampariah.com. Please be sure to whitelist that address in your anti-spam filters. Check your Junk Mail or Spam folder if you miss an email prior to whitelisting briefing@iampariah.com.

Privacy and CAN-SPAM Compliance

All Pariah Burke newsletters comply with the U.S. CAN-SPAM Act. The newsletter even uses a third-party ESP to audit and ensure its compliance with CAN-SPAM. And your privacy is assured: your email address and other information will never be sold or given away.