Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved : Create Sortable Sitemap File With Xss Stylesheet Template #19

Open
alierenerdal opened this issue Jun 10, 2017 · 1 comment

Comments

@alierenerdal
Copy link

alierenerdal commented Jun 10, 2017

This update provide sitemap sort property and send sitemap to Google and Bing crawlers

Screenshot :
aklisahane_sitemap_xss

Demo : http://www.aklisahane.com/sitemap.xml

Just Change your library file in this file in attachment : sitemap_lib.php.txt and rename to sitemap_lib.php.
sitemap_lib.php.txt

Usage :

`<?php
require_once("www_includes/func/sql.php"); // call database connection file
require_once("www_includes/func/func_inc.php"); // call your functions file
require_once 'sitemap_lib.php'; // call sitemap_lib.php file

$handle = fopen("../sitemap.xml", "w"); fclose($handle); // delete current sitemap file
$sitemap = new Sitemap('http://www.yoursite.com');
$sitemap->setPath('../');
$sitemap->setFilename('sitemap');

$query = mysqli_query($bag, 'Select * from blog_posts order by post_id desc ');

while ($post = mysql_fetch_array($query)) {
$sitemap->addItem('/blog/'.$post['id'].'-'.sefyap($post['adi']).'/' , '0.4', 'daily', $post["tarih"]);
}

$sitemap->setDomain('http://aklisahane.com/');
$sitemap->createSitemapIndex('http://www.yoursite.com/', 'Today');

$sitemaps = array("http://yourwebsite.com/sitemap.xml");

//This codes for sent sitemap file to Google And Bing Crawler Services

function Submit($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $httpCode;
}
function SubmitSiteMap($url) {
$returnCode = Submit($url);
if ($returnCode != 200) {
echo "Error $returnCode: $url
";
} else {
echo "Submitted $returnCode: $url
";
}
}

foreach ($sitemaps as $sitemapUrl) {
$sitemapUrl = htmlentities($sitemapUrl);

//Google
$url = "http://www.google.com/webmasters/sitemaps/ping?sitemap=".$sitemapUrl;
SubmitSiteMap($url);

//Bing / MSN
$url = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$sitemapUrl;
SubmitSiteMap($url);

// Live
$url = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$sitemapUrl;
SubmitSiteMap($url);

// moreover
$url = "http://api.moreover.com/ping?sitemap=".$sitemapUrl;
SubmitSiteMap($url);
}

?>`

@alierenerdal alierenerdal changed the title Add <?xml-stylesheet type="text/xsl" href="gss.xsl"?> tag Resolved : Create Sortable Sitemap File With Xss Stylesheet Template Jun 10, 2017
@alierenerdal alierenerdal reopened this Jun 10, 2017
@o
Copy link
Owner

o commented Jul 4, 2017

Hi Ali,

Sorry for my late response.

Currently, I am not maintaining this version anymore. I was start to work over a new version of this library which is easily extendable.

I will keep this issue open. And I will let you know about when beta version of this library available.
Thanks for your interest.
O.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants