mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Bugtracker #4253 - image resizing in forum upload had stopped working
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
|
||||||
| $Revision: 1.13 $
|
| $Revision: 1.14 $
|
||||||
| $Date: 2007-11-06 20:12:32 $
|
| $Date: 2007-12-18 21:55:35 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -579,7 +579,7 @@ function redirect($url)
|
|||||||
|
|
||||||
function process_upload()
|
function process_upload()
|
||||||
{
|
{
|
||||||
global $pref, $forum_info, $thread_info;
|
global $pref, $forum_info, $thread_info, $admin_log;
|
||||||
|
|
||||||
if(isset($thread_info['head']['thread_id']))
|
if(isset($thread_info['head']['thread_id']))
|
||||||
{
|
{
|
||||||
@@ -608,12 +608,11 @@ function process_upload()
|
|||||||
$orig_file = $upload['name'];
|
$orig_file = $upload['name'];
|
||||||
$p = strrpos($orig_file,'.');
|
$p = strrpos($orig_file,'.');
|
||||||
$new_file = substr($orig_file, 0 , $p)."_".substr($orig_file, $p);
|
$new_file = substr($orig_file, 0 , $p)."_".substr($orig_file, $p);
|
||||||
// $fpath = e_FILE."public/";
|
if(resize_image(e_FILE.'public/'.$orig_file, e_FILE.'public/'.$new_file, $pref['forum_maxwidth']))
|
||||||
if(resize_image($fpath.$orig_file, $fpath.$new_file, $pref['forum_maxwidth']))
|
|
||||||
{
|
{
|
||||||
if($pref['forum_linkimg'])
|
if($pref['forum_linkimg'])
|
||||||
{
|
{
|
||||||
$parms = image_getsize($fpath.$new_file);
|
$parms = image_getsize(e_FILE.'public/'.$new_file);
|
||||||
$_POST['post'] .= "[br][link=".$fpath.$orig_file."][img{$parms}]".$fpath.$new_file."[/img][/link][br]";
|
$_POST['post'] .= "[br][link=".$fpath.$orig_file."][img{$parms}]".$fpath.$new_file."[/img][/link][br]";
|
||||||
//show resized, link to fullsize
|
//show resized, link to fullsize
|
||||||
}
|
}
|
||||||
@@ -621,25 +620,19 @@ function process_upload()
|
|||||||
{
|
{
|
||||||
@unlink($fpath.$orig_file);
|
@unlink($fpath.$orig_file);
|
||||||
//show resized
|
//show resized
|
||||||
$parms = image_getsize($fpath.$new_file);
|
$parms = image_getsize(e_FILE.'public/'.$new_file);
|
||||||
$_POST['post'] .= "[br][img{$parms}]".$fpath.$new_file."[/img][br]";
|
$_POST['post'] .= "[br][img{$parms}]".$fpath.$new_file."[/img][br]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ //resize failed, show original
|
||||||
//resize failed, show original
|
$parms = image_getsize(e_FILE.'public/'.$upload['name']);
|
||||||
// $parms = image_getsize(e_FILE."public/".$upload['name']);
|
|
||||||
// $_POST['post'] .= "[br][img{$parms}]".e_FILE."public/".$upload['name']."[/img]";
|
|
||||||
$parms = image_getsize($fpath.$upload['name']);
|
|
||||||
$_POST['post'] .= "[br][img{$parms}]".$fpath.$upload['name']."[/img]";
|
$_POST['post'] .= "[br][img{$parms}]".$fpath.$upload['name']."[/img]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{ //resizing disabled, show original
|
||||||
// $parms = image_getsize(e_FILE."public/".$upload['name']);
|
$parms = image_getsize(e_FILE.'public/'.$upload['name']);
|
||||||
// //resizing disabled, show original
|
|
||||||
// $_POST['post'] .= "[br]<div class='spacer'>[img{$parms}]".e_FILE."public/".$upload['name']."[/img]</div>\n";
|
|
||||||
$parms = image_getsize($fpath.$upload['name']);
|
|
||||||
//resizing disabled, show original
|
//resizing disabled, show original
|
||||||
$_POST['post'] .= "[br]<div class='spacer'>[img{$parms}]".$fpath.$upload['name']."[/img]</div>\n";
|
$_POST['post'] .= "[br]<div class='spacer'>[img{$parms}]".$fpath.$upload['name']."[/img]</div>\n";
|
||||||
}
|
}
|
||||||
@@ -647,8 +640,6 @@ function process_upload()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//upload was not an image, link to file
|
//upload was not an image, link to file
|
||||||
//echo "<pre>"; print_r($upload); echo "</pre>";
|
|
||||||
// $_POST['post'] .= "[br][file=".e_FILE."public/".$upload['name']."]".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."[/file]";
|
|
||||||
$_POST['post'] .= "[br][file=".$fpath.$upload['name']."]".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."[/file]";
|
$_POST['post'] .= "[br][file=".$fpath.$upload['name']."]".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."[/file]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user