Pomimo nadania CHMOD 777 na katalog w którym znajdują się zdjęcia po dodaniu przez użytkownika x kolejnego zdjęcia otrzymuje on CHMOD 600 (sam plik z grafiką oczywiście)
Nie wiem co jest grane bo za każdym razem muszę zmieniać ten atrybut ręcznie a to jest wkurzające przy kilkudziesięciu zdjęciach dziennie, pozdrawiam
tutaj kawałek kodu z mojej stronki:
CODE
<?php
if (!empty($_POST['name']) && !empty($_POST['id_category']) && !empty($_POST['id_location']) && !empty($_POST['city']) && !empty($_POST['phone']) && !empty($_POST['zip_code']) && !empty($_POST['description']) && !empty($_POST['street'])) {
$advertisement_id = $advertisement->addAdvertisementData($_POST['name'], $_POST['city'], $_POST['zip_code'], $_POST['street'], $_POST['id_state'], $_POST['phone'], $_POST['www'], $_POST['email']);
foreach($_POST as $tmp_post => $show_post) {
if (strstr($tmp_post, "_option")) {
$option = str_replace('_option', '', $tmp_post);
$advertisement->addOption($advertisement_id, $option);
}
else if (strstr($tmp_post, "_lng")) {
$language = str_replace('_lng', '', $tmp_post);
$advertisement->addLanguage($advertisement_id, $language);
}
}
$user_id = $_SESSION['id'];
if (empty($user_id)) {
$user_id = '1';
}
$advertisement->addAdvertisement($advertisement_id, $user_id);
$advertisement->addAdvertisementInfo("$advertisement_id", "$_POST[id_category]", "$_POST[id_location]", "$_POST[description]", "$_POST[tourist_attractions]", "$_POST[equipment]", "$_POST[start_price]", "$_POST[end_price]", "$_POST[pks]", "$_POST[pkp]", "$_POST[city_km]", "$_POST[airport]", "$_POST[shop]", "$_POST[restaurant]");
$advertisement->addTagsAdvertisement($advertisement_id, $_POST['tags']);
$advertisement->activeAdvertisement($advertisement_id);
$time = $config->showBasicConfig('payment_limit');
if ($_POST['abonament'] == 'n') {
if (!empty($_SESSION['email'])) {
$payments->addPayment($advertisement_id, $_POST['payment_id'], $time, $advertisement_id, $_SESSION['email']);
}
else
$payments->addPayment($advertisement_id, $_POST['payment_id'], $time, $advertisement_id, $_POST['email']);
}
if ($_POST['abonament'] == 'y') {
if (!empty($_SESSION['email'])) {
$payments->addPayment($advertisement_id, $_POST['payment_id'], $time, $advertisement_id, $_SESSION['email']);
}
else
$payments->addPayment($advertisement_id, $_POST['payment_id'], $time, $advertisement_id, $_POST['email']);
$advertisement->addPremiumAdvertisement($advertisement_id);
}
if (!empty($_FILES)) {
$i = 0;
$count = count($_FILES);
foreach ($_FILES as $tmp => $image) {
if ($image['size'] > 0) {
$i++;
$advertisement->addImage($advertisement_id, $i, $image['tmp_name'], '400', '300');
$advertisement->addImage($advertisement_id, $i, $image['tmp_name'], '150', '112', '1');
}
}
}
}
if (empty($advertisement_id)) {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"table_search_3\"><tr><td>Wypełnij Poprawnie formularz.</tr></td></table>";
}
else {
if (!empty($_POST['sms'])) {
$control = md5($advertisement_id);
if (!empty($_SESSION['email'])) {
$payments->acceptPayment($advertisement_id, $_POST['price'], $_SESSION['email'], $control);
}
else
$payments->acceptPayment($advertisement_id, $_POST['price'], $_POST['email'], $control);
}
$payment_check = $config->showBasicConfig('payment');
if ($register == '1' && $payment_check == '1') {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"table_search_3\"><tr><td>Obiekt został dodany do bazy noclegów!</td></tr></table>";
}
if ($register == '1' && $payment_check == '0') {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"table_search_3\"><tr><td>Obiekt został dodany do bazy noclegów!</td></tr></table>";
}
if ($register == '0' && $payment_check == '1') {
$control = $advertisement_id;
$id = $config->showBasicConfig('dotpay_id');
$domain = $config->showBasicConfig('domain');
$check_payment = $payments->checkPaymentAdvertisement($advertisement_id);
if ($check_payment == 1) {
$pay_form = $payments->showPayment($id, $_POST['email'], $domain, $advertisement_id, $control);
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"table_search_3\"><tr><td>Obiekt został dodany do bazy noclegów!</td></tr>";
chmod($image, 0777);
if (empty($_POST['sms'])) {
echo "<tr><td>Opłać Abonament.</td></tr>
<tr><td>$pay_form</td></tr>";
}
echo "</table>";
}
}
if ($register == '0' && $payment_check == '0') {
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"table_search_3\"><tr><td>Obiekt został dodany do bazy noclegów!</td></tr></table>";
}
}
?>