[PHP} - Need some help in recoding a script menu

User Tag List

Results 1 to 10 of 10
  1. #1
    JediPwN's Avatar Member
    Reputation
    1
    Join Date
    Aug 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PHP} - Need some help in recoding a script

    Hey guys. I got a Problem with a script that did the following Things:

    In Germany there are many house-dealers which are using CRM Systems like OnOffice.com or Flowfact. These are Management-Systems. You can enter all Details for an house and can spread it onto different Portals like immoscout24.de , Immonet.de etc... These CRMS have the Option to Export the data onto own Portals like wordpress etc. This is called OpenImmo.

    There is where the Trouble starts. the customer got a script which has worked as the following:

    PHP Code:
    foreach ( $folder_names as $real_estate_id ) :

                
    $folder_path    $this->open_immo_path $real_estate_id;
                
    $xml_path        $folder_path '/' $real_estate_id '.xml';

                
    $xml_obj        simplexml_load_file$xml_path ); 

    open_immo_path has been declared and this has worked already. But the customer has Chosen to leave OnOffice and move to FlowFact and they are exoprting the same way but the XML has got an another Name than the Folder so the script does not work.
    However, i am not a pro at this. I Need help - Of Course not for free!.
    What i Need now is something like that:

    PHP Code:
    foreach ( $folder_names as $real_estate_id ) :

                
    $folder_path    $this->open_immo_path $real_estate_id;
                
    $xml_path        $folder_path '/' $real_XML_name.;

                
    $xml_obj        simplexml_load_file$xml_path ); 
    $real_XML_Name - Can somebody help me to fill it?

    i tried to mess around with glob a bit but only got full Errors which stopped wordpress at all.

    [PHP} - Need some help in recoding a script
  2. #2
    Tronux's Avatar Active Member
    Reputation
    42
    Join Date
    Jun 2009
    Posts
    90
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That code snippet should stay the same, what you need to do is change the value's in the $folder_names array to the new ones.

  3. Thanks Ket, HI5, stoneharry (3 members gave Thanks to Tronux for this useful post)
  4. #3
    JediPwN's Avatar Member
    Reputation
    1
    Join Date
    Aug 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No because the $Folder_names are generated from the zipfile´s Name. in this zipfile should be an XML file which has the same Name but thats not the case anymore. only way is to find the right Name of the XML file and load it for parsing.

    How can i find out the Name ? is there a load all Feature or something?

  5. #4
    Tronux's Avatar Active Member
    Reputation
    42
    Join Date
    Jun 2009
    Posts
    90
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://php.net/manual/en/function.rename.php
    To rename the .xml

    And
    function chopExtension($filename) {
    return substr($filename, 0, strrpos($filename, '.'));
    }

    to get the name of the .zip without the extension.
    Last edited by Tronux; 10-06-2015 at 07:08 AM.

  6. Thanks Ket, HI5, stoneharry (3 members gave Thanks to Tronux for this useful post)
  7. #5
    JediPwN's Avatar Member
    Reputation
    1
    Join Date
    Aug 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tronux View Post
    PHP: rename - Manual
    To rename the .xml

    And
    function chopExtension($filename) {
    return substr($filename, 0, strrpos($filename, '.'));
    }

    to get the name of the .zip without the extension.



    hm. no renaming is needed. i Need to find the Name of the XML . then i can save it in $real_xml_name and edit it to:
    PHP Code:
    foreach ( $folder_names as $real_estate_id ) : 

                
    $folder_path    $this->open_immo_path $real_estate_id
                
    $xml_path        $folder_path '/' $real_XML_name.; 

                
    $xml_obj        simplexml_load_file$xml_path ); 

  8. #6
    Tronux's Avatar Active Member
    Reputation
    42
    Join Date
    Jun 2009
    Posts
    90
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a function to read the zip file. I hope you can locate the .xml you need or otherwise call flowfact for how that .xml file is getting named when put in the .zip.

    <?php

    /*
    * PHP Zip - Open a zip archive and list files
    */

    //create a ZipArchive instance
    $zip = new ZipArchive;
    //open the archive
    if ($zip->open('data/test112.zip') === TRUE) {
    //iterate the archive files array and display the filename or each one
    for ($i = 0; $i < $zip->numFiles; $i++) {
    echo 'Filename: ' . $zip->getNameIndex($i) . '<br />';
    }
    } else {
    echo 'Failed to open the archive!';
    }
    ?>

  9. Thanks Ket, HI5, stoneharry (3 members gave Thanks to Tronux for this useful post)
  10. #7
    JediPwN's Avatar Member
    Reputation
    1
    Join Date
    Aug 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tronux View Post
    This is a function to read the zip file. I hope you can locate the .xml you need or otherwise call flowfact for how that .xml file is getting named when put in the .zip.

    <?php

    /*
    * PHP Zip - Open a zip archive and list files
    */

    //create a ZipArchive instance
    $zip = new ZipArchive;
    //open the archive
    if ($zip->open('data/test112.zip') === TRUE) {
    //iterate the archive files array and display the filename or each one
    for ($i = 0; $i < $zip->numFiles; $i++) {
    echo 'Filename: ' . $zip->getNameIndex($i) . '<br />';
    }
    } else {
    echo 'Failed to open the archive!';
    }
    ?>
    could you download anydesk from anydesk.de? so i can Show you the exact Problem

  11. #8
    Tronux's Avatar Active Member
    Reputation
    42
    Join Date
    Jun 2009
    Posts
    90
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sry I couldn't help you, I wont be able to make time today to help you further.

  12. #9
    JediPwN's Avatar Member
    Reputation
    1
    Join Date
    Aug 2015
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay, thank you anyway

  13. #10
    Veritable's Avatar OwnedCore News Correspondent
    Reputation
    326
    Join Date
    Apr 2007
    Posts
    372
    Thanks G/R
    52/123
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

Similar Threads

  1. Need some help with unlocked LUA scripting (UnitBuff)
    By ownedpandas in forum WoW UI, Macros and Talent Specs
    Replies: 0
    Last Post: 10-13-2016, 10:55 AM
  2. [Lua Script] Need some help with my lua script
    By riizu in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-13-2010, 01:40 AM
  3. Need some help with LUA script
    By SupernovaHH in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2009, 07:25 AM
  4. Noob LUA script, need some help.
    By pancakebuddy in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-14-2008, 08:33 AM
  5. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
All times are GMT -5. The time now is 07:08 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search