diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 99b2f323a..a021f3b2b 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -1743,7 +1743,7 @@ class e_parse extends e_parser // Convert URL's to clickable links, unless modifiers or prefs override if ($opts['link_click']) { - if ($opts['link_replace'] && ADMIN_AREA !== true) + if ($opts['link_replace'] && defset('ADMIN_AREA') !== true) { $link_text = $pref['link_text']; @@ -3796,8 +3796,8 @@ class e_parser elseif(!empty($parm['legacy'])) // Search legacy path for image in a specific folder. No path, only file name provided. { - $legacyPath = $parm['legacy'].$file; - $filePath = $tp->replaceConstants($legacyPath,'rel'); + $legacyPath = rtrim($parm['legacy'],'/').'/'.$file; + $filePath = $tp->replaceConstants($legacyPath); if(is_readable($filePath)) { diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index c54f8d274..413ccb766 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -4340,7 +4340,7 @@ class e_form $value = ''.$name.''; break; - case 'image': //TODO - thumb, js tooltip... + case 'image': //js tooltip... if($value) { @@ -4396,13 +4396,27 @@ class e_form { $thparms['aw'] = intval($parms['thumb_aw']); } - + + if(!empty($parms['legacyPath'])) + { + $thparms['legacy'] = $parms['legacyPath']; + $parms['pre'] = rtrim($parms['legacyPath'],'/').'/'; + } // return print_a($thparms,true); $src = $tp->replaceConstants(vartrue($parms['pre']).$value, 'abs'); $thsrc = $tp->thumbUrl(vartrue($parms['pre']).$value, $thparms, varset($parms['thumb_urlraw'])); $alt = basename($src); - $ttl = ''.$alt.''; + // $ttl = ''.$alt.''; + + $thparms['alt'] = $alt; + $thparms['class'] = "thumbnail e-thumb"; + + $ttl = $tp->toImage(vartrue($parms['pre']).$value, $thparms); + + e107::getDebug()->log($value); + e107::getDebug()->log($thparms); + $value = ''.$ttl.''; } else @@ -4419,7 +4433,7 @@ class e_form $ret = '
    '; for ($i=0; $i < 5; $i++) { - $k = $key.'['.$i.'][path]'; + //$k = $key.'['.$i.'][path]'; $ival = $value[$i]['path']; $ret .= '
  1. '.$ival.'
  2. '; } diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index 28e8735ea..746270f88 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -138,7 +138,7 @@ class download_cat_ui extends e_admin_ui protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), - 'download_category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'width' => '5%', 'thclass' => 'center','class'=>'center','writeParms'=>'glyphs=1' ), + 'download_category_icon' => array('title'=> LAN_ICON, 'type' => 'method', 'width' => '5%', 'thclass' => 'center','class'=>'center','writeParms'=>'glyphs=1' ), 'download_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE), 'download_category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'), 'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'), @@ -196,6 +196,34 @@ class download_cat_form_ui extends e_admin_form_ui break; } } + + + + + public function download_category_icon($curVal,$mode) + { + + if(!empty($curVal) && strpos($curVal, chr(1))) + { + list($curVal,$tmp) = explode(chr(1),$curVal); + } + + switch($mode) + { + case 'read': + return e107::getParser()->toIcon($curVal, array('legacy'=>'{e_IMAGE}icons/')); + break; + + case 'write': + return $this->iconpicker('download_category_icon', $curVal,null,array('glyphs'=>true, 'legacyPath'=>'{e_IMAGE}icons/')); + break; + + case 'filter': + case 'batch': + return null; + break; + } + } } @@ -250,8 +278,8 @@ class download_main_admin_ui extends e_admin_ui 'download_active' => array('title'=> DOWLAN_21, 'type' => 'method', 'data' => 'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center', 'batch' => TRUE, 'filter'=>TRUE, 'noedit' => true), 'download_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'thclass' => '', 'readParms' => 'long', 'writeParms' => ''), - 'download_thumb' => array('title'=> DOWLAN_20, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>TRUE ), - 'download_image' => array('title'=> DOWLAN_19, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>TRUE, 'batch' => FALSE, 'filter'=>FALSE), + 'download_thumb' => array('title'=> DOWLAN_20, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60&legacyPath={e_FILE}downloadthumbs', 'readonly'=>TRUE ), + 'download_image' => array('title'=> DOWLAN_19, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60&legacyPath={e_FILE}downloadimages', 'readonly'=>TRUE, 'batch' => FALSE, 'filter'=>FALSE), 'download_comment' => array('title'=> DOWLAN_102, 'type' => 'boolean', 'data' => 'int', 'width' => '5%', 'thclass' => 'center', 'batch' => TRUE, 'filter'=>TRUE, 'noedit' => true), 'download_class' => array('title'=> DOWLAN_113, 'type' => 'userclass', 'width' => 'auto', 'inline'=>true, 'data' => 'int','batch' => TRUE, 'filter'=>TRUE), @@ -1387,7 +1415,7 @@ $columnInfo = array( $text .= " "; */ - $text .= $frm->imagepicker('download_image', $download_image,'','download_image'); + $text .= $frm->imagepicker('download_image', $download_image,'',array('mode'=>'download_image', 'legacyPath'=>'{e_FILE}downloadimages')); if ($subAction == "dlm" && $download_image) { @@ -1418,7 +1446,7 @@ $columnInfo = array( $text .= " "; */ - $text .= $frm->imagepicker('download_thumb', $download_thumb,'','download_thumb'); + $text .= $frm->imagepicker('download_thumb', $download_thumb,'',array('mode'=>'download_thumb', 'legacyPath'=>'{e_FILE}downloadthumbs')); $text .= " diff --git a/news.php b/news.php index 03dbb4abb..e52d85fbd 100644 --- a/news.php +++ b/news.php @@ -1124,7 +1124,8 @@ if(is_dir("remotefile")) { } } -if (isset($pref['nfp_display']) && $pref['nfp_display'] == 2) { +if (isset($pref['nfp_display']) && $pref['nfp_display'] == 2 && is_readable(e_PLUGIN."newforumposts_main/newforumposts_main.php")) +{ require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php"); }