mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
New shortcode added on News view page: {NEWS_AUTHOR_REALNAME}
Tagcloud menu can now be sorted via shortcode parms. eg. {MENU: path=tagcloud&order=tag,asc&limit=20} Animate.css library loading example added to bootstrap5/theme.xml
This commit is contained in:
@@ -1167,7 +1167,7 @@ class news_front
|
||||
else
|
||||
{*/
|
||||
$query = "
|
||||
SELECT n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords,
|
||||
SELECT n.*, u.user_id, u.user_name, u.user_customtitle, u.user_image, u.user_login, nc.category_id, nc.category_name, nc.category_sef, nc.category_icon, nc.category_meta_keywords,
|
||||
nc.category_meta_description
|
||||
FROM #news AS n
|
||||
LEFT JOIN #user AS u ON n.news_author = u.user_id
|
||||
|
@@ -18,6 +18,11 @@ if (!e107::isInstalled('tagcloud'))
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @example {MENU: path=tagcloud&order=size,desc}
|
||||
* @example {MENU: path=tagcloud&order=tag,asc&limit=20}
|
||||
*/
|
||||
|
||||
require_once('tagcloud_class.php');
|
||||
|
||||
|
||||
@@ -40,6 +45,11 @@ if(!class_exists('tagcloud_menu'))
|
||||
$cloud = new TagCloud();
|
||||
$sql = e107::getDb();
|
||||
|
||||
if(is_string($parm))
|
||||
{
|
||||
parse_str($parm,$parm);
|
||||
}
|
||||
|
||||
e107::getCache()->setMD5(e_LANGUAGE);
|
||||
|
||||
if ($text = e107::getCache()->retrieve('tagcloud', 5, false))
|
||||
@@ -86,10 +96,25 @@ if(!class_exists('tagcloud_menu'))
|
||||
return $text;
|
||||
});
|
||||
|
||||
$cloud->setOrder('size', 'DESC');
|
||||
|
||||
|
||||
if(!empty($parm['order']))
|
||||
{
|
||||
list($o1,$o2) = explode(',', $parm['order']);
|
||||
$cloud->setOrder($o1, strtoupper($o2));
|
||||
}
|
||||
else
|
||||
{
|
||||
$cloud->setOrder('size', 'DESC');
|
||||
}
|
||||
|
||||
$limit = !empty($parm['tagcloud_limit']) ? intval($parm['tagcloud_limit']) : 50;
|
||||
|
||||
if(!empty($parm['limit']))
|
||||
{
|
||||
$limit = (int) $parm['limit'];
|
||||
}
|
||||
|
||||
$cloud->setLimit($limit);
|
||||
|
||||
$text = $cloud->render();
|
||||
|
Reference in New Issue
Block a user