Results 1 to 7 of 7

Thread: Background Pic not been deleted (admin panel)

  1. #1
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Unhappy Background Pic not been deleted (admin panel)

    Hi.

    I need some help here, when a member uploads a background picture when customizing his/her profile, it cannot be deleted physically from the admin panel, if the member deletes it at profile_customize.php by either hitting the reset button or checking the delete checkbox and hitting save changes, it works fine.

    If you, as the admin, are moderating uploaded background pictures, you can check the checkboxes of the ones you want to delete, then you hit delete and it erases it from the database, but the file itself is still saved at the server, I was checking the code for this at admin/post_mod_profiles.php and the code for the file to be deleted is there but I don't know why it doesn't actually delete the background image file.

    This admin/post_mod_profiles.php doesn't have to much code so it should be easy to check, most of what I was checking is at this file after the line: elseif ( $_POST['delete'] )

    I also checked, for reference, the file profile_customize.php since from there these background picture files do get deleted as they should.

    Please, any help would be very appreciated, thanks.
    Using modified Dolphin 5.6.0002 hosted at shared server

  2. #2
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Unhappy

    Anybody?? haven't been able to fix it yet

    By the way, when I said that the background picture cannot be deleted physically from the admin panel, I meant that the file is not been deleted physically from the server by using the admin panel feature to confirm or delete them (At the admin panel, at the initial page, at the section with the title: POSTMODERATION, the link "Background images"). Just in case it was not clear at post #1.

    Help please. Thanks in advance.
    Last edited by elusuario; 05-09-2007 at 02:31 AM.
    Using modified Dolphin 5.6.0002 hosted at shared server

  3. #3
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Unhappy

    Still having the same problem, I think the problem might be at admin/post_mod_profiles.php, It might be this part of the code at that file, but I'm not sure if it is or how to fix:

    Code:
    if ( $_POST['confirm'] )
    {
        $query = '';
        foreach ( $_POST as $key => $value )
        {
    
    	if ( 'mem' == $value )
    	    $query .= " IDMember = '$key' OR ";
        }
    
        $query = "UPDATE ProfilesSettings SET `Status` = 'Active' WHERE " . $query . " '1'='0' ";
    
        db_res( $query );
    
    }
    elseif ( $_POST['delete'] )
    {
    
        $query = '';
        foreach ( $_POST as $key => $value )
        {
    
    	if ( 'mem' == $value )
    	    $query .= " IDMember = '$key' OR ";
        }
    
        $query1 = "SELECT `BackgroundFilename` FROM ProfilesSettings WHERE " . $query . " '1'='0' ";
        $arr = db_res( $query1 );
        while ( $arr = mysql_fetch_array( $res ) )
        {
    	 if (file_exists($dir['profileBackground'] . $arr['BackgroundFilename'])) unlink($dir['profileBackground'] . $arr['BackgroundFilename']);
        }
    
        $query2 = "UPDATE ProfilesSettings SET `BackgroundFilename` = '' WHERE " . $query . " '1'='0' ";
    
        db_res( $query2 );
    
    }
    Also I noticed something else, when a member tries to upload a background picture with a file size bigger than the allowed max photo file size (you get a blank page after trying to upload) it is not applied to be the background image (which is ok), but the image is uploaded to the server, this is wasting hard disk space.

    How can I set it to NOT upload the background image file if it's size is bigger than the allowed max photo file size?

    I think this problem have something to do with the function moveUploadedImage located at inc/images.inc.php. Maybe this part of the code, but I'm not sure if it is or how to fix:

    Code:
    function moveUploadedImage( $_FILES, $fname, $path_and_name, $maxsize='', $imResize='true' )
    {
    	global $max_photo_height;
    	global $max_photo_width;
    
    	$height = $max_photo_height;
    	if ( !$height )
    		$height = 400;
    	$width = $max_photo_width;
    	if ( !$width )
    		$width = 400;
    
    	if ( $maxsize && ($_FILES[$fname]['size'] > $maxsize || $_FILES[$fname]['size'] == 0) )
    	{
    		if ( file_exists($_FILES[$fname]['tmp_name']) )
    		{
    			unlink($_FILES[$fname]['tmp_name']);
    		}
    		return false;
    	}
    	else
    	{
    		$scan = getimagesize($_FILES[$fname]['tmp_name']);
    
    		if ( ($scan['mime'] == 'image/jpeg' && $ext = '.jpg' ) || ( $scan['mime'] == 'image/gif' && $ext = '.gif' ) ||
    			( $scan['mime'] == 'image/png' && $ext = '.png' ) || ( $scan['mime'] == 'image/bmp' && $ext = '.bmp' ) )
    		{
    
    			$path_and_name .= $ext;
    			move_uploaded_file( $_FILES[$fname]['tmp_name'], $path_and_name );
    
    			if ( $imResize )
    			    imageResize( $path_and_name, $path_and_name, $width, $height );
    
    		}
    		else
    		{
    			return IMAGE_ERROR_WRONG_TYPE;
    		}
    	}
    
    	return $ext;
    }
    Help please.
    Last edited by elusuario; 05-09-2007 at 06:40 PM.
    Using modified Dolphin 5.6.0002 hosted at shared server

  4. #4

    Join Date
    Apr 2007
    Posts
    5

    Default bugs??

    Not that I have alot of experience to help you, but one thing that has helped me on my site is to check the email that you set up your 'bugs' to go to, and also check your error.log file in your public_html directory somewhere. This has helped me out immensly.

    I am still experimenting with my site, so I don't know if I have, or will have the same background problem yet, as I haven't gotten tested up to that point yet.

  5. #5
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Cool

    Well, basic1, thank you for at least saying something, sometimes I think the threads I start are only for me :S jajaja

    I guess many people don't care about keeping worthless files at their servers wasting hard disk space, I did find a solution to the background image not been deleted physically from the server when attempting to delete if from the admin panel (the background image that can be set by members at customize profile).

    By the way, the same problem is present when post-moderating profile pics, if you unapprove/delete them at the admin panel they are not deleted physically from the server:

    For Background Pictures:

    At admin/post_mod_profiles.php:

    Below:
    Code:
    $arr = db_res( $query1 );
    Add:
    Code:
    $res = db_res( $query1 );
    For Profile Photos:

    At admin/post_mod_photos.php:

    Above:
    Code:
    $sIconFile = $dir['profileImage'] . $aPhoto['med_prof_id'] . '/icon_' . $aPhoto['med_file'];
    Add:
    Code:
    $aPhoto = db_arr( "SELECT * FROM `media` WHERE `med_id` = '$iPhotoID';" );
    I'll continue working about the other problem I mentioned before at this thread tomorrow to see what I can get.

    Take care.
    Using modified Dolphin 5.6.0002 hosted at shared server

  6. #6
    skyhawk85u
    Guest

    Default

    Oh, up above is what you mentioned in a PM and is a MAJOR problem for me now (in another thread.) With register_globals off, when a user tries to upload a larger picture (400 kb) they get to just a blank page and nothing else happens. Smaller pictures always work and with register_globals on there is no problem. And now that you've pointed it out, I see a bunch of large photos in the file system that never made it into the site. Nothing in any logs. This is a MAJOR showstopper because I'll need to either leave register_globals on or hope my users don't try to upload large files, neither of which is acceptable.
    Last edited by skyhawk85u; 05-11-2007 at 09:43 PM.

  7. #7
    elusuario's Avatar
    Join Date
    Sep 2006
    Posts
    173

    Exclamation

    Just for reference, the thread mentioned by skyhawk85u is:

    Blank Page After Uploading Larger Images
    Blank Page After Uploading Larger Images
    Using modified Dolphin 5.6.0002 hosted at shared server

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. help !!....admin panel
    By BUGGY in forum General Troubleshooting
    Replies: 5
    Last Post: 11-14-2007, 06:18 AM
  2. BUG FIX: Images are not deleted from server (admin mode)
    By vanarie in forum Bugs Dolphin 6.02
    Replies: 0
    Last Post: 10-17-2007, 09:40 PM
  3. Members not really Deleted from admin panel
    By Prometheus in forum Bugs and Fixes
    Replies: 7
    Last Post: 05-23-2006, 09:53 PM
  4. Members not really Deleted from admin panel
    By Prometheus in forum Bugs aeDating v4.1.3
    Replies: 3
    Last Post: 05-23-2006, 09:30 PM
  5. Need help with getting to Admin panel!
    By LG in forum General Troubleshooting
    Replies: 6
    Last Post: 07-03-2005, 12:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •