Changeset 25674 for extensions/UserCollections
- Timestamp:
- Nov 24, 2013, 2:48:30 PM (10 years ago)
- Location:
- extensions/UserCollections
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/include/UserCollection.class.php
r24421 r25674 327 327 * @return: array errors 328 328 */ 329 function addShare( $share, $abord_on_duplicate=true)329 function addShare(&$share, $abord_on_duplicate=true) 330 330 { 331 331 global $conf, $page; … … 342 342 else 343 343 { 344 $share['share_key'] = $this->data['id'].'-'.str2url($share['share_key']); 344 $share['share_key'] = str2url($share['share_key']); 345 $share_key = $this->data['id'].'-'.$share['share_key']; 345 346 346 347 $query = ' 347 348 SELECT id FROM '.COLLECTION_SHARES_TABLE.' 348 349 WHERE col_id = '.$this->data['id'].' 349 AND share_key = "'.$share ['share_key'].'"350 AND share_key = "'.$share_key.'" 350 351 ;'; 351 352 $result = pwg_query($query); … … 358 359 else 359 360 { 360 return USER_COLLEC_PUBLIC . 'view/' . $share ['share_key'];361 return USER_COLLEC_PUBLIC . 'view/' . $share_key; 361 362 } 362 363 } … … 373 374 if (!empty($share['password'])) 374 375 { 375 $share['password'] = sha1($conf['secret_key'].$share['password'].$share ['share_key']);376 $share['password'] = sha1($conf['secret_key'].$share['password'].$share_key); 376 377 } 377 378 … … 392 393 VALUES( 393 394 '.$this->data['id'].', 394 "'.$share ['share_key'].'",395 "'.$share_key.'", 395 396 "'.pwg_db_real_escape_string($params).'", 396 397 "'.date('Y-m-d H:i:s').'" … … 399 400 pwg_query($query); 400 401 401 return USER_COLLEC_PUBLIC . 'view/' . $share ['share_key'];402 return USER_COLLEC_PUBLIC . 'view/' . $share_key; 402 403 } 403 404 -
extensions/UserCollections/include/collections.inc.php
r24421 r25674 124 124 if ($conf['user_collections']['allow_public']) 125 125 { 126 $share = array(127 'share_key' => get_random_key(16),128 'password' => null,129 'deadline' => null,130 );131 132 126 if (isset($_POST['add_share'])) 133 127 { … … 165 159 $share['open'] = true; 166 160 } 167 161 162 if (!isset($share['share_key'])) 163 { 164 $share['share_key'] = get_random_key(16); 165 $share['password'] = null; 166 $share['deadline'] = null; 167 } 168 168 169 $template->assign('share', $share); 169 170 } -
extensions/UserCollections/include/install.inc.php
r24421 r25674 93 93 94 94 mass_inserts($prefixeTable.'collection_shares', 95 array('col_id','share_key',' add_date'),95 array('col_id','share_key','params','add_date'), 96 96 $inserts 97 97 ); -
extensions/UserCollections/template/collection_edit.tpl
r24421 r25674 18 18 19 19 20 <script>21 20 {footer_script require='jquery,jquery.ui.timepicker'} 21 var bg_color = $('#the_page #content').css('background-color'); 22 if (!bg_color || bg_color=='transparent') {ldelim} 23 bg_color = $('body').css('background-color'); 24 } 25 22 26 {if isset($U_SHARE)} 23 27 {literal} … … 67 71 $share_form.find('.set_share_key').on('click', function() { 68 72 if ($share_form.find('input[name="share_key"]').val().length < 8) { 69 alert("{/literal}{'The key must be at least 8 characters long'|@translate }{literal}");73 alert("{/literal}{'The key must be at least 8 characters long'|@translate|escape:javascript}{literal}"); 70 74 } 71 75 else { … … 107 111 return false; 108 112 }); 109 jQuery("#share_form").css('background-color', jQuery("#the_page #content").css('background-color'));113 jQuery("#share_form").css('background-color', bg_color); 110 114 {/literal} 111 115 {/if} … … 121 125 return false; 122 126 }); 123 jQuery("#mail_form").css('background-color', jQuery("#the_page #content").css('background-color')); 127 128 129 jQuery("#mail_form").css('background-color', bg_color); 124 130 {/literal} 125 131 {/if} … … 138 144 {/literal} 139 145 {/footer_script} 140 </script>141 146 142 147 -
extensions/UserCollections/template/thumbnails_colorbox.tpl
r24421 r25674 10 10 title: function() {ldelim} 11 11 var title = $(this).children("img.thumbnail").attr("alt"); 12 {if $F_ACTION} title+= ' · <a class="addCollection" data-id="'+ $(this).data('id') +'" rel="nofollow">{'Remove from collection'|@translate }</a>';{/if}13 title+= ' · <a href="'+ $(this).attr('href') +'" target="_blank">{'jump to photo'|@translate } →</a>';12 {if $F_ACTION} title+= ' · <a class="addCollection" data-id="'+ $(this).data('id') +'" rel="nofollow">{'Remove from collection'|@translate|escape:javascript}</a>';{/if} 13 title+= ' · <a href="'+ $(this).attr('href') +'" target="_blank">{'jump to photo'|@translate|escape:javascript} →</a>'; 14 14 return title; 15 15 } -
extensions/UserCollections/template/thumbnails_css_js.tpl
r24421 r25674 23 23 // ENTER or ESC pressed 24 24 "keyup": function(event) {ldelim} 25 if (event.which == 27) { 25 if (event.which == 27) {ldelim} 26 26 jQuery(this).val('').hide().prev().show(); 27 27 return; … … 161 161 <div class="switchBoxFooter"> 162 162 <span>✚</span> <a class="new">{'Create a new collection'|@translate}</a> 163 <input class="new" placeholder="{'Name'|@translate}" size="25"/>163 <input type="text" class="new" placeholder="{'Name'|@translate}" size="25"/> 164 164 </div> 165 165 </div>
Note: See TracChangeset
for help on using the changeset viewer.