prepareQuery(); $table = $config->sql_tablename_publish_de(); $table_extern = $config->sql_tablename_extracontent(); //create your XML document, using the namespaces $urlset = new SimpleXMLElement(''); $stmt = $pdo->prepare("SELECT p_title,p_picturelink,p_shortcode FROM $table_extern WHERE id>'0' ORDER BY p_timestamp DESC LIMIT 49995;"); $stmt->execute(); /* while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) { $p_headline = $func->clear_description($rows["p_title"]); $p_picture = $rows["p_picturelink"]; $p_shortcode = $rows["p_shortcode"]; $lastmod = date('c',time()); $rand_vor = rand(6, 9); $rand_nach = rand(1, 9); $linkingcode = "https://www.buzzerstar.com/news.php?a=".$p_shortcode; //add the page URL to the XML urlset $url = $urlset->addChild('url'); $url->addChild('loc', $linkingcode ); $url->addChild('lastmod', $lastmod ); $url->addChild('changefreq', 'monthly'); //weekly etc. $url->addChild('priority', "0.$rand_vor".$rand_nach); $image = $url->addChild('image:image', null, 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:loc',$p_picture, 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:caption',$p_headline, 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:title',$p_headline, 'http://www.google.com/schemas/sitemap-image/1.1'); }; */ $stmt = $pdo->prepare("SELECT p_headline,p_picture_1_description,p_shortcode FROM $table WHERE id>'0' AND p_isonline=1 ORDER BY p_timestamp DESC LIMIT 49995;"); $stmt->execute(); while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) { $row_count++; $all_row_count++; $p_headline = $func->clear_string($rows["p_headline"]); $p_picture = $func->clear_string($rows["p_picture_1_description"]); $p_shortcode = $rows["p_shortcode"]; $lastmod = date('c',time()); $rand_vor = rand(6, 9); $rand_nach = rand(1, 9); $linkingcode = "https://www.buzzerstar.com/".$func->makeArticleLink($p_shortcode); //add the page URL to the XML urlset $url = $urlset->addChild('url'); $url->addChild('loc', $linkingcode ); $url->addChild('lastmod', $lastmod ); $url->addChild('changefreq', 'monthly'); //weekly etc. $url->addChild('priority', "0.$rand_vor".$rand_nach); $image = $url->addChild('image:image', null, 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:loc',"https://www.buzzerstar.com/i.php?s=$p_shortcode", 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:caption',$p_picture, 'http://www.google.com/schemas/sitemap-image/1.1'); $image->addChild('image:title',$p_headline, 'http://www.google.com/schemas/sitemap-image/1.1'); }; //add whitespaces to xml output (optional, of course) $dom = new DomDocument(); $dom->loadXML($urlset->asXML()); $dom->formatOutput = true; //output xml echo $dom->saveXML(); exit(0); ?>