Dotclear

Changeset 2817


Ignore:
Timestamp:
12/30/10 11:34:16 (13 years ago)
Author:
philippe
Message:

myGmaps : more php 5.3 notice corrected

Location:
plugins/myGmaps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/myGmaps/_define.php

    r2816 r2817  
    1515     /* Description*/         "Create Google Maps objects to include in maps associated to your posts", 
    1616     /* Author */             "Philippe aka amalgame", 
    17      /* Version */            '0.6.3', 
     17     /* Version */            '0.6.4', 
    1818     /* Permissions */        'usage,contentadmin' 
    1919); 
  • plugins/myGmaps/addmap.php

    r2814 r2817  
    1414 
    1515dcPage::check('usage,contentadmin'); 
     16 
     17global $core; 
    1618 
    1719$p_url    = 'plugin.php?p='.basename(dirname(__FILE__)); 
     
    477479     '</div>' 
    478480     ); 
    479      if ($maps_array) { 
     481      
     482     if (isset($maps_array)) { 
    480483          for ($i = 0; $i < sizeof($maps_array); ++$i) { 
    481484               echo '<p style="display:none">'.form::checkbox(array('entries[]'),$maps_array[$i],'true','','','').'</p>'; 
    482485          } 
    483486     } 
     487      
    484488     echo 
    485489     '<p><input type="hidden" name="myGmaps_center" id="myGmaps_center" value="'.$myGmaps_center.'" />'. 
     
    492496     echo '<div class="multi-part" id="settings" title="'.__('Settings').'">'; 
    493497      
     498      
    494499     $meta =& $GLOBALS['core']->meta; 
    495500     $my_params['post_id'] = $post_id; 
     
    497502                     
    498503     $rs = $core->blog->getPosts($my_params); 
    499      $meta_rs = $meta->getMetaStr($post->post_meta,'map_options'); 
    500       
    501      if ($meta_rs) { 
    502           $map_options = explode(",",$meta_rs); 
    503           $myGmaps_center = $map_options[0].','.$map_options[1]; 
    504           $myGmaps_zoom = $map_options[2]; 
    505           $myGmaps_type = $map_options[3]; 
     504     if(isset($post)) { 
     505          $meta_rs = $meta->getMetaStr($post->post_meta,'map_options'); 
     506          if ($meta_rs) { 
     507               $map_options = explode(",",$meta_rs); 
     508               $myGmaps_center = $map_options[0].','.$map_options[1]; 
     509               $myGmaps_zoom = $map_options[2]; 
     510               $myGmaps_type = $map_options[3]; 
     511          } 
    506512     } 
    507513      
     
    517523     $core->formNonce(); 
    518524      
    519      if ($has_map) { 
     525     if (isset($has_map) && $has_map == true) { 
    520526          echo '<p>'.($post_id ? form::hidden('post_id',$post_id) : '').'<input type="submit" value="'.__('Save').'" name="updmap" /></p>'; 
    521527     } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map