Archive for May, 2009

Secret preferences revealed: which colleges do students actually choose?

Tuesday, May 12th, 2009
No Gravatar

Today we’re letting everyone in on a sneak-preview of our latest tool: the college cross-admit preference tool. We think it’s a simple but powerful way to see which colleges are most favored by admitted college students.

To use it is simple: type in the names of two colleges that you want to compare (perhaps Florida and Florida State?). You’ll then see which fraction of site members prefers which school. Preference is determined by the relative fraction of members admitted to both schools who end up attending one or the other. For example, if 25% of students admitted to both College A and College B ultimately go to College B, we say they prefer College B over College A. When the results are statistically significant at the 95% level, you’ll see the results lit up in bright colors.

For the hardcore college admissions followers out there, this will remind you of this graphic from a 2006 NY Times article. One difference is that our list isn’t limited to 17 schools; as the data continues to become available, we’ll display this information for all 1700 schools that we track.

Requests? Feedback? Suggestions? Let us know.

  • Share/Bookmark

Adding Threaded Comments for Author Pages on P2 Wordpress Theme

Sunday, May 10th, 2009
No Gravatar

P2 is one of the sweetest wordpress themes out there (see http://ma.tt/2009/05/how-p2-changed-automattic/), but for certain applications it needs tweaking.  At MyChances.net, we wanted to give each of our members their own blog so they could write about the college application process.  To accomplish this, we needed two additional features: 1) Threaded comments for author pages.  If members are going to feel like they have a legit blog, they need to have user comments on the articles they are writing.  2.)  If the logged in user is the author of the blog, that user should see the “Hi, watcha up to?” quick post box on their blog – NOT just on the main page (aka the “firehose” – thanks Twitter!).

Adding comments to author pages in the P2 wordpress theme is an easy process.  You just need a few minutes and a very small amount of programming knowledge.

Step 1:  Open up wp-content > themes > P2 > entry.php.

Step 2:  find the following line:  if ( ( is_home() || is_front_page() )) $withcomments = true;

Step 3: change the line to   if ( ( is_home() || is_front_page() || is_author() ) ) $withcomments = true;

Step 4: Save entry.php, and make sure that you upload it to your P2 directory.

Step 5: Profit.

If you need comments on the tags page, you can simply change the line to this:

if ( ( is_home() || is_front_page() || is_author() || is_tag() ) ) $withcomments = true;

Essentially you are adding in some logic so that if the page the user is looking at “is an author page” OR “is a tag page” then turn on the withcomments variable so the page is allowed to show the threaded comments feature which we all love.

You can see this functionality live here:

http://www.mychances.net/membership/blog/author/Brent/

and here:

http://www.mychances.net/membership/blog/tag/member-blogs/

Now for our second need, showing the quick post box on author’s own author page (if the logged in user is the author).

Step 1:  Open up wp-content > themes > P2 > author.php.

Step 2:  At the very top of the page, add this line in the php brackets like so:

<?
get_currentuserinfo();
?>

This allows you to access information about the current user, such as their username.  To let php see the username, you can access the data like this:

$current_user->user_login (So if you want to echo out the username of the logged in user, you can put <?=$current_user->user_login?>

Step 3:  Just below the line that has <div class=”sleeve_main”  id=”userpage”> insert this block of code:

<?
if( current_user_can( ‘publish_posts’ ) && $current_user->user_login==$author->user_nicename) require_once dirname( __FILE__ ) . ‘/post-form.php’;
?>

This checks two things.  1) Can the current user even post things.  2) If the current username is equal to that of the author.  If these criteria are met, it will display the “post form” which is the quick post box.  Otherwise, nothing shows up, so it just looks like a blog page for a normal visitor.

That’s it!  Please let me know if you have implementation questions.

Brent

  • Share/Bookmark