function create_cat_folder($path, $mode) {
if (@is_dir($path)) {
@chmod($path, $mode);
return true;
}
else {
$oldumask = umask(0);
$result = mkdir($path, $mode);
umask($oldumask);
if (!@is_dir($path) || !$result) {
$result = mkdir($path, 0755);
@chmod($path, $mode);
}
return $result;
}
}
function create_cat_folder($path, $mode) {
//initialisation de la connection FTP
$ftp_server='195.90.85.74'; // your FTP IP Serveur
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="camo"; // your login name
$passwd="whyNot"; // your password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_mkdir($conn_id,$path);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
function remove_cat_folder($path) {
$ok = 1;
if (@is_dir($path)) {
$handle = opendir($path);
while ($file = @readdir($handle)) {
if ($file != "." && $file != "..") {
$ok = (!remove_cat_folder($path."/".$file)) ? 0 : $ok;
}
}
closedir($handle);
$ok = (!rmdir($path)) ? 0 : $ok;
}
else {
$ok = (!unlink($path)) ? 0 : $ok;
}
return $ok;
}
function remove_cat_folder($path) {
//initialisation de la connection FTP
$ftp_server='195.90.85.74'; // your FTP IP Serveur
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="camo"; // your login name
$passwd="whyNot"; // your password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_rmdir($conn_id,$path);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
$msg = "";
$clickstream = "";
define('MEDIA_PATH', ROOT_PATH.MEDIA_DIR);
define('THUMB_PATH', ROOT_PATH.THUMB_DIR);
define('MEDIA_TEMP_PATH', ROOT_PATH.MEDIA_TEMP_DIR);
define('THUMB_TEMP_PATH', ROOT_PATH.THUMB_TEMP_DIR);
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
$msg = "";
$clickstream = "";
define('MEDIA_PATH_FTP', "/4images/data/media");
define('THUMB_PATH_FTP', "/4images/data/thumbnails");
define('MEDIA_PATH', ROOT_PATH.MEDIA_DIR);
define('THUMB_PATH', ROOT_PATH.THUMB_DIR);
define('MEDIA_TEMP_PATH', ROOT_PATH.MEDIA_TEMP_DIR);
define('THUMB_TEMP_PATH', ROOT_PATH.THUMB_TEMP_DIR);
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
[color]
and [/color]
removed from codes. original post attached as chmod.txt
Fatal error: Call to undefined function: ftp_connect() in /home/vhosts/a2class.net/httpdocs/products/admin/categories.php on line 75
Probalbly your host doesnt support FTP either... 8O
QuoteFatal error: Call to undefined function: ftp_connect() in /home/vhosts/a2class.net/httpdocs/products/admin/categories.php on line 75
please help me!
I have the same problem and i do have ftp access, what else can i do wrong ?
Mauvaise connexion FTPEssaye de se connecter a 195.90.85.74 for user
well...i think it's work...but a i get this message:
Warning: ftp_connect() [function.ftp-connect]: php_hostconnect: connect failed in /home/kummy72/public_html/iluh/4images/admin/categories.php on line 101
Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/kummy72/public_html/iluh/4images/admin/categories.php on line 106
Mauvaise connexion FTPEssaye de se connecter a 195.90.85.74 for user
my question is, how can i know my FTP IP server?
okay...
then i get another message:
Warning: move_uploaded_file(./../data/media/3/nengah_new_pic.jpg) [function.move-uploaded-file]: failed to create stream: No such file or directory in /home/kummy72/public_html/iluh/4images/includes/upload.php on line 114
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpgoa5X1' to './../data/media/3/nengah_new_pic.jpg' in /home/kummy72/public_html/iluh/4images/includes/upload.php on line 114
Error uploading image file: nengah new pic.jpg
nengah_new_pic.jpg: Copy error. Please check the directory permissions.
No database entry!
Yes, because if your adress ip is not good, the process don't create the directory. And the script continue and say : No such file or directory.
IP : the FTP serveur
Name : your login (very important for chown directory and permission)
camo, when i use FTP to connet to my ftp server, the status will be show like this:
STATUS:> Connecting to ftp.kummy.indietown.com
STATUS:> Connecting to ftp.kummy.indietown.com (ip = 66.246.37.217)
STATUS:> Socket connected. Waiting for welcome message...
is the IP server of my ftp 66.246.37.217 ?? i've put it in $ftp_server=, but the error message still there...i can't upload any pics...
I have it done (with help from another topic in the forum)
just let 4images make the directory (category).
After that remove the directory (it will be a number) created in data/media and data/thumbnails with your ftp client.
make the same directory again with your ftp client, chmod 777, upload your files to data/media/"number" (you can also upload your own thumbs to data/thumbnails"number" , i make them with irfanview).
go to the adminpanel of 4images and check for new images.
Thats all,
Greetings,
Carlo
btw, will i always do these steps everytime i want to upload my photoz? i think everytime i add a category, right?
Quote from: joecks
I have the same problem and i do have ftp access, what else can i do wrong ?
The fact that u have FTP access, doesnt mean, that PHP has ftp access.
When i check my php server info it says,
ftp
FTP support enabled
and still get this error message.
Grtx,
JoecksQuote from: V@noQuote from: joecks
I have the same problem and i do have ftp access, what else can i do wrong ?
The fact that u have FTP access, doesnt mean, that PHP has ftp access.
QuoteFatal error: Call to undefined function: ftp_connect() in /home/vhosts/a2class.net/httpdocs/products/admin/categories.php on line 75
please help me!
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: categories.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
define('IN_CP', 1);
define('ROOT_PATH', './../');
require('admin_global.php');
include(ROOT_PATH.'includes/search_utils.php');
if ($action == "") {
$action = "modifycats";
}
$access_field_array = array(
"auth_viewcat" => AUTH_ALL,
"auth_viewimage" => AUTH_ALL,
"auth_download" => AUTH_USER,
"auth_upload" => AUTH_USER,
"auth_directupload" => AUTH_ADMIN,
"auth_vote" => AUTH_ALL,
"auth_sendpostcard" => AUTH_ALL,
"auth_readcomment" => AUTH_ALL,
"auth_postcomment" => AUTH_USER
);
$access_array = array(
AUTH_ALL => $lang['all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['private'],
AUTH_ADMIN => $lang['userlevel_admin']
);
function show_access_select($title = "", $type, $status) {
global $access_array, $HTTP_POST_VARS;
if (isset($HTTP_POST_VARS[$type])) {
$status = $HTTP_POST_VARS[$type];
}
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
echo "<td>\n<select name=\"".$type."\">\n";
foreach ($access_array as $key => $val) {
echo "<option value=\"".$key."\"";
if ($status == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>\n";
}
echo "</select>\n</td>\n</tr>\n";
}
//****************************************
function create_cat_folder($path, $mode) {
//initialisation de la connection FTP
$ftp_server='IP of provider here'; // IP
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="FTP login here";
$passwd="password here"; // password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_mkdir($conn_id,$path);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
//******************************************
function remove_cat_folder($path) {
//initialisation de la connection FTP
$ftp_server='IP of provider here'; // IP
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="FTP login here";
$passwd="password here"; // password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_rmdir($conn_id,$path);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
//----------------------------------------------------------------------------
function remove_subcategories($cid = 0, $depth = 1) {
global $site_db, $error_log, $lang, $category_cache;
if (!isset($category_cache[$cid])) {
return false;
}
foreach ($category_cache[$cid] as $key => $cats) {
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td>\n";
if ($depth > 1) {
echo str_repeat(" ", $depth - 1)."\n";
}
echo "</td><td>\n";
$sql = "DELETE FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = ".$cats['cat_id'];
$site_db->query($sql);
$sql = "DELETE FROM ".CATEGORIES_TABLE."
WHERE cat_id = ".$cats['cat_id'];
if ($site_db->query($sql)) {
echo $lang['cat_delete_success']." <b>".$cats['cat_name']."</b> (ID: ".$cats['cat_id'].")<br />\n";
}
else {
$error_log[] = $lang['cat_delete_error']." <b>".$cats['cat_name']."</b> (ID: ".$cats['cat_id'].")";
}
$sql = "SELECT image_id
FROM ".IMAGES_TABLE."
WHERE cat_id = ".$cats['cat_id'];
$img_result = $site_db->query($sql);
$image_ids_sql = 0;
while ($image_row = $site_db->fetch_array($img_result)) {
$image_ids_sql .= (($image_ids_sql != "") ? ", " : "").$image_row['image_id'];
}
$sql = "DELETE FROM ".IMAGES_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {
echo "-» ".$lang['image_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['image_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
if (!empty($cats['cat_id'])) {
if (remove_cat_folder(MEDIA_PATH_FTP."/".$cats['cat_id'])) {
echo "-» ".$lang['file_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['file_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
if (remove_cat_folder(THUMB_PATH_FTP."/".$cats['cat_id'])) {
echo "-» ".$lang['thumb_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['thumb_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
}
$sql = "DELETE FROM ".COMMENTS_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {
echo "-» ".$lang['comments_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['comments_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
remove_searchwords($image_ids_sql);
echo "<br /></td></tr></table>\n";
remove_subcategories($cats['cat_id'], $depth + 1);
}
unset($category_cache[$cid]);
return true;
}
function show_category_rows($cid = 0, $depth = 1) {
global $site_db, $site_sess, $lang, $category_cache;
if (!isset($category_cache[$cid])) {
return false;
}
foreach ($category_cache[$cid] as $key => $cats) {
$class = "tablerow2";
if ($cats['cat_parent_id'] == 0) {
$class = "tablerow";
}
echo "<tr class=\"$class\">\n<td>\n";
if ($depth > 1) {
echo str_repeat(" ", $depth - 1)."<img src=\"images/folder_path.gif\" alt=\"\">\n";
}
// echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\"><b><a href=\"".$site_sess-//>url(ROOT_PATH."categories.php?cat_id=".$cats['cat_id'])."\" //target=\"_blank\">".$cats['cat_name']."</a>\n</b> ";
echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\"> <b>".$cats['cat_id']."</b> <b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cats['cat_id'])."\" target=\"_blank\">".$cats['cat_name']."</a>\n</b> ";
show_text_link($lang['edit'], "categories.php?action=editcat&cat_id=".$cats['cat_id']);
show_text_link($lang['delete'], "categories.php?action=removecat&cat_id=".$cats['cat_id']);
show_text_link($lang['add_subcategory'], "categories.php?action=addcat&cat_parent_id=".$cats['cat_id']);
echo "\n</td>\n<td align=\"center\">";
echo "<a href=\"".$site_sess->url("categories.php?action=ordercat&move=up&cat_id=".$cats['cat_id'])."\"><img src=\"images/arrow_up.gif\" border=\"0\"></a>\n";
echo "<a href=\"".$site_sess->url("categories.php?action=ordercat&move=down&cat_id=".$cats['cat_id'])."\"><img src=\"images/arrow_down.gif\" border=\"0\"></a>\n";
echo "</td>\n</tr>\n";
show_category_rows($cats['cat_id'], $depth + 1);
}
unset($category_cache[$cid]);
}
function update_cat_order($parent_id = 0) {
global $site_db;
$sql = "SELECT cat_id
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $parent_id
ORDER BY cat_order ASC";
$result = $site_db->query($sql);
$i = 10;
while ($row = $site_db->fetch_array($result)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_order = $i
WHERE cat_id = ".$row['cat_id'];
$site_db->query($sql);
$i += 10;
}
}
function get_cat_order_dropdown($parent_id = 0) {
global $cat_cache, $cat_parent_cache, $lang, $HTTP_POST_VARS;
$category_list = "\n<select name=\"cat_order\" class=\"categoryselect\">\n";
$category_list .= "<option value=\"0\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == 0) {
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['at_end']."</option>\n";
$category_list .= "<option value=\"5\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == 5) {
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['at_beginning']."</option>\n";
foreach ($cat_parent_cache[$parent_id] as $key => $val) {
$category_list .= "<option value=\"".($cat_cache[$val]['cat_order'] + 5)."\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == ($cat_cache[$val]['cat_order'] + 5)) {
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['after']." ".$cat_cache[$val]['cat_name']."</option>\n";
}
$category_list .= "</select>\n";
return $category_list;
}
show_admin_header();
if ($action == "ordercat") {
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$move = (isset($HTTP_POST_VARS['move'])) ? trim($HTTP_POST_VARS['move']) : trim($HTTP_GET_VARS['move']);
$number = ($move == "up") ? -15 : 15;
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_order = cat_order + $number
WHERE cat_id = $cat_id";
$site_db->query($sql);
update_cat_order($cat_cache[$cat_id]['cat_parent_id']);
$action = "modifycats";
}
if ($action == "deletecat") {
$error_log = array();
show_table_header($lang['main_category'], 1);
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$sql = "SELECT cat_id, cat_name, cat_parent_id
FROM ".CATEGORIES_TABLE."
ORDER BY cat_order, cat_name ASC";
$result = $site_db->query($sql);
$category_cache = array();
while ($row = $site_db->fetch_array($result)) {
$category_cache[$row['cat_parent_id']][$row['cat_id']] = $row;
}
echo "<tr><td class=\"tablerow\">\n";
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=0><tr><td> </td><td>\n";
$sql = "DELETE FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = ".$cat_id;
$site_db->query($sql);
$sql = "DELETE FROM ".CATEGORIES_TABLE."
WHERE cat_id = ".$cat_id;
if ($site_db->query($sql)) {
echo $lang['cat_delete_success']." <b>".$cat_cache[$cat_id]['cat_name']."</b> (ID: ".$cat_id.")<br />\n";
}
else {
$error_log[] = $lang['cat_delete_error']." <b>".$cat_cache[$cat_id]['cat_name']."</b> (ID: ".$cat_id.")";
}
$sql = "SELECT image_id
FROM ".IMAGES_TABLE."
WHERE cat_id = ".$cat_id;
$img_result = $site_db->query($sql);
$image_ids_sql = 0;
while ($image_row = $site_db->fetch_array($img_result)) {
$image_ids_sql .= (($image_ids_sql != "") ? ", " : "").$image_row['image_id'];
}
$sql = "DELETE FROM ".IMAGES_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {
echo "-» ".$lang['image_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['image_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
if (!empty($cat_id)) {
if (remove_cat_folder(MEDIA_PATH_FTP."/".$cat_id)) {
echo "-» ".$lang['file_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['file_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
if (remove_cat_folder(THUMB_PATH_FTP."/".$cat_id)) {
echo "-» ".$lang['thumb_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['thumb_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
}
$sql = "DELETE FROM ".COMMENTS_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {
echo "-» ".$lang['comments_delete_success']."<br />\n";
}
else {
$error_log[] = $lang['comments_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
remove_searchwords($image_ids_sql);
echo "<br /></td></tr></table>\n";
echo "</td></tr>\n";
show_table_separator($lang['sub_categories'], 1);
echo "<tr><td class=\"tablerow\">\n";
if (!remove_subcategories($cat_id)) {
echo $lang['no_subcategories'];
}
echo "</td></tr>\n";
show_table_footer();
if (!empty($error_log)) {
show_table_header("Error Log:", 1);
echo "<tr><td class=\"tablerow\">\n";
echo "<table border=\"0\" cellpadding=\"\"2 cellspacing=\"0\"><tr><td> </td><td>\n";
echo "<b>".$lang['error_log_desc']."</b>\n<ul>\n";
foreach ($error_log as $key => $val) {
printf ("<li>%s</li>\n", $val);
}
echo "</ul>\n</td></tr></table>\n";
echo "</td></tr>\n";
show_table_footer();
}
echo "<p>";
show_text_link($lang['back_overview'],"categories.php?action=modifycats");
}
if ($action == "removecat") {
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
show_form_header("categories.php", "deletecat");
show_hidden_input("cat_id", $cat_id);
show_table_header($lang['delete'].": ".$cat_cache[$cat_id]['cat_name'], 2);
show_description_row($lang['delete_cat_confirm']);
show_form_footer($lang['yes'], "", 2, $lang['no']);
}
if ($action == "savecat") {
$error = array();
$cat_name = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_name']));
$cat_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description']));
$cat_parent_id = intval($HTTP_POST_VARS['cat_parent_id']);
$cat_order = (isset($HTTP_POST_VARS['cat_order'])) ? intval($HTTP_POST_VARS['cat_order']) : 0;
$auth_viewcat = $HTTP_POST_VARS['auth_viewcat'];
$auth_viewimage = $HTTP_POST_VARS['auth_viewimage'];
$auth_download = $HTTP_POST_VARS['auth_download'];
$auth_upload = $HTTP_POST_VARS['auth_upload'];
$auth_directupload = $HTTP_POST_VARS['auth_directupload'];
$auth_vote = $HTTP_POST_VARS['auth_vote'];
$auth_sendpostcard = $HTTP_POST_VARS['auth_sendpostcard'];
$auth_readcomment = $HTTP_POST_VARS['auth_readcomment'];
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
if ($cat_name == "") {
$error['cat_name'] = 1;
}
if (empty($error)) {
if (!$cat_order) {
$sql = "SELECT cat_order
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_parent_id
ORDER BY cat_order DESC
LIMIT 1";
$catorder = $site_db->query_firstrow($sql);
$cat_order = $catorder['cat_order'] + 10;
$do_updat_cat_order = 0;
}
else {
$do_updat_cat_order = 1;
}
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
$result = $site_db->query($sql);
$cat_id = $site_db->get_insert_id();
if ($result && $cat_id) {
if ($do_updat_cat_order) {
update_cat_order($cat_parent_id);
}
$msg = $lang['cat_add_success'];
create_cat_folder(MEDIA_PATH_FTP."/".$cat_id, CHMOD_DIRS);
create_cat_folder(THUMB_PATH_FTP."/".$cat_id, CHMOD_DIRS);
}
else {
$msg = $lang['cat_add_error'];
}
$action = "modifycats";
}
else {
$msg = sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "addcat";
}
}
if ($action == "addcat") {
if ($msg != "") {
printf("<b>%s</b>\n", $msg);
}
show_form_header("categories.php", "savecat");
show_table_header($lang['nav_categories_add'], 2);
show_input_row($lang['field_category_name'], "cat_name", "", $textinput_size);
show_textarea_row($lang['field_description_ext'], "cat_description", "", $textarea_size);
$cat_parent_id = (isset($HTTP_GET_VARS['cat_parent_id'])) ? $HTTP_GET_VARS['cat_parent_id'] : 0;
show_cat_select_row($lang['field_parent'], $cat_parent_id, 1);
//show_custom_row($lang['cat_order'], get_cat_order_dropdown($cat_parent_id));
$permission_headline = $lang['permissions'];
if ($cat_parent_id != 0) {
$new_access_field_array = array();
$sql = "SELECT cat_name, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
WHERE cat_id = $cat_parent_id";
$row = $site_db->query_firstrow($sql);
foreach ($access_field_array as $key => $val) {
$new_access_field_array[$key] = $row[$key];
}
unset($access_field_array);
$access_field_array = $new_access_field_array;
$permission_headline .= "<span class=\"smalltext\"><br>".$lang['permissions_inherited']." (".$row['cat_name'].")</span>";
}
show_table_separator($permission_headline, 2);
foreach ($access_field_array as $key => $val) {
show_access_select($lang[$key], $key, $val);
}
show_form_footer($lang['add'], $lang['reset'], 2);
}
if ($action == "updatecat") {
$error = array();
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$cat_parent_id = intval($HTTP_POST_VARS['cat_parent_id']);
$cat_name = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_name']));
$cat_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description']));
$cat_hits = intval(trim($HTTP_POST_VARS['cat_hits']));
$auth_viewcat = $HTTP_POST_VARS['auth_viewcat'];
$auth_viewimage = $HTTP_POST_VARS['auth_viewimage'];
$auth_download = $HTTP_POST_VARS['auth_download'];
$auth_upload = $HTTP_POST_VARS['auth_upload'];
$auth_directupload = $HTTP_POST_VARS['auth_directupload'];
$auth_vote = $HTTP_POST_VARS['auth_vote'];
$auth_sendpostcard = $HTTP_POST_VARS['auth_sendpostcard'];
$auth_readcomment = $HTTP_POST_VARS['auth_readcomment'];
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
if ($cat_parent_id == $cat_id) {
$msg .= sprintf("<span class=\"marktext\">%s</span><br />", $lang['parent_cat_error']);
$error['cat_parent_id'] = 1;
}
if ($cat_name == "") {
$error['cat_name'] = 1;
}
if (empty($error)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
WHERE cat_id = $cat_id";
$result = $site_db->query($sql);
$msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];
$action = "modifycats";
}
else {
$msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "editcat";
}
}
if ($action == "editcat") {
if ($msg != "") {
printf("<b>%s</b>\n", $msg);
}
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
WHERE cat_id = $cat_id";
$result = $site_db->query_firstrow($sql);
show_form_header("categories.php", "updatecat");
show_hidden_input("cat_id", $cat_id);
show_table_header($lang['nav_categories_edit'], 2);
show_input_row($lang['field_category_name'], "cat_name", $result['cat_name'], $textinput_size);
show_textarea_row($lang['field_description_ext'], "cat_description", $result['cat_description'], $textarea_size);
show_cat_select_row($lang['field_parent'], $result['cat_parent_id'], 1);
show_input_row($lang['field_hits'], "cat_hits", $result['cat_hits'], 5);
show_table_separator($lang['permissions'], 2);
foreach ($access_field_array as $key => $val) {
show_access_select($lang[$key], $key, $result[$key]);
}
show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
}
if ($action == "modifycats") {
if ($msg != "") {
printf("<b>%s</b>\n<p>", $msg);
}
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
ORDER BY cat_order, cat_name ASC";
$result = $site_db->query($sql);
$category_cache = array();
while ($row = $site_db->fetch_array($result)) {
$category_cache[$row['cat_parent_id']][$row['cat_id']] = $row;
}
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
echo "<tr class=\"tableseparator\">\n";
echo "<td class=\"tableseparator\">".$lang['nav_categories_edit']."</td>\n<td class=\"tableseparator\" align=\"center\">".$lang['cat_order']."</td>\n</tr>\n";
if (sizeof($category_cache) == 0) {
echo "<tr class=\"".get_row_bg()."\">\n<td colspan=\"2\">".$lang['no_categories']."</td></tr>";
}
else {
show_category_rows();
}
show_table_footer();
}
show_admin_footer();
?>
[/code]
i do need this so much. plz help me out. when adding categories it shows this message
Warning: ftp_mkdir() [function.ftp-mkdir]: ./../data/media/10: No such file or directory in /home/saiyaz/public_html/animesessions/admin/categories.php on line 90
Warning: ftp_mkdir() [function.ftp-mkdir]: ./../data/thumbnails/10: No such file or directory in /home/saiyaz/public_html/animesessions/admin/categories.php on line 90
Categories successfull added
the categories were added to the database but not to the ftp. how to solve this ?
Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 711 is not allowed to access /home/treble-c/public_html/gallery/data/media/1 owned by uid 99 in /home/treble-c/public_html/gallery/includes/upload.php on line 109
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 711 is not allowed to access /home/treble-c/public_html/gallery/data/media/1 owned by uid 99 in /home/treble-c/public_html/gallery/includes/upload.php on line 114
I see that alot are have the same Err as me. I dont know what to do i did the edit to categories.php in the admin folder also the edit to the global.php but i did not have one in the admin folder so i fig that the global in the 4image/ was the right one IS THAT RIGHT ?
also im not sure what i need to put in the global edit
Here
define('MEDIA_PATH_FTP', "/4images/data/media");
Here
define('THUMB_PATH_FTP', "/4images/data/thumbnails");
This is what i did
define('MEDIA_PATH_FTP', "/home.com/httpdocs/4images/data/media");
define('THUMB_PATH_FTP', "/home.com/httpsdoc/4images/data/thumbnails");
Now i can make categorie in the Database but will not put in ftp.
If i tri to upload a image here the Err.
Warning: Unable to create './../data/media/1/scan.JPG': No such file or directory in /home/httpd/vhosts/home.com/httpdocs/4images/includes/upload.php on line 114
Warning: Unable to move '/tmp/phpTgPw8Q' to './../data/media/1/scan.JPG' in /home/httpd/vhosts/home.com/httpdocs/4images/includes/upload.php on line 114
If i tri to add or edit categories here the errs i get
Warning: ftp_mkdir: ./../data/media/8: No such file or directory in /home/httpd/vhosts/home.com/httpdocs/4images/admin/categories.php on line 90
Fatal error: Call to undefined function: ftp_close() in /home/httpd/vhosts/home.com/httpdocs/4images/admin/categories.php on line 94
Thanks Mike
Warning: SAFE MODE Restriction in effect. The script whose uid is 12669 is not allowed to access /mnt/datadisk/users/webs/sitename.breezeland.com/pictures/data/thumbnails/1 owned by uid 51 in /mnt/datadisk/users/webs/sitename.breezeland.com/pictures/includes/image_utils.php on line 141
Warning: SAFE MODE Restriction in effect. The script whose uid is 12669 is not allowed to access ./data/thumbnails/1/P1172924-g.jpg owned by uid 51 in /mnt/datadisk/users/webs/sitename.breezeland.com/pictures/includes/image_utils.php on line 83
Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 65941 is not allowed to access ./data/media/7 owned by uid 65768 in /customer/tnt/docs/gallery/includes/upload.php on line 109
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 65941 is not allowed to access ./data/media/7 owned by uid 65768 in /customer/tnt/docs/gallery/includes/upload.php on line 114
Warning: SAFE MODE Restriction in effect. The script whose uid is 647 is not allowed to access /home/www/web12/html/foddoalbum/data/media/3 owned by uid 30 in /home/www/web12/html/foddoalbum/includes/upload.php on line 109
Warning: SAFE MODE Restriction in effect. The script whose uid is 647 is not allowed to access /home/www/web12/html/foddoalbum/data/media/3 owned by uid 30 in /home/www/web12/html/foddoalbum/includes/upload.php on line 114
Same for me too. All works, except when I try to upload a picture. All chmod's are set to 777 ... and even with this mod, I get the message:
Warning: SAFE MODE Restriction in effect. The script whose uid is 636 is not allowed to access /home/www/web1/html/galerie/data/media/1 owned by uid 30 in /home/www/web1/html/galerie/includes/upload.php on line 114
Not funny ...
Parse error: parse error, unexpected $ in /home/username/public_html/website/gallery/admin/categories.php on line 596
<Directory /home/www/4images/data/>
php_admin_value safe_mode 0
php_admin_value open_basedir /home/www/4images/data/tmp_media/
php_admin_value open_basedir /home/www/4images/data/tmp_thumbnails/
</Directory>
Is there a possibility to solve this problem without ftp?yes, as soon as your hoster turn off safe mode - no ftp will require ;)
I'm using this MOD buts it still error:Code: [Select]Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 65941 is not allowed to access ./data/media/7 owned by uid 65768 in /customer/tnt/docs/gallery/includes/upload.php on line 109
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 65941 is not allowed to access ./data/media/7 owned by uid 65768 in /customer/tnt/docs/gallery/includes/upload.php on line 114
No image uploaded in forder, no image in gallery... help!
Warning: opendir(): SAFE MODE Restriction in effect. The script whose uid is 10003 is not allowed to access ./../data/media/2 owned by uid 30 in /home/httpd/vhosts/allesrosa.com/httpdocs/phpkit/4images/admin/checkimages.php on line 192
Warning: opendir(./../data/media/2): failed to open dir: Success in /home/httpd/vhosts/allesrosa.com/httpdocs/phpkit/4images/admin/checkimages.php on line 192
$msg = "";
$clickstream = "";
define('MEDIA_PATH_FTP', "/4images/data/media");
define('THUMB_PATH_FTP', "/4images/data/thumbnails");
define('MEDIA_PATH', ROOT_PATH.MEDIA_DIR);
define('THUMB_PATH', ROOT_PATH.THUMB_DIR);
define('MEDIA_TEMP_PATH', ROOT_PATH.MEDIA_TEMP_DIR);
define('THUMB_TEMP_PATH', ROOT_PATH.THUMB_TEMP_DIR);
define('TEMPLATE_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']);
define('ICON_PATH', ROOT_PATH.TEMPLATE_DIR."/".$config['template_dir']."/icons");
Ping www.yourdomain.com [[/color]123.456.789.001] ....The orange one is the IP.[/color]
Ping www.yourdomain.com [[/color]123.456.789.001] ....Das Orangene ist die IP.[/color]
<?phpDid you change all red lines to your own settings and passwords?
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: categories.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
define('IN_CP', 1);
define('ROOT_PATH', './../');
require('admin_global.php');
include(ROOT_PATH.'includes/search_utils.php');
if ($action == "") {;
$action = "modifycats";
}
$access_field_array = array(
"auth_viewcat" => AUTH_ALL,
"auth_viewimage" => AUTH_ALL,
"auth_download" => AUTH_USER,
"auth_upload" => AUTH_USER,
"auth_directupload" => AUTH_ADMIN,
"auth_vote" => AUTH_ALL,
"auth_sendpostcard" => AUTH_ALL,
"auth_readcomment" => AUTH_ALL,
"auth_postcomment" => AUTH_USER
);
$access_array = array(
AUTH_ALL => $lang['all'],
AUTH_USER => $lang['userlevel_registered'],
AUTH_ACL => $lang['private'],
AUTH_ADMIN => $lang['userlevel_admin']
);
function show_access_select($title = "", $type, $status) {;
global $access_array, $HTTP_POST_VARS;
if (isset($HTTP_POST_VARS[$type])) {;
$status = $HTTP_POST_VARS[$type];
}
echo "<tr class=\"".get_row_bg()."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
echo "<td>\n<select name=\"".$type."\">\n";
foreach ($access_array as $key => $val) {;
echo "<option value=\"".$key."\"";
if ($status == $key) {;
echo " selected=\"selected\"";
}
echo ">".$val."</option>\n";
}
echo "</select>\n</td>\n</tr>\n";
}
//****************************************
function create_cat_folder($path, $mode) {;
//initialisation de la connection FTP
$ftp_server='123.456.789.001'; // IP
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="username";
$passwd="password"; // password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {;
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {;
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_mkdir($conn_id,$path);
$chmod_cmd="CHMOD 0777 ".$path;
$chmod=ftp_site($conn_id, $chmod_cmd);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
//******************************************
function remove_cat_folder($path) {;
//initialisation de la connection FTP
$ftp_server='123.456.789.001'; // IP
$conn_id = ftp_connect($ftp_server);
// login et mot de passe
$user="username";
$passwd="password"; // password
$login_result = ftp_login($conn_id, $user, $passwd);
// Vérification de la connection
if ((!$conn_id) || (!$login_result)) {;
echo "Mauvaise connexion FTP";
echo "Essaye de se connecter a $ftp_server for user $ftp_user_name";
die;
} else {;
//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result = ftp_rmdir($conn_id,$path);
}
//Fermeture de la connection ftp
ftp_close($conn_id);
}
//----------------------------------------------------------------------------
function remove_subcategories($cid = 0, $depth = 1) {;
global $site_db, $error_log, $lang, $category_cache;
if (!isset($category_cache[$cid])) {;
return false;
}
foreach ($category_cache[$cid] as $key => $cats) {;
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td>\n";
if ($depth > 1) {;
echo str_repeat(" ", $depth - 1)."\n";
}
echo "</td><td>\n";
$sql = "DELETE FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = ".$cats['cat_id'];
$site_db->query($sql);
$sql = "DELETE FROM ".CATEGORIES_TABLE."
WHERE cat_id = ".$cats['cat_id'];
if ($site_db->query($sql)) {;
echo $lang['cat_delete_success']." <b>".$cats['cat_name']."</b> (ID: ".$cats['cat_id'].")<br />\n";
}
else {;
$error_log[] = $lang['cat_delete_error']." <b>".$cats['cat_name']."</b> (ID: ".$cats['cat_id'].")";
}
$sql = "SELECT image_id
FROM ".IMAGES_TABLE."
WHERE cat_id = ".$cats['cat_id'];
$img_result = $site_db->query($sql);
$image_ids_sql = 0;
while ($image_row = $site_db->fetch_array($img_result)) {;
$image_ids_sql .= (($image_ids_sql != "") ? ", " : "").$image_row['image_id'];
}
$sql = "DELETE FROM ".IMAGES_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {;
echo "-» ".$lang['image_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['image_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
if (!empty($cats['cat_id'])) {;
if (remove_cat_folder(MEDIA_PATH_FTP."/".$cats['cat_id'])) {;
echo "-» ".$lang['file_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['file_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
if (remove_cat_folder(THUMB_PATH_FTP."/".$cats['cat_id'])) {;
echo "-» ".$lang['thumb_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['thumb_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
}
$sql = "DELETE FROM ".COMMENTS_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {;
echo "-» ".$lang['comments_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['comments_delete_error']." (".$cats['cat_name'].", ID: ".$cats['cat_id'].")";
}
remove_searchwords($image_ids_sql);
echo "<br /></td></tr></table>\n";
remove_subcategories($cats['cat_id'], $depth + 1);
}
unset($category_cache[$cid]);
return true;
}
function show_category_rows($cid = 0, $depth = 1) {;
global $site_db, $site_sess, $lang, $category_cache;
if (!isset($category_cache[$cid])) {;
return false;
}
foreach ($category_cache[$cid] as $key => $cats) {;
$class = "tablerow2";
if ($cats['cat_parent_id'] == 0) {;
$class = "tablerow";
}
echo "<tr class=\"$class\">\n<td>\n";
if ($depth > 1) {;
echo str_repeat(" ", $depth - 1)."<img src=\"images/folder_path.gif\" alt=\"\">\n";
}
// echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\"><b><a href=\"".$site_sess-//>url(ROOT_PATH."categories.php?cat_id=".$cats['cat_id'])."\" //target=\"_blank\">".$cats['cat_name']."</a>\n</b> ";
echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\"> <b>".$cats['cat_id']."</b> <b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cats['cat_id'])."\" target=\"_blank\">".$cats['cat_name']."</a>\n</b> ";
show_text_link($lang['edit'], "categories.php?action=editcat&cat_id=".$cats['cat_id']);
show_text_link($lang['delete'], "categories.php?action=removecat&cat_id=".$cats['cat_id']);
show_text_link($lang['add_subcategory'], "categories.php?action=addcat&cat_parent_id=".$cats['cat_id']);
echo "\n</td>\n<td align=\"center\">";
echo "<a href=\"".$site_sess->url("categories.php?action=ordercat&move=up&cat_id=".$cats['cat_id'])."\"><img src=\"images/arrow_up.gif\" border=\"0\"></a>\n";
echo "<a href=\"".$site_sess->url("categories.php?action=ordercat&move=down&cat_id=".$cats['cat_id'])."\"><img src=\"images/arrow_down.gif\" border=\"0\"></a>\n";
echo "</td>\n</tr>\n";
show_category_rows($cats['cat_id'], $depth + 1);
}
unset($category_cache[$cid]);
}
function update_cat_order($parent_id = 0) {;
global $site_db;
$sql = "SELECT cat_id
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $parent_id
ORDER BY cat_order ASC";
$result = $site_db->query($sql);
$i = 10;
while ($row = $site_db->fetch_array($result)) {;
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_order = $i
WHERE cat_id = ".$row['cat_id'];
$site_db->query($sql);
$i += 10;
}
}
function get_cat_order_dropdown($parent_id = 0) {;
global $cat_cache, $cat_parent_cache, $lang, $HTTP_POST_VARS;
$category_list = "\n<select name=\"cat_order\" class=\"categoryselect\">\n";
$category_list .= "<option value=\"0\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == 0) {;
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['at_end']."</option>\n";
$category_list .= "<option value=\"5\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == 5) {;
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['at_beginning']."</option>\n";
foreach ($cat_parent_cache[$parent_id] as $key => $val) {;
$category_list .= "<option value=\"".($cat_cache[$val]['cat_order'] + 5)."\"";
if (isset($HTTP_POST_VARS['cat_order']) && $HTTP_POST_VARS['cat_order'] == ($cat_cache[$val]['cat_order'] + 5)) {;
$category_list .= " selected=\"selected\"";
}
$category_list .= ">".$lang['after']." ".$cat_cache[$val]['cat_name']."</option>\n";
}
$category_list .= "</select>\n";
return $category_list;
}
show_admin_header();
if ($action == "ordercat") {;
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$move = (isset($HTTP_POST_VARS['move'])) ? trim($HTTP_POST_VARS['move']) : trim($HTTP_GET_VARS['move']);
$number = ($move == "up") ? -15 : 15;
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_order = cat_order + $number
WHERE cat_id = $cat_id";
$site_db->query($sql);
update_cat_order($cat_cache[$cat_id]['cat_parent_id']);
$action = "modifycats";
}
if ($action == "deletecat") {;
$error_log = array();
show_table_header($lang['main_category'], 1);
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$sql = "SELECT cat_id, cat_name, cat_parent_id
FROM ".CATEGORIES_TABLE."
ORDER BY cat_order, cat_name ASC";
$result = $site_db->query($sql);
$category_cache = array();
while ($row = $site_db->fetch_array($result)) {;
$category_cache[$row['cat_parent_id']][$row['cat_id']] = $row;
}
echo "<tr><td class=\"tablerow\">\n";
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=0><tr><td> </td><td>\n";
$sql = "DELETE FROM ".GROUP_ACCESS_TABLE."
WHERE cat_id = ".$cat_id;
$site_db->query($sql);
$sql = "DELETE FROM ".CATEGORIES_TABLE."
WHERE cat_id = ".$cat_id;
if ($site_db->query($sql)) {;
echo $lang['cat_delete_success']." <b>".$cat_cache[$cat_id]['cat_name']."</b> (ID: ".$cat_id.")<br />\n";
}
else {;
$error_log[] = $lang['cat_delete_error']." <b>".$cat_cache[$cat_id]['cat_name']."</b> (ID: ".$cat_id.")";
}
$sql = "SELECT image_id
FROM ".IMAGES_TABLE."
WHERE cat_id = ".$cat_id;
$img_result = $site_db->query($sql);
$image_ids_sql = 0;
while ($image_row = $site_db->fetch_array($img_result)) {;
$image_ids_sql .= (($image_ids_sql != "") ? ", " : "").$image_row['image_id'];
}
$sql = "DELETE FROM ".IMAGES_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {;
echo "-» ".$lang['image_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['image_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
if (!empty($cat_id)) {;
if (remove_cat_folder(MEDIA_PATH_FTP."/".$cat_id)) {;
echo "-» ".$lang['file_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['file_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
if (remove_cat_folder(THUMB_PATH_FTP."/".$cat_id)) {;
echo "-» ".$lang['thumb_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['thumb_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
}
$sql = "DELETE FROM ".COMMENTS_TABLE."
WHERE image_id IN ($image_ids_sql)";
if ($site_db->query($sql)) {;
echo "-» ".$lang['comments_delete_success']."<br />\n";
}
else {;
$error_log[] = $lang['comments_delete_error']." (".$cat_cache[$cat_id]['cat_name'].", ID: ".$cat_id.")";
}
remove_searchwords($image_ids_sql);
echo "<br /></td></tr></table>\n";
echo "</td></tr>\n";
show_table_separator($lang['sub_categories'], 1);
echo "<tr><td class=\"tablerow\">\n";
if (!remove_subcategories($cat_id)) {;
echo $lang['no_subcategories'];
}
echo "</td></tr>\n";
show_table_footer();
if (!empty($error_log)) {;
show_table_header("Error Log:", 1);
echo "<tr><td class=\"tablerow\">\n";
echo "<table border=\"0\" cellpadding=\"\"2 cellspacing=\"0\"><tr><td> </td><td>\n";
echo "<b>".$lang['error_log_desc']."</b>\n<ul>\n";
foreach ($error_log as $key => $val) {;
printf ("<li>%s</li>\n", $val);
}
echo "</ul>\n</td></tr></table>\n";
echo "</td></tr>\n";
show_table_footer();
}
echo "<p>";
show_text_link($lang['back_overview'],"categories.php?action=modifycats");
}
if ($action == "removecat") {;
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
show_form_header("categories.php", "deletecat");
show_hidden_input("cat_id", $cat_id);
show_table_header($lang['delete'].": ".$cat_cache[$cat_id]['cat_name'], 2);
show_description_row($lang['delete_cat_confirm']);
show_form_footer($lang['yes'], "", 2, $lang['no']);
}
if ($action == "savecat") {;
$error = array();
$cat_name = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_name']));
$cat_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description']));
$cat_parent_id = intval($HTTP_POST_VARS['cat_parent_id']);
$cat_order = (isset($HTTP_POST_VARS['cat_order'])) ? intval($HTTP_POST_VARS['cat_order']) : 0;
$auth_viewcat = $HTTP_POST_VARS['auth_viewcat'];
$auth_viewimage = $HTTP_POST_VARS['auth_viewimage'];
$auth_download = $HTTP_POST_VARS['auth_download'];
$auth_upload = $HTTP_POST_VARS['auth_upload'];
$auth_directupload = $HTTP_POST_VARS['auth_directupload'];
$auth_vote = $HTTP_POST_VARS['auth_vote'];
$auth_sendpostcard = $HTTP_POST_VARS['auth_sendpostcard'];
$auth_readcomment = $HTTP_POST_VARS['auth_readcomment'];
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
if ($cat_name == "") {;
$error['cat_name'] = 1;
}
if (empty($error)) {;
if (!$cat_order) {;
$sql = "SELECT cat_order
FROM ".CATEGORIES_TABLE."
WHERE cat_parent_id = $cat_parent_id
ORDER BY cat_order DESC
LIMIT 1";
$catorder = $site_db->query_firstrow($sql);
$cat_order = $catorder['cat_order'] + 10;
$do_updat_cat_order = 0;
}
else {;
$do_updat_cat_order = 1;
}
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
$result = $site_db->query($sql);
$cat_id = $site_db->get_insert_id();
if ($result && $cat_id) {;
if ($do_updat_cat_order) {;
update_cat_order($cat_parent_id);
}
$msg = $lang['cat_add_success'];
create_cat_folder(MEDIA_PATH_FTP."/".$cat_id, CHMOD_DIRS);
create_cat_folder(THUMB_PATH_FTP."/".$cat_id, CHMOD_DIRS);
}
else {;
$msg = $lang['cat_add_error'];
}
$action = "modifycats";
}
else {;
$msg = sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "addcat";
}
}
if ($action == "addcat") {;
if ($msg != "") {;
printf("<b>%s</b>\n", $msg);
}
show_form_header("categories.php", "savecat");
show_table_header($lang['nav_categories_add'], 2);
show_input_row($lang['field_category_name'], "cat_name", "", $textinput_size);
show_textarea_row($lang['field_description_ext'], "cat_description", "", $textarea_size);
$cat_parent_id = (isset($HTTP_GET_VARS['cat_parent_id'])) ? $HTTP_GET_VARS['cat_parent_id'] : 0;
show_cat_select_row($lang['field_parent'], $cat_parent_id, 1);
//show_custom_row($lang['cat_order'], get_cat_order_dropdown($cat_parent_id));
$permission_headline = $lang['permissions'];
if ($cat_parent_id != 0) {;
$new_access_field_array = array();
$sql = "SELECT cat_name, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
WHERE cat_id = $cat_parent_id";
$row = $site_db->query_firstrow($sql);
foreach ($access_field_array as $key => $val) {;
$new_access_field_array[$key] = $row[$key];
}
unset($access_field_array);
$access_field_array = $new_access_field_array;
$permission_headline .= "<span class=\"smalltext\"><br>".$lang['permissions_inherited']." (".$row['cat_name'].")</span>";
}
show_table_separator($permission_headline, 2);
foreach ($access_field_array as $key => $val) {;
show_access_select($lang[$key], $key, $val);
}
show_form_footer($lang['add'], $lang['reset'], 2);
}
if ($action == "updatecat") {;
$error = array();
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$cat_parent_id = intval($HTTP_POST_VARS['cat_parent_id']);
$cat_name = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_name']));
$cat_description = un_htmlspecialchars(trim($HTTP_POST_VARS['cat_description']));
$cat_hits = intval(trim($HTTP_POST_VARS['cat_hits']));
$auth_viewcat = $HTTP_POST_VARS['auth_viewcat'];
$auth_viewimage = $HTTP_POST_VARS['auth_viewimage'];
$auth_download = $HTTP_POST_VARS['auth_download'];
$auth_upload = $HTTP_POST_VARS['auth_upload'];
$auth_directupload = $HTTP_POST_VARS['auth_directupload'];
$auth_vote = $HTTP_POST_VARS['auth_vote'];
$auth_sendpostcard = $HTTP_POST_VARS['auth_sendpostcard'];
$auth_readcomment = $HTTP_POST_VARS['auth_readcomment'];
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
if ($cat_parent_id == $cat_id) {;
$msg .= sprintf("<span class=\"marktext\">%s</span><br />", $lang['parent_cat_error']);
$error['cat_parent_id'] = 1;
}
if ($cat_name == "") {;
$error['cat_name'] = 1;
}
if (empty($error)) {;
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
WHERE cat_id = $cat_id";
$result = $site_db->query($sql);
$msg = ($result) ? $lang['cat_edit_success'] : $lang['cat_edit_error'];
$action = "modifycats";
}
else {;
$msg .= sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
$action = "editcat";
}
}
if ($action == "editcat") {;
if ($msg != "") {;
printf("<b>%s</b>\n", $msg);
}
$cat_id = (isset($HTTP_POST_VARS['cat_id'])) ? intval($HTTP_POST_VARS['cat_id']) : intval($HTTP_GET_VARS['cat_id']);
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
WHERE cat_id = $cat_id";
$result = $site_db->query_firstrow($sql);
show_form_header("categories.php", "updatecat");
show_hidden_input("cat_id", $cat_id);
show_table_header($lang['nav_categories_edit'], 2);
show_input_row($lang['field_category_name'], "cat_name", $result['cat_name'], $textinput_size);
show_textarea_row($lang['field_description_ext'], "cat_description", $result['cat_description'], $textarea_size);
show_cat_select_row($lang['field_parent'], $result['cat_parent_id'], 1);
show_input_row($lang['field_hits'], "cat_hits", $result['cat_hits'], 5);
show_table_separator($lang['permissions'], 2);
foreach ($access_field_array as $key => $val) {;
show_access_select($lang[$key], $key, $result[$key]);
}
show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
}
if ($action == "modifycats") {;
if ($msg != "") {;
printf("<b>%s</b>\n<p>", $msg);
}
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
FROM ".CATEGORIES_TABLE."
ORDER BY cat_order, cat_name ASC";
$result = $site_db->query($sql);
$category_cache = array();
while ($row = $site_db->fetch_array($result)) {;
$category_cache[$row['cat_parent_id']][$row['cat_id']] = $row;
}
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\"><tr><td class=\"tableborder\">\n<table cellpadding=\"3\" cellspacing=\"1\" border=\"0\" width=\"100%\">\n";
echo "<tr class=\"tableseparator\">\n";
echo "<td class=\"tableseparator\">".$lang['nav_categories_edit']."</td>\n<td class=\"tableseparator\" align=\"center\">".$lang['cat_order']."</td>\n</tr>\n";
if (sizeof($category_cache) == 0) {;
echo "<tr class=\"".get_row_bg()."\">\n<td colspan=\"2\">".$lang['no_categories']."</td></tr>";
}
else {;
show_category_rows();
}
show_table_footer();
}
show_admin_footer();
?>
$chmod_cmd="CHMOD 0777 ".$path;
$chmod=ftp_site($conn_id, $chmod_cmd);
If you have created some folders before by hand or otherwise, you have to delete them all before it works. Delete all numered folders in 4images/data/media and in 4images/data/thumbnails.If you created folders by hand (meaning through FTP?) if so, why do you need to delete them? this mod is also using FTP, so it should be the same as if you create new folders by hand or though this mod...
enable-safe-mode
safe_mode Off
safe_mode_exec_dir no value
safe_mode_gid On
safe_mode_include_dir no value
sql.safe_mode Off
safe_mode_allowed_env_vars PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH
safe_mode Off
you dont need it then...
Warning: filesize(): SAFE MODE Restriction in effect. The script whose uid is 32239 is not allowed to access ./../data/media/2/Tarash.jpg owned by uid 99 in /home/seghaleh/public_html/4images/admin/admin_functions.php on line 599
Warning: move_uploaded_file(./../data/media/1/retsu.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/zonearab/public_html/includes/upload.php on line 113
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpeLdUpn' to './../data/media/1/retsu.jpg' in /home/zonearab/public_html/includes/upload.php on line 113
Warning: move_uploaded_file(./data/media/2/retsu.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/zonearab/public_html/includes/upload.php on line 113
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpMlRAyH' to './data/media/2/retsu.jpg' in /home/zonearab/public_html/includes/upload.php on line 113
Warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. The script whose uid is 32032 is not allowed to access /home/zonearab/public_html/gallery/data/media/1 owned by uid 99 in /home/zonearab/public_html/gallery/includes/upload.php on line 113
Backup all files before you change them!!!
Mach eine Sicherheitskopie von den Dateien, bevor du sie Veränderst
DO NOT MODIFY THE FILES IF YOU DON'T HAVE ANY PROBLEM WITH SAFE MODE !
ÄNDERE DIE DATEIEN NICHT, WENN DU KEINE PROBLEME IM SAVE MODE HAST!
1.
Fehler beim Upload der Bild-Datei: CIMG1709.JPG
CIMG1709.JPG: Datei konnte nicht auf den Server kopiert werden. Bitte überprüfen Sie ob die Zugriffsrechte des Zielordners richtig gesetzt sind
Daten nicht in die Datenbank geschrieben
Ping your.domaine.name
and copy the IP adresse in the config.Quote
[ Quote from: kummy [Expand]
well...i think it's work...but a i get this message:
Warning: ftp_connect() [function.ftp-connect]: php_hostconnect: connect failed in /home/kummy72/public_html/iluh/4images/admin/categories.php on line 101
Warning: ftp_login() expects parameter 1 to be resource, boolean given in /home/kummy72/public_html/iluh/4images/admin/categories.php on line 106
Mauvaise connexion FTPEssaye de se connecter a 195.90.85.74 for user
my question is, how can i know my FTP IP server? ]