BTW, here is the step-by-step instruction on how to import the FHG galleries with CyberSEO.
1) Simply add the FHG RSS feed with CyberSEO. It can be the RSS feed of your "master blog" with galleries, or any sponsored FHG feed like this:
Digital Desire Fully Hosted Galleries, this:
MC-NUDES.COM - FREE HOSTED GALLERIES or this:
Cindy Cupcakes Galleries (actually any FHG RSS feed will work).
2) Put the following code into the "
PHP code" box:
Code:
if (!cseo_post_exists($post)) {
$max_images = 20;
$comumns = 4;
$thumb_width = 180;
$thumb_height = 240;
add_image_size('thumbnail', $thumb_width, $thumb_height, true);
if ($post['link'] != '') {
$glink = urldecode($post['link']);
} else {
$glink = urldecode($post['guid']);
}
$gallery = cseo_file_get_contents($glink);
global $cseo_last_effective_url;
if (isset($cseo_last_effective_url)) {
$base_url = $cseo_last_effective_url;
} else {
$base_url = $glink;
}
$base_url = parse_url($base_url, PHP_URL_SCHEME) . '://' . parse_url($base_url, PHP_URL_HOST) . parse_url($base_url, PHP_URL_PATH);
if ($base_url[strlen($base_url) - 1] != '/') {
$base_url = str_replace(basename($base_url), "", $base_url);
}
preg_match_all('/<a.+?href=[\s]?["|\']?([\w%-\.\/:\?&=]+\.jpg([\?0-9a-zA-Z_\-,=]+)?)["|\']?.*?>.*?<img.*?src.*?>/is', html_entity_decode($gallery), $matches);
if (!isset($matches[1]) || !count($matches[1])) {
return $post = false;
}
for ($i = 0; $i < min(((int) (count($matches[1]) / $comumns)) * $comumns, $max_images); $i++) {
if (substr($matches[1][$i], 0, 2) == '//') {
$matches[1][$i] = 'http:' . $matches[1][$i];
}
if (stripos($matches[1][$i], "http://") !== false) {
$image = $matches[1][$i];
} elseif (substr($matches[1][$i], 0, 1) == "/") {
$image = "http://" . parse_url($base_url, PHP_URL_HOST) . $matches[1][$i];
} else {
$image = $base_url . $matches[1][$i];
}
cseo_must_be_binary($image);
cseo_add_image_to_library($image, $post['post_title']);
}
$post['post_content'] = '<p>' . strip_tags($post['post_excerpt']) . '</p><p>[gallery columns="4" link="file"]</p>';
$post['post_excerpt'] = $post['post_content'];
} else {
$post = false;
}
3) Select "
Generate from the first post image" in the "
Post thumbnail" drop-down box, if you want to automatically create featured images for every imported gallery.
4) Save the settings and let CyberSEO do all your job on autopilot. It will check the feeds for updates, download the images to your host, crop the thumbnails, build the galleries and generate new WP posts with them. Even featured images will be created, if you want it.