function _archive_url in Archive 6
Same name and namespace in other branches
- 5 archive.module \_archive_url()
- 7.2 archive.module \_archive_url()
- 7 archive.module \_archive_url()
Generate an archive URL based on the $y, $m and $d provided.
Parameters
$type: The node type to use if valid.
$y: The year to use if valid.
$m: The month to use if valid.
$d: The day to use if valid.
Return value
A string with the generated archive URL.
6 calls to _archive_url()
- archive_page in ./
archive.pages.inc - Fetch nodes for the selected date, or current date if none selected.
- theme_archive_block_calendar in ./
archive.module - Returns a single month as a calendar grid.
- theme_archive_navigation_days in ./
archive.pages.inc - Theme the list of days for the archive navigation.
- theme_archive_navigation_months in ./
archive.pages.inc - Theme the list of months for the archive navigation.
- theme_archive_navigation_node_types in ./
archive.pages.inc - Theme the list of node types for the archives.
File
- ./
archive.module, line 296
Code
function _archive_url($type, $y = 0, $m = 0, $d = 0) {
$url = 'archive';
if (_archive_validate_type($type)) {
$url .= '/' . $type;
}
else {
$url .= '/all';
}
if (_archive_validate_date($y, $m, $d)) {
$url .= '/' . $y . '/' . $m . '/' . $d;
}
else {
if (_archive_validate_date($y, $m)) {
$url .= '/' . $y . '/' . $m;
}
else {
if (_archive_validate_date($y)) {
$url .= '/' . $y;
}
}
}
return $url;
}