oh dear... sorry, but I have to bump this thread again, SORRY!!! I have e107 v0.7.15, and none of the posted solutions work... here's a link to one of my topics: [-link-] I have installed mrj's file, but it doesn't seem to work... Does anyone have an idea? thanks in advance, Dave
global $pref;
if (trim($code_text) == "") return ""; // Do nothing on empty file
if (preg_match("#\.php\?.*#",$code_text)){return "";}
global $IMAGES_DIRECTORY, $FILES_DIRECTORY, $e107;
$search = array('"', '{E_IMAGE}', '{E_FILE}', 'http://e107.org/e107_images/', 'http://e107.org/e107_files/');
$replace = array(''', $e107->base_path.$IMAGES_DIRECTORY, $e107->base_path.$FILES_DIRECTORY, $e107->base_path.$IMAGES_DIRECTORY, $e107->base_path.$FILES_DIRECTORY);
$code_text = str_replace($search, $replace, $code_text);
unset($imgParms);
$imgParms['class']="bbcode";
$imgParms['alt']='';
$code_text = $tp -> toAttribute($code_text);
if($parm)
{
$parm = preg_replace('#one<i></i>rror *=#i','',$parm);
$parm = str_replace("amp;", "&", $parm);
parse_str($parm,$tmp);
foreach($tmp as $p => $v)
{
$imgParms[$p]=$v;
}
}
$parmStr="";
foreach($imgParms as $k => $v)
{
$parmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
}
// Only look for file if not a url - suspected bug in PHP 5.2.5 on XP
if((strpos($code_text,'../') === FALSE) && (strpos($code_text,'://') === FALSE) && file_exists(e_IMAGE."newspost_images/".$code_text))
{
$code_text = e_IMAGE_ABS."newspost_images/".$code_text;
}
if (varsettrue($pref['image_post']) && check_class($pref['image_post_class']))
{
return "<a href=javascript:open_window('".$code_text."',800,850) /><img src='".$code_text."' title='Click image for fullsize pic' BORDER=0 ></a>";
}
switch ($pref['image_post_disabled_method'])
{
case '1' :
return CORE_LAN17;
case '2' :
return '';
}
return CORE_LAN18.$code_text;
This add a link to the image (fullsize)
We now need limit the size of viewed image. Just add this in your themes style.css.
img {
border: 0px; max-width: 400px;
}
Users will now be able to use the bb-button (in eg. forums, submitnews, content, and so on..) without breakage of the layout. As a bonus, visitors are offered fullsize image by clikking the image inserted by bb-code button.
It even works with Photobucket. I c&p the [ img] code they very kindly supplied, and voila!
Thanks to all.
2d, I know marj has resisted putting this in the core but, in the words of Morrissey "Please please please, let me get what I want. Lord knows, it would be the first time".
Thanks again to janvi. As we all know, members don't understand the implications of posting huge pics, and this helps tremendously.
Problem enabling unpload image ?? Excuse my English!
I need help aid had negra trained unpload images to upload to the forum, although I may add that the show unfortunately but not inserted completely nothing?
What should I do to enable? Do you still have to add in plugins? That will work. Thanks for the reply !!
Janvi's code worked...too well. It started shrinking my banners. EDIT: Would it be possible to make a second IMG tag? Like make IMG2 tag with appropriate bbcode, and max-width css. And then add the button, beside the default image button and change text to say "For large images."
Firefox does everything perfectly well. IE8, on the other hand, simply resizes the image but leaves it within the original, full size container, breaking the layout. Given the history of MS/IE, and their willingness to just plough on with things that don't work properly, I probably shouldn't be surprised