I'm working on a new site for a customer and found one thing missing:
{RELATED...} replacement tag but also with custom given keyword. As for now only the keywords of the current articles are used. I extended this - very simple thing. If you want to use also:
{RELATED:INT_COUNT:keyword1, keyword2,...}
INT_COUNT = how many related articles should be listed.
Keywords can be splitted by " " or "," or ";"
In content.func.inc.php change around line 347 to (line 353 is new):
Code: Select all
// related articles based on keywords, inspired by Magnar Stav Johanssen
if( ! ( strpos($content["all"],'{RELATED:')===false ) ) {
if (!$no_content_for_this_page && $content["articles"][$aktion[1]]["article_keyword"]) {
$related_keywords = $content["articles"][$aktion[1]]["article_keyword"];
}
$content["all"] = preg_replace('/\{RELATED:(\d+)\}/e','get_related_articles($related_keywords,$aktion[1],$template_default["related"],"$1",$db);',$content["all"]);
$content["all"] = preg_replace('/\{RELATED:(\d+):(.*?)\}/e','get_related_articles("$2",$aktion[1],$template_default["related"],"$1",$db);',$content["all"]);
}