Plugin Directory

Changeset 766157


Ignore:
Timestamp:
09/03/2013 08:38:30 AM (12 years ago)
Author:
sudiptomahato
Message:

bug fix related to import from localhost

Location:
blogger-301-redirect
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • blogger-301-redirect/trunk/bloggerredirect.php

    r764495 r766157  
    33Plugin Name: Blogger 301 Redirect
    44Plugin URI: http://techxt.com/blogger-301-redirect-plugin-for-wordpress/
    5 Description: Redirect from blogger to wordpress 
     5Description: Redirect from blogger to wordpress. Helps you keep your blog traffic and Pagerank after migration from Blogger to WordPress.
    66Author URI: http://techxt.com
    77Author: Sudipto Pratap Mahato
    8 Version: 2.2
    9 Requires at least: 3.0
    10 Tested up to: 3.6
     8Version: 2.3
    119*/
    1210
     
    7775        if($new_url == "")
    7876        {
    79             $q = "SELECT guid FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ".
     77            $q = "SELECT ID FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ".
    8078            "ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) WHERE ".
    8179            "$wpdb->postmeta.meta_key='blogger_permalink' AND ".
    82             "$wpdb->postmeta.meta_value='$permalink[1]'";
     80            "$wpdb->postmeta.meta_value='$permalink[1]' LIMIT 1";
    8381            if($wpdb->get_var($q))
    8482            {
    85                 $new_url =  $wpdb->get_var($q);
     83                $new_url =  get_permalink($wpdb->get_var($q));
    8684                $stat1[0]=$stat1[0]+1;
    8785            }
     
    9290            $si = explode("/", $permalink[1]);
    9391            $si[3] = '%'.str_replace($vrs, "%", $si[3]).'%';
    94             $q="SELECT guid FROM $wpdb->posts WHERE year(`post_date`) = $si[1] and month(`post_date`) = $si[2] and `post_name` like '$si[3]' and `post_type` = 'post'";
     92            $q="SELECT ID FROM $wpdb->posts WHERE year(`post_date`) = $si[1] and month(`post_date`) = $si[2] and `post_name` like '$si[3]' and `post_type` = 'post' and `post_status` = 'publish' LIMIT 1";
    9593            if($wpdb->get_var($q))
    9694            {
    97                 $new_url =  $wpdb->get_var($q);
     95                $new_url =  get_permalink($wpdb->get_var($q));
    9896                $stat1[0]=$stat1[0]+1;
    9997            }
     98        }
     99        if($new_url != "")
     100        {
     101            $new_url=str_replace("//","",$new_url);
     102            $pos = strpos($new_url, "/");   
     103            if ($pos !== false)
     104            {
     105                $new_url=site_url().str_replace( substr($new_url,0,$pos),"",$new_url);
     106            }   
    100107        }
    101108        if(get_option('home_re')=="checked" && $new_url == "")
     
    129136    <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Ftechxt&layout=standard&show_faces=false&width=450&action=like&font=verdana&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe><br />And if you are too generous then you can always <b>DONATE</b> by clicking the donation button.<br/>If you like the plugin then <b>write a review</b> of it pointing out the plus and minus points.
    130137    <p><b>Necessary steps before post migration from Blogger</b></p>
    131     1. Set the Timezone (Setting > General > Timezone)<br/>2. Change the Permalinks Structure to Custom [<b>/%year%/%monthnum%/%postname%.html</b>] <br/>&nbsp;&nbsp;&nbsp;(without brackets [] from Settings > Permalinks > Custom Structure)<br/>3. Import Posts using <a href="/wp-admin/admin.php?import=blogger">Blogger Import Plugin</a><br/>&nbsp;&nbsp;&nbsp;(Tools > Import > Blogger)
     138    1. Set the Timezone (Setting > General > Timezone)<br/>2. Change the Permalinks Structure to Custom [ <b>/%year%/%monthnum%/%postname%.html</b> ]<br/>&nbsp;&nbsp;&nbsp;(without brackets [ ] from Settings > Permalinks > Custom Structure)<br/>&nbsp;&nbsp;&nbsp;<i>(Note: Permalink change is recommended but not required. You can keep your own custom permalink structure)</i><br/>3. Import Posts using <a href="/wp-admin/admin.php?import=blogger">Blogger Import Plugin</a><br/>&nbsp;&nbsp;&nbsp;(Tools > Import > Blogger)
    132139    <form method="post" action="options.php">
    133140    <?php wp_nonce_field('update-options'); ?>
     
    140147    </tr>
    141148    <tr valign="top">
    142     <td><input type="checkbox" name="adv_ser" value="checked" <?php echo get_option('adv_ser'); ?> />Activate Advance search<br />Rarely used but sometimes very useful if you migrated without using Blogger import plugin</td>
     149    <td><input type="checkbox" name="adv_ser" value="checked" <?php echo get_option('adv_ser'); ?> />Activate Advance search<br />Rarely used but sometimes very useful if you migrated without using Blogger import plugin. <br/>Only works if post publish dates and post titles are same on both blogs.</td>
    143150    </tr>
    144151    <tr valign="top">
     
    167174<div style="background: #6699FF; padding-left: 20px;">
    168175    <h2> Method 1: Using New Blogger Template </h2>
    169     <textarea onclick="this.select()" cols="80" rows="16" readonly="true">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
     176    <textarea onclick="this.select()" cols="80" rows="16" readonly="true" style="width:95%">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
    170177<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    171178<html expr:dir='data:blog.languageDirection' lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr' xmlns:fb='http://ogp.me/ns/fb#' xmlns:og='http://ogp.me/ns#'>
     
    174181<b:if cond='data:blog.pageType == &quot;index&quot;'>
    175182<link rel='canonical' href='<?php echo site_url()."/"; ?>' />
     183<meta content='0;url=<?php echo site_url()."/"; ?>' http-equiv='refresh'/>
    176184<b:else/>
    177 <link rel='canonical' expr:href='&quot;<?php echo site_url()."/"; ?>?br=&quot; + data:blog.url' />     
     185<link rel='canonical' expr:href='&quot;<?php echo site_url()."/"; ?>?br=&quot; + data:blog.url' />
     186<meta expr:content='&quot;0;url=<?php echo site_url()."/"; ?>?br=&quot; + data:blog.url' http-equiv='refresh'/>     
    178187</b:if>
    179188<script type='text/javascript'>
     
    199208</b:section>
    200209
    201 <div style='border:#ccc 1px solid; background:#eee; padding:20px; margin:80px;'>
    202 <p>This page has moved to a new address.</p>
     210<div>
     211<p>This page has found a new home </p>
    203212  <a href='<?php echo site_url()."/"; ?>'><data:blog.title/></a>
    204213  <a expr:href='&quot;<?php echo site_url()."/"; ?>br=&quot; + data:blog.url' />
    205214</div>
    206 <a href='http://techxt.com'>Blogger 301 Redirect Plugin</a>
     215<a href='http://techxt.com/?'>Blogger 301 Redirect Plugin</a>
    207216</body>
    208217</html></textarea>
     
    222231    <h2> Method 2: Using Classic Template </h2>
    223232    The Template that you are required to copy to your Blogger blog<br />
    224     <textarea onclick="this.select()" cols="80" rows="16" readonly="true"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="<$BlogLanguageDirection$>"><head><title><$BlogPageTitle$></title><script type="text/javascript"><MainorArchivePage>window.location.href="<?php echo site_url()."/"; ?>"</MainOrArchivePage><Blogger><ItemPage>window.location.href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>"</ItemPage></Blogger></script><MainPage><link rel="canonical" href="<?php echo site_url()."/"; ?>" /></MainPage><Blogger><ItemPage><link rel="canonical" href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>" /></ItemPage></Blogger></head><body><div style="border: #ccc 1px solid; background: #eee; padding: 20px; margin: 80px;"><p>This page has moved to a new address.</p><h1><MainOrArchivePage><a href="<?php echo site_url()."/"; ?>"><$BlogTitle$></a></MainOrArchivePage><Blogger><ItemPage><a href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a></ItemPage></Blogger></h1></div><a href='http://techxt.com'>Blogger 301 Redirect Plugin</a></body></html></textarea>
     233    <textarea onclick="this.select()" cols="80" rows="16" readonly="true" style="width:95%">
     234<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     235<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="<$BlogLanguageDirection$>">
     236<head><title><$BlogPageTitle$></title>
     237<script type="text/javascript">
     238<MainorArchivePage>window.location.href="<?php echo site_url()."/"; ?>"</MainOrArchivePage>
     239<Blogger><ItemPage>window.location.href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>"</ItemPage></Blogger>
     240</script>
     241<MainPage><link rel="canonical" href="<?php echo site_url()."/"; ?>" /></MainPage>
     242<Blogger><ItemPage><link rel="canonical" href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>" /></ItemPage></Blogger>
     243<MainorArchivePage><meta content='0;url=<?php echo site_url()."/"; ?>' http-equiv='refresh'/></MainOrArchivePage>
     244<Blogger><ItemPage><meta content='0;url=<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>' http-equiv='refresh'/></ItemPage></Blogger>
     245</head>
     246<body>
     247<div>
     248<p>This page has found a new home </p>
     249<h1><MainOrArchivePage><a href="<?php echo site_url()."/"; ?>"><$BlogTitle$></a></MainOrArchivePage>
     250<Blogger><ItemPage><a href="<?php echo site_url()."/"; ?>?br=<$BlogItemPermalinkURL$>"><$BlogItemTitle$></a></ItemPage></Blogger></h1>
     251</div>
     252<a href='http://techxt.com/?'>Blogger 301 Redirect Plugin</a>
     253</body></html>
     254</textarea>
    225255   
    226256    <p><b>Where to copy the above Template</b></p>
     
    254284    <tr><td width="255"><p/><b>Total Hits </b></td><td><b><?php echo $stat1[0]+$stat1[1]+$stat1[2]+$stat1[3]+$stat1[4]+$stat1[5];?></b></td>
    255285    </tr><tr><td width="255"><a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=bloggerredirect&clearstat=true" onclick = "if (! confirm('Do you really want to clear all Stats?')) return false;">Clear All Statistics</a></td><td></td></tr></table>
    256 </td><td width="2%">&nbsp;</td><td width="20%"><b>Follow us on</b><br/><a href="http://twitter.com/techxt" target="_blank"><img src="http://a0.twimg.com/a/1303316982/images/twitter_logo_header.png" /></a><br/><a href="http://facebook.com/techxt" target="_blank"><img src="https://secure-media-sf2p.facebook.com/ads3/creative/pressroom/jpg/b_1234209334_facebook_logo.jpg" height="38px" width="118px"/></a><p></p><b>Feeds and News</b><br /><?php get_feeds() ?>
     286</td><td width="2%">&nbsp;</td><td width="20%"><a href="http://techxt.com/blogger301_ad" target="_blank"><img src="http://techxt.com/blogger301_ad.png" /></a><br/><b>Follow us on</b><br/><a href="http://twitter.com/techxt" target="_blank"><img src="http://a0.twimg.com/a/1303316982/images/twitter_logo_header.png" /></a><br/><a href="http://facebook.com/techxt" target="_blank"><img src="https://secure-media-sf2p.facebook.com/ads3/creative/pressroom/jpg/b_1234209334_facebook_logo.jpg" height="38px" width="118px"/></a><p></p><b>Feeds and News</b><br /><?php get_feeds() ?>
    257287<p></p>
    258288<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  • blogger-301-redirect/trunk/readme.txt

    r764495 r766157  
    55Requires at least: 3.0
    66Tested up to: 3.6
    7 Stable tag: 2.2
     7Stable tag: 2.3
    88
    99Useful for mapping your Blogger post and feeds to Wordpress posts and feeds after blogger to wordpress migration.
Note: See TracChangeset for help on using the changeset viewer.