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
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
Quote
upload photos without having to approve them
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.
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.
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.
} 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();
}
}
Category Forum
User Administration - 8Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions