Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter photospirit

    (@photospirit)

    Hi,

    thanks for the quick reply. It was really strange… it didn’t work in my Firefox Browser (even though cache was cleared). Just tried it with Chrome and everything works as expected.

    you can close the Ticket ??

    Best, Chris

    @jtempelman , yes now it worked…rollback didn’t worked the first time on one of my network instances… but now everything went smooth back to 1.9.175

    thanks for the hint.

    agree, also my sites are all down using the latest version of the plugin.. generating the fatal error. Need an urgent fix

    Thread Starter photospirit

    (@photospirit)

    Hi,

    thanks for that, but has no effect.. still same behaviour.
    Anything else I need to consider?

    Thanks, Chris

    Thread Starter photospirit

    (@photospirit)

    Hi,

    thanks again for your great help. As a temporary solution I’m using now the “else” statement for each pic, which is now working fine.

    I will now work on restructuring the file, which was done by another developer (I even paid for it)…

    Anyway, gives me some good learning lessons in PHP ??

    Thanks again…Chris

    Thread Starter photospirit

    (@photospirit)

    ok, thanks for the quick reply and help.

    Each line in the txt-file has a predefined set of 185 fields. I need to have all of the fields populated in the txt-file, even though they are empty. So if no value is found than I have a # as an empty field.

    If I would unset the array for each pic, where would I need to do that?

    Thanks again, Chris

    Thread Starter photospirit

    (@photospirit)

    That’s what I thought as well, but it doesn’t work with

    unset ($files['imagename']);

    I use the variables pic1, pic2, etc. to write the result into a txt-file (beside some other infos about the real-estate). The txt-file incl. the images is then being uploaded to various real-estate portals. So not sure if that would also work with your suggestion. I might give a try.

    So my whole code for creating the txt-file with all the relevant variables is as follows. Maybe there are some errors here?

    
    $txt = "";
    foreach($data as $id)
    {
            
        $meta = get_post_meta($id);
        $files = array();
        $post_data = get_post($id);
        $post_description = $post_data->post_content;
        $post_description = trim(preg_replace('/\s\s+/', ' ', $post_description));
        $post_description = str_replace(array('</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>'), array('</b><br />', '</b><br />', '</b><br />', '</b><br />', '</b><br />', '</b><br />'), $post_description);
        // Replace opening b and i tags
        $post_description = preg_replace(array('<code>(<h1)([^\w])</code>i', '<code>(<h2)([^\w])</code>i', '<code>(<h3)([^\w])</code>i', '<code>(<h4)([^\w])</code>i', '<code>(<h5)([^\w])</code>i', '<code>(<h6)([^\w])</code>i'), array("<br /><br /><b$2", "<br /><br /><b$2", "<br /><br /><b$2", "<br /><br /><b$2", "<br /><br /><b$2", "<br /><br /><b$2"), $post_description);
        $type = wp_get_post_terms($id, 'property_type');
        $label = wp_get_post_terms($id, 'property_label');
        $prop_label = $label[0]->name;
        $status = wp_get_post_terms($id, 'property_status');
        $prop_status = $status[0]->name;
        $proptype = $type[0]->name;
        $city1 = wp_get_post_terms($id, 'property_city');
        $propcity = $city1[0]->name;
        $files['images'][] = ABSPATH . parse_url(wp_get_attachment_url(get_post_thumbnail_id( $id )), PHP_URL_PATH);
        $files_all['video'][] = $files['video'][] = ABSPATH . parse_url(wp_get_attachment_url( $meta[fave_video_image][0] ),PHP_URL_PATH);
        $files['images'][] = ABSPATH . parse_url(wp_get_attachment_url( $meta[fave_prop_slider_image][0] ),PHP_URL_PATH);
        $address = $meta['fave_property_address'][0];
        $zip = $meta['fave_property_zip'][0];
        $country = $meta['fave_property_country'][0];
        $avail_from =$meta['fave_property_price_prefix'][0];
        $sale_price = $meta['fave_property_price'][0];
        $rent_price = $meta['fave_property_price'][0];
        $title = get_the_title($id);
        $rooms = $meta['fave_property_bedrooms'][0];
        $property_size = $meta['fave_property_size'][0];
        $property_land = $meta['fave_property_land'][0];
        $property_year = $meta['fave_property_year'][0];
        $property_garage = $meta['fave_property_garage'][0];
        if(!empty($property_garage))
        {
            $garage = 'Y';
        }
        $property_id = ($id);
        $agent_name = get_the_title($meta['fave_agents'][0]);
        $videos_name = $meta['fave_video_image'][0];
        $video_title = get_the_title($meta['fave_video_image'][0]);
        $images =  $meta['fave_property_images'];
        $object_link = get_permalink($id);
        $distance_public_transport = $meta['fave_property_distance_public_transport'][0];
        $distance_shop = $meta['fave_property_distance_shop'][0];
        $distance_kindergarten = $meta['fave_property_distance_kindergarten'][0];
        $distance_school1 = $meta['fave_property_distance_school1'][0];
        $distance_school2 = $meta['fave_property_distance_school2'][0];
                
        $attachments = $meta['fave_attachments'];
        $docname = basename(parse_url(wp_get_attachment_url( $meta['fave_attachments'][0] ), PHP_URL_PATH));
        $doctitle = get_the_title($meta['fave_attachments'][0]);
        if(!empty($attachments))
        {
            foreach($attachments as $attach)
            {
                $filepath = parse_url(wp_get_attachment_url( $attach ), PHP_URL_PATH);
                $files_all['attachments'][] = $files['attachments'][] = ABSPATH . $filepath;
            }
        }
        
        unset ($files['imagename']);
        foreach($images as $image)
        {
            $path = parse_url(wp_get_attachment_url( $image ), PHP_URL_PATH);
            $files_all['images'][] = $files['images'][] = ABSPATH . $path;
            $files['title'][] = get_the_title($image);
            $files['imagename'][] = basename(ABSPATH . $path);
        }
    
        if(!empty($files['imagename'][0]))
        {
            $pic1_filename = $files['imagename'][0];
            $pic1_title = $files['title'][0];
        }
        
        if(!empty($files['imagename'][1]))
        {
            $pic2_filename = $files['imagename'][1];
            $pic2_title = $files['title'][1];
        }
                        
        if(!empty($files['imagename'][2]))
        {
            $pic3_filename = $files['imagename'][2];
            $pic3_title = $files['title'][2];
        }
        
        if(!empty($files['imagename'][3]))
        {
            $pic4_filename = $files['imagename'][3];
            $pic4_title = $files['title'][3];
        }
        
        if(!empty($files['imagename'][4]))
        {
            $pic5_filename = $files['imagename'][4];
            $pic5_title = $files['title'][4];
        }
        
        if(!empty($files['imagename'][5]))
        {
            $pic6_filename = $files['imagename'][5];
            $pic6_title = $files['title'][5];
        }
    
        if(!empty($files['imagename'][6]))
        {
            $pic7_filename = $files['imagename'][6];
            $pic7_title = $files['title'][6];
        }
        
        if(!empty($files['imagename'][7]))
        {
            $pic8_filename = $files['imagename'][7];
            $pic8_title = $files['title'][7];
        }
        
        if(!empty($files['imagename'][8]))
        {
            $pic9_filename = $files['imagename'][8];
            $pic9_title = $files['title'][8];
        }
        
        if(!empty($files['imagename'][9]))
        {
            $pic10_filename = $files['imagename'][9];
            $pic10_title = $files['title'][9];
        }
        
        if(!empty($files['imagename'][10]))
        {
            $pic11_filename = $files['imagename'][10];
            $pic11_title = $files['title'][10];
        }
        
        if(!empty($files['imagename'][11]))
        {
            $pic12_filename = $files['imagename'][11];
            $pic12_title = $files['title'][11];
        }
        
        if(!empty($files['imagename'][12]))
        {
            $pic13_filename = $files['imagename'][12];
            $pic13_title = $files['title'][12];
        }
    
        if($prop_label == "Wohnung")
        {
            $prop_label = 1;
        }
        if($prop_label == "Maisonette / Duplex")
        {
            $prop_label = 2;
        }
        if($prop_label == "Attikawohnung")
        {
            $prop_label = 3;
        }
        if($prop_label == "Dachwohnung")
        {
            $prop_label = 4;
        }
        if($prop_label == "Studio")
        {
            $prop_label = 5;
        }
        if($prop_label == "Einzelzimmer")
        {
            $prop_label = 6;
        }
        if($prop_label == "M?bliertes Wohnobjekt")
        {
            $prop_label = 7;
        }
        if($prop_label == "Terrassenwohnung")
        {
            $prop_label = 8;
        }
        if($prop_label == "Einliegerwohnung")
        {
            $prop_label = 9;
        }
        if($prop_label == "Loft")
        {
            $prop_label = 10;
        }
        if($prop_label == "Mansarde")
        {
            $prop_label = 11;
        }
        if($prop_label == "Einfamilienhaus")
        {
            $prop_label = 1;
        }
        if($prop_label == "Reihenfamilienhaus")
        {
            $prop_label = 2;
        }
        if($prop_label == "Doppeleinfamilienhaus")
        {
            $prop_label = 3;
        }
        if($prop_label == "Terrassenhaus")
        {
            $prop_label = 4;
        }
        if($prop_label == "Villa")
        {
            $prop_label = 5;
        }
        if($prop_label == "Bauernhaus")
        {
            $prop_label = 6;
        }
        if($prop_label == "Mehrfamilienhaus")
        {
            $prop_label = 7;
        }
        if($prop_label == "H?hlen- / Erdhaus")
        {
            $prop_label = 9;
        }
        if($prop_label == "Schloss")
        {
            $prop_label = 10;
        }
        if($prop_label == "St?ckli")
        {
            $prop_label = 11;
        }
        if($prop_label == "Chalet")
        {
            $prop_label = 12;
        }
        if($prop_label == "Rustico")
        {
            $prop_label = 13;
        }
        if($prop_label == "Bauland")
        {
            $prop_label = 1;
        }
        if($prop_label == "Agrarland")
        {
            $prop_label = 2;
        }
        if($prop_label == "Gewerbeland")
        {
            $prop_label = 3;
        }
        if($prop_label == "Industriebauland")
        {
            $prop_label = 4;
        }
    
                    
        if($proptype == "Haus")
        {
            $proptype ="HOUSE";
        }
        if($proptype == "Wohnung")
        {
            $proptype ="APPT";
        }
        if($proptype == "Grundstücke")
        {
            $proptype ="PROP";
        }
        if($proptype == "Renditeobjekte")
        {
            $proptype ="HOUSE";
        }
    
        if($sale_price == "")
        {
            $sale_price ="Auf Anfrage";
        }
        if($rent_price == "")
        {
            $rent_price ="Auf Anfrage";
        }
        if($prop_status == "Zu verkaufen")
        {
            $prop_status = "SALE";
            $rent_price ="";
        }
        if($prop_status == "Zu vermieten")
        {
            $prop_status = "RENT";
            $sale_price ="";
        }
    
        $txt .= "IDX3.01#Wordpress_4.6.2#".$proptype."#".$prop_label."#".$prop_status."#".$property_id."###".$address."#".$zip."#".$propcity."##".$country."###".$avail_from."#".$title.'#'.$post_description."#".$sale_price."#".$rent_price."##SELL#CHF###".$rooms."##".$property_size."#".$property_land."###".$property_year."#######".$garage."###".$distance_public_transport."#".$distance_shop."#".$distance_kindergarten."#".$distance_school1."#".$distance_school2."#".$pic1_filename."#".$pic2_filename."#".$pic3_filename."#".$pic4_filename."#".$pic5_filename."#".$pic1_title."#".$pic2_title."#".$pic3_title."#".$pic4_title."#".$pic5_title."######".$videos_name."#".$videos_title."##".$docname."#".$doctitle."##".$object_link."#agncyidxxxccc#Mischler Immobilien AG###Moosmattstrasse 23#6005#Luzern#CH#0413620101###[email protected]##".$agent_name."#0413620101#####".$pic6_filename."#".$pic7_filename."#".$pic8_filename."#".$pic9_filename."#".$pic6_title."#".$pic7_title."#".$pic8_title."#".$pic9_title."################################################".$pic10_filename."#".$pic11_filename."#".$pic12_filename."#".$pic13_filename."#".$pic10_title."#".$pic11_title."#".$pic12_title."#".$pic13_title."##################################".PHP_EOL;
            
    }
    
    
    Thread Starter photospirit

    (@photospirit)

    thanks for that.
    I was playing around with unset, but couldn’t fix my issue.

    Where and what do I need to place to solve the problem?

    Thanks, Chris

    Thread Starter photospirit

    (@photospirit)

    after some more thinking and investigation I found a solution by using the profile_photo the user is uploading, when creating/editing the profile.

    So my code is as follows:

    <?php
    $args2 = array(
     'role' => 'editor',
     'meta_key' => 'rolle_sort',
     'orderby'  => 'meta_value',
     'order' => 'ASC'
    );
    
    $members = get_users($args2);
    
    echo '<table cellpadding="0" cellspacing="0">';
    foreach ($members as $user) {
    
    $path1 = "https://domain-name.com/wp-content/uploads/ultimatemember/";
    $path2 = $user->ID;
    $file = $user->profile_photo;
    $logo = '<img src="' .$path1 . $path2 . "/" . $file . '">';
    
    echo '<tr>';
    echo '<td>' . '<strong>' . $user->rolle . ':' .'</strong>' . '</td>';
    echo '<td>' . $user->first_name . ' ' .$user->last_name .'</td>';
    echo '<td>' . $logo .'</td>';
    echo '</tr>';
    }
    echo '</table>';
    
    ?>
Viewing 9 replies - 1 through 9 (of 9 total)