Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Retrieving External images

  1. #11
    Join Date
    Feb 2005
    Location
    BiH
    Age
    39
    Posts
    811

    Default Re: Retrieving External images

    and 2nd q: if I delete agent (all listings are deleted too, correct?) will it also delete images for those listings?

  2. #12
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Retrieving External images

    Quote Originally Posted by bit View Post
    and 2nd q: if I delete agent (all listings are deleted too, correct?) will it also delete images for those listings?
    Yes, in fact you should get a warning when you do it.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  3. #13
    Join Date
    Feb 2005
    Location
    BiH
    Age
    39
    Posts
    811

    Default Re: Retrieving External images

    OK, tnx. Yes I know that. What has made me confused is conversation with an developer who said he is making an addont that will clean image directory from orphan files. hmm I said, doesnt OR do that by default (when U delete listing it should delete images too? now I know answer

  4. #14
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Retrieving External images

    Quote Originally Posted by bit View Post
    OK, tnx. Yes I know that. What has made me confused is conversation with an developer who said he is making an addont that will clean image directory from orphan files. hmm I said, doesnt OR do that by default (when U delete listing it should delete images too? now I know answer
    When using an import add-on, sometimes situations occur where the import is not allowed to complete or is interrupted. Since the add-on should normally remove any "expired" listings and photos, and it was not allowed to complete, this can leave "orphaned images". Also, not all import add-ons deal with expired listing photos, and they simply remove the listing data from the OR DB without physically removing the photos, creating "orphans".

    If you are using the OR listing management interface exclusively to add/remove photos, "orphaned" photos won't normally occur.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  5. #15
    Join Date
    Feb 2005
    Location
    BiH
    Age
    39
    Posts
    811

    Default Re: Retrieving External images

    tnx. hmmm.. than I need to put that addon on my addon wish list it makes sense to have it as I plan to start using importer.

    As we are already talking about deletion of listings/images, etc, Id like to know is it possible to delete all listings from an agent but to not delete him, or better to ask is there such function already in OR, that can be used for creation of an addon for such task? Main reason to have it is this what you just explained (if something goes wrong with import, Id like to be able to delete all listings from that agent).

  6. #16
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default Re: Retrieving External images

    Quote Originally Posted by bit View Post
    tnx. hmmm.. than I need to put that addon on my addon wish list it makes sense to have it as I plan to start using importer.

    As we are already talking about deletion of listings/images, etc, Id like to know is it possible to delete all listings from an agent but to not delete him, or better to ask is there such function already in OR, that can be used for creation of an addon for such task? Main reason to have it is this what you just explained (if something goes wrong with import, Id like to be able to delete all listings from that agent).
    There is not an existing function to remove listings without also removing the Agent. You can accomplish most of what you need with simple SQL:
    Code:
    DELETE  FROM default_en_listingsdb WHERE userdb_id ='X';
    DELETE  FROM default_en_listingsdbelements WHERE userdb_id ='X';
    DELETE  FROM default_en_listingsimages WHERE userdb_id ='X';
    X is the Agent ID# for the Agent which you want to remove listings.

    Physically removing the photos from the server is another much more involved matter, and why a lot of rudimentary import scripts leave orphaned images.
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  7. #17
    Join Date
    Feb 2004
    Posts
    1,085

    Default Re: Retrieving External images

    bit, here is a function to delete the user's listings without deleting the user.
    Code:
    // Delete listings from a user
        function addonname_delete_listings() {
            global $conn, $lang, $config;
            require_once($config['basepath'] . '/include/misc.inc.php');
            $misc = new misc();
            require_once($config['basepath'] . '/include/listing_editor.inc.php');
            $userid = '413';
            $sql = "SELECT listingsdb_id FROM " . $config['table_prefix'] . "listingsd
    b WHERE userdb_id = '$userid'";
            $rs = $conn->Execute($sql);
            if ($rs === false) {
                $misc->log_error($sql);
            }
            while (!$rs->EOF) {
                $ListingID = $rs->fields['listingsdb_id'];
                    $display .= listing_editor::delete_listing($ListingID, false);
                    $rs->MoveNext();
             }
            $display .= 'Delete user $userid listings done';
            return $display;
        }

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
  •