Nate Weiner

  • Archive
  • RSS

Export Wordpress to Tumblr

Well I finally made the switch. After ignoring my old (Wordpress) blog for 2 years I decided to make the move to Tumblr.

I didn’t want to lose all of my previous content but for some reason it was rather difficult to find a solid way to import my old Wordpress content into Tumblr.

The best I found was dhawalhshah’s project on GitHub.

After making a few quick tweaks, I was rolling on Tumblr in no time:

/ideashower/Export-Wordpress-posts-to-Tumblr Changes:

  • Imports tags and slugs
  • Skip unpublished posts
  • Import only from specified categories
  • Outputs a php array that can be used to redirect the old site links to the new one
    • #wordpress
    • #tumblr
    • #php
    • #github
    • #import
  • 4 months ago
  • 19
  • Permalink
  • Share
    Tweet

Override Wordpress Htaccess with Custom Rewrite Rules

I was working on a client project that used Wordpress as it’s main method for content management.  In addition to Wordpress, it had a seperate admin/member area hosted on the same domain.  In this member area I had implemented several uses of Mod Rewrite to make cleaner urls. However, when Wordpress was installed it’s htaccess rules took over request, no matter what I had entered and in what order. Here what my htaccess file looks like to allow other rewrite rules to run side by side with Wordpress:

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(file|member|photo) [NC]
RewriteRule . /index.php [L]

RewriteRule ^member/([0-9]+)/ /member_profile.php?m=$1
RewriteRule ^file/([0-9]+)/(.+)? /file.php?f=$1
RewriteRule ^photo/([^/]+)/([^/]+)/(.+)? /file.php?type=$1&ref_id=$2&photo=1

</IfModule>
By adding the Rewrite Condition with Request URI, I’m able to add rules/folders that Wordpress should ignore.  Make sure you use Request_URI and not Request_Filename.  They provide two different results.

    • #htaccess
    • #mod-rewrite
    • #web-design
    • #wordpress
  • 3 years ago
  • Permalink
  • Share
    Tweet

Comment to Email - Wordpress Plugin

The Comment to Email Wordpress Plugin allows you to reply to a comment and have your response be sent simultaneously to the commenter via email and posted as a regular comment in your comment section, killing two birds with one stone. As some of you have probably noticed, I like to try to email commenters personally. The main reason I do this is because I assume that the commenter is not going to be checking back routinely to see if I posted a response. The only problem with emailing a response is that it takes the conversation away from your comment section, meaning anyone else who has the same problem or question will miss the answer. Because of this I would find myself copying and pasting my emails back into the comments, which is just tedious. So I decided to create a better solution.

How it Works

It’s quite simple. After installing the plugin:
  1. Under the Comments menu select ‘Reply to Comments’.
  2. Click ‘Reply’ on the comment you wish to reply to.
  3. Enter your message with WYSIWYG editor.
  4. Click Send.
  5. An email is sent to the commenter and your email is posted as a comment.
Additionally you have the option to BCC yourself on the message so you can get a copy to put into your sent items in your email program.

Features In the Works

As I said, I just quickly whipped this up today and I’m working on another idea at the time being, so I couldn’t do everything I wanted yet. Here’s what I’m hoping to add to it in the near future:
  • Ability to provide independent footers for the email and for the comment. This will allow you to say “I’m going to post this email in the comments so that others can see our discussion” to the email, but not have it appear in the actual comment.
  • Adding a flag in the subject line of the BCC email so that you can setup a message filter in Outlook, Thunderbird, etc to automatically have the BCC’d email drop into your sent items. This way it will be as if you sent it from your own email like normal.
  • What else can you think of?

Install/Configuration

  1. Download the plugin
  2. Upload the plugin to your /wp-content/plugins/ directory
  3. Under the ‘Plugins’ menu in your WP Admin, click ‘activate’ next to the plugin.
  4. Note: The email that messages are sent as (and bcc’d to) is the email address in your user profile in Wordpress. You can change this under the ‘Users’ menu.

Download

Test it out and if you run into any problems, drop me a note in the comments. Download - Version 0.4 (Requires Wordpress 2.5+) Download - Version 0.2 (For Wordpress 2.0 - 2.3)
    • #plugin
    • #wordpress
  • 4 years ago
  • 2
  • Permalink
  • Share
    Tweet

Wordpress Plugin: Extra Comment Fields

Overview

