Author Topic: [MOD] for Bypassing The SAFE MODE  (Read 165016 times)

0 Members and 1 Guest are viewing this topic.

Offline kummy

  • Newbie
  • *
  • Posts: 11
    • View Profile
[MOD] for Bypassing The SAFE MODE
« Reply #15 on: February 18, 2003, 04:52:38 PM »
my God...it's really work... :lol:  8)
camo, i still use the real categories.php (none edited)..and it's work  :D

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 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

Offline joecks

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://www.familie-bruil.com
[MOD] for Bypassing The SAFE MODE
« Reply #16 on: February 18, 2003, 07:35:35 PM »
Yes, you only have to do the trick when ever you create a new category...

Grtx,

Joecks

Offline camo93

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://central-galerie.com
[MOD] for Bypassing The SAFE MODE
« Reply #17 on: February 19, 2003, 09:42:16 AM »
Quote
btw, will i always do these steps everytime i want to upload my photoz? i think everytime i add a category, right?

Yes ! and this is why my solution is the best. The solution which joecks gives is known in another topic and is not the object here.
I have tested just one time this solution because it's irritatting !.

For hundreds of directory's it is very irritating to make del/create, del/create and many much more...and finished by 777.
My website show many photographers and it's impossible to del/add many directory and chown 777 :-) lol

Now with my code, 4images is the same one that before without the SAFE Mode disturbing it.

Regards,
Camo

Offline joecks

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://www.familie-bruil.com
Re: help me!!!!!!!!!!!!!!!!!!!!!
« Reply #18 on: February 20, 2003, 07:59:51 PM »
When i check my php server info it says,

ftp
FTP support  enabled  

and still get this error message.

Grtx,

Joecks

Quote from: V@no
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.

Offline camo93

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://central-galerie.com
Re: help me!!!!!!!!!!!!!!!!!!!!!
« Reply #19 on: February 20, 2003, 08:13:05 PM »
Quote from: joecks
When i check my php server info it says,

ftp
FTP support  enabled  

and still get this error message.

Grtx,

Joecks

Quote from: V@no
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.


