Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Submit Photo error

Asked Modified Viewed 2,977 times
W
Wing
W
Wing 10
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
asked
Junior Member

When uploading a photo using the Submit Photo link people keep getting errors on my site, the size of the image and height/width is fine, it seemed if the image name was small (about 5 characters) there would be no problems, so I'm assuming there's a characters on photo filenames. How do I increase those? Also is there a way for admins to upload photos without having to approve them? I didn't see anything like that in the admin panel.
I'm using PHPFusion V7
0 replies

7 posts

S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
answered
Junior Member

Quote

Wing wrote:
When uploading a photo using the Submit Photo link people keep getting errors on my site, the size of the image and height/width is fine, it seemed if the image name was small (about 5 characters) there would be no problems, so I'm assuming there's a characters on photo filenames. How do I increase those? Also is there a way for admins to upload photos without having to approve them? I didn't see anything like that in the admin panel.
I'm using PHPFusion V7


I don't know, but I'd really like to know if you can allow the public to upload images without verification. I was wondering about that earlier today.
0 replies
Y
Yxos
Y
Yxos 10
Yxos

The best solution is not necessarily a technical solution !
  • Senior Member, joined since
  • Contributed 277 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

Quote

Wing wrote:
When uploading a photo using the Submit Photo link people keep getting errors on my site, the size of the image and height/width is fine, it seemed if the image name was small (about 5 characters) there would be no problems, so I'm assuming there's a characters on photo filenames. How do I increase those? Also is there a way for admins to upload photos without having to approve them? I didn't see anything like that in the admin panel.
I'm using PHPFusion V7

File names must be without space character and other special characters like %, &, æ, ø, å.

Quote

upload photos without having to approve them

Look again! Admins with rights to access photoalbum in the admin section may upload photos directly to an album without approval.
0 replies
S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
answered
Junior Member

Quote

Yxos wrote:

Quote

Wing wrote:
When uploading a photo using the Submit Photo link people keep getting errors on my site, the size of the image and height/width is fine, it seemed if the image name was small (about 5 characters) there would be no problems, so I'm assuming there's a characters on photo filenames. How do I increase those? Also is there a way for admins to upload photos without having to approve them? I didn't see anything like that in the admin panel.
I'm using PHPFusion V7

File names must be without space character and other special characters like %, &, æ, ø, å.

Quote

upload photos without having to approve them

Look again! Admins with rights to access photoalbum in the admin section may upload photos directly to an album without approval.


I want to change my gallery to a straight up image uploader (remove the verification; I want it to be like imageshack, photobucket etc). Is there any way to do this? (Without ripping everything apart :p).
0 replies
Y
Yxos
Y
Yxos 10
Yxos

The best solution is not necessarily a technical solution !
  • Senior Member, joined since
  • Contributed 277 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

Of course there is a way. :) Find the right place in the php-files you want to work differently.

However, php-Fusion is a CMS. If you want it to be like Imageschack; Messenger; whatever, use Imageschack; Messenger etc... :)

Easy to say, but your request seems to be far from what PHPFusion was designed for.
Its also a matter of security. If you let you CMS wide open, there will be a greater risk of having unwanted intruders.

0 replies
S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
answered
Junior Member

Quote

Yxos wrote:
Of course there is a way. :) Find the right place in the php-files you want to work differently.

However, php-Fusion is a CMS. If you want it to be like Imageschack; Messenger; whatever, use Imageschack; Messenger etc... :)

Easy to say, but your request seems to be far from what PHPFusion was designed for.
Its also a matter of security. If you let you CMS wide open, there will be a greater risk of having unwanted intruders.



