1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Media-Manager fixes.

This commit is contained in:
Cameron
2013-03-09 20:30:37 -08:00
parent ac0ce7e98c
commit d612bb88df
4 changed files with 22 additions and 7 deletions

View File

@@ -354,7 +354,7 @@ class page_admin_ui extends e_admin_ui
'menu_text' => array('title'=> "Menu Body", 'nolist'=>true, 'tab' => 2, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page' ),
'menu_template' => array('title'=> "Menu Template", 'nolist'=>true, 'tab' => 2, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
'menu_image' => array('title' =>"Menu Image", 'nolist'=>true, 'tab' => 2, 'type' => 'image', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>false),
'menu_image' => array('title' =>"Menu Image", 'nolist'=>true, 'tab' => 2, 'type' => 'image', 'width' => '110px', 'thclass' => 'center', 'class' => "center", 'nosort' => false, 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','writeParms'=>'media=page', 'readonly'=>false),
@@ -388,7 +388,7 @@ class page_admin_ui extends e_admin_ui
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'page_id' => array('title'=> 'ID', 'type'=>'text', 'tab' => 0, 'width'=>'5%', 'readParms'=>'','forced'=> TRUE),
'menu_image' => array('title' =>"Menu Image", 'type' => 'image', 'width' => '110px', 'thclass' => 'left', 'class' => "left", 'nosort' => false, 'readParms'=>'thumb=80&thumb_urlraw=0&thumb_aw=80','readonly'=>false),
'menu_image' => array('title' =>"Menu Image", 'type' => 'image', 'width' => '110px', 'thclass' => 'left', 'class' => "left", 'nosort' => false, 'readParms'=>'thumb=80&thumb_urlraw=0&thumb_aw=80', 'readonly'=>false),
'menu_name' => array('title'=> "Menu Name", 'type' => 'text', 'inline'=>true, 'width' => 'auto','nolist'=>false, "help"=>"Will be listed in the Menu-Manager under this name"),
'menu_template' => array('title'=> "Menu Template", 'type' => 'dropdown', 'width' => 'auto', 'filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),

View File

@@ -467,12 +467,14 @@ class e_form
{
$tp = e107::getParser();
$name_id = $this->name2id($name);
if(is_string($sc_parameters))
{
if(strpos($sc_parameters, '=') === false) $sc_parameters = 'media='.$sc_parameters;
parse_str($sc_parameters, $sc_parameters);
}
$default_thumb = $default;
if($default)
{
@@ -515,14 +517,13 @@ class e_form
$thpath = isset($sc_parameters['nothumb']) || vartrue($hide) ? $default : $tp->thumbUrl($default_thumb, $att, true);
$label = "<img id='{$name_id}_prev' src='{$default_url}' alt='{$default_url}' class='image-selector' style='display:block;border:1px dashed black;' />";
if($cat != 'news' && $cat !='page')
if($cat != 'news' && $cat !='page' && $cat !='')
{
$cat = $cat . "_image";
}
}
$ret .= $this->mediaUrl($cat, $label,$name_id,$sc_parameters);
$ret .= "</div>\n";
$ret .= "<input type='hidden' name='{$name}' id='{$name_id}' value='{$default}' />";

View File

@@ -315,6 +315,11 @@ class e_media
*/
public function countImages($cat,$search=null)
{
return $this->getImages($cat, 0, 'all',$search);
/*
$inc = array();
$searchinc = array();
@@ -345,6 +350,7 @@ class e_media
}
return e107::getDb()->db_Select_gen($query);
*/
}
@@ -387,9 +393,12 @@ class e_media
$ret = array();
// $query = "SELECT * FROM #core_media WHERE media_userclass IN (".USERCLASS_LIST.") AND ( ".implode(" OR ",$inc)." ) " ;
$query = "SELECT * FROM #core_media WHERE `media_category` REGEXP '(^|,)".implode("|",$catArray)."(,|$)' AND `media_userclass` IN (".USERCLASS_LIST.") " ;
$fields = ($amount == 'all') ? "media_id" : "*";
$query = "SELECT ".$fields." FROM #core_media WHERE `media_category` REGEXP '(^|,)".implode("|",$catArray)."(,|$)' AND `media_userclass` IN (".USERCLASS_LIST.") " ;
// $query = "SELECT ".$fields." FROM #core_media WHERE media_userclass IN (".USERCLASS_LIST.") AND ( ".implode(" OR ",$inc)." ) " ;
if($search)
{
@@ -398,6 +407,11 @@ class e_media
$query .= " ORDER BY media_id DESC";
if($amount == 'all')
{
return e107::getDb()->gen($query);
}
if($amount)
{

View File

@@ -23,7 +23,7 @@ global $PLUGINS_DIRECTORY;
$tp = e107::getParser();
$sql = e107::getDb();
if($sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
if(USER_AREA && $sql->db_Select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name"))
{
while($row=$sql->db_Fetch())
{ // Wildcard topic_id's should not be listed