mirror of
https://github.com/e107inc/e107.git
synced 2025-06-06 19:06:39 +02:00
Closes #4044 - News e_related URL fix. Thanks to @Serios
This commit is contained in:
parent
93918849f4
commit
f5352be768
@ -26,8 +26,14 @@ class news_related // include plugin-folder in the name.
|
||||
|
||||
$tag_regexp = "'(^|,)(".str_replace(",", "|", $tags).")(,|$)'";
|
||||
|
||||
$query = "SELECT * FROM #news WHERE news_id != ".$parm['current']." AND news_class REGEXP '".e_CLASS_REGEXP."' AND news_meta_keywords REGEXP ".$tag_regexp." ORDER BY news_datestamp DESC LIMIT ".$parm['limit'];
|
||||
|
||||
// $query = "SELECT * FROM #news WHERE news_id != ".$parm['current']." AND news_class REGEXP '".e_CLASS_REGEXP."' AND news_meta_keywords REGEXP ".$tag_regexp." ORDER BY news_datestamp DESC LIMIT ".$parm['limit'];
|
||||
|
||||
$query = "SELECT n.*, nc.category_id, nc.category_name, nc.category_sef
|
||||
FROM #news AS n
|
||||
LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
|
||||
WHERE n.news_id != ".$parm['current']." AND n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_meta_keywords REGEXP ".$tag_regexp." ORDER BY n.news_datestamp DESC LIMIT ".$parm['limit'];
|
||||
|
||||
|
||||
if($sql->gen($query))
|
||||
{
|
||||
while($row = $sql->fetch())
|
||||
|
Loading…
x
Reference in New Issue
Block a user