[svn r20172] FS#3912 - Fixing uploading and showing forum-images.

skala
Ivan Tcholakov 16 years ago
parent 443b1837f2
commit 30504e408e
  1. 2
      main/forum/forumfunction.inc.php
  2. 5
      main/forum/index.php

@ -332,7 +332,7 @@ function show_add_forum_form($inputvalues=array()) {
}
$forum_image=isset($inputvalues['forum_image']) ? $inputvalues['forum_image'] : '';
$form->addElement('file', 'picture', ($forum_image != '' ? get_lang('UpdateImage') : get_lang('AddImage')));
$form->addRule('picture', get_lang('OnlyImagesAllowed'), 'mimetype', array('image/gif', 'image/jpeg', 'image/png'));
$form->addRule('picture', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif'));
$form->addElement('html','</div>');
// The OK button

@ -372,7 +372,12 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo "\t\t<td width=\"50\">";
if(!empty($forum['forum_image'])) {
$image_path = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/upload/forum/images/'.$forum['forum_image'];
/*
$image_size = @getimagesize($image_path);
*/
$image_size = @getimagesize(api_url_to_local_path($image_path));
$img_attributes = '';
if (!empty($image_size)) {
if ($image_size[0] > 100 || $image_size[1] > 100) {

Loading…
Cancel
Save