Arghhhhhhhhhhhhhh !!!
I'm sorry, i don't understand ...
snifff ;(((

Offline joecks

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://www.familie-bruil.com
Re: help me!!!!!!!!!!!!!!!!!!!!!
« Reply #20 on: February 21, 2003, 06:40:58 PM »
I mean that i get the same error...

When i check php info it says that ftp is supported..

Grtx,

Joecks

Quote from: heocon
Quote
Fatal error: Call to undefined function: ftp_connect() in /home/vhosts/a2class.net/httpdocs/products/admin/categories.php on line 75

please help me!

Offline rah

  • Newbie
  • *
  • Posts: 21
    • View Profile
[MOD] for Bypassing The SAFE MODE
« Reply #21 on: February 25, 2003, 03:29:40 AM »
I am totally lost! I followed the instructions on how to deal with this safe mode thing, and still did not rectify it:
http://www.bazodeecentral.com/bcgallery/index.php

I firstly went into (/admin/catergories.php) made the changes and then into (/global.php) to make the necessary changes as well. But nothing happened. Any suggestions on where I went wrong???

More info: both files were in chmod 644 before I started working on them... I chmod them to 777 while working on them, then chmod it back to 644 when I was completed. Could that be my problem?

Offline Kamui

  • Newbie
  • *
  • Posts: 19
    • View Profile
hi
« Reply #22 on: March 14, 2003, 02:26:36 PM »
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 ?

Offline camo93

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://central-galerie.com
CORRECTION : FOR ALL THIS IS MY CONFIG FILE
« Reply #23 on: March 14, 2003, 05:01:22 PM »
Hi,

Sorry for the problems.
This is my categories.php file.
Please backup your original.

Change the IP, password and login in this code.
Tell me more.

Regards

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File&#58; categories.php                                       *
 *        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
 *            Email&#58; jan@4homepages.de                                    *
 *              Web&#58; http&#58;//www.4homepages.de                             *
 *    Scriptversion&#58; 1.7                                                  *
 *                                                                        *
 *    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41;   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen &#40;Lizenz.txt&#41; für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    &#40;Licence.txt&#41; for further information.                              *
 *                                                                        *
 *************************************************************************/

define&#40;'IN_CP', 1&#41;;
define&#40;'ROOT_PATH', './../'&#41;;
require&#40;'admin_global.php'&#41;;

include&#40;ROOT_PATH.'includes/search_utils.php'&#41;;

if &#40;$action == ""&#41; &#123;
  
$action "modifycats";
&
#125;

$access_field_array = array&#40;
  
"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
&#41;;

$access_array = array&#40;
  
AUTH_ALL => $lang['all'&#93;,
  
AUTH_USER => $lang['userlevel_registered'&#93;,
  
AUTH_ACL => $lang['private'&#93;,
  
AUTH_ADMIN => $lang['userlevel_admin'&#93;
&#41;;

function show_access_select&#40;$title = "", $type, $status&#41; &#123;
  
global $access_array$HTTP_POST_VARS;
  if &
#40;isset&#40;$HTTP_POST_VARS[$type&#93;&#41;&#41; &#123;
    
$status $HTTP_POST_VARS[$type&#93;;
  
&#125;
  
echo "<tr class=\"".get_row_bg&#40;&#41;."\" valign=\"top\">\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
  
echo "<td>\n<select name=\"".$type."\">\n";
  foreach &
#40;$access_array as $key => $val&#41; &#123;
    
echo "<option value=\"".$key."\"";
    if &
#40;$status == $key&#41; &#123;
      
echo " selected=\"selected\"";
    &
#125;
    
echo ">".$val."</option>\n";
  &
#125;
  
echo "</select>\n</td>\n</tr>\n";
&
#125;

//****************************************
function create_cat_folder&#40;$path, $mode&#41; &#123;

//initialisation de la connection FTP 
$ftp_server='IP of provider here'// IP 
$conn_id ftp_connect&#40;$ftp_server&#41;; 

// login et mot de passe 
$user="FTP login here"
$passwd="password here"// password 
$login_result ftp_login&#40;$conn_id, $user, $passwd&#41;; 

// Vérification de la connection 
if &#40;&#40;!$conn_id&#41; || &#40;!$login_result&#41;&#41; &#123; 
echo "Mauvaise connexion FTP"
echo 
"Essaye de se connecter a $ftp_server for user $ftp_user_name"
die; 
&
#125; else &#123; 

//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result ftp_mkdir&#40;$conn_id,$path&#41;;
&#125; 

//Fermeture de la connection ftp 
ftp_close&#40;$conn_id&#41;; 
&#125;

//******************************************
function remove_cat_folder&#40;$path&#41; &#123;

//initialisation de la connection FTP 
$ftp_server='IP of provider here'// IP 
$conn_id ftp_connect&#40;$ftp_server&#41;; 

// login et mot de passe
$user="FTP login here"
$passwd="password here"// password 
$login_result ftp_login&#40;$conn_id, $user, $passwd&#41;; 

// Vérification de la connection 
if &#40;&#40;!$conn_id&#41; || &#40;!$login_result&#41;&#41; &#123; 
echo "Mauvaise connexion FTP"
echo 
"Essaye de se connecter a $ftp_server for user $ftp_user_name"
die; 
&
#125; else &#123; 

//ici, la connection est bien effectuée, alors on appelle la fonction qui crée le répertoire
$result ftp_rmdir&#40;$conn_id,$path&#41;;
&#125; 

//Fermeture de la connection ftp 
ftp_close&#40;$conn_id&#41;; 

&#125;
//----------------------------------------------------------------------------

function remove_subcategories&#40;$cid = 0, $depth = 1&#41; &#123;
  
global $site_db$error_log$lang$category_cache;

  if &
#40;!isset&#40;$category_cache[$cid&#93;&#41;&#41; &#123;
    
return false;
  &
#125;
  
foreach &#40;$category_cache[$cid&#93; as $key => $cats&#41; &#123;
    
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\"><tr><td>\n";
    if &
#40;$depth > 1&#41; &#123;
      
echo str_repeat&#40;"&nbsp;&nbsp;&nbsp;&nbsp;", $depth - 1&#41;."\n";
    
&#125;
    
echo "</td><td>\n";

    
$sql "DELETE FROM ".GROUP_ACCESS_TABLE.
            WHERE cat_id = "
.$cats['cat_id'&#93;;
    
$site_db->query&#40;$sql&#41;;

    
$sql "DELETE FROM ".CATEGORIES_TABLE.
            WHERE cat_id = "
.$cats['cat_id'&#93;;

    
if &#40;$site_db->query&#40;$sql&#41;&#41; &#123;
      
echo $lang['cat_delete_success'&#93;." <b>".$cats['cat_name'&#93;."</b> &#40;ID&#58; ".$cats['cat_id'&#93;."&#41;<br />\n";
    
&#125;
    
else &#123;
      
$error_log[&#93; = $lang['cat_delete_error'&#93;." <b>".$cats['cat_name'&#93;."</b> &#40;ID&#58; ".$cats['cat_id'&#93;."&#41;";
    
&#125;

    
$sql "SELECT image_id 
            FROM "
.IMAGES_TABLE.
            WHERE cat_id = "
.$cats['cat_id'&#93;;
    
$img_result $site_db->query&#40;$sql&#41;;

    
$image_ids_sql 0;
    while &
#40;$image_row = $site_db->fetch_array&#40;$img_result&#41;&#41; &#123;
      
$image_ids_sql .= &#40;&#40;$image_ids_sql != ""&#41; ? ", " &#58; ""&#41;.$image_row['image_id'&#93;;
    
&#125;

    
$sql "DELETE FROM ".IMAGES_TABLE.
            WHERE image_id IN &#40;
$image_ids_sql&#41;";
    if &
#40;$site_db->query&#40;$sql&#41;&#41; &#123;
      
echo "-&raquo ".$lang['image_delete_success'&#93;."<br />\n";
    
&#125;
    
else &#123;
      
$error_log[&#93; = $lang['image_delete_error'&#93;." &#40;".$cats['cat_name'&#93;.", ID&#58; ".$cats['cat_id'&#93;."&#41;";
    
&#125;

    
if &#40;!empty&#40;$cats['cat_id'&#93;&#41;&#41; &#123;
      
if &#40;remove_cat_folder&#40;MEDIA_PATH_FTP."/".$cats['cat_id'&#93;&#41;&#41; &#123;
        
echo "-&raquo ".$lang['file_delete_success'&#93;."<br />\n";
      
&#125;
      
else &#123;
        
$error_log[&#93; = $lang['file_delete_error'&#93;." &#40;".$cats['cat_name'&#93;.", ID&#58; ".$cats['cat_id'&#93;."&#41;";
      
&#125;
      
if &#40;remove_cat_folder&#40;THUMB_PATH_FTP."/".$cats['cat_id'&#93;&#41;&#41; &#123;
        
echo "-&raquo ".$lang['thumb_delete_success'&#93;."<br />\n";
      
&#125;
      
else &#123;
        
$error_log[&#93; = $lang['thumb_delete_error'&#93;." &#40;".$cats['cat_name'&#93;.", ID&#58; ".$cats['cat_id'&#93;."&#41;";
      
&#125;
    
&#125;

    
$sql "DELETE FROM ".COMMENTS_TABLE.
            WHERE image_id IN &#40;
$image_ids_sql&#41;";
    if &
#40;$site_db->query&#40;$sql&#41;&#41; &#123;
      
echo "-&raquo ".$lang['comments_delete_success'&#93;."<br />\n";
    
&#125;
    
else &#123;
      
$error_log[&#93; = $lang['comments_delete_error'&#93;." &#40;".$cats['cat_name'&#93;.", ID&#58; ".$cats['cat_id'&#93;."&#41;";
    
&#125;

    
remove_searchwords&#40;$image_ids_sql&#41;;

    
echo "<br /></td></tr></table>\n";
    
remove_subcategories&#40;$cats['cat_id'&#93;, $depth + 1&#41;;
  
&#125;
  
unset&#40;$category_cache[$cid&#93;&#41;;
  
return true;
&
#125;

function show_category_rows&#40;$cid = 0, $depth = 1&#41; &#123;
  
global $site_db$site_sess$lang$category_cache;

  if &
#40;!isset&#40;$category_cache[$cid&#93;&#41;&#41; &#123;
    
return false;
  &
#125;
  
foreach &#40;$category_cache[$cid&#93; as $key => $cats&#41; &#123;
    
$class "tablerow2";
    if &
#40;$cats['cat_parent_id'&#93; == 0&#41; &#123;
      
$class "tablerow";
    &
#125;
    
echo "<tr class=\"$class\">\n<td>\n";
    if &
#40;$depth > 1&#41; &#123;
      
echo str_repeat&#40;"&nbsp;&nbsp;&nbsp;&nbsp;", $depth - 1&#41;."<img src=\"images/folder_path.gif\" alt=\"\">\n";
    
&#125;

//    echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\"><b><a href=\"".$site_sess-//>url&#40;ROOT_PATH."categories.php?cat_id=".$cats['cat_id'&#93;&#41;."\" //target=\"_blank\">".$cats['cat_name'&#93;."</a>\n</b>&nbsp;&nbsp;&nbsp;&nbsp;";

echo "<img src=\"".ROOT_PATH."admin/images/folder.gif\" alt=\"\">&nbsp;<b>".$cats['cat_id'&#93;."</b>&nbsp;<b><a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?cat_id=".$cats['cat_id'&#93;&#41;."\" target=\"_blank\">".$cats['cat_name'&#93;."</a>\n</b>&nbsp;&nbsp;&nbsp;&nbsp;"; 

    
    
    
show_text_link&#40;$lang['edit'&#93;, "categories.php?action=editcat&cat_id=".$cats['cat_id'&#93;&#41;;
    
show_text_link&#40;$lang['delete'&#93;, "categories.php?action=removecat&cat_id=".$cats['cat_id'&#93;&#41;;
    
show_text_link&#40;$lang['add_subcategory'&#93;, "categories.php?action=addcat&cat_parent_id=".$cats['cat_id'&#93;&#41;;
    
echo "\n</td>\n<td align=\"center\">";
    echo 
"<a href=\"".$site_sess->url&#40;"categories.php?action=ordercat&move=up&cat_id=".$cats['cat_id'&#93;&#41;."\"><img src=\"images/arrow_up.gif\" border=\"0\"></a>\n";
    
echo "<a href=\"".$site_sess->url&#40;"categories.php?action=ordercat&move=down&cat_id=".$cats['cat_id'&#93;&#41;."\"><img src=\"images/arrow_down.gif\" border=\"0\"></a>\n";
    
echo "</td>\n</tr>\n";
    
show_category_rows&#40;$cats['cat_id'&#93;, $depth + 1&#41;;
  
&#125;
  
unset&#40;$category_cache[$cid&#93;&#41;;
&#125;

function update_cat_order&#40;$parent_id = 0&#41; &#123;
  
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&#40;$sql&#41;;
  
$i 10;
  while &
#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
    
$sql "UPDATE ".CATEGORIES_TABLE.
            SET cat_order = 
$i 
            WHERE cat_id = "
.$row['cat_id'&#93;;
    
$site_db->query&#40;$sql&#41;;
    
$i += 10;
  &
#125;
&#125;

function get_cat_order_dropdown&#40;$parent_id = 0&#41; &#123;
  
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 &
#40;isset&#40;$HTTP_POST_VARS['cat_order'&#93;&#41; && $HTTP_POST_VARS['cat_order'&#93; == 0&#41; &#123;
    
$category_list .= " selected=\"selected\"";
  &
#125;
  
$category_list .= ">".$lang['at_end'&#93;."</option>\n";
  
$category_list .= "<option value=\"5\"";
  if &
#40;isset&#40;$HTTP_POST_VARS['cat_order'&#93;&#41; && $HTTP_POST_VARS['cat_order'&#93; == 5&#41; &#123;
    
$category_list .= " selected=\"selected\"";
  &
#125;
  
$category_list .= ">".$lang['at_beginning'&#93;."</option>\n";
  
foreach &#40;$cat_parent_cache[$parent_id&#93; as $key => $val&#41; &#123;
    
$category_list .= "<option value=\"".&#40;$cat_cache[$val&#93;['cat_order'&#93; + 5&#41;."\"";
    
if &#40;isset&#40;$HTTP_POST_VARS['cat_order'&#93;&#41; && $HTTP_POST_VARS['cat_order'&#93; == &#40;$cat_cache[$val&#93;['cat_order'&#93; + 5&#41;&#41; &#123;
      
$category_list .= " selected=\"selected\"";
    &
#125;
    
$category_list .= ">".$lang['after'&#93;." ".$cat_cache[$val&#93;['cat_name'&#93;."</option>\n";
  
&#125;
  
$category_list .= "</select>\n";
  return 
$category_list;
&
#125;

show_admin_header&#40;&#41;;

if &#40;$action == "ordercat"&#41; &#123;
  
$cat_id = &#40;isset&#40;$HTTP_POST_VARS['cat_id'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_id'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['cat_id'&#93;&#41;;
  
$move = &#40;isset&#40;$HTTP_POST_VARS['move'&#93;&#41;&#41; ? trim&#40;$HTTP_POST_VARS['move'&#93;&#41; &#58; trim&#40;$HTTP_GET_VARS['move'&#93;&#41;;

  
$number = &#40;$move == "up"&#41; ? -15 &#58; 15;

  
$sql "UPDATE ".CATEGORIES_TABLE.
          SET cat_order = cat_order + 
$number 
          WHERE cat_id = 
$cat_id";
  
$site_db->query&#40;$sql&#41;;

  
update_cat_order&#40;$cat_cache[$cat_id&#93;['cat_parent_id'&#93;&#41;;
  
$action "modifycats";
&
#125;

if &#40;$action == "deletecat"&#41; &#123;
  
$error_log = array&#40;&#41;;
  
show_table_header&#40;$lang['main_category'&#93;, 1&#41;;
  
$cat_id = &#40;isset&#40;$HTTP_POST_VARS['cat_id'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_id'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['cat_id'&#93;&#41;;

  
$sql "SELECT cat_id, cat_name, cat_parent_id 
          FROM "
.CATEGORIES_TABLE.
          ORDER BY cat_order, cat_name ASC"
;
  
$result $site_db->query&#40;$sql&#41;;
  
$category_cache = array&#40;&#41;;
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
    
$category_cache[$row['cat_parent_id'&#93;&#93;[$row['cat_id'&#93;&#93; = $row;
  
&#125;

  
echo "<tr><td class=\"tablerow\">\n";
  echo 
"<table border=\"0\" cellpadding=\"2\" cellspacing=0><tr><td>&nbsp;</td><td>\n";

  
$sql "DELETE FROM ".GROUP_ACCESS_TABLE.
          WHERE cat_id = "
.$cat_id;
  
$site_db->query&#40;$sql&#41;;

  
$sql "DELETE FROM ".CATEGORIES_TABLE.
          WHERE cat_id = "
.$cat_id;

  if &
#40;$site_db->query&#40;$sql&#41;&#41; &#123;
    
echo $lang['cat_delete_success'&#93;." <b>".$cat_cache[$cat_id&#93;['cat_name'&#93;."</b> &#40;ID&#58; ".$cat_id."&#41;<br />\n";
  
&#125;
  
else &#123;
    
$error_log[&#93; = $lang['cat_delete_error'&#93;." <b>".$cat_cache[$cat_id&#93;['cat_name'&#93;."</b> &#40;ID&#58; ".$cat_id."&#41;";
  
&#125;

  
$sql "SELECT image_id 
          FROM "
.IMAGES_TABLE.
          WHERE cat_id = "
.$cat_id;
  
$img_result $site_db->query&#40;$sql&#41;;

  
$image_ids_sql 0;
  while &
#40;$image_row = $site_db->fetch_array&#40;$img_result&#41;&#41; &#123;
    
$image_ids_sql .= &#40;&#40;$image_ids_sql != ""&#41; ? ", " &#58; ""&#41;.$image_row['image_id'&#93;;
  
&#125;

  
$sql "DELETE FROM ".IMAGES_TABLE.
          WHERE image_id IN &#40;
$image_ids_sql&#41;";
  if &
#40;$site_db->query&#40;$sql&#41;&#41; &#123;
    
echo "-&raquo ".$lang['image_delete_success'&#93;."<br />\n";
  
&#125;
  
else &#123;
    
$error_log[&#93; = $lang['image_delete_error'&#93;." &#40;".$cat_cache[$cat_id&#93;['cat_name'&#93;.", ID&#58; ".$cat_id."&#41;";
  
&#125;

  
if &#40;!empty&#40;$cat_id&#41;&#41; &#123;
    
if &#40;remove_cat_folder&#40;MEDIA_PATH_FTP."/".$cat_id&#41;&#41; &#123;
      
echo "-&raquo ".$lang['file_delete_success'&#93;."<br />\n";
    
&#125;
    
else &#123;
      
$error_log[&#93; = $lang['file_delete_error'&#93;." &#40;".$cat_cache[$cat_id&#93;['cat_name'&#93;.", ID&#58; ".$cat_id."&#41;";
    
&#125;
    
if &#40;remove_cat_folder&#40;THUMB_PATH_FTP."/".$cat_id&#41;&#41; &#123;
      
echo "-&raquo ".$lang['thumb_delete_success'&#93;."<br />\n";
    
&#125;
    
else &#123;
      
$error_log[&#93; = $lang['thumb_delete_error'&#93;." &#40;".$cat_cache[$cat_id&#93;['cat_name'&#93;.", ID&#58; ".$cat_id."&#41;";
    
&#125;
  
&#125;

  
$sql "DELETE FROM ".COMMENTS_TABLE.
          WHERE image_id IN &#40;
$image_ids_sql&#41;";
  if &
#40;$site_db->query&#40;$sql&#41;&#41; &#123;
    
echo "-&raquo ".$lang['comments_delete_success'&#93;."<br />\n";
  
&#125;
  
else &#123;
    
$error_log[&#93; = $lang['comments_delete_error'&#93;." &#40;".$cat_cache[$cat_id&#93;['cat_name'&#93;.", ID&#58; ".$cat_id."&#41;";
  
&#125;

  
remove_searchwords&#40;$image_ids_sql&#41;;

  
echo "<br /></td></tr></table>\n";
  echo 
"</td></tr>\n";
  
show_table_separator&#40;$lang['sub_categories'&#93;, 1&#41;;
  
echo "<tr><td class=\"tablerow\">\n";
  if &
#40;!remove_subcategories&#40;$cat_id&#41;&#41; &#123;
    
echo $lang['no_subcategories'&#93;;
  
&#125;
  
echo "</td></tr>\n";
  
show_table_footer&#40;&#41;;
  
if &#40;!empty&#40;$error_log&#41;&#41; &#123;
    
show_table_header&#40;"Error Log&#58;", 1&#41;;
    
echo "<tr><td class=\"tablerow\">\n";
    echo 
"<table border=\"0\" cellpadding=\"\"2 cellspacing=\"0\"><tr><td>&nbsp;</td><td>\n";
    echo 
"<b>".$lang['error_log_desc'&#93;."</b>\n<ul>\n";
    
foreach &#40;$error_log as $key => $val&#41; &#123;
      
printf &#40;"<li>%s</li>\n", $val&#41;;
    
&#125;
    
echo "</ul>\n</td></tr></table>\n";
    echo 
"</td></tr>\n";
    
show_table_footer&#40;&#41;;
  
&#125;
  
echo "<p>";
  
show_text_link&#40;$lang['back_overview'&#93;,"categories.php?action=modifycats"&#41;;
&#125;

if &#40;$action == "removecat"&#41; &#123;
  
$cat_id = &#40;isset&#40;$HTTP_POST_VARS['cat_id'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_id'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['cat_id'&#93;&#41;;

  
show_form_header&#40;"categories.php", "deletecat"&#41;;
  
show_hidden_input&#40;"cat_id", $cat_id&#41;;
  
show_table_header&#40;$lang['delete'&#93;."&#58; ".$cat_cache[$cat_id&#93;['cat_name'&#93;, 2&#41;;
  
show_description_row&#40;$lang['delete_cat_confirm'&#93;&#41;;
  
show_form_footer&#40;$lang['yes'&#93;, "", 2, $lang['no'&#93;&#41;;
&#125;

if &#40;$action == "savecat"&#41; &#123;
  
$error = array&#40;&#41;;
  
$cat_name un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS['cat_name'&#93;&#41;&#41;;
  
$cat_description un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS['cat_description'&#93;&#41;&#41;;
  
$cat_parent_id intval&#40;$HTTP_POST_VARS['cat_parent_id'&#93;&#41;;
  
$cat_order = &#40;isset&#40;$HTTP_POST_VARS['cat_order'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_order'&#93;&#41; &#58; 0;

  
$auth_viewcat $HTTP_POST_VARS['auth_viewcat'&#93;;
  
$auth_viewimage $HTTP_POST_VARS['auth_viewimage'&#93;;
  
$auth_download $HTTP_POST_VARS['auth_download'&#93;;
  
$auth_upload $HTTP_POST_VARS['auth_upload'&#93;;
  
$auth_directupload $HTTP_POST_VARS['auth_directupload'&#93;;
  
$auth_vote $HTTP_POST_VARS['auth_vote'&#93;;
  
$auth_sendpostcard $HTTP_POST_VARS['auth_sendpostcard'&#93;;
  
$auth_readcomment $HTTP_POST_VARS['auth_readcomment'&#93;;
  
$auth_postcomment $HTTP_POST_VARS['auth_postcomment'&#93;;

  
if &#40;$cat_name == ""&#41; &#123;
    
$error['cat_name'&#93; = 1;
  
&#125;

  
if &#40;empty&#40;$error&#41;&#41; &#123;
    
if &#40;!$cat_order&#41; &#123;
      
$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&#40;$sql&#41;;
      
$cat_order $catorder['cat_order'&#93; + 10;
      
$do_updat_cat_order 0;
    &
#125;
    
else &#123;
      
$do_updat_cat_order 1;
    &
#125;

    
$sql "INSERT INTO ".CATEGORIES_TABLE.
            &#40;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&#41; 
            VALUES 
            &#40;'
$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&#41;";
    
$result $site_db->query&#40;$sql&#41;;
    
$cat_id $site_db->get_insert_id&#40;&#41;;

    
if &#40;$result && $cat_id&#41; &#123;
      
if &#40;$do_updat_cat_order&#41; &#123;
        
update_cat_order&#40;$cat_parent_id&#41;;
      
&#125;
      
$msg $lang['cat_add_success'&#93;;
      
create_cat_folder&#40;MEDIA_PATH_FTP."/".$cat_id, CHMOD_DIRS&#41;;
      
create_cat_folder&#40;THUMB_PATH_FTP."/".$cat_id, CHMOD_DIRS&#41;;
    
&#125;
    
else &#123;
      
$msg $lang['cat_add_error'&#93;;
    
&#125;
    
$action "modifycats";
  &
#125;
  
else &#123;
    
$msg sprintf&#40;"<span class=\"marktext\">%s</span>", $lang['lostfield_error'&#93;&#41;;
    
$action "addcat";
  &
#125;
&#125;

if &#40;$action == "addcat"&#41; &#123;
  
if &#40;$msg != ""&#41; &#123;
    
printf&#40;"<b>%s</b>\n", $msg&#41;;
  
&#125;

  
show_form_header&#40;"categories.php", "savecat"&#41;;
  
show_table_header&#40;$lang['nav_categories_add'&#93;, 2&#41;;
  
show_input_row&#40;$lang['field_category_name'&#93;, "cat_name", "", $textinput_size&#41;;
  
show_textarea_row&#40;$lang['field_description_ext'&#93;, "cat_description", "", $textarea_size&#41;;
  
$cat_parent_id = &#40;isset&#40;$HTTP_GET_VARS['cat_parent_id'&#93;&#41;&#41; ? $HTTP_GET_VARS['cat_parent_id'&#93; &#58; 0;
  
show_cat_select_row&#40;$lang['field_parent'&#93;, $cat_parent_id, 1&#41;;

  //show_custom_row&#40;$lang['cat_order'&#93;, get_cat_order_dropdown&#40;$cat_parent_id&#41;&#41;;

  
$permission_headline $lang['permissions'&#93;;
  
if &#40;$cat_parent_id != 0&#41; &#123;
    
$new_access_field_array = array&#40;&#41;;

    
$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&#40;$sql&#41;;

    
foreach &#40;$access_field_array as $key => $val&#41; &#123;
      
$new_access_field_array[$key&#93; = $row[$key&#93;;
    
&#125;
    
unset&#40;$access_field_array&#41;;
    
$access_field_array $new_access_field_array;
    
$permission_headline .= "<span class=\"smalltext\"><br>".$lang['permissions_inherited'&#93;." &#40;".$row['cat_name'&#93;."&#41;</span>";
  
&#125;

  
show_table_separator&#40;$permission_headline, 2&#41;;
  
foreach &#40;$access_field_array as $key => $val&#41; &#123;
    
show_access_select&#40;$lang[$key&#93;, $key, $val&#41;;
  
&#125;

  
show_form_footer&#40;$lang['add'&#93;, $lang['reset'&#93;, 2&#41;;
&#125;

if &#40;$action == "updatecat"&#41; &#123;
  
$error = array&#40;&#41;;
  
$cat_id = &#40;isset&#40;$HTTP_POST_VARS['cat_id'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_id'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['cat_id'&#93;&#41;;

  
$cat_parent_id intval&#40;$HTTP_POST_VARS['cat_parent_id'&#93;&#41;;
  
$cat_name un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS['cat_name'&#93;&#41;&#41;;
  
$cat_description un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS['cat_description'&#93;&#41;&#41;;
  
$cat_hits intval&#40;trim&#40;$HTTP_POST_VARS['cat_hits'&#93;&#41;&#41;;

  
$auth_viewcat $HTTP_POST_VARS['auth_viewcat'&#93;;
  
$auth_viewimage $HTTP_POST_VARS['auth_viewimage'&#93;;
  
$auth_download $HTTP_POST_VARS['auth_download'&#93;;
  
$auth_upload $HTTP_POST_VARS['auth_upload'&#93;;
  
$auth_directupload $HTTP_POST_VARS['auth_directupload'&#93;;
  
$auth_vote $HTTP_POST_VARS['auth_vote'&#93;;
  
$auth_sendpostcard $HTTP_POST_VARS['auth_sendpostcard'&#93;;
  
$auth_readcomment $HTTP_POST_VARS['auth_readcomment'&#93;;
  
$auth_postcomment $HTTP_POST_VARS['auth_postcomment'&#93;;

  
if &#40;$cat_parent_id == $cat_id&#41; &#123;
    
$msg .= sprintf&#40;"<span class=\"marktext\">%s</span><br />", $lang['parent_cat_error'&#93;&#41;;
    
$error['cat_parent_id'&#93; = 1;
  
&#125;
  
if &#40;$cat_name == ""&#41; &#123;
    
$error['cat_name'&#93; = 1;
  
&#125;

  
if &#40;empty&#40;$error&#41;&#41; &#123;
    
$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&#40;$sql&#41;;

    
$msg = &#40;$result&#41; ? $lang['cat_edit_success'&#93; &#58; $lang['cat_edit_error'&#93;;
    
$action "modifycats";
  &
#125;
  
else &#123;
    
$msg .= sprintf&#40;"<span class=\"marktext\">%s</span>", $lang['lostfield_error'&#93;&#41;;
    
$action "editcat";
  &
#125;
&#125;

if &#40;$action == "editcat"&#41; &#123;
  
if &#40;$msg != ""&#41; &#123;
    
printf&#40;"<b>%s</b>\n", $msg&#41;;
  
&#125;
  
$cat_id = &#40;isset&#40;$HTTP_POST_VARS['cat_id'&#93;&#41;&#41; ? intval&#40;$HTTP_POST_VARS['cat_id'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['cat_id'&#93;&#41;;

  
$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&#40;$sql&#41;;

  
show_form_header&#40;"categories.php", "updatecat"&#41;;
  
show_hidden_input&#40;"cat_id", $cat_id&#41;;
  
show_table_header&#40;$lang['nav_categories_edit'&#93;, 2&#41;;
  
show_input_row&#40;$lang['field_category_name'&#93;, "cat_name", $result['cat_name'&#93;, $textinput_size&#41;;
  
show_textarea_row&#40;$lang['field_description_ext'&#93;, "cat_description", $result['cat_description'&#93;, $textarea_size&#41;;
  
show_cat_select_row&#40;$lang['field_parent'&#93;, $result['cat_parent_id'&#93;, 1&#41;;
  
show_input_row&#40;$lang['field_hits'&#93;, "cat_hits", $result['cat_hits'&#93;, 5&#41;;

  
show_table_separator&#40;$lang['permissions'&#93;, 2&#41;;
  
foreach &#40;$access_field_array as $key => $val&#41; &#123;
    
show_access_select&#40;$lang[$key&#93;, $key, $result[$key&#93;&#41;;
  
&#125;

  
show_form_footer&#40;$lang['save_changes'&#93;, $lang['reset'&#93;, 2, $lang['back'&#93;&#41;;
&#125;

if &#40;$action == "modifycats"&#41; &#123;
  
if &#40;$msg != ""&#41; &#123;
    
printf&#40;"<b>%s</b>\n<p>", $msg&#41;;
  
&#125;

  
$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&#40;$sql&#41;;

  
$category_cache = array&#40;&#41;;
  
while &#40;$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123;
    
$category_cache[$row['cat_parent_id'&#93;&#93;[$row['cat_id'&#93;&#93; = $row;
  
&#125;

  
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'&#93;."</td>\n<td class=\"tableseparator\" align=\"center\">".$lang['cat_order'&#93;."</td>\n</tr>\n";
  
if &#40;sizeof&#40;$category_cache&#41; == 0&#41; &#123;
    
echo "<tr class=\"".get_row_bg&#40;&#41;."\">\n<td colspan=\"2\">".$lang['no_categories'&#93;."</td></tr>";
  
&#125;
  
else &#123;
    
show_category_rows&#40;&#41;;
  
&#125;
  
show_table_footer&#40;&#41;;
&#125;
show_admin_footer&#40;&#41;;
?>

[/code]

Offline OpenGL

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: hi
« Reply #24 on: April 12, 2003, 12:17:11 PM »
Quote from: Kamui
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 ?


i did try new camo93's categories.php but nothing happened... i dont know how to resolve this problem....
Help me plz...............

Offline treblecharger

  • Pre-Newbie
  • Posts: 1
    • View Profile
[MOD] for Bypassing The SAFE MODE
« Reply #25 on: April 17, 2003, 09:35:40 PM »
I installed it, and did everything you said to bypass the safe mode, but i still get this error:

Quote
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


what am i doing wrong?

Offline mjt123

  • Pre-Newbie
  • Posts: 2
    • View Profile
Ftp will not make Dir. ---Not sure if global is edited right
« Reply #26 on: April 19, 2003, 08:21:52 PM »
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

Offline Nightfall

  • Pre-Newbie
  • Posts: 1
    • View Profile
[MOD] for Bypassing The SAFE MODE
« Reply #27 on: May 01, 2003, 04:33:22 PM »
I have tried to use both the full path and only the /4images/data/media
They both didn't work The problem is as follows:

Warning: ftp_mkdir(): /home/virtual/site4/fst/var/www/html/4images/data/media/25: No such file or directory in /home/virtual/site4/fst/var/www/html/4images/admin/categories.php on line 91

Warning: ftp_mkdir(): /home/virtual/site4/fst/var/www/html/4images/data/thumbnails/25: No such file or directory in /home/virtual/site4/fst/var/www/html/4images/admin/categories.php on line 91
Category added

It only adds category to database no change in ftp

Pls help thanks.

Offline Qais

  • Newbie
  • *
  • Posts: 24
    • View Profile
[MOD] for Bypassing The SAFE MODE
« Reply #28 on: May 26, 2003, 09:14:18 PM »
i did all the configuration
but again
i'm getting this error
asked host to change the server mode but they said no they can't change it...



can anybody help me...

i'm getting this error

Warning: SAFE MODE Restriction in effect. The script whose uid is 504 is not allowed to access ./../data/media/7 owned by uid 48 in /home/virtual/site2/fst/var/www/html/photos/admin/checkimages.php on line 191


help?

Offline ib41

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: Ftp will not make Dir. ---Not sure if global is edited right
« Reply #29 on: June 01, 2003, 05:45:42 AM »
Quote from: mjt123
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




 "/home.com/httpdocs/4images/data/media");  

you dont need the RED area, also, you should only leave the 4images in IF your folder is created  in your server as 4images

you should RENAME "4images" to the CORRECT NAME of your 4images "FOLDER".
People gain a lil authority and suddenly they think they're god
then you tell them the truth and they can't handle it
so they abuse the power bestowed upon them