*/ ?>
Item not found!
Use this feature to upgrade old posts into the new ArtPal framework. This will do the following:
Converting the following posts: '; foreach ( $return_ids as $thisID ) { echo $thisID . ', '; } echo ' ...
'; // Go through each post for ( $thisPost = 0; $thisPost < count ( $return_ids ); $thisPost++ ) { echo 'Reading post ' . $return_ids [ $thisPost ] . '...
';
$content = $return_content [ $thisPost ];
if ( preg_match ('/\[paypal=(.*);(.*);(.*)\]/iU', $content, $matches) ) {
echo 'Tag: ' . $matches [ 0 ] . '
';
echo 'Title (ignored): ' . $matches [ 1 ] . '
';
echo 'Price: ' . $matches [ 2 ] . '
';
echo 'Shipping: ' . $matches [ 3 ] . '
';
// Insert price metadata
$sql = 'INSERT INTO ' . $wpdb -> postmeta . ' ( post_id, meta_key, meta_value ) VALUES ( ' . $return_ids [ $thisPost ] . ', "' . ds_ap_CFPRICE . '", "' . $matches [ 2 ] . '" )';
echo $sql . '
';
if ( $commit )
$wpdb -> query ( $sql );
$sql = 'INSERT INTO ' . $wpdb -> postmeta . ' ( post_id, meta_key, meta_value ) VALUES ( ' . $return_ids [ $thisPost ] . ', "' . ds_ap_CFSHIPPING . '", "' . $matches [ 3 ] . '" )';
echo $sql . '
';
if ( $commit )
$wpdb -> query ( $sql );
// Replace old data with new.
$content = str_replace ( $matches [ 0 ], ds_ap_TAGINSERT, $content );
$sql = 'UPDATE ' . $wpdb -> posts . ' SET post_content = "' . addslashes ( $content ) . '" WHERE ID = ' . $return_ids [ $thisPost ];
if ( $commit )
$wpdb -> query ( $sql );
}
echo '
Changes committed.
'; else echo 'Changes not committed.
'; } ?>