public static function generateSitemap() { global $SITEURL; self::generateSitemapWithoutPing(); if (!defined('GSDONOTPING') || !GSDONOTPING) { if (file_exists(GSROOTPATH . 'sitemap.xml')) { if (200 === ($status = pingGoogleSitemaps($SITEURL . 'sitemap.xml'))) { #sitemap successfully created & pinged return true; } else { error_log(i18n_r('SITEMAP_ERRORPING')); return i18n_r('SITEMAP_ERRORPING'); } } else { error_log(i18n_r('SITEMAP_ERROR')); return i18n_r('SITEMAP_ERROR'); } } else { #sitemap successfully created - did not ping return true; } }
exec_action('sitemap-additem'); } //create xml file $file = $relative . 'sitemap.xml'; exec_action('save-sitemap'); XMLsave($xml, $file); } } // Variables for website $spath = $relative . 'data/other/'; $sfile = "website.xml"; $data = getXML($spath . $sfile); $SITEURL = $data->SITEURL; if (!defined('GSDONOTPING')) { if (file_exists($relative . 'sitemap.xml')) { if (200 === ($status = pingGoogleSitemaps($SITEURL . 'sitemap.xml'))) { $response = $i18n['SITEMAP_CREATED']; header('location: theme.php?success=' . $response); exit; } else { $response = $i18n['SITEMAP_ERRORPING']; header('location: theme.php?err=' . $response); exit; } } else { $response = $i18n['SITEMAP_ERROR']; header('location: theme.php?err=' . $response); exit; } } else { $response = $i18n['SITEMAP_ERRORPING'];
/** * Creates Sitemap * * Creates sitemap.xml in the site's root. * Pending: read the content path (xml's) */ function generate_sitemap() { // Variable settings global $SITEURL; $path = GSDATAPAGESPATH; $count = "0"; $filenames = getFiles($path); if (count($filenames) != 0) { foreach ($filenames as $file) { if (isFile($file, $path, 'xml')) { $data = getXML($path . $file); if ($data->url != '404') { $status = $data->menuStatus; $pagesArray[$count]['url'] = $data->url; $pagesArray[$count]['parent'] = $data->parent; $pagesArray[$count]['date'] = $data->pubDate; $pagesArray[$count]['private'] = $data->private; $pagesArray[$count]['menuStatus'] = $data->menuStatus; $count++; } } } } $pagesSorted = subval_sort($pagesArray, 'menuStatus'); if (count($pagesSorted) != 0) { $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset></urlset>'); $xml->addAttribute('xsi:schemaLocation', 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd', 'http://www.w3.org/2001/XMLSchema-instance'); $xml->addAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9'); foreach ($pagesSorted as $page) { if ($page['private'] != 'Y') { // set <loc> $pageLoc = find_url($page['url'], $page['parent']); // set <lastmod> $tmpDate = date("Y-m-d H:i:s", strtotime($page['date'])); $pageLastMod = makeIso8601TimeStamp($tmpDate); // set <changefreq> $pageChangeFreq = 'weekly'; // set <priority> if ($page['menuStatus'] == 'Y') { $pagePriority = '1.0'; } else { $pagePriority = '0.5'; } //add to sitemap $url_item = $xml->addChild('url'); $url_item->addChild('loc', $pageLoc); $url_item->addChild('lastmod', $pageLastMod); $url_item->addChild('changefreq', $pageChangeFreq); $url_item->addChild('priority', $pagePriority); exec_action('sitemap-additem'); } } //create xml file $file = GSROOTPATH . 'sitemap.xml'; exec_action('save-sitemap'); XMLsave($xml, $file); } if (!defined('GSDONOTPING')) { if (file_exists(GSROOTPATH . 'sitemap.xml')) { if (200 === ($status = pingGoogleSitemaps($SITEURL . 'sitemap.xml'))) { #sitemap successfully created & pinged return true; } else { error_log(i18n_r('SITEMAP_ERRORPING')); return i18n_r('SITEMAP_ERRORPING'); } } else { error_log(i18n_r('SITEMAP_ERROR')); return i18n_r('SITEMAP_ERROR'); } } else { #sitemap successfully created - did not ping return true; } }
// mesaj olarak yaziyoz $sorgu = "INSERT INTO mesajciklar "; $sorgu .= "(sira,mesaj,yazar,ip,tarih,gun,ay,yil,saat)"; $sorgu .= " VALUES "; $sorgu .= "('$id','".mysql_real_escape_string($mesaj)."','$yazar','$ip','$tarih','$gun','$ay','$yil','$saat')"; mysql_query($sorgu); // mesajida yazdik //rss pingliyoruz. include "config.php"; $sitemap = $siterss; if ($sorgu) { $pingle = pingGoogleSitemaps($sitemap); $rss = "http://pingomatic.com/ping/?title=Anka+Sozluk&blogurl=$site&rssurl=$siterss&chk_weblogscom=on&chk_blogs=on&chk_technorati=on&chk_feedburner=on&chk_syndic8=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_blogrolling=on&chk_blogstreet=on&chk_moreover=on&chk_weblogalot=on&chk_icerocket=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_bloglines=on&chk_postrank=on&chk_skygrid=on&chk_collecta=on&chk_audioweblogs=on&chk_rubhub=on&chk_geourl=on&chk_a2b=on&chk_blogshares=on"; $rss=getir($rss); } else {} // ekranada basiyoz echo " <script language=\"javascript\">goUrl('sozluk.php?process=today','left');</script> <META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=sozluk.php?process=word&q=$baslik\">"; } // bitirdik IF i function form($baslik) { ?>