$entry['link'] = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
$entry['commURL'] = serendipity_archiveURL($entry['id'], $entry['title'], 'baseURL', false, array('timestamp' => $entry['timestamp']));
+ $entry['html_title']= $entry['title'];
$entry['title'] = htmlspecialchars($entry['title']);
$entry['title_rdf'] = preg_replace('@-{2,}@', '-', $entry['title']);
$output[$y]['months'][] = $data;
}
}
-
+
$serendipity['smarty']->assign_by_ref('archives', $output);
$serendipity['smarty']->assign_by_ref('max_entries', $max);
// Remove excess separators
$str = trim($str, $to[0]);
-
+
if (empty($str)) {
if (isset($GLOBALS['i18n_unknown'])) {
$str = $GLOBALS['i18n_unknown'];
if (!isset($serendipity['permalinkStructure'])) {
$serendipity['permalinkStructure'] = 'archives/%id%-%title%.html';
}
-
+
if (!isset($serendipity['permalinkFeedAuthorStructure'])) {
$serendipity['permalinkFeedAuthorStructure'] = 'feeds/authors/%id%-%realname%.rss';
}
-
+
if (!isset($serendipity['permalinkFeedCategoryStructure'])) {
$serendipity['permalinkFeedCategoryStructure'] = 'feeds/categories/%id%-%name%.rss';
}
-
+
if (!isset($serendipity['permalinkCategoryStructure'])) {
$serendipity['permalinkCategoryStructure'] = 'categories/%id%-%name%';
}
-
+
if (!isset($serendipity['permalinkAuthorStructure'])) {
$serendipity['permalinkAuthorStructure'] = 'authors/%id%-%realname%';
}
-
+
if (!isset($serendipity['permalinkArchivesPath'])) {
$serendipity['permalinkArchivesPath'] = 'archives';
}
-
+
if (!isset($serendipity['permalinkArchivePath'])) {
$serendipity['permalinkArchivePath'] = 'archive';
}
-
+
if (!isset($serendipity['permalinkCategoriesPath'])) {
$serendipity['permalinkCategoriesPath'] = 'categories';
}
-
+
if (!isset($serendipity['permalinkAuthorsPath'])) {
$serendipity['permalinkAuthorsPath'] = 'authors';
}
-
+
if (!isset($serendipity['permalinkUnsubscribePath'])) {
$serendipity['permalinkUnsubscribePath'] = 'unsubscribe';
}
-
+
if (!isset($serendipity['permalinkDeletePath'])) {
$serendipity['permalinkDeletePath'] = 'delete';
}
-
+
if (!isset($serendipity['permalinkApprovePath'])) {
$serendipity['permalinkApprovePath'] = 'approve';
}
-
+
if (!isset($serendipity['permalinkFeedsPath'])) {
$serendipity['permalinkFeedsPath'] = 'feeds';
}
-
+
if (!isset($serendipity['permalinkPluginPath'])) {
$serendipity['permalinkPluginPath'] = 'plugin';
}
-
+
if (!isset($serendipity['permalinkAdminPath'])) {
$serendipity['permalinkAdminPath'] = 'admin';
}
-
+
if (!isset($serendipity['permalinkSearchPath'])) {
$serendipity['permalinkSearchPath'] = 'search';
}
-
+
/* URI paths
* These could be defined in the language headers, except that would break
* backwards URL compatibility
@define('PATH_PLUGIN', $serendipity['permalinkPluginPath']);
@define('PATH_ADMIN', $serendipity['permalinkAdminPath']);
@define('PATH_SEARCH', $serendipity['permalinkSearchPath']);
-
+
/* URI patterns
* Note that it's important to use @ as the pattern delimiter. DO NOT use shortcuts
* like \d or \s, since mod_rewrite will use the regexps as well and chokes on them.
*/
function &serendipity_permalinkPatterns($return = false) {
global $serendipity;
-
+
$PAT = array();
$PAT['UNSUBSCRIBE'] = '@/' . $serendipity['permalinkUnsubscribePath'].'/(.*)/([0-9]+)@';
if (is_array($permalink)) {
return $permalink['entry_id'];
}
- }
+ }
return $default;
}
case 'category':
return serendipity_categoryURL($data, '', false);
break;
-
+
case 'author':
return serendipity_authorURL($data, '', false);
break;
}
-
+
return false;
}
case 'entry':
$idfield = 'id';
break;
-
+
case 'author':
$idfield = 'authorid';
break;
-
+
case 'category':
$idfield = 'categoryid';
break;
}
-
+
return(serendipity_db_query(sprintf("INSERT INTO {$serendipity['dbPrefix']}permalinks
(permalink, entry_id, type)
VALUES ('%s', '%s', '%s')",
$data['entry']['timestamp'] = time();
}
}
-
+
$ts = serendipity_serverOffsetHour($data['entry']['timestamp']);
-
+
$replacements =
array(
(int)$data['id'],
);
return str_replace($entryKeys, $replacements, $format);
break;
-
+
case 'author':
$replacements =
array(
);
return str_replace($authorKeys, $replacements, $format);
break;
-
+
case 'category':
$replacements =
array(