Changeset 13092 for extensions/rv_gmaps/trunk
- Timestamp:
- Feb 11, 2012, 6:38:34 AM (12 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_edit.php
r9069 r13092 116 116 { 117 117 $query=' 118 SELECT id, tn_ext,name,path,file,lat,lon FROM '.IMAGES_TABLE.'118 SELECT id,representative_ext,name,path,file,lat,lon FROM '.IMAGES_TABLE.' 119 119 WHERE id IN ('.implode(',',$page['cat_elements_id']).') 120 120 '.$conf['order_by'].' … … 130 130 $tpl_var = array_merge( $image, 131 131 array( 132 'U_TN' => get_thumbnail_url($image),133 'TITLE' => get_thumbnail_title($image)132 'U_TN' => DerivativeImage::thumb_url($image), 133 'TITLE' => render_element_name($image) 134 134 ) 135 135 ); -
extensions/rv_gmaps/trunk/admin/admin_sync.php
r12701 r13092 5 5 $sync_options = array( 6 6 'simulate' => isset($_POST['simulate']), 7 'use_high' => isset($_POST['use_high']),8 7 'cat_id' => isset($_POST['cat_id']) ? (int)$_POST['cat_id'] : 0, 9 8 'subcats_included' => isset($_POST['subcats_included']), … … 12 11 $sync_options = array( 13 12 'simulate' => true, 14 'use_high' => true,15 13 'cat_id' => 0, 16 14 'subcats_included' => true, … … 35 33 36 34 $query=' 37 SELECT id,path,lat,lon ,has_high35 SELECT id,path,lat,lon 38 36 FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id 39 37 WHERE category_id IN ('.implode(',', $cat_ids).') … … 43 41 { 44 42 $query=' 45 SELECT id,path,lat,lon ,has_high43 SELECT id,path,lat,lon 46 44 FROM '.IMAGES_TABLE; 47 45 } … … 53 51 { 54 52 $filename = $image['path']; 55 if ($sync_options['use_high'] and $image['has_high']=='true')56 $filename = get_high_path($image);57 53 $exif = @read_exif_data( $filename ); 58 54 if ( empty($exif) ) … … 110 106 array( 111 107 'SUBCATS_INCLUDED_CHECKED' => $sync_options['subcats_included'] ? 'checked="checked"' : '', 112 'USE_HIGH_CHECKED' => $sync_options['use_high'] ? 'checked="checked"' : ''113 108 ) 114 109 ); -
extensions/rv_gmaps/trunk/admin/admin_sync.tpl
r8724 r13092 27 27 <ul> 28 28 <li><label><input type="checkbox" name="simulate" value="1" checked="checked" /> {'only perform a simulation (no change in database will be made)'|@translate}</label></li> 29 <li><label><input type="checkbox" name="use_high" value="1" {$USE_HIGH_CHECKED} /> use high resolution images if available</label></li>30 29 </ul> 31 30 </fieldset> -
extensions/rv_gmaps/trunk/changelog.txt
r12719 r13092 1 2.4.a 2 -compatible with piwigo 2.4 3 1 4 2.3.b 2 5 - search for places / location uses now google auto complete -
extensions/rv_gmaps/trunk/include/functions.php
r12700 r13092 4 4 { 5 5 global $conf; 6 $dir = $conf['local_data_dir']; 7 return $dir.'/tmp/_rvgm_cat_cache.dat'; 6 return PHPWG_ROOT_PATH.$conf['data_location'].'/tmp/_rvgm_cat_cache.dat'; 8 7 } 9 8 -
extensions/rv_gmaps/trunk/include/functions_map.php
r8776 r13092 10 10 global $page, $conf; 11 11 unset( $page['__rvm_config__'] ); 12 return $conf['local_data_dir'].'/plugins/'.basename(dirname(dirname(__FILE__))).'.dat';12 return PHPWG_ROOT_PATH.$conf['data_location'].'/plugins/'.basename(dirname(dirname(__FILE__))).'.dat'; 13 13 } 14 14 -
extensions/rv_gmaps/trunk/include/picture_map.inc.php
r8304 r13092 9 9 array( 10 10 'RVM_PLUGIN_VERSION' => RVM_PLUGIN_VERSION, 11 'GMAPS_API_KEY' => $conf['gmaps_api_key'],12 11 'PLUGIN_ROOT_URL' => get_absolute_root_url().'plugins/'.$rvm_dir, 13 12 'PLUGIN_LOCATION' => 'plugins/'.$rvm_dir, … … 35 34 $template->assign( 36 35 array( 37 'TN_SRC' => $picture['thumbnail'],38 36 'U_NO_MAP' => duplicate_picture_url(), 39 37 'U_BLOWUP' => rvm_make_blowup_url( array('ll'=>$picture), array('start','box') ), -
extensions/rv_gmaps/trunk/kml.php
r8666 r13092 44 44 45 45 46 $img_fields = ' i.id,i. tn_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon,i.date_creation';46 $img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon,i.date_creation'; 47 47 48 48 rvm_build_section_items($img_fields, $where_sql, RVM_BUILD_ARRAY, $order_by); … … 92 92 { 93 93 $query = ' 94 SELECT id, path, tn_ext94 SELECT id, path, representative_ext 95 95 FROM '.IMAGES_TABLE.' 96 96 WHERE id IN ('.implode(',', $thumbnail_ids).')'; 97 97 $result = pwg_query($query); 98 98 while ($row = mysql_fetch_assoc($result)) 99 $thumbnail_src_of[$row['id']] = get_thumbnail_url($row);99 $thumbnail_src_of[$row['id']] = DerivativeImage::thumb_url($row); 100 100 unset($thumbnail_ids); 101 101 } … … 149 149 $page_url = duplicate_picture_url(array('image_id' => $img['id'],'image_file' => $img['file']), array('start') ); 150 150 151 if (!empty( $img['name'] ) )152 $title = $img['name'];153 else154 $title = str_replace('_', ' ', get_filename_wo_extension($img['file']));155 156 151 $tpl_var = array( 157 152 'U_PAGE'=> $page_url, 158 153 'TN_SRC' => get_thumbnail_url($img), 159 'TITLE' => $title,160 'DESCRIPTION' => trigger_event('render_element_description', $img['comment']),154 'TITLE' => render_element_name($img), 155 'DESCRIPTION' => render_element_description($img), 161 156 'LAT' => $img['lat'], 162 157 'LON' => $img['lon'], -
extensions/rv_gmaps/trunk/main.inc.php
r12706 r13092 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2. 3.b3 Version: 2.4.a 4 4 Description: Extend your gallery with Google Maps and Google Earth ... 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122 … … 7 7 Author URI: http://www.modusoptimus.com/ 8 8 */ 9 define( 'RVM_PLUGIN_VERSION', '2. 3.b');9 define( 'RVM_PLUGIN_VERSION', '2.4.a'); 10 10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 -
extensions/rv_gmaps/trunk/maintain.inc.php
r12701 r13092 39 39 { 40 40 global $conf; 41 $dest = $conf['local_data_dir'].'/plugins/'.basename(dirname(__FILE__)).'.dat';41 $dest = PHPWG_ROOT_PATH.$conf['data_location'].'/plugins/'.basename(dirname(__FILE__)).'.dat'; 42 42 if (!file_exists($dest) ) 43 43 { … … 70 70 71 71 global $conf; 72 $dest = $conf['local_data_dir'].'/plugins/'.basename(dirname(__FILE__)).'.dat';72 $dest = PHPWG_ROOT_PATH.$conf['data_location'].'/plugins/'.basename(dirname(__FILE__)).'.dat'; 73 73 @unlink( $dest ); 74 74 } -
extensions/rv_gmaps/trunk/map_data.php
r12719 r13092 31 31 $where_sql = rvm_bounds_to_sql( $page['box'] ); 32 32 33 $img_fields = ' i.id,i. tn_ext,i.name,i.comment,i.path,i.lat,i.lon';33 $img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.path,i.lat,i.lon'; 34 34 35 35 $was_flat = @$page['flat']; … … 42 42 header('Pragma:');*/ 43 43 header('Content-Type: text/plain; charset='.get_pwg_charset()); 44 header('X-Robots-Tag: noindex'); 44 45 45 46 if ( extension_loaded('zlib') && !ini_get('zlib.output_compression') ) -
extensions/rv_gmaps/trunk/mapl.php
r8666 r13092 49 49 $where_sql = rvm_bounds_to_sql( $page['box'] ); 50 50 51 $img_fields = ' i.id ,i.tn_ext,i.name,i.path,i.lat,i.lon';51 $img_fields = ' i.id'; 52 52 53 53 $was_flat = @$page['flat']; 54 54 $page['flat']=true; 55 55 rvm_build_section_items($img_fields, $where_sql, RVM_BUILD_HASH, $order_by); 56 $page['items']=array_keys($page['items']); 56 57 if (!$was_flat) unset($page['flat']); 57 58 … … 61 62 { 62 63 /* GENERATE THE CATEGORY LIST *************************************************/ 63 $where_sql = 'i.id IN ('.implode(',', array_keys($page['items'])).')';64 $where_sql = 'i.id IN ('.implode(',', $page['items'] ).')'; 64 65 $where_sql .= get_sql_condition_FandF( 65 66 array( 'forbidden_categories' => 'category_id' ), … … 95 96 96 97 /* GENERATE THE TAG LIST ******************************************************/ 97 $tags = get_common_tags( array_keys($page['items']), $conf['content_tag_cloud_items_number'], null);98 $tags = get_common_tags( $page['items'], $conf['content_tag_cloud_items_number'], null); 98 99 $tags = add_level_to_tags($tags); 99 100 function counter_compare($a, $b) … … 145 146 ); 146 147 147 foreach ($page['items'] as $img) 148 { 149 $img['file'] = basename( $img['path'] ); 150 $thumbnail_url = get_thumbnail_url($img); 148 $pictures = array(); 149 if (count($page['items']) > 0) 150 { 151 $rank_of = array_flip($page['items']); 152 153 $query = ' 154 SELECT * 155 FROM '.IMAGES_TABLE.' 156 WHERE id IN ('.implode(',', $page['items']).') 157 ;'; 158 $result = pwg_query($query); 159 while ($row = pwg_db_fetch_assoc($result)) 160 { 161 $row['rank'] = $rank_of[ $row['id'] ]; 162 $pictures[] = $row; 163 } 164 usort($pictures, 'rank_compare'); 165 unset($rank_of); 166 } 167 168 foreach ($pictures as $img) 169 { 151 170 $page_url = duplicate_picture_url( 152 171 array( … … 157 176 array('start') 158 177 ); 159 if (!empty( $img['name'] ) ) 160 $title = $img['name']; 161 else 162 $title = str_replace('_', ' ', get_filename_wo_extension($img['file'])); 163 164 $template->append( 165 'thumbnails', 166 array( 167 'TN_SRC' => $thumbnail_url, 168 'URL' => $page_url, 169 'TN_ALT' => $img['file'], 170 'TN_TITLE' => $title, 171 ) 172 ); 173 } 178 $name = render_element_name($img); 179 $desc = render_element_description($img); 180 181 $tpl_thumbnails_var[] = array_merge( $img, array( 182 'NAME' => $name, 183 'TN_ALT' => htmlspecialchars(strip_tags($name)), 184 'TN_TITLE' => get_thumbnail_title($img, $name, $desc), 185 'URL' => $page_url, 186 'DESCRIPTION' => $desc, 187 'src_image' => new SrcImage($img), 188 ) ); 189 } 190 $template->assign( array( 191 'derivative_params' => ImageStdParams::get_by_type(IMG_THUMB), 192 'SHOW_THUMBNAIL_CAPTION' => false, 193 'thumbnails' => $tpl_thumbnails_var, 194 ) ); 195 $template->set_filename('index_thumbnails', 'thumbnails.tpl'); 196 $template->assign_var_from_handle('THUMBNAILS', 'index_thumbnails'); 174 197 175 198 $title = $page['title']; -
extensions/rv_gmaps/trunk/template/mapl.tpl
r8636 r13092 1 {html_head} 2 <style type="text/css"> 1 {html_style} 3 2 .fullTagCloud {ldelim} 4 3 text-align: justify; … … 9 8 display: inline;white-space: nowrap; 10 9 } 11 </style> 12 {/html_head} 10 {/html_style} 13 11 14 12 <div id="content" class="content" style="margin: 0;"> … … 50 48 {/if} 51 49 52 {if !empty($navbar) }{include file='navigation_bar.tpl'}{/if}50 {if !empty($navbar)}{include file='navigation_bar.tpl' assign='NAVBAR'}{$NAVBAR}{/if} 53 51 54 {if not empty($thumbnails)} 55 <ul class="thumbnails"> 56 {foreach from=$thumbnails item=thumbnail} 57 <li><span class="wrap1"><span class="wrap2"> 58 <a href="{$thumbnail.URL}" title="{$thumbnail.TN_TITLE}"> 59 <img class="thumbnail" src="{$thumbnail.TN_SRC}" alt="{$thumbnail.TN_ALT}" /> 60 </a> 61 </span></span> 62 </li> 63 {/foreach} 52 {if !empty($THUMBNAILS)} 53 <ul class="thumbnails" id="thumbnails"> 54 {$THUMBNAILS} 64 55 </ul> 65 56 {/if} 66 57 58 {if !empty($NAVBAR)}{$NAVBAR}{/if} 67 59 </div> -
extensions/rv_gmaps/trunk/template/picture_map_content.tpl
r12719 r13092 1 2 1 {html_head} 3 2 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code}" type="text/javascript"></script> … … 5 4 {combine_script id='jquery.nyroModal' load='async' path="`$PLUGIN_LOCATION`/template/nyroModal/jquery.nyroModal-1.6.2.js" version='1.6.2'} 6 5 <link href="{$PLUGIN_ROOT_URL}/template/nyroModal/nyroModal.css" rel="stylesheet" type="text/css"> 7 8 <style type="text/css">{literal} 6 {/html_head}{html_style}{literal} 9 7 #mapPicture { 10 8 position:absolute; … … 20 18 } 21 19 22 #thumbPrev, #thumbNext {display:none;} 23 {/literal}</style> 24 {/html_head} 20 #linkPrev, #linkNext {display:none} 21 {/literal}{/html_style} 25 22 26 23 <div id="mapPicture"> 27 <a href="{$U_NO_MAP}" title="{'return to normal view mode'|@translate}" rel="nofollow"><img src="{$ TN_SRC}" alt="thumb"/></a>24 <a href="{$U_NO_MAP}" title="{'return to normal view mode'|@translate}" rel="nofollow"><img src="{$current.THUMB_SRC}" alt="thumb"/></a> 28 25 <br/> 29 26 <a href="{$U_BLOWUP}" onclick="return blowupUrl(this.href);">{'More photos near this location'|@translate}</a>
Note: See TracChangeset
for help on using the changeset viewer.