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

Quick media-manager fix.

This commit is contained in:
CaMer0n
2009-12-11 00:36:30 +00:00
parent abc0d5a7c6
commit 32657ae450
3 changed files with 41 additions and 11 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
| $Revision: 1.68 $ | $Revision: 1.69 $
| $Date: 2009-12-10 21:26:53 $ | $Date: 2009-12-11 00:36:24 $
| $Author: e107steved $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -1084,10 +1084,10 @@ function addIndexToTable($target, $indexSpec, $just_check, &$updateMessages, $op
*/ */
function catch_error(&$target) function catch_error(&$target)
{ {
if (vartrue($target->mySQLlastErrText) && E107_DEBUG_LEVEL != 0) if (vartrue($target->getLastErrText()) && E107_DEBUG_LEVEL != 0)
{ {
$tmp2 = debug_backtrace(); $tmp2 = debug_backtrace();
$tmp = $target->mySQLlastErrText; $tmp = $target->getLastErrText();
echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />"; echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />";
} }
return; return;

View File

@@ -9,9 +9,9 @@
* Form Handler * Form Handler
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.94 $ * $Revision: 1.95 $
* $Date: 2009-12-09 18:33:41 $ * $Date: 2009-12-11 00:36:25 $
* $Author: secretr $ * $Author: e107coders $
* *
*/ */
@@ -121,6 +121,23 @@ class e_form
//FIXME - use the media-manager as an image selector. //FIXME - use the media-manager as an image selector.
function imagepicker($name, $default, $label = '', $sc_parameters = '') function imagepicker($name, $default, $label = '', $sc_parameters = '')
{ {
// Temporary Fix for using Media-Manager data
$sql = e107::getDb();
if($sql->db_Select('core_media','*',"media_userclass IN (".USERCLASS_LIST.") ORDER BY media_name"))
{
while($row = $sql->db_Fetch())
{
$opts[$row['media_category']][$row['media_url']] = $row['media_name']. " (".$row['media_dimensions'].") ";
}
asort($opts);
return $this->selectbox($name,$opts,$default, array('default'=>'&nbsp;'));
}
// ----------------
if(is_string($sc_parameters)) parse_str($sc_parameters, $sc_parameters); if(is_string($sc_parameters)) parse_str($sc_parameters, $sc_parameters);
if(!$label) $label = LAN_SELECT; if(!$label) $label = LAN_SELECT;
$parms = "name={$name}"; $parms = "name={$name}";
@@ -419,6 +436,14 @@ class e_form
return "<select name='{$name}'".$this->get_attributes($options, $name).">"; return "<select name='{$name}'".$this->get_attributes($options, $name).">";
} }
/**
*
* @param object $name
* @param object $option_array
* @param object $selected [optional]
* @param object $options [optional]
* @return
*/
function selectbox($name, $option_array, $selected = false, $options = array()) function selectbox($name, $option_array, $selected = false, $options = array())
{ {
if($option_array == 'yesno') if($option_array == 'yesno')

View File

@@ -9,9 +9,9 @@
* Featurebox Item model * Featurebox Item model
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Date: 2009-12-10 22:46:45 $ * $Date: 2009-12-11 00:36:30 $
* $Author: secretr $ * $Author: e107coders $
* *
*/ */
@@ -86,6 +86,11 @@ class plugin_featurebox_item extends e_model
$tp = e107::getParser(); $tp = e107::getParser();
$src = $tp->replaceConstants($this->get('fb_image'), 'full'); $src = $tp->replaceConstants($this->get('fb_image'), 'full');
//FIXME - doesn't display anything that uses {e_MEDIA} in the path.
if(isset($parm['src'])) if(isset($parm['src']))
{ {
return $src; return $src;