1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Issue #4172 Fixed missing category_sef value in admin/news area and news gsitemap url generation.

This commit is contained in:
Cameron
2020-05-21 12:00:54 -07:00
parent a908c9fc8e
commit 57b6546892
2 changed files with 19 additions and 13 deletions

View File

@@ -430,22 +430,21 @@ class news_admin_ui extends e_admin_ui
protected $batchExport = true;
protected $batchCopy = true;
protected $batchLink = true;
protected $listQry = "SELECT n.*,u.user_id,u.user_name FROM `#news` AS n LEFT JOIN `#user` AS u ON n.news_author = u.user_id "; // without any Order or Limit.
protected $listQry = "SELECT n.*, nc.category_name, nc.category_sef, u.user_id,u.user_name FROM `#news` AS n
LEFT JOIN `#news_category` AS nc ON n.news_category = nc.category_id
LEFT JOIN `#user` AS u ON n.news_author = u.user_id "; // without any Order or Limit.
protected $listOrder = "news_id desc";
// true for 'vars' value means use same var
protected $tabs = array(LAN_NEWS_52, 'SEO', LAN_NEWS_53);
protected $url = array(
'route'=>'news/view/item',
'name' => 'news_title',
'description' => 'news_summary',
'vars'=> array('news_id' => true, 'news_sef' => true, 'category_id' => 'news_category', 'category_sef' => true) // FIXME category_sef missing, we have to retrieve category data on the list view
); // 'link' only needed if profile not provided.
'route' => 'news/view/item',
'name' => 'news_title',
'description' => 'news_summary',
'vars'=> array('news_id' => true, 'news_sef' => true, 'category_id' => 'news_category', 'category_sef' => true)
); // 'link' only needed if profile not provided.
protected $fields = array(

View File

@@ -14,9 +14,7 @@ if (!defined('e107_INIT'))
exit;
}
// e107::plugLan('news', true);
// solution from news.php:
e107::includeLan(e_LANGUAGEDIR . e_LANGUAGE . '/lan_news.php'); // Temporary
e107::coreLan('news');
// v2.x Standard
@@ -40,7 +38,16 @@ class news_gsitemap
);
}
$data = $sql->retrieve("news", "*", "news_class IN (" . $userclass_list . ") AND news_start < " . $_t . " ORDER BY news_datestamp ASC", true);
$query = "SELECT n.*, 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_class IN (". $userclass_list.") AND n.news_start < ".$_t." AND (n.news_end=0 || n.news_end>".time().") ORDER BY n.news_datestamp ASC ";
// $data = $sql->retrieve("news", "*", "news_class IN (" . $userclass_list . ") AND news_start < " . $_t . " ORDER BY news_datestamp ASC", true);
$data = $sql->retrieve($query,true);
foreach($data as $row)
{
$import[] = array(