function spp_generate_sitemap()
{
    require 'settings.php';
    if (class_exists('GoogleSitemapGenerator')) {
        $generatorObject =& GoogleSitemapGenerator::GetInstance();
        if ($generatorObject != null) {
            global $wpdb;
            // Let's get some keywords
            $terms = $wpdb->get_col('SELECT term FROM ' . $wpdb->prefix . 'spp ORDER BY RAND() LIMIT ' . $settings['limit']);
            foreach ($terms as $term) {
                $generatorObject->AddUrl(build_permalink_for($term, $settings['permalink']), time(), "daily", 0.5);
            }
        }
    }
}
Beispiel #2
0
	function liq_spp_feedkw( $atts ) {
		extract( shortcode_atts( array(
			's' => 1,
			'x' => 10,
			'url'	=> ''
		), $atts ) );
		
		$xml = liq_spp_fetch($url);
		
		if( $xml->channel->item ){

			$result = '<ul class="spp_feeder">'; 
				$maxs = 1;
				foreach ($xml->channel->item as $item) {
					
					if( $s==1 ) liq_spp_save_term(liq_spp_clean_term($item->title));

					$result .= '<li><a href="'.build_permalink_for(sanitize_title($item->title),0).'">'.$item->title.'</a></li>';
					
					if($maxs == $x) break;

					$maxs++;
				}
			$result .= '</ul>';

		} else $result = 'No feed to display';

					
		return $result;
	}