Commit dd188d54 authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Merged 6.x-2.x branch back into HEAD for a Drupal 7 branch. Must...

by Dave Reid: Merged 6.x-2.x branch back into HEAD for a Drupal 7 branch. Must get started on this now while working on 6.x-2.x.
parent 34ebcd4e
$Id$
XML Sitemap 7.x-2.x-dev
-----------------------
$Id$
XML Sitemap Module
If you are upgrading from Google Sitemap, make sure you are using the latest
version.
Installation Instructions:
1. Place the xmlsitemap directory in sites/all/modules.
2. Go to the XML Sitemap section at
http://www.example.com/?q=admin/build/modules and enable the modules for the
types of links you want in your site map. Enable XML Sitemap: Engines if you
want to be able to automatically submit your site map to search engines.
3. The sitemap is now operational at http://www.example.com/?q=sitemap.xml.
Configure advanced options at
http://www.example.com/?q=admin/settings/xmlsitemap.
$Id$
XML Sitemap Module
Author: Matthew Loar <matthew at loar dot name>
This module was originally written as part of Google Summer of Code 2005.
DESCRIPTION
-----------
The XML Sitemap module creates an XML site map at
http://www.example.com/?q=sitemap.xml that conforms to the sitemaps.org
specification. It provides many options for customizing the data reported in the
site map.
INSTALLATION
------------
See INSTALL.txt in this directory.
SPECIALIZED SITE MAPS
CONTENTS OF THIS FILE
---------------------
You can create specialized site maps using Views. To do so, enable both Views
and XML Sitemap: Node and create a new view. In the Page settings, choose XML
Sitemap: Sitemap as the view type for a regular site map or XML Sitemap: News
for a Google News site map.
* Introduction
* Installing
* Uninstalling
* Frequently Asked Questions (FAQ)
* Known Issues
* More Information
* How Can You Contribute?
INTRODUCTION
------------
Current Maintainer: Dave Reid <http://drupal.org/user/53892>
Co-maintainer: Kiam <http://drupal.org/user/55077>
Co-maintainer: Earnie <http://drupal.org/user/86710>
Co-maintainer: Darren Oh <http://drupal.org/user/30772>
Original Author: Matthew Loar <http://drupal.org/user/24879>
XML Sitemap automatically creates a sitemap that conforms to the sitemaps.org
specification. This helps search engines keep their search results up to date.
INSTALLING
----------
See http://drupal.org/getting-started/install-contrib for instructions on
how to install or update Drupal modules.
Once XML Sitemap is installed and enabled, you can adjust the settings for your
site's sitemap at admin/settings/xmlsitemap. Your can view your site's sitemap
at http://yoursite.com/sitemap.xml.
It is highly recommended that you have clean URLs enabled for this module.
UNINSTALLING
------------
Because Drupal does not uninstall modules in reverse order of their
dependencies, if you want to uninstall all the XML sitemap modules, be sure to
disable and uninstall all the sub-modules before the base XML sitemap module.
To help fix this bug in Drupal core, visit http://drupal.org/node/151452.
FREQUENTLY ASKED QUESTIONS (FAQ)
--------------------------------
- There are no frequently asked questions at this time.
KNOWN ISSUES
------------
Users who have not enabled clean URLs have reported receiving an
"Unsupported file format" error from Google. The solution is to replace
"?q=sitemap.xml" at the end of the submission URL with
"index.php?q=sitemap.xml". Submission URLs for each search engine can be
configured at http://www.example.com/?q=admin/settings/xmlsitemap/engines.
- See http://drupal.org/node/482550 for a list of the current known issues.
MORE INFORMATION
----------------
The Sitemap protocol: http://sitemaps.org.
Search engines:
http://www.google.com/webmasters/sitemap (Google)
http://developer.yahoo.com/search/siteexplorer/V1/ping.html (Yahoo!)
http://webmaster.live.com/ (Windows Live)
- To issue any bug reports, feature or support requests, see the module issue
queue at http://drupal.org/project/issues/xmlsitemap.
- For additional documentation, see the online module handbook at
http://drupal.org/handbook/modules/gsitemap.
- You can view the sitemap.org specification at http://sitemaps.org.
- You can view the module's API documentation at
http://project.davereid.net/api/xmlsitemap
HOW CAN YOU CONTRIBUTE?
-----------------------
- Report any bugs, feature requests, etc. in the issue tracker.
http://drupal.org/project/issues/xmlsitemap
- Help translate this module.
http://localize.drupal.org/translate/projects/xmlsitemap
- Write a review for this module at drupalmodules.com.
http://drupalmodules.com/module/xml-sitemap
- Help keep development active by dontating to the developer.
http://davereid.chipin.com/
<?php
// $Id$
/**
* @addtogroup hooks
* @{
*/
/**
* Define additional links to add to the site map.
*
* This hook allows modules to add additional links to the site map. Links
* may be associated with nodes, terms, or users, as shown in the example.
* @param $type:
* If set, a string specifying the type of additional links to return. You
* can use your own type or a type from one of the included modules:
* - node:
* Links associated with nodes
* - term:
* Links associated with terms
* - user:
* Links associated with users
* - xml:
* An XML site map (for including site maps from other modules)
* You can define additional types by adding them to the switch statement.
* @param $excludes:
* Depends on the type of links being requested.
* - For "node", an array of excluded node types
* - For "term", an array of excluded vocabularies
* - For "user", an array of included roles
* @return
* If $type is xml, return an XML site map. Otherwise, return an array of
* links or an empty array. Each link should be an array with the
* following keys:
* - nid, tid, uid, or custom ID type:
* ID to associate with this link (If you have defined your own link type,
* use the ID key to group related links together.)
* - #loc:
* The URL of the page
* - #lastmod:
* Timestamp of last modification
* - #changefreq:
* Number of seconds between changes
* - #priority:
* A number between 0 and 1 indicating the link's priority
*/
function hook_xmlsitemap_links($type = NULL, $excludes = array()) {
$links = array();
switch ($type) {
case 'node':
break;
case 'term':
break;
case 'user':
// Load profiles.
$result = db_query("
SELECT u.uid, xu.last_changed, xu.previously_changed, xu.priority_override, SUM(xur.priority), ua.dst AS alias
FROM {users} u
LEFT JOIN {users_roles} ur ON ur.uid = u.uid
LEFT JOIN {xmlsitemap_user_role} xur ON xur.rid = ur.rid
LEFT JOIN {xmlsitemap_user} xu ON xu.uid = u.uid
LEFT JOIN {url_alias} ua ON ua.pid = xu.pid
WHERE (xu.priority_override IS NULL OR xu.priority_override >= 0) AND u.uid <> %d
GROUP BY u.uid, xu.last_changed, xu.previously_changed, xu.priority_override, ua.dst
HAVING MIN(xur.priority) <> -1
", _xmlsitemap_user_frontpage());
// Create link array for each profile.
while ($user = db_fetch_object($result)) {
$age = time() - $user->last_changed;
$interval = empty($user->previously_changed) ? 0 : $user->last_changed - $user->previously_changed;
$links[] = array(
'uid' => $user->uid,
'#loc' => xmlsitemap_url("user/$user->uid", $user->alias, NULL, NULL, TRUE),
'#lastmod' => $user->last_changed,
'#changefreq' => max($age, $interval),
'#priority' => _xmlsitemap_user_priority($user),
);
}
// Add other user links to the links array.
$links = array_merge($links, module_invoke_all('xmlsitemap_links', 'user'));
// Sort links by user ID and URL.
foreach ($links as $key => $link) {
$uid[$key] = $link['uid'];
$loc[$key] = $link['#loc'];
}
array_multisort($uid, $loc, $links);
break;
case 'xml':
// Retrieve an XML site map.
$links = example_sitemap();
break;
default:
// Add arbitrary additional links.
$result = db_query("
SELECT xa.*, ua.dst AS alias FROM {xmlsitemap_additional} xa
LEFT JOIN {url_alias} ua ON xa.pid = ua.pid
");
while ($link = db_fetch_object($result)) {
$age = time() - $link->last_changed;
if (!empty($link->previously_changed)) {
$interval = $link->last_changed - $link->previously_changed;
}
else {
$interval = 0;
}
$entry = array(
'#loc' => xmlsitemap_url($link->path, $link->alias, NULL, NULL, TRUE),
'#lastmod' => $link->last_changed,
'#changefreq' => max($age, $interval),
'#priority' => $link->priority,
);
$additional[] = $entry;
}
break;
}
return $links;
}
/**
* Define actions for search engines.
* @param $op:
* - form:
* Add search engine to form at admin/settings/xmlsitemap.
* - ping:
* Submit site map to search engine.
* - access:
* Log search engine access.
* @param $type:
* If $op is 'access', one of the following strings will indicate what was
* downloaded:
* - Site map:
* The site map was downloaded.
* - Site map index
* The site map index was downloaded.
* - Site map $chunk
* Chunk $chunk was downloaded.
* @return
* - form:
* Array of form elements for search engine settings
* - ping:
* None
* - access:
* Message string for access log
*/
function hook_xmlsitemap_engines($op, $type = NULL) {
switch ($op) {
case 'form':
$form['google'] = array(
'#type' => 'fieldset',
'#title' => t('Google'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['google']['xmlsitemap_engines_google_submit'] = array(
'#type' => 'checkbox',
'#title' => t('Submit site map to Google.'),
'#default_value' => variable_get('xmlsitemap_engines_google_submit', TRUE),
);
$form['google']['xmlsitemap_engines_google_url'] = array(
'#type' => 'textfield',
'#title' => t('Submission URL'),
'#default_value' => variable_get('xmlsitemap_engines_google_url', 'http://www.google.com/webmasters/tools/ping?sitemap='. xmlsitemap_url('sitemap.xml', drupal_lookup_path('alias', 'sitemap.xml') ? drupal_lookup_path('alias', 'sitemap.xml') : NULL, NULL, NULL, TRUE)),
'#description' => t('The URL to submit the site map to.'),
);
$form['google']['xmlsitemap_engines_google_verify'] = array(
'#type' => 'textfield',
'#title' => t('Verification link'),
'#default_value' => variable_get('xmlsitemap_engines_google_verify', ''),
'#description' => t('In order to show statistics, Google will ask you to verify that you control this site by creating a file with a certain name. Enter that name here and the XML Sitemap module will create a path to that file name. This will only work if you have clean URLs enabled.'),
);
return $form;
case 'ping':
if (variable_get('xmlsitemap_engines_google_submit', TRUE)) {
$result = drupal_http_request(variable_get('xmlsitemap_engines_google_url', 'http://www.google.com/webmasters/tools/ping?sitemap='. xmlsitemap_url('sitemap.xml', drupal_lookup_path('alias', 'sitemap.xml') ? drupal_lookup_path('alias', 'sitemap.xml') : NULL, NULL, NULL, TRUE)));
if ($result->code == 200) {
watchdog('xmlsitemap', 'Sitemap successfully submitted to Google.');
}
else {
watchdog('xmlsitemap', 'Error occurred submitting sitemap to Google: @code', array('@code' => $result->code), WATCHDOG_ERROR);
}
}
break;
case 'access':
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot') !== FALSE) {
return t('!sitemap downloaded by Google.', array('!sitemap' => $type));
}
break;
}
}
/**
* @} End of "addtogroup hooks".
*/
# Danish translation of Drupal (gsitemap.module)
# Copyright 2006 Morten Wulff <wulff@tem.dtu.dk>
msgid ""
msgstr ""
"Project-Id-Version: Danish translation of Drupal (gsitemap.module) $Id$\n"
"POT-Creation-Date: 2006-04-07 15:29+0200\n"
"PO-Revision-Date: 2006-04-07 15:58+0100\n"
"Last-Translator: Morten Wulff <wulff@psyke.org>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Danish\n"
"X-Poedit-Country: DENMARK\n"
#: gsitemap.module:15
msgid "Creates a Google Sitemap at q=gsitemap"
msgstr "Opretter et Google Sitemap på q=gsitemap"
#: gsitemap.module:17
msgid "The following options allow you to alter the behavior of the Google Sitemap module."
msgstr "De følgende indstillinger lader dig ændre hvordan Google Sitemap-modulet opfører sig."
#: gsitemap.module:37;402;405;443;446;0
msgid "gsitemap"
msgstr "gsitemap"
#: gsitemap.module:43
msgid "gsitemap verification page"
msgstr "Efterprøv gsitemap"
#: gsitemap.module:59
msgid "gsitemap Settings"
msgstr "Indstillinger for gsitemap"
#: gsitemap.module:65
msgid "Priority override"
msgstr "Tilsidesæt prioritet"
#: gsitemap.module:69
msgid "Optionally specify a value for the priority in the Google Sitemap, or -1 to prevent it from appearing in the sitemap."
msgstr "Angiv en værdi for prioriteten i Google Sitemap (valgfrit) eller -1 for at forhindre at indholdet optræder på sidekortet."
#: gsitemap.module:132
msgid "Priority must be a number between 0.0 and 1.0, inclusive, or -1 to prevent this node from appearing in the sitemap."
msgstr "Prioriteten skal være et tal mellem 0.0 og 1.0, inklusive, eller -1 for at forhindre at dette indhold optræder på sidekortet."
#: gsitemap.module:187
msgid "Priority Settings"
msgstr "Prioritetsindstillinger"
#: gsitemap.module:192
msgid "Front page priority"
msgstr "Forsideprioritet"
#: gsitemap.module:196
msgid "This is the absolute priority for the front page. Values can range between 0.0 and 1.0."
msgstr "Forsidens absolutte prioritet. Værdier kan være mellem 0.0 og 1.0."
#: gsitemap.module:200
msgid "Promotion adjustment"
msgstr "Juster forfremmelse"
#: gsitemap.module:204
msgid "This number will be added to the priority of each node that is promoted to the front page."
msgstr "Tallet lægges til prioriteten for hvert indholdselement, der forfremmes til forsiden."
#: gsitemap.module:208
msgid "Comment ratio weight"
msgstr "Vægt af kommentarforhold"
#: gsitemap.module:212
msgid "This number will be multiplied with the ratio of the number of comments on the node over the number of comments on the node with the most comments, i.e., this number will be added to the priority of the node with the most comments."
msgstr "Dette tal ganges med forholdet mellem antallet af kommentarer til det aktuelle indholdselement og antallet af kommentarer til indholdselementet med flest kommentarer, dvs. dette tal lægges til prioriteten af indholdselementet med flest kommentarer."
#: gsitemap.module:218
msgid "You can enter -1 in any of the following fields to prevent nodes of that type from appearing in the sitemap."
msgstr "Du kan indtaste -1 i hvert af de følgende felter for at forhindre at indhold af den angivne type optræder i sidekortet."
#: gsitemap.module:224
msgid "%name adjustment"
msgstr "%name justering"
#: gsitemap.module:228
msgid "This number will be added to the priority of nodes of type %name."
msgstr "Dette tal lægges til prioriteten af alle indholdselementer af typen %name."
#: gsitemap.module:234
msgid "Other Settings"
msgstr "Andre indstillinger"
#: gsitemap.module:240
msgid "Verification link"
msgstr "Henvisning til efterprøvning"
#: gsitemap.module:243
msgid "In order to view stats, Google will ask you to verify that you control this site by creating a page with a certain name. Enter that name here and the gsitemap module will hook that filename. Note that this will only work if you have clean URLs enabled."
msgstr "For at kunne vise statisikker vil Google bede dig om at bevise, at du kontrollerer dette netsted ved at oprette en side med et særligt navn. Indtast navnet her og gsitemap-modulet vil håndtere det. Bemærk at dette kun virker hvis du har aktiveret rene URLer."
#: gsitemap.module:247
msgid "Count comments in change date and frequency"
msgstr "Medtag kommentarer i opdateringsdato og frekvens"
#: gsitemap.module:250
msgid "If enabled, the frequency of comments on a node will affect its change frequency and last modification date."
msgstr "Frekvensen af kommentarer til et indholdslement vil påvirke dets opdateringsfrekvens og ændringsdato."
#: gsitemap.module:254
msgid "Include links to taxonomy term pages"
msgstr "Medtag henvisninger til taksonomiord"
#: gsitemap.module:257
msgid "If enabled, links to taxonomy term pages will be included in the sitemap."
msgstr "Henvisninger til taksonomiord medtages i sidekortet."
#: gsitemap.module:261
msgid "Submit sitemap to Google when updated"
msgstr "Indsend sidekort til Google ved opdatering"
#: gsitemap.module:264
msgid "If enabled, the sitemap will be submitted to Google via HTTP request each time it is updated. If you have submitted your sitemap using a Google Account, this is probably unnecessary."
msgstr "Sidekortet indsendes til Google via en HTTP-forespørgsel hver gang det opdateres. Hvis du har indsendt sidekortet vha. en Google-konto er dette sikkert unødvendigt."
#: gsitemap.module:268
msgid "Submit sitemap to Google on cron run"
msgstr "Indsend sidekort til Google når cron køres."
#: gsitemap.module:271
msgid "If enabled, the sitemap will be submitted to Google via HTTP request each time the cron job is run. If you have submitted your sitemap using a Google Account, this is probably unnecessary."
msgstr "Sidekortet indsendes til Google via en HTTP-forespørgsel næste gang der køres en cron-opgave. Hvis du har indsendt sidekortet vha. en Google-konto er dette sikkert unødvendigt."
#: gsitemap.module:275
msgid "Log accesses"
msgstr "Registrer tilgang"
#: gsitemap.module:278
msgid "If enabled, an watchdog entry will be made each time the sitemap is accessed, containing information about the requestor."
msgstr "Aktiver dette for at oprette en linje i hændelsesloggen med information om spørgeren hver gang sidekortet tilgås."
#: gsitemap.module:25
msgid "override node priority"
msgstr "tilsidesæt indholdsprioritet"
# $Id$
#
# LANGUAGE translation of Drupal (gsitemap.module)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# gsitemap.module,v 1.56.2.7 2007/03/18 21:55:39 darrenoh
# gsitemap.info,v 1.3.2.3 2007/02/13 15:57:06 darrenoh
#
msgid ""
msgstr ""
"Project-Id-Version: Deutsche Übersetzung von Google Sitemap für Drupal\n"
"POT-Creation-Date: 2007-03-18 17:59-0400\n"
"PO-Revision-Date: 2007-12-14 08:49+0100\n"
"Last-Translator: Alexander Hass\n"
"Language-Team: Alexander Hass\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: German\n"
"X-Poedit-Country: GERMANY\n"
"X-Poedit-SourceCharset: utf-8\n"
#: xmlsitemap.module:15
msgid "Configure the site map. Your site map is at !url."
msgstr "Die Sitemap konfigurieren. Die Sitemap befindet sich unter !url."
#: xmlsitemap.module:17
msgid "Configure behavior for search engines."
msgstr "Das Verhalten für Suchmaschinen konfigurieren."
#: xmlsitemap.module:19
msgid "Set up additional links for your site map."
msgstr "Zusätzliche Verweise angeben, die zur Sitemap hinzugefügt werden."
#: xmlsitemap.module:33
#: xmlsitemap.info:0;0
#: xmlsitemap_engines/xmlsitemap_engines.info:0
#: xmlsitemap_node/xmlsitemap_node.info:0
#: xmlsitemap_term/xmlsitemap_term.info:0
#: xmlsitemap_user/xmlsitemap_user.info:0
msgid "XML Sitemap"
msgstr "XML-Sitemap"
#: xmlsitemap.module:34;42
msgid "Configure site map."
msgstr "Sitemap konfigurieren."
#: xmlsitemap.module:41;342
#: xmlsitemap_node/xmlsitemap_node.module:198
#: xmlsitemap_user/xmlsitemap_user.module:99
msgid "Site map"
msgstr "Sitemap"
#: xmlsitemap.module:48
msgid "Search engines"
msgstr "Suchmaschinen"
#: xmlsitemap.module:49
msgid "Configure search engines."
msgstr "Suchmaschinen konfigurieren."
#: xmlsitemap.module:56
msgid "Additional"
msgstr "Zusätzlich"
#: xmlsitemap.module:57
msgid "Configure additional links."
msgstr "Zusätzliche Verweise konfigurieren."
#: xmlsitemap.module:65;342
msgid "Site map index"
msgstr "Sitemap Index"
#: xmlsitemap.module:76
msgid "Site map !number"
msgstr "Sitemap !number"
#: xmlsitemap.module:93
msgid "Chunk size"
msgstr "Paketgröße"
#: xmlsitemap.module:97
msgid "This is the number of links to include in one site map. Values can range between 1 and 50,000. If the total number of links exceeds the chunk size, multiple site maps will be generated."
msgstr "Dies ist Anzahl der Verweise innerhalb einer Sitemap. Die Werte können im Bereich von 1 bis 50.000 liegen. Sollte die Gesamtanzahl von Verweisen die Paketgröße überschreiten, werden mehrere Sitemaps generiert."
#: xmlsitemap.module:102
msgid "Front page priority"
msgstr "Priorität der Startseite"
#: xmlsitemap.module:105
msgid "This is the absolute priority for the front page."
msgstr "Dieses ist die absolute Priorität für die Startseite."
#: xmlsitemap.module:116
msgid "Cannot send more than 50,000 links at one time."
msgstr "Mehr wie 50.000 Links können nicht auf einmal übertragen werden."
#: xmlsitemap.module:134
msgid "Submission settings"
msgstr "Einstellungen zur Übermittlung"
#: xmlsitemap.module:138
msgid "Submit site map when updated."
msgstr "Übermittlung der Sitemap nach einer Aktualisierung."
#: xmlsitemap.module:140
msgid "If enabled, search engines will be notified of changes to the site map each time it is updated."
msgstr "Sobald aktiviert, werden die Suchmaschinen bei jeder Aktualisierung über Änderungen an der Sitemap benachrichtigt."
#: xmlsitemap.module:144
msgid "Submit site map on cron run."
msgstr "Übermittlung der Sitemap durch einen Cron-Lauf."
#: xmlsitemap.module:146
msgid "If enabled, search engines will be notified of changes to the site map each time cron is run."
msgstr "Sobald aktiviert, werden die Suchmaschinen bei jedem Cron-Lauf über Änderungen an der Sitemap benachrichtigt."
#: xmlsitemap.module:150
msgid "Log access."
msgstr "Zugriffe protokollieren."
#: xmlsitemap.module:152
msgid "If enabled, a watchdog entry will be made each time the site map is accessed, containing information about the requestor."
msgstr "Sobald aktiviert, wird bei jedem Zugriff auf die Sitemap ein Eintrag im Wächterprotokoll erzeugt, welcher die Informationen des Anfragers enthält."
#: xmlsitemap.module:176
msgid "Link priority"
msgstr "Priorität der Verweise"
#: xmlsitemap.module:179
msgid "This is the default priority for additional links."
msgstr "Dies ist die Standardpriorität für zusätzliche Verweise."
#: xmlsitemap.module:187
msgid "Enter a Drupal path to add to the site map."
msgstr "Einen Drupal-Pfad eingeben, der zur Sitemap hinzugefügt wird."
#: xmlsitemap.module:218
msgid "Delete"
msgstr "Löschen"
#: xmlsitemap.module:218
msgid "Path"
msgstr "Pfad"
#: xmlsitemap.module:218
msgid "Priority"
msgstr "Priorität"
#: xmlsitemap.module:239
msgid "Save configuration"
msgstr "Konfiguration speichern"
#: xmlsitemap.module:301
msgid "Default"
msgstr "Standard"
#: xmlsitemap.module:310
msgid "Not in site map"