Hi!
Sadly I think this is due to your change of permalinks; if you had kept the %id% variable in your URL, the plugin could detect which category a single entry is in.
However, I believe we can fix this easily.
Edit your include/functions_permalinks.inc.php file. Search for this function:
Code: Select all
function serendipity_searchPermalink($struct, $url, $default, $type = 'entry') {
global $serendipity;
if (stristr($struct, '%id%') === FALSE) {
$url = preg_replace('@^(' . preg_quote($serendipity['serendipityHTTPPath'], '@') . '(' . preg_quote($serendipity['indexFile'], '@') . ')?\??(url=)?/?)([^&?]+).*@', '\4', $url);
// If no entryid is submitted, we rely on a new DB call to fetch the permalink.
$pq = "SELECT entry_id, data
FROM {$serendipity['dbPrefix']}permalinks
WHERE permalink = '" . serendipity_db_escape_string($url) . "'
AND type = '" . serendipity_db_escape_string($type) . "'
AND entry_id > 0
LIMIT 1";
$permalink = serendipity_db_query($pq, true, 'both', false, false, false, true);
if (is_array($permalink)) {
return $permalink['entry_id'];
}
}
return $default;
}
change this into:
Code: Select all
function serendipity_searchPermalink($struct, $url, $default, $type = 'entry') {
global $serendipity;
if (stristr($struct, '%id%') === FALSE) {
$url = preg_replace('@^(' . preg_quote($serendipity['serendipityHTTPPath'], '@') . '(' . preg_quote($serendipity['indexFile'], '@') . ')?\??(url=)?/?)([^&?]+).*@', '\4', $url);
// If no entryid is submitted, we rely on a new DB call to fetch the permalink.
$pq = "SELECT entry_id, data
FROM {$serendipity['dbPrefix']}permalinks
WHERE permalink = '" . serendipity_db_escape_string($url) . "'
AND type = '" . serendipity_db_escape_string($type) . "'
AND entry_id > 0
LIMIT 1";
$permalink = serendipity_db_query($pq, true, 'both', false, false, false, true);
if (is_array($permalink)) {
$serendipity['GET']['id'] = $permalink['entry_id'];
return $permalink['entry_id'];
}
}
return $default;
}
Note how I set the $serendipity['GET']['id'] variable there.
Tell me if this works out for you!
Best regards,
Garvin