This Wordpress plugin allows you to add additional fields for users to complete when submitting a comment. The extra data will be saved in the wp database and can be retrieved when showing a post’s list of comments. The extra comment variables will show up in the list of comments in your Wordpress admin and are editable through the standard admin comment edit page. This plugin requires a basic knowledge of HTML to modify your comment form. Jump to Download

Example of Use

For this example, we are going to add a field asking for a users age to the comments form.

1. First, add the field to your comments form.

Typically your comments form is in your theme folder and is comments.php Most likely: (/wp-content/themes/YOURTHEME/comments.php) Enter the HTML of your new field into the desired spot. To add a textfield for the user to enter their age into, you would add the following to your form. I’ll add mine right below the url textfield.
<p><input type="text" name="age" id="age" size="22" />
<label for="url"><small>Website</small></label></p>

Screenshot of Adding Field

2. Next, we need to add the field-variable to Wordpress.

Inside your Wordpress admin, click the ‘Settings’ menu. Then click the ‘Extra Comment Fields’ menu. Next, enter the name of the field. This has to be the exact name attribute you gave to the field you added to your comments form. For example, I added this field to my form:
<p><input type="text" name="age" id="age" size="22" />
<label for="url"><small>Website</small></label></p>
The input’s name attribute is ‘age’, so the variable you would enter for this field is ‘age’. Note: This can only contain letters, numbers, and/or dashes.

3. Last we want to make use of the data somehow when showing comments.

Your extra fields will be in the $comments variable retrieved by Wordpress. The extra fields you added will have a prefix of ‘extra_’. So to access the data for our ‘age’ field, we use $comment->extra_age inside the comments loop. So, for example, if I modify the default theme’s comment.php file, I just insert one line to display the extra comment information (highlighted in bold).
<ol class=”commentlist”> <?php foreach ($comments as $comment) : ?> <li <?php echo $oddcomment; ?>id=”comment-<?php comment_ID() ?>”> <?php echo get_avatar( $comment, 32 ); ?> <cite><?php comment_author_link() ?></cite> Says: <?php if ($comment->comment_approved == ‘0’) : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <br /> <small class=”commentmetadata”><a href=”#comment-<?php comment_ID() ?>” title=”“><?php comment_date(‘F jS, Y’) ?> at <?php comment_time() ?></a> <?php edit_comment_link(‘edit’,’ ‘,”); ?></small> <?php comment_text() ?> User’s Age is: <?php print $comment->extra_age; ?> </li> <?php /* Changes every other comment to a different class */ $oddcomment = ( empty( $oddcomment ) ) ? ‘class=”alt” ’ : ”; ?> <?php endforeach; /* end for each comment */ ?> </ol>

Another Example Posted on Problogger

How I added the Twitter ID field to comments on Twitip.com

Version History

1.2 - June 23rd, 2008
  • Corrected behavior when deleting/changing status of comment
1.1 Alpha - May 20th. 2008
  • Fixed blank comment content field
1.0 Beta - May 4th, 2008
  • Updated for WP 2.5
  • Added ability to edit comments
  • Added ability to view comments in admin
  • Extra Comments data deleted when comment is deleted
  • Fixed database table prefix
0.2 Alpha - Sept. 2007
  • Initial Release

Download

NOTE: I am no longer developing this plugin.  If you’d like to continue it, please consider it open source.  If you release a new version, update users in the comments below.  Thanks Download the Extra Comment Fields Wordpress Plugin version 1.2 Beta (For Wordpress 2.5+) Download the Extra Comment Fields Wordpress Plugin version 0.2 Alpha (Only for Wordpress 2.0 - 2.3) To install, unzip the files into your /wp- content/plugins/ folder. Then activate it under the Plugin menu in your Wordpress admin.

Important Note When Upgrading from 0.2 to 1

If your Wordpress database tables do not start with ‘wp_’, you will likely need to rename the wp_comments_extra table in your database to match the other table’s prefix. This is a result of the first version incorrectly assuming the prefix across all installations. For example, if you have have tables named called prefix_posts, prefix_comments, prefix_options, etc then you should rename the wp_comments_extra table to prefix_comments_extra.

    • #php
    • #plugins
    • #wordpress
  • 4 years ago
  • 6
  • Permalink
  • Share
    Tweet

About

Prototyper, water waster, developer of Pocket.

 

Follow

Twitter: @NateWeiner
Vimeo: Nate Weiner
500px: Nate Weiner
Blog: RSS

Pages

  • Contact
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr