1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01: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:
Cameron 2021-06-12 16:18:51 -07:00
parent f561c5920b
commit aa6e449aee
6 changed files with 47 additions and 7 deletions

View File

@ -492,7 +492,7 @@ class theme_admin_ui extends e_admin_ui
if(empty($_POST) && deftrue('e_DEVELOPER') || deftrue('e_DEBUG')) // check for new theme media and import.
{
$name = e107::getPref('sitetheme');
e107::getMedia()->import('_common_image', e_THEME.$name, '', 'min-size=10000');
e107::getMedia()->import('_common_image', e_THEME.$name, '', array('min-size'=>10000));
e107::getMessage()->addInfo('Developer/Debug Mode: Scanning theme images folder for new media to import.');
}

View File

@ -99,6 +99,12 @@ class news_shortcodes extends e_shortcode
}
function sc_news_author_realname($parm=null)
{
return !empty($this->news_item['user_login']) ? $this->news_item['user_login'] : null;
}
function sc_news_author($parm=null)
{
@ -117,6 +123,8 @@ class news_shortcodes extends e_shortcode
}
function sc_newscomments($parm=null)
{

View File

@ -100,7 +100,7 @@ class e_media
$img_array = $fl->get_files($epath, $fmask,'',2);
if(!count($img_array))
if(empty($img_array))
{
e107::getMessage()->addDebug("Media-Import could not find any files in <b>".$epath."</b> with fmask: ".$fmask);
return $this;
@ -119,11 +119,13 @@ class e_media
if(vartrue($options['min-width']) && ($f['img-width'] < $options['min-width']))
{
$mes->addDebug("Skipped: ".$f['fname']);
continue;
}
if(vartrue($options['min-size']) && ($f['fsize'] < $options['min-size']))
{
$mes->addDebug("Skipped: ".$f['fname']);
continue;
}
@ -145,7 +147,7 @@ class e_media
'media_tags' => '',
'media_type' => $f['mime']
);
if(!$sql->select('core_media','media_url',"media_url = '".$fullpath."' LIMIT 1"))
{
@ -159,11 +161,15 @@ class e_media
$mes->addError("Media not imported: ".$f['fname']);
}
}
else
{
$mes->addDebug("Skipped (already exists): ".$f['fname']);
}
}
// if($count)
if(!empty($count))
{
// $mes->addSuccess("Imported {$count} Media items.");
$mes->addDebug("Imported {$count} Media items.");
}
return $this;

View File

@ -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

View File

@ -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();

View File

@ -16,6 +16,7 @@
<libraries>
<library name="bootstrap" version="5" scope="front"/>
<library name="fontawesome" version="5" scope="front"/>
<library name="animate.css" scope="front" />
</libraries>
<stylesheets>
<css file="style.css" name="Default" />