function generateAutoContent($query, $google = 1, $yahoo = 1, $bing = 1, $limit = 5, $duration = 7776000, $cache = '/wp-content/cache') { //prepare simplepie $feed = new SimplePie(); $f = $google + $yahoo + $bing; if ($f == 1) { if ($google) { $feed->set_feed_url(googleFeed($query)); } else { if ($yahoo) { $feed->set_feed_url(yahooFeed($query)); } else { if ($bing) { $feed->set_feed_url(bingFeed($query)); } } } } else { if ($google && $yahoo && $bing) { $feed->set_feed_url(array(googleFeed($query), yahooFeed($query), bingFeed($query))); } else { if ($google && $yahoo) { $feed->set_feed_url(array(googleFeed($query), yahooFeed($query))); } else { if ($google && $bing) { $feed->set_feed_url(array(googleFeed($query), bingFeed($query))); } else { if ($yahoo && $bing) { $feed->set_feed_url(array(yahooFeed($query), bingFeed($query))); } } } } } $feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . $cache); $feed->set_item_limit($limit); $feed->set_cache_duration($duration); $feed->init(); $feed->handle_content_type(); $ac = array(); //generate foreach ($feed->get_items() as $item) { $fSource = $item->get_permalink(); if (isBlokir($fSource)) { continue; } $fDescription = clearDescription($item->get_description()); $fKeyword = clearTitle($item->get_title()); $fPermalink = clearKeyword($fKeyword); //$fPermalink = generatePermalink($Permalink); $ac[] = array("keyword" => ucwords($fKeyword), "permalink" => $fPermalink, "description" => $fDescription, "source" => $fSource); } return $ac; }
foreach ($result as $item) { $count = 1; $title = $item->get_title(); if (str_word_count($title, 0) <= 3) { if (stristr($title, "iPhone Wallpaper") === FALSE) { $title .= " iPhone Wallpaper"; } foreach ($item->get_enclosures() as $enc) { if ($count == 1) { $count++; foreach ($enc->get_credits() as $cred) { $name = $cred->get_name(); echo '<p><img src="' . $enc->get_thumbnail() . '" alt="' . $title . '" align="left"/>'; echo "Uploader: " . $name . "\n"; } echo "<br/>Desc: " . clearDescription($enc->get_description()) . "</p>"; } } echo '<h3 class="title-item"><a href="/wallpaper/' . str_replace('--', '-', clearTitle(clearQuery(str_ireplace("wallpaper", "", str_ireplace("iPhone", "", $title))))) . 'iphone-wallpaper/">' . $title . "</a></h3>"; } } ?> <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?> <!-- <?php trackback_rdf(); ?> -->
$count = 1; $title = $item->get_title(); if (stristr($title, "iPhone Wallpaper") === FALSE) { $title .= " iPhone Wallpaper"; } foreach ($item->get_enclosures() as $enc) { if ($count == 1) { ///echo '<h3 class="title-item"><a href="/wallpaper/' . str_replace('+', '-',clearTitle(clearQuery(str_ireplace("wallpaper","", str_ireplace("iPhone","", $title))))) . '-iphone-wallpaper/">' . $title . "</a></h3>"; echo '<h3 class="title-item">' . $title . "</h3>"; $count++; foreach ($enc->get_credits() as $cred) { $name = $cred->get_name(); echo '<p><img src="' . $enc->get_link() . '" alt="' . $title . '" align="left"/>'; echo 'Uploader: <a href="http://iphone.masbuchin.com/wallpaper/' . str_replace('+', '-', clearTitle(clearQuery($name))) . '-iphone-wallpaper/">' . $name . "</a>\n"; } echo "<br/>Description: This is an iPhone Wallpaper uploaded by " . $name . ' with given title "' . $title . '". The original description from this author is ' . clearDescription($enc->get_description()) . ". Click the link below to see this wallpaper in actual size. You may download " . $title . " by click the link below, after the image displayed in full size:</p>\n\t\t\t\t\t<blockquote><p>How To Install Wallpaper on Your iPhone:</p>\n<p>1. In Safari, go to the screen that gives you the option for ‘medium’ or ‘original image’ sizes. Click ‘Original Size’</p>\n\n<p>2. Tap and hold your finger on the image. When you see a pop-up box, choose ‘Save Image’</p>\n<p>3. Go to your iPhone’s Camera Roll, choose the photo, tap the Action icon, then tap ‘Use As Wallpaper’</p>\t\t\t\n\t\t\t\t\t"; echo '<a href="' . $enc->get_link() . '">View and Download ' . $title . "</a></blockquote><br/><br/>"; echo 'Another iPhone Wallpapers Tagged With: '; $exp_title = explode(' ', $title); foreach ($exp_title as $tag) { if (stristr($tag, "iphone") === FALSE && stristr($tag, "wallpaper") === FALSE) { echo '<a href="/wallpaper/' . str_replace('+', '-', clearTitle(clearQuery(str_ireplace("wallpaper", "", str_ireplace("iPhone", "", $tag))))) . '-iphone-wallpaper/">' . $tag . "</a> "; } } } } //echo '<h3 class="title-item"><a href="/wallpaper/' . str_replace('+', '-',clearTitle(clearQuery(str_ireplace("---","-",str_ireplace("wallpaper","", str_ireplace("iPhone","", $title)))))) . '-iphone-wallpaper/">' . $title . "</a></h3>"; //} /*else{ $cnt = 1; while($cnt==1){