Changeset 28714
- Timestamp:
- Jun 18, 2014, 9:51:42 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/add_core_tabs.inc.php
r26461 r28714 22 22 // +-----------------------------------------------------------------------+ 23 23 24 add_event_handler('tabsheet_before_select', 'add_core_tabs', 0 , 2);24 add_event_handler('tabsheet_before_select', 'add_core_tabs', 0); 25 25 26 26 function add_core_tabs($sheets, $tab_id) … … 35 35 $sheets['notification'] = array('caption' => '<span class="icon-mail-alt"></span>'.l10n('Notification'), 'url' => $admin_album_base_url.'-notification'); 36 36 break; 37 37 38 38 case 'albums': 39 39 global $my_base_url; … … 42 42 $sheets['permalinks'] = array('caption' => '<span class="icon-link"></span>'.l10n('Permalinks'), 'url' => $my_base_url.'permalinks'); 43 43 break; 44 44 45 45 case 'batch_manager': 46 46 global $manager_link; … … 48 48 $sheets['unit'] = array('caption' => l10n('unit mode'), 'url' => $manager_link.'unit'); 49 49 break; 50 50 51 51 case 'cat_options': 52 52 global $link_start, $conf; … … 58 58 $sheets['representative'] = array('caption' => l10n('Representative'), 'url' => $link_start.'cat_options&section=representative'); 59 59 break; 60 60 61 61 case 'comments': 62 62 $sheets[''] = array('caption' => l10n('User comments'), 'url' => ''); … … 80 80 $sheets['default'] = array('caption' => l10n('Guest Settings'), 'url' => $conf_link.'default'); 81 81 break; 82 82 83 83 case 'help': 84 84 global $help_link; … … 89 89 $sheets['misc'] = array('caption' => l10n('Miscellaneous'), 'url' => $help_link.'misc'); 90 90 break; 91 91 92 92 case 'history': 93 93 global $link_start; … … 95 95 $sheets['history'] = array('caption' => '<span class="icon-search"></span>'.l10n('Search'), 'url' => $link_start.'history'); 96 96 break; 97 97 98 98 case 'languages': 99 99 global $my_base_url; … … 102 102 $sheets['new'] = array('caption' => '<span class="icon-plus-circled"></span>'.l10n('Add New Language'), 'url' => $my_base_url.'&tab=new'); 103 103 break; 104 104 105 105 case 'nbm': 106 106 global $base_url; … … 109 109 $sheets['send'] = array('caption' => l10n('Send'), 'url' => $base_url.'?page=notification_by_mail&mode=send'); 110 110 break; 111 111 112 112 case 'photo': 113 113 global $admin_photo_base_url; … … 115 115 $sheets['coi'] = array('caption' => '<span class="icon-crop"></span>'.l10n('Center of interest'), 'url' => $admin_photo_base_url.'-coi'); 116 116 break; 117 117 118 118 case 'photos_add': 119 119 global $conf; … … 123 123 $sheets['ftp'] = array('caption' => '<span class="icon-exchange"></span>'.l10n('FTP + Synchronization'), 'url' => PHOTOS_ADD_BASE_URL.'&section=ftp'); 124 124 break; 125 125 126 126 case 'plugins': 127 127 global $my_base_url; … … 130 130 $sheets['new'] = array('caption' => '<span class="icon-plus-circled"></span>'.l10n('Other plugins'), 'url' => $my_base_url.'&tab=new'); 131 131 break; 132 132 133 133 case 'rating': 134 134 $sheets['rating'] = array('caption' => l10n('Photos'), 'url' => get_root_url().'admin.php?page=rating'); 135 135 $sheets['rating_user'] = array('caption' => l10n('Users'), 'url' => get_root_url().'admin.php?page=rating_user'); 136 136 break; 137 137 138 138 case 'themes': 139 139 global $my_base_url; … … 142 142 $sheets['new'] = array('caption' => '<span class="icon-plus-circled"></span>'.l10n('Add New Theme'), 'url' => $my_base_url.'&tab=new'); 143 143 break; 144 144 145 145 case 'updates': 146 146 global $my_base_url; … … 149 149 break; 150 150 } 151 151 152 152 return $sheets; 153 153 } -
trunk/admin/include/functions_history.inc.php
r28587 r28714 72 72 $search['image_ids'] = array_from_query($query, 'id'); 73 73 } 74 74 75 75 // echo '<pre>'; print_r($search); echo '</pre>'; 76 76 77 77 $clauses = array(); 78 78 … … 90 90 { 91 91 $local_clauses = array(); 92 92 93 93 foreach ($types as $type) { 94 94 if (in_array($type, $search['fields']['types'])) { … … 102 102 $clause.= "= '".$type."'"; 103 103 } 104 104 105 105 $local_clauses[] = $clause; 106 106 } 107 107 } 108 108 109 109 if (count($local_clauses) > 0) 110 110 { … … 123 123 $clauses[] = 'image_id = '.$search['fields']['image_id']; 124 124 } 125 125 126 126 if (isset($search['fields']['filename'])) 127 127 { … … 141 141 $clauses[] = 'IP LIKE "'.$search['fields']['ip'].'"'; 142 142 } 143 143 144 144 $clauses = prepend_append_array_items($clauses, '(', ')'); 145 145 … … 149 149 $clauses 150 150 ); 151 151 152 152 $query = ' 153 153 SELECT … … 177 177 } 178 178 179 add_event_handler('get_history', 'get_history' , EVENT_HANDLER_PRIORITY_NEUTRAL, 3);179 add_event_handler('get_history', 'get_history'); 180 180 trigger_notify('functions_history_included'); 181 181 -
trunk/admin/include/functions_upload.inc.php
r26461 r28714 26 26 27 27 // add default event handler for image and thumbnail resize 28 add_event_handler('upload_image_resize', 'pwg_image_resize' , EVENT_HANDLER_PRIORITY_NEUTRAL, 7);29 add_event_handler('upload_thumbnail_resize', 'pwg_image_resize' , EVENT_HANDLER_PRIORITY_NEUTRAL, 9);28 add_event_handler('upload_image_resize', 'pwg_image_resize'); 29 add_event_handler('upload_thumbnail_resize', 'pwg_image_resize'); 30 30 31 31 function get_upload_form_config() … … 127 127 $min, $max 128 128 ); 129 129 130 130 $form_errors[$field] = '['.$min.' .. '.$max.']'; 131 131 } … … 261 261 262 262 prepare_directory(dirname($representative_file_path)); 263 263 264 264 $exec = $conf['ext_imagick_dir'].'convert'; 265 265 … … 268 268 $exec .= ' -quality 98'; 269 269 } 270 270 271 271 $exec .= ' "'.realpath($file_path).'"'; 272 272 273 273 $dest = pathinfo($representative_file_path); 274 274 $exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'"'; 275 275 276 276 $exec .= ' 2>&1'; 277 277 @exec($exec, $returnarray); … … 287 287 $representative_file_abspath 288 288 ); 289 289 290 290 if (file_exists($first_file_abspath)) 291 291 { … … 323 323 $rotation_angle = pwg_image::get_rotation_angle($file_path); 324 324 $rotation = pwg_image::get_rotation_code_from_angle($rotation_angle); 325 325 326 326 $file_infos = pwg_image_infos($file_path); 327 327 … … 412 412 $thumb_url = preg_replace('#admin/include/i#', 'i', DerivativeImage::thumb_url($image_infos)); 413 413 unset_make_full_url(); 414 414 415 415 fetchRemote($thumb_url, $dest); 416 416 417 417 418 418 return $image_id; -
trunk/include/common.inc.php
r28587 r28714 270 270 if ( !empty($conf['original_url_protection']) ) 271 271 { 272 add_event_handler('get_element_url', 'get_element_url_protection_handler' , EVENT_HANDLER_PRIORITY_NEUTRAL, 2);273 add_event_handler('get_src_image_url', 'get_src_image_url_protection_handler' , EVENT_HANDLER_PRIORITY_NEUTRAL, 2);272 add_event_handler('get_element_url', 'get_element_url_protection_handler'); 273 add_event_handler('get_src_image_url', 'get_src_image_url_protection_handler'); 274 274 } 275 275 trigger_notify('init'); -
trunk/include/functions_comment.inc.php
r28587 r28714 25 25 * @package functions\comment 26 26 */ 27 28 29 add_event_handler('user_comment_check', 'user_comment_check', 30 EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 27 28 29 add_event_handler('user_comment_check', 'user_comment_check'); 31 30 32 31 /** … … 144 143 $_POST['cr'][] = 'key'; // rvelices: I use this outside to see how spam robots work 145 144 } 146 145 147 146 // website 148 147 if (!empty($comm['website_url'])) … … 159 158 } 160 159 } 161 160 162 161 // email 163 162 if (empty($comm['email'])) … … 178 177 $comment_action='reject'; 179 178 } 180 179 181 180 // anonymous id = ip address 182 181 $ip_components = explode('.', $comm['ip']); … … 284 283 $user_where_clause = ' AND author_id = \''.$GLOBALS['user']['id'].'\''; 285 284 } 286 285 287 286 if (is_array($comment_id)) 288 287 $where_clause = 'id IN('.implode(',', $comment_id).')'; 289 288 else 290 289 $where_clause = 'id = '.$comment_id; 291 290 292 291 $query = ' 293 292 DELETE FROM '.COMMENTS_TABLE.' … … 295 294 $user_where_clause.' 296 295 ;'; 297 296 298 297 if ( pwg_db_changes(pwg_query($query)) ) 299 298 { 300 299 invalidate_user_cache_nb_comments(); 301 300 302 email_admin('delete', 301 email_admin('delete', 303 302 array('author' => $GLOBALS['user']['username'], 304 303 'comment_id' => $comment_id … … 384 383 ;'; 385 384 $result = pwg_query($query); 386 385 387 386 // mail admin and ask to validate the comment 388 if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action) 387 if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action) 389 388 { 390 389 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); … … 412 411 } 413 412 } 414 413 415 414 return $comment_action; 416 415 } … … 483 482 } 484 483 } 485 484 486 485 list($author_id) = pwg_db_fetch_row($result); 487 486 … … 500 499 else 501 500 $where_clause = 'id = '.$comment_id; 502 501 503 502 $query = ' 504 503 UPDATE '.COMMENTS_TABLE.' … … 508 507 ;'; 509 508 pwg_query($query); 510 509 511 510 invalidate_user_cache_nb_comments(); 512 511 trigger_notify('user_comment_validation', $comment_id); -
trunk/include/functions_user.inc.php
r28587 r28714 251 251 { 252 252 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 253 253 254 254 $keyargs_content = array( 255 255 get_l10n_args('Hello %s,', stripslashes($login)), … … 263 263 get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()), 264 264 ); 265 265 266 266 pwg_mail( 267 267 $mail_address, … … 282 282 ) 283 283 ); 284 284 285 285 return $user_id; 286 286 } … … 1051 1051 return true; 1052 1052 } 1053 1053 1054 1054 // Rehash using new hash. 1055 1055 $hash = pwg_password_hash($password); … … 1089 1089 } 1090 1090 1091 add_event_handler('try_log_user', 'pwg_login' , EVENT_HANDLER_PRIORITY_NEUTRAL, 4);1091 add_event_handler('try_log_user', 'pwg_login'); 1092 1092 1093 1093 /** … … 1448 1448 } 1449 1449 1450 /** 1450 /** 1451 1451 * Returns sql WHERE condition for recent photos/albums for current user. 1452 1452 * -
trunk/picture.php
r28640 r28714 136 136 137 137 // add default event handler for rendering element content 138 add_event_handler( 139 'render_element_content', 140 'default_picture_content', 141 EVENT_HANDLER_PRIORITY_NEUTRAL, 142 2 143 ); 138 add_event_handler('render_element_content', 'default_picture_content'); 144 139 // add default event handler for rendering element description 145 140 add_event_handler('render_element_description', 'nl2br');
Note: See TracChangeset
for help on using the changeset viewer.