Right. All I should need to do is go into the admin users section where the verification thing is, then take the code from there and work it into submit.php where type=p, like into the bottom so it automatically does the verification. I was just hoping there'd be an easier way :p. And it's not that I want it to be like imageshack in the sense that it's just made to upload photos, if that were the case I'd have found/coded my own image portal. I just want it to be wide open for the people that do join. As long as the uploader is secure (which I've checked and modified) all I'm worried about is nasty/unwanted images.
0 replies
W
Wing
W
Wing 10
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

Yxos wrote:

Quote

Wing wrote:
When uploading a photo using the Submit Photo link people keep getting errors on my site, the size of the image and height/width is fine, it seemed if the image name was small (about 5 characters) there would be no problems, so I'm assuming there's a characters on photo filenames. How do I increase those? Also is there a way for admins to upload photos without having to approve them? I didn't see anything like that in the admin panel.
I'm using PHPFusion V7

File names must be without space character and other special characters like %, &, æ, ø, å.

Quote

upload photos without having to approve them

Look again! Admins with rights to access photoalbum in the admin section may upload photos directly to an album without approval.

>.< How didn't I see that :| Thanks for that :)
0 replies
S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
answered
Junior Member


} elseif ($_GET['stype'] == "p") {
   if (isset($_POST['submit_photo'])) {
    define("SAFEMODE", @ini_get("safe_mode") ? true : false);
      require_once INCLUDES."photo_functions_include.php";
      $error = "";
      $submit_info['photo_title'] = stripinput($_POST['photo_title']);
      $submit_info['photo_description'] = stripinput($_POST['photo_description']);
      $submit_info['album_id'] = isnum($_POST['album_id']) ? $_POST['album_id'] : "0";
      if (is_uploaded_file($_FILES['photo_pic_file']['tmp_name'])) {
         $photo_types = array(".gif",".jpg",".jpeg",".png");
         $photo_pic = $_FILES['photo_pic_file'];
         $photo_name = strtolower(substr($photo_pic['name'], 0, strrpos($photo_pic['name'], ".")));
         $photo_ext = strtolower(strrchr($photo_pic['name'],"."));
         $photo_dest = PHOTOS.(!SAFEMODE ? "album_".$submit_info['album_id']."/" : "");
         if (!preg_match("/^[-0-9A-Z_\[\]]+$/i", $photo_name)) {
            $error = 1;
         } elseif ($photo_pic['size'] > $settings['photo_max_b']){
            $error = 2;
         } elseif (!in_array($photo_ext, $photo_types)) {
            $error = 3;
         } else {
            $photo_file = image_exists($photo_dest, $photo_name.$photo_ext);
            move_uploaded_file($photo_pic['tmp_name'], $photo_dest.$photo_file);
            $imagefile = @getimagesize($photo_dest.$photo_file);
            if (!verify_image($photo_dest.$photo_file)) {
               $error = 3;
               unlink($photo_dest.$photo_file);
            } elseif ($imagefile[0] > $settings['photo_max_w'] || $imagefile[1] > $settings['photo_max_h']) {
               $error = 4;
               unlink($photo_dest.$photo_file);
            } else {
               $submit_info['photo_file'] = $photo_file;
            }
         }
      }
      add_to_title($locale['global_200'].$locale['570']);
      opentable($locale['570']);
      if (!$error)
      {
         $photo_thumb1 = image_exists($photo_dest, $photo_name."_t1".$photo_ext);
         createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb1, $settings['thumb_w'], $settings['thumb_h']);
         if ($imagefile[0] > $settings['photo_w'] || $imagefile[1] > $settings['photo_h']) {
            $photo_thumb2 = image_exists($photo_dest, $photo_name."_t2".$photo_ext);
            createthumbnail($imagefile[2], $photo_dest.$photo_file, $photo_dest.$photo_thumb2, $settings['photo_w'], $settings['photo_h']);
         }
         $photo_order = dbresult(dbquery("SELECT MAX(photo_order) FROM ".DB_PHOTOS." WHERE album_id='{$submit_info['album_id']}'"), 0) + 1;
         $result = dbquery("INSERT INTO ".DB_PHOTOS." (album_id, photo_title, photo_description, photo_filename, photo_thumb1, photo_thumb2, photo_datestamp, photo_user, photo_views, photo_order, photo_allow_comments, photo_allow_ratings) VALUES ('{$submit_info['album_id']}', '{$submit_info['photo_title']}', '{$submit_info['photo_description']}', '{$submit_info['photo_file']}', '$photo_thumb1', '$photo_thumb2', '".time()."', '{$userdata['user_id']}', '0', '$photo_order', '1', '1')");
         echo "<div style='text-align:center'><br />\n".$locale['580']."<br /><br />\n";
         echo "<a href='submit.php?stype=p'>".$locale['581']."</a><br /><br />\n";
         echo "<a href='index.php'>".$locale['412']."</a><br /><br />\n</div>\n";
      }
      else
      {
         echo "<div style='text-align:center'><br />\n".$locale['600']."<br /><br />\n";
         if ($error == 1) { echo $locale['601']; }
         elseif ($error == 2) { echo sprintf($locale['602'], $settings['photo_max_b']); }
         elseif ($error == 3) { echo $locale['603']; }
         elseif ($error == 4) { echo sprintf($locale['604'], $settings['photo_max_w'], $settings['photo_max_h']); }
         echo "<br /><br />\n<a href='submit.php?stype=p'>".$locale['581']."</a><br /><br />\n</div>\n";
      }
      closetable();
   } else {
      $opts = "";
      add_to_title($locale['global_200'].$locale['570']);
      opentable($locale['570']);
      $result = dbquery("SELECT * FROM ".DB_PHOTO_ALBUMS." WHERE ".groupaccess("album_access")." ORDER BY album_title");
      if (dbrows($result)) {
         while ($data = dbarray($result)) $opts .= "<option value='".$data['album_id']."'>".$data['album_title']."</option>\n";
         echo $locale['620']."<br /><br />\n";
         echo "<form name='submit_form' method='post' action='".FUSION_SELF."?stype=p' enctype='multipart/form-data' onsubmit='return validatePhoto(this);'>\n";
         echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
         echo "<td class='tbl'>".$locale['621']."</td>\n";
         echo "<td class='tbl'><input type='text' name='photo_title' maxlength='100' class='textbox' style='width:250px;' /></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td valign='top' class='tbl'>".$locale['622']."</td>\n";
         echo "<td class='tbl'><textarea name='photo_description' cols='60' rows='5' class='textbox' style='width:300px;'></textarea></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td valign='top' class='tbl'>".$locale['623']."</td>\n";
         echo "<td class='tbl'><input type='file' name='photo_pic_file' class='textbox' style='width:250px;' /><br />\n";
         echo "<span class='small2'>".sprintf($locale['624'], parsebytesize($settings['photo_max_b']), $settings['photo_max_w'], $settings['photo_max_h'])."</span></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td class='tbl'>".$locale['625']."</td>\n";
         echo "<td class='tbl'><select name='album_id' class='textbox'>\n$opts</select></td>\n";
         echo "</tr>\n<tr>\n";
         echo "<td align='center' colspan='2' class='tbl'><br />\n";
         echo "<input type='submit' name='submit_photo' value='".$locale['626']."' class='button' />\n</td>\n";
         echo "</tr>\n</table>\n</form>\n";
      } else {
         echo "<div style='text-align:center'><br />\n".$locale['551']."<br /><br />\n</div>\n";
      }
      closetable();
   }
}


Add that code to your submit.php under the type=p portion to mod it in a way that allows users to directly upload photos directly to albums and bypass that stupid approval crap :).
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

Y
Y
Yxos 10
Yxos

The best solution is not necessarily a technical solution !
  • Senior Member, joined since
  • Contributed 277 posts on the community forums.
  • Started 28 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
W
W
Wing 10
  • Junior Member, joined since
  • Contributed 21 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet