Plugin Directory

Changeset 3134704


Ignore:
Timestamp:
08/13/2024 07:48:39 AM (19 months ago)
Author:
apimofficiel
Message:

Commit Message:
===============

  • Version 2.5.9.1
  • Updated: Fix SQL query issue by ensuring the correct table prefix is used
  • Updated: Update currency handling to display prices in the correct currency
Location:
apimo/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • apimo/trunk/admin/logs.php

    r2872252 r3134704  
    99$tablename = $wpdb->prefix . 'actionscheduler_actions';
    1010
    11 $rows =  $wpdb->get_results('SELECT * FROM ' . $tablename .' WHERE hook="apimo_import_property_recurring" OR hook="apimo_fetch_property_manual" ' );
     11$rows =  $wpdb->get_results('SELECT * FROM ' . $tablename . ' WHERE hook="apimo_import_property_recurring" OR hook="apimo_fetch_property_manual" ');
    1212
    1313
     
    2626
    2727<style>
    28 
    29 .dropdown {
    30 
    31   float: left;
    32 
    33   overflow: hidden;
    34 
    35 }
    36 
    37 
    38 
    39 .dropdown .dropbtn {
    40 
    41   cursor: pointer;
    42 
    43   font-size: 16px; 
    44 
    45   border: none;
    46 
    47   outline: none;
    48 
    49   color: #2271b1;
    50 
    51   background-color: inherit;
    52 
    53   margin: 0;
    54 
    55   font-size: 13px;
    56 
    57   line-height: 1.4em;
    58 
    59   text-decoration: underline;
    60 
    61 }
    62 
    63 
    64 
    65 .dropdown-content {
    66 
    67   display: none;
    68 
    69   position: absolute;
    70 
    71   background-color: #f9f9f9;
    72 
    73   min-width: 160px;
    74 
    75   box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    76 
    77   z-index: 1;
    78 
    79 }
    80 
    81 
    82 
    83 .dropdown-content a {
    84 
    85   float: none;
    86 
    87   color: black;
    88 
    89   padding: 12px 16px;
    90 
    91   text-decoration: none;
    92 
    93   display: block;
    94 
    95   text-align: left;
    96 
    97 }
    98 
    99 
    100 
    101 .dropdown-content a:hover {
    102 
    103   background-color: #ddd;
    104 
    105 }
    106 
    107 
    108 
    109 .show {
    110 
    111   display: block;
    112 
    113 }
    114 
     28  .dropdown {
     29
     30    float: left;
     31
     32    overflow: hidden;
     33
     34  }
     35
     36
     37
     38  .dropdown .dropbtn {
     39
     40    cursor: pointer;
     41
     42    font-size: 16px;
     43
     44    border: none;
     45
     46    outline: none;
     47
     48    color: #2271b1;
     49
     50    background-color: inherit;
     51
     52    margin: 0;
     53
     54    font-size: 13px;
     55
     56    line-height: 1.4em;
     57
     58    text-decoration: underline;
     59
     60  }
     61
     62
     63
     64  .dropdown-content {
     65
     66    display: none;
     67
     68    position: absolute;
     69
     70    background-color: #f9f9f9;
     71
     72    min-width: 160px;
     73
     74    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
     75
     76    z-index: 1;
     77
     78  }
     79
     80
     81
     82  .dropdown-content a {
     83
     84    float: none;
     85
     86    color: black;
     87
     88    padding: 12px 16px;
     89
     90    text-decoration: none;
     91
     92    display: block;
     93
     94    text-align: left;
     95
     96  }
     97
     98
     99
     100  .dropdown-content a:hover {
     101
     102    background-color: #ddd;
     103
     104  }
     105
     106
     107
     108  .show {
     109
     110    display: block;
     111
     112  }
    115113</style>
    116114
     
    119117<div class="apimo-dashboard">
    120118
    121     <div class="apimo-header">
    122 
    123         <div class="apimo-logo">
    124 
    125             <img src="<?php echo esc_url( $apimo_url . '/assets/images/small-logo.svg' ); ?>">
    126 
     119  <div class="apimo-header">
     120
     121    <div class="apimo-logo">
     122
     123      <img src="<?php echo esc_url($apimo_url . '/assets/images/small-logo.svg'); ?>">
     124
     125
     126    </div>
     127
     128    <div class="apimo-nav">
     129
     130      <nav>
     131
     132        <ul>
     133
     134          <li>
     135
     136            <a href="/wp-admin/admin.php?page=apimo"><?php echo _e('Settings', 'Apimo'); ?></a>
     137
     138          </li>
     139
     140          <li>
     141
     142            <a href="/wp-admin/admin.php?page=apimo_logs"><?php echo _e('Logs', 'Apimo'); ?></a>
     143
     144          </li>
     145
     146          <li>
     147
     148            <div class="dropdown">
     149
     150              <button class="dropbtn" onclick="openDropMenu()"><?php echo _e('Documentation', 'Apimo'); ?>
     151
     152                <i class="fa fa-caret-down"></i>
     153
     154              </button>
     155
     156              <div class="dropdown-content" id="myDropdown">
     157
     158                <a href="<?php echo esc_url($apimo_url . '/doc/guida_installazione.pdf'); ?>" target="_blank">Italiano</a>
     159
     160                <a href="<?php echo esc_url($apimo_url . '/doc/guide_installation.pdf'); ?>" target="_blank">Français</a>
     161
     162                <a href="<?php echo esc_url($apimo_url . '/doc/installation_guide.pdf'); ?>" target="_blank">English</a>
     163
     164
     165              </div>
     166
     167            </div>
     168
     169          </li>
     170
     171        </ul>
     172
     173      </nav>
     174
     175    </div>
     176
     177  </div>
     178
     179  <form method="post">
     180
     181    <div class="apimo-row">
     182
     183      <div class="apimo-col-8">
     184
     185        <div class="apimo-block">
     186
     187          <div class="apimo-block-header">
     188
     189            <h3>Scheduled Logs</h3>
     190
     191          </div>
     192
     193          <div class="apimo-block-body">
     194
     195            <div class="apimo-block-info">
     196
     197              <!-- <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p> -->
     198
     199            </div>
     200
     201            <table class="wp-list-table widefat fixed striped feeds">
     202
     203              <thead>
     204
     205                <tr>
     206
     207                  <th scope="col"><?php echo _e('Action ID', 'Apimo'); ?></th>
     208
     209                  <th scope="col"><?php echo _e('Hook', 'Apimo'); ?></th>
     210
     211                  <th scope="col"><?php echo _e('Status', 'Apimo'); ?></th>
     212
     213                  <th scope="col"><?php echo _e('Args', 'Apimo'); ?></th>
     214
     215                  <th scope="col"><?php echo _e('Time', 'Apimo'); ?></th>
     216
     217                </tr>
     218
     219              </thead>
     220
     221              <tbody>
     222
     223                <?php
     224
     225                foreach ($rows as $row) {
     226
     227                  // if($row->hook == 'apimo_fetch_property_recurring' || $row->hook == 'apimo_fetch_property_manual'){
     228
     229                ?>
     230
     231                  <tr>
     232
     233                    <td><?php echo esc_html($row->action_id); ?></td>
     234
     235                    <td><?php echo esc_html($row->hook); ?></td>
     236
     237                    <td><?php echo esc_html($row->status); ?></td>
     238
     239                    <td><?php echo esc_html($row->args); ?></td>
     240
     241                    <td><?php echo esc_html($row->scheduled_date_local); ?></td>
     242
     243                  </tr>
     244
     245                <?php
     246
     247                  //  }
     248
     249                }
     250
     251                ?>
     252
     253              </tbody>
     254
     255              <tfoot>
     256
     257                <tr>
     258
     259                  <th scope="col"><?php echo _e('Action ID', 'Apimo'); ?></th>
     260
     261                  <th scope="col"><?php echo _e('Hook', 'Apimo'); ?></th>
     262
     263                  <th scope="col"><?php echo _e('Status', 'Apimo'); ?></th>
     264
     265                  <th scope="col"><?php echo _e('Args', 'Apimo'); ?></th>
     266
     267                  <th scope="col"><?php echo _e('Time', 'Apimo'); ?></th>
     268
     269                </tr>
     270
     271              </tfoot>
     272
     273            </table>
     274
     275          </div>
    127276
    128277        </div>
    129278
    130         <div class="apimo-nav">
    131 
    132             <nav>
    133 
    134                 <ul>
    135 
    136                     <li>
    137 
    138                         <a href="/wp-admin/admin.php?page=apimo"><?php echo _e('Settings','Apimo');?></a>
    139 
    140                     </li>
    141 
    142                     <li>
    143 
    144                         <a href="/wp-admin/admin.php?page=apimo_logs"><?php echo _e('Logs','Apimo');?></a>
    145 
    146                     </li>
    147 
    148                     <li>
    149 
    150                       <div class="dropdown">
    151 
    152                         <button class="dropbtn" onclick="openDropMenu()"><?php echo _e('Documentation','Apimo');?>
    153 
    154                           <i class="fa fa-caret-down"></i>
    155 
    156                         </button>
    157 
    158                         <div class="dropdown-content" id="myDropdown">
    159 
    160                             <a href="<?php echo esc_url( $apimo_url . '/doc/guida_installazione.pdf' ); ?>" target="_blank">Italiano</a>
    161 
    162                             <a href="<?php echo esc_url( $apimo_url . '/doc/guide_installation.pdf' ); ?>" target="_blank">Français</a>
    163 
    164                             <a href="<?php echo esc_url( $apimo_url . '/doc/installation_guide.pdf' ); ?>" target="_blank">English</a>
    165 
    166 
    167                         </div>
    168 
    169                       </div>                     
    170 
    171                     </li>
    172 
    173                 </ul>
    174 
    175             </nav>
     279      </div>
     280
     281      <div class="apimo-col-4">
     282
     283        <div class="apimo-block">
     284
     285          <div class="apimo-block-header">
     286
     287            <h3>Manually Run</h3>
     288
     289          </div>
     290
     291          <div class="apimo-block-body">
     292
     293            <div class="apimo-block-info apimo-api-result">
     294
     295              <p>You can manually run the properties import from APIMO webservices.</p>
     296
     297            </div>
     298
     299          </div>
     300
     301          <div class="apimo-footer align-right">
     302
     303            <input type="button" class="button button-primary wt_iew_export_action_btn run_menual_scheduler" name="run_scheduler" value="Run Scheduler">
     304
     305          </div>
    176306
    177307        </div>
    178308
     309      </div>
     310
    179311    </div>
    180312
    181     <form method="post">
    182 
    183         <div class="apimo-row">
    184 
    185             <div class="apimo-col-8">
    186 
    187                 <div class="apimo-block">
    188 
    189                     <div class="apimo-block-header">
    190 
    191                         <h3>Scheduled Logs</h3>
    192 
    193                     </div>
    194 
    195                     <div class="apimo-block-body">
    196 
    197                         <div class="apimo-block-info">
    198 
    199                             <!-- <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p> -->
    200 
    201                         </div>
    202 
    203                         <table class="wp-list-table widefat fixed striped feeds">
    204 
    205                             <thead>
    206 
    207                                 <tr>
    208 
    209                                     <th scope="col"><?php echo _e('Action ID','Apimo');?></th>
    210 
    211                                     <th scope="col"><?php echo _e('Hook','Apimo');?></th>
    212 
    213                                     <th scope="col"><?php echo _e('Status','Apimo');?></th>
    214 
    215                                     <th scope="col"><?php echo _e('Args','Apimo');?></th>
    216 
    217                                     <th scope="col"><?php echo _e('Time','Apimo');?></th>
    218 
    219                                 </tr>
    220 
    221                             </thead>
    222 
    223                             <tbody>
    224 
    225                             <?php
    226 
    227                                 foreach($rows as $row){
    228 
    229                                    // if($row->hook == 'apimo_fetch_property_recurring' || $row->hook == 'apimo_fetch_property_manual'){
    230 
    231                                     ?>
    232 
    233                                     <tr>
    234 
    235                                       <td><?php echo esc_html( $row->action_id ); ?></td>
    236 
    237                                       <td><?php echo esc_html( $row->hook ); ?></td>
    238 
    239                                       <td><?php echo esc_html( $row->status ); ?></td>
    240 
    241                                       <td><?php echo esc_html( $row->args ); ?></td>
    242 
    243                                       <td><?php echo esc_html( $row->scheduled_date_local ); ?></td>
    244 
    245                                     </tr>
    246 
    247                                     <?php
    248 
    249                                   //  }
    250 
    251                                 }
    252 
    253                                 ?>
    254 
    255                             </tbody>
    256 
    257                             <tfoot>
    258 
    259                                 <tr>
    260 
    261                                     <th scope="col"><?php echo _e('Action ID','Apimo');?></th>
    262 
    263                                     <th scope="col"><?php echo _e('Hook','Apimo');?></th>
    264 
    265                                     <th scope="col"><?php echo _e('Status','Apimo');?></th>
    266 
    267                                     <th scope="col"><?php echo _e('Args','Apimo');?></th>
    268 
    269                                     <th scope="col"><?php echo _e('Time','Apimo');?></th>
    270 
    271                                 </tr>
    272 
    273                             </tfoot>
    274 
    275                         </table>
    276 
    277                     </div>
    278 
    279                 </div>
    280 
    281             </div>
    282 
    283             <div class="apimo-col-4">
    284 
    285                 <div class="apimo-block">
    286 
    287                     <div class="apimo-block-header">
    288 
    289                         <h3>Manually Run</h3>
    290 
    291                     </div>
    292 
    293                     <div class="apimo-block-body">
    294 
    295                         <div class="apimo-block-info apimo-api-result">
    296 
    297                             <p>You can manually run the properties import from APIMO webservices.</p>
    298 
    299                         </div>
    300 
    301                     </div>
    302 
    303                     <div class="apimo-footer align-right">
    304 
    305                         <input type="button" class="button button-primary wt_iew_export_action_btn run_menual_scheduler" name="run_scheduler" value="Run Scheduler">
    306 
    307                     </div>
    308 
    309                 </div>
    310 
    311             </div>
    312 
    313         </div>
    314 
    315     </form>
     313  </form>
    316314
    317315</div>
    318316
    319317<script>
    320 
    321 function openDropMenu() {
    322 
    323   document.getElementById("myDropdown").classList.toggle("show");
    324 
    325 }
    326 
    327 window.onclick = function(e) {
    328 
    329   if (!e.target.matches('.dropbtn')) {
    330 
    331   var myDropdown = document.getElementById("myDropdown");
    332 
    333     if (myDropdown.classList.contains('show')) {
    334 
    335       myDropdown.classList.remove('show');
     318  function openDropMenu() {
     319
     320    document.getElementById("myDropdown").classList.toggle("show");
     321
     322  }
     323
     324  window.onclick = function(e) {
     325
     326    if (!e.target.matches('.dropbtn')) {
     327
     328      var myDropdown = document.getElementById("myDropdown");
     329
     330      if (myDropdown.classList.contains('show')) {
     331
     332        myDropdown.classList.remove('show');
     333
     334      }
    336335
    337336    }
    338337
    339338  }
    340 
    341 }
    342 
    343339</script>
  • apimo/trunk/admin/settings.php

    r3121531 r3134704  
    652652                $tablename = $wpdb->prefix . 'actionscheduler_actions';
    653653
    654                 $rows =  $wpdb->get_results('SELECT * FROM ' . $tablename . ' WHERE hook="apimo_import_property_recurring" OR hook="apimo_fetch_property_manual" ORDER BY `wp_actionscheduler_actions`.`action_id` DESC limit 5 ');
     654                $rows =  $wpdb->get_results(
     655                    'SELECT * FROM ' . $tablename . '
     656    WHERE hook="apimo_import_property_recurring"
     657    OR hook="apimo_fetch_property_manual"
     658    ORDER BY ' . $tablename . '.action_id DESC
     659    LIMIT 5'
     660                );
    655661                ?>
    656662                <div class="apimo-row">
  • apimo/trunk/apimo.php

    r3131709 r3134704  
    77 * Description: Manage Real Estat Bussiness
    88
    9  * Version: 2.5.9
     9 * Version: 2.5.9.1
    1010
    1111 * Author: ApiWork
     
    10441044
    10451045
    1046 
    1047 function apimo_currency_format($amout)
    1048 
    1049 {
    1050 
    1051     // return number_format($amout, 2, ',', ' ').'€';
    1052 
    1053     //$fmt = numfmt_create('de_DE', NumberFormatter::CURRENCY);
    1054 
    1055     //return str_replace(',00', '', numfmt_format_currency($fmt, $amout, "EUR"));
    1056 
    1057     return '€ ' . str_replace(',00', '', number_format((float)$amout, 2, ',', '.'));
    1058 }
     1046function apimo_currency_format($amount, $currency = 'EUR')
     1047{
     1048    // Ensure $currency is a string
     1049    if (is_array($currency)) {
     1050        // Handle the case where $currency is an array
     1051        $currency = isset($currency[0]) ? $currency[0] : 'EUR'; // Default to 'EUR' if the array is empty or invalid
     1052    } elseif (!is_string($currency)) {
     1053        // Handle other unexpected types by setting to default
     1054        $currency = 'EUR';
     1055    }
     1056
     1057    switch ($currency) {
     1058        case 'XOF': // Franc CFA
     1059            return number_format((float)$amount, 0, ',', ' ') . ' CFA';
     1060
     1061        case 'USD': // US Dollar
     1062            return '$' . number_format((float)$amount, 2, '.', ',');
     1063
     1064        case 'GBP': // British Pound
     1065            return '£' . number_format((float)$amount, 2, '.', ',');
     1066
     1067        case 'JPY': // Japanese Yen
     1068            return '¥' . number_format((float)$amount, 0, ',', ' ');
     1069
     1070        case 'EUR': // Euro
     1071            return '€ ' . str_replace(',00', '', number_format((float)$amount, 2, ',', '.'));
     1072
     1073        case 'CAD': // Canadian Dollar
     1074            return 'C$' . number_format((float)$amount, 2, '.', ',');
     1075
     1076        case 'AUD': // Australian Dollar
     1077            return 'A$' . number_format((float)$amount, 2, '.', ',');
     1078
     1079        case 'CHF': // Swiss Franc
     1080            return number_format((float)$amount, 2, '.', '\'') . ' CHF';
     1081
     1082        case 'CNY': // Chinese Yuan
     1083            return '¥' . number_format((float)$amount, 2, '.', ',');
     1084
     1085        case 'INR': // Indian Rupee
     1086            return '₹' . number_format((float)$amount, 2, '.', ',');
     1087
     1088        case 'MXN': // Mexican Peso
     1089            return '$' . number_format((float)$amount, 2, '.', ',') . ' MXN';
     1090
     1091        case 'BRL': // Brazilian Real
     1092            return 'R$' . number_format((float)$amount, 2, '.', ',');
     1093
     1094        case 'ZAR': // South African Rand
     1095            return 'R' . number_format((float)$amount, 2, '.', ',');
     1096
     1097        case 'RUB': // Russian Ruble
     1098            return number_format((float)$amount, 2, ',', ' ') . ' ₽';
     1099
     1100        case 'SEK': // Swedish Krona
     1101            return number_format((float)$amount, 2, ',', ' ') . ' kr';
     1102
     1103        case 'NOK': // Norwegian Krone
     1104            return number_format((float)$amount, 2, ',', ' ') . ' kr';
     1105
     1106        case 'DKK': // Danish Krone
     1107            return number_format((float)$amount, 2, ',', ' ') . ' kr';
     1108
     1109        case 'PLN': // Polish Zloty
     1110            return number_format((float)$amount, 2, ',', ' ') . ' zł';
     1111
     1112        case 'TRY': // Turkish Lira
     1113            return number_format((float)$amount, 2, ',', ' ') . ' ₺';
     1114
     1115        default:
     1116            // If the currency is not recognized, return the amount with a generic symbol or empty string
     1117            return number_format((float)$amount, 2, '.', ',') . ' ' . strtoupper($currency);
     1118    }
     1119}
  • apimo/trunk/readme.txt

    r3131709 r3134704  
    33Tags: real estate, property management, listings, clients, leads, showings, open houses, reports
    44Tested up to: 6.4.2
    5 Stable tag: 2.5.9
     5Stable tag: 2.5.9.1
    66License: GPLv2
    77License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    175175== Changelog ==
    176176
     177= 2.5.9.1 =
     178* Fixed SQL query issue by ensuring the correct table prefix is used.
     179* Updated currency handling to display prices in the correct currency.
     180
    177181= 2.5.9 =
    178182* Fix Display problem and shortcode filter problem
  • apimo/trunk/templates/single_property_style_2.php

    r3129309 r3134704  
    976976                        _e('Private negotiation', 'apimo');
    977977                    } else {
     978
     979
    978980                        if ($metas['apimo_price'][0]) {
    979                             echo esc_html(apimo_currency_format($metas['apimo_price'][0]));
     981
     982                            $currency = $metas['apimo_price_currency'];
     983
     984                            echo esc_html(apimo_currency_format($metas['apimo_price'][0]), $currency);
    980985                        } else {
    981986                            echo esc_html(apimo_currency_format(0));
  • apimo/trunk/templates/template_archive_block.php

    r3017863 r3134704  
    44
    55$metas = get_post_meta(get_the_ID());
     6
     7//price
     8
     9// echo "<pre>";
     10// if (isset($metas['apimo_price_data']) && is_array($metas['apimo_price_data'])) {
     11//     foreach ($metas['apimo_price_data'] as $priceData) {
     12//         // Check if the data is serialized
     13//         if (is_string($priceData) && preg_match('/^O:\d+:"stdClass"/', $priceData)) {
     14//             // Unserialize the object
     15//             $priceData = unserialize($priceData);
     16//         }
     17
     18//         // Check if we have an object now
     19//         if (is_object($priceData)) {
     20//             foreach ($priceData as $key => $value) {
     21//                 if (is_object($value)) {
     22//                     echo ucfirst($key) . ":\n";
     23//                     foreach ($value as $subKey => $subValue) {
     24//                         echo "  " . ucfirst($subKey) . ": " . ($subValue !== null ? $subValue : "N/A") . "\n";
     25//                     }
     26//                 } else {
     27//                     echo ucfirst($key) . ": " . ($value !== null ? $value : "N/A") . "\n";
     28//                 }
     29//             }
     30//         } else {
     31//             echo "Invalid price data format.\n";
     32//         }
     33//         echo "\n";
     34//     }
     35// } else {
     36//     echo "No valid price data available.\n";
     37// }
     38// echo "</pre>";
     39
     40
    641
    742$thumbnail = get_the_post_thumbnail_url(get_the_ID());
     
    3267$subtypes = wp_get_post_terms(get_the_ID(), 'apimo_subtype');
    3368
    34 if(isset($subtypes[0])){
     69if (isset($subtypes[0])) {
    3570    $subtype = $subtypes[0]->name;
    3671}
     
    94129            $rand = rand(); ?>
    95130
    96             <div class="apimo-propery-images-archive apimo-display apimo-slider-image-<?php /*echo count($gallery_images); */ if(is_array($gallery_images) || is_object($gallery_images)){echo count($gallery_images);} ?>">
     131            <div class="apimo-propery-images-archive apimo-display apimo-slider-image-<?php /*echo count($gallery_images); */ if (is_array($gallery_images) || is_object($gallery_images)) {
     132                                                                                            echo count($gallery_images);
     133                                                                                        } ?>">
    97134
    98135
     
    127164
    128165                        <div class="apimo-image-slide-wrapper">
    129                             <?php 
    130 
    131                                 if($thumbnail == ""){
    132                                     $src = plugin_dir_url(dirname(__FILE__)) . 'assets/images/noimage.png';                                   
    133                                 }else{
    134                                     $src = $thumbnail;
    135                                 }
     166                            <?php
     167
     168                            if ($thumbnail == "") {
     169                                $src = plugin_dir_url(dirname(__FILE__)) . 'assets/images/noimage.png';
     170                            } else {
     171                                $src = $thumbnail;
     172                            }
    136173
    137174                            ?>
     
    154191                <?php
    155192
    156                 if(is_array($gallery_images) || is_object($gallery_images)){
     193                if (is_array($gallery_images) || is_object($gallery_images)) {
    157194                    foreach ($gallery_images as $gallery_image) {
    158195
    159196                        if (isset($apimo_archive_settings['gallery_display_lighbox']) && $apimo_archive_settings['gallery_display_lighbox'] == 1) :
    160197
    161                     ?>
     198                ?>
    162199
    163200                            <div class="apimo-image">
     
    189226                        ?>
    190227
    191                     <?php
     228                <?php
    192229
    193230                    }
     
    255292
    256293        <?php
    257             // foreach (unserialize($metas['apimo_content'][0]) as $language) {
    258 
    259             //     if ($language->language == 'it') {
    260 
    261             //         if ($language->hook != '' || !empty($language->hook)) {
    262 
    263             //             echo '<div class="Pro-category ProCategory2">';
    264 
    265             //             echo '<span>' . nl2br($language->hook) . '</span>';
    266 
    267             //             echo '</div>';
    268             //         }
    269             //     }
    270             // }
    271 
    272             if (isset($metas['apimo_content'][0])) {
    273                 $contents = unserialize($metas['apimo_content'][0]);
    274                 if (is_array($contents)) {
    275                   foreach ($contents as $language) {
     294        // foreach (unserialize($metas['apimo_content'][0]) as $language) {
     295
     296        //     if ($language->language == 'it') {
     297
     298        //         if ($language->hook != '' || !empty($language->hook)) {
     299
     300        //             echo '<div class="Pro-category ProCategory2">';
     301
     302        //             echo '<span>' . nl2br($language->hook) . '</span>';
     303
     304        //             echo '</div>';
     305        //         }
     306        //     }
     307        // }
     308
     309        if (isset($metas['apimo_content'][0])) {
     310            $contents = unserialize($metas['apimo_content'][0]);
     311            if (is_array($contents)) {
     312                foreach ($contents as $language) {
    276313                    if ($language->language == 'it') {
    277                       if (!empty($language->hook)) {
    278                         echo '<div class="Pro-category ProCategory2">';
    279                         echo '<span>' . nl2br($language->hook) . '</span>';
    280                         echo '</div>';
    281                       }
     314                        if (!empty($language->hook)) {
     315                            echo '<div class="Pro-category ProCategory2">';
     316                            echo '<span>' . nl2br($language->hook) . '</span>';
     317                            echo '</div>';
     318                        }
    282319                    }
    283                   }
    284320                }
    285321            }
    286        
     322        }
     323
    287324        ?>
    288325
     
    480517                                    echo 0;
    481518                                }
    482                                 ?> 
     519                                ?>
    483520                                <?php
    484521                                if (
     
    736773            <?php else : ?>
    737774
    738                 <span><?php if ($metas['apimo_price'][0]) {
    739 
    740                             echo esc_html(apimo_currency_format($metas['apimo_price'][0]));
    741                         } else {
    742 
    743                             echo esc_html(apimo_currency_format(0));
    744                         } ?></span>
     775                <span>
     776                    <?php
     777                    $price = $metas['apimo_price'][0] ? $metas['apimo_price'][0] : 0;
     778                    $currency = isset($metas['apimo_price_currency']) ? $metas['apimo_price_currency'] : 'EUR';
     779
     780                    echo esc_html(apimo_currency_format($price, $currency));
     781                    ?>
     782                </span>
    745783
    746784            <?php endif; ?>
     
    752790        </div>
    753791
     792
    754793    </a>
    755794
Note: See TracChangeset for help on using the changeset viewer.