*/ ?>

Item not found!

Here is a link to item number .

Item Lookup

Find an Item (Post)

Enter item number (object id):

Upgrade Items

Use this feature to upgrade old posts into the new ArtPal framework. This will do the following:

  1. Search through all posts
  2. Create custom fields based on tagged content.
  3. Replace old tags with new ones
posts . ' WHERE post_content LIKE "%[paypal=%;%;%]%"'; $poststoconvert = $wpdb -> get_results ( $sql, ARRAY_A ); $return_ids = array (); $return_content = array (); // Merge ID and content into respective arrays. foreach ( $poststoconvert as $thisPost ) { $return_ids [] = $thisPost [ 'ID' ]; $return_content [] = $thisPost [ 'post_content' ]; } echo '

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 '

'; } if ( $commit ) echo '

Changes committed.

'; else echo '

Changes not committed.

'; } ?>