Changeset 32222 for extensions
- Timestamp:
- Jun 1, 2020, 11:09:48 PM (4 years ago)
- Location:
- extensions/memories
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/memories/blockhome/main.inc.php
r32203 r32222 30 30 $datepfoya = $confpfoya['pfoya_dateb']; 31 31 32 32 33 if (script_basename() == 'picture' 33 34 or ($datas['cat_display'] == 'wo_thumb' and !empty($page['items'])) … … 40 41 if($confpfoya['pfoya_datemax']>1 and $confpfoya['pfoya_showps']!=0)$template->assign('pfoya','a'); 41 42 $template->assign('renewpfoya',realpath(PFOYA_PATH.'blockhome/main.inc.php')); 42 if (isset($_GET['memodate'])) { 43 check_input_parameter('memodate', $_GET, false, PATTERN_ID); 44 $daydate=date("Y-m-d", strtotime('-'.$_GET['memodate'].' year')); 43 if (isset($_SESSION['memodate'])) { 44 $daydate=date("Y-m-d", strtotime('-'.$_SESSION['memodate'].' year')); 45 45 }else{ 46 46 $daydate=date("Y-m-d", strtotime('-1 year')); … … 82 82 } 83 83 if($confpfoya['pfoya_showps']==2){ 84 if(isset($page['section']) and empty($page['category']['id'])){ 85 if($page['section'] == 'additional_page'){ 86 //$items['URL']=get_absolute_root_url().'index.php?/page/'.$page['additional_page']['id'].'&memodate='.$i; 87 $items['URL']=get_absolute_root_url().'?&memodate='.$i; 88 }else{ 89 $items['URL']=get_absolute_root_url().'index.php?/categories&memodate='.$i; 90 } 91 }else{ 92 $items['URL']=$_SERVER["REQUEST_URI"].'&memodate='.$i; 93 } 84 $items['URL']=$_SERVER["REQUEST_URI"]; 94 85 } 86 $items['MEMODATE']=$i; 95 87 $template->append('pfoyas', $items); 96 88 } … … 144 136 $template->assign('THUMBNAILS', $tpl_save); 145 137 138 if($confpfoya['pfoya_showps']==2){ 139 if(isset($page['section']) and empty($page['category']['id'])){ 140 if($page['section'] == 'additional_page'){ 141 //redirect(); 142 } 143 } 144 } 145 146 146 ?> -
extensions/memories/blockhome/stuffs_homepfoya.tpl
r32196 r32222 33 33 } 34 34 {/html_style} 35 {footer_script} 36 jQuery('.calItempfoya').click(function(even){ 37 var memodate= jQuery(this).data('memodate'); 38 $.ajax({ 39 url: "ws.php?format=json&method=memories.photos.list", 40 type:"POST", 41 async:false, 42 data: { 43 memodate : memodate, 44 }, 45 success: function(){ 46 } 47 }); 48 }); 49 50 {/footer_script} 35 51 36 52 {if isset($pfoya)} … … 40 56 <span class="calItem">{$pfoya.LABEL}</span> 41 57 {else} 42 <a class="calItem calItempfoya" {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a>58 <a class="calItem calItempfoya" data-memodate="{$pfoya.MEMODATE}" {if isset($pfoya.NB_IMAGES)} title="{$pfoya.NB_IMAGES|@translate_dec:'%d photo':'%d photos'}"{/if} href="{$pfoya.URL}">{$pfoya.LABEL}</a> 43 59 {/if} 44 60 {/foreach} -
extensions/memories/include/function.pfoya.inc.php
r32197 r32222 108 108 } 109 109 110 function ws_memories_photos_list($params, &$service){ 111 $_SESSION['memodate']=$params['memodate']; 112 } 110 113 ?> -
extensions/memories/main.inc.php
r32198 r32222 192 192 193 193 add_event_handler('get_stuffs_modules', 'register_pfoya_module'); 194 195 194 function register_pfoya_module($modules){ 196 195 array_push($modules, array( … … 202 201 return $modules; 203 202 } 203 204 add_event_handler('ws_add_methods', 'memories_add_methods'); 205 function memories_add_methods($arr){ 206 $service = &$arr[0]; 207 208 $service->addMethod( 209 'memories.photos.list', 210 'ws_memories_photos_list', 211 array( 212 'years' => array('default' => null, 'type' => WS_TYPE_ID), 213 ), 214 'get list photos n years ago)' 215 ); 216 }
Note: See TracChangeset
for help on using the changeset viewer.