Changeset 35 for trunk/bb-includes/functions.php
- Timestamp:
- 01/06/2005 01:38:55 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/bb-includes/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.php
r25 r35 189 189 return $bb->admin_email; 190 190 break; 191 case 'edit_lock' : 192 return $bb->edit_lock; 193 break; 191 194 endswitch; 192 195 } … … 258 261 } 259 262 260 function bb_current_time( $type) {263 function bb_current_time( $type = 'timestamp' ) { 261 264 switch ($type) { 262 265 case 'mysql': … … 414 417 } 415 418 419 function can_delete( $user_id, $admin_id = 0) { 420 global $bbdb, $current_user; 421 if ( !$admin_id ) 422 $admin_id = $current_user->user_id; 423 $admin = bb_get_user( $admin_id ); 424 $user = bb_get_user( $user_id ); 425 426 if ( $user->user_type < $admin->user_type && $admin->user_type != 0 ) 427 return true; 428 else 429 return false; 430 } 431 432 function can_edit_post( $post_id, $user_id = 0 ) { 433 global $bbdb, $current_user; 434 if ( !$user_id ) 435 $user_id = $current_user->user_id; 436 $user = bb_get_user( $user_id ); 437 $post = bb_get_post( $post_id ); 438 $post_author = bb_get_user ( $post->poster_id ); 439 440 if ( $user->user_type > $post_author->user_type ) 441 return true; 442 443 $post_time = strtotime( $post->post_time ); 444 $curr_time = time(); 445 $time_limit = bb_get_option('edit_lock') * 60; 446 if ( ($curr_time - $post_time) > $time_limit ) 447 return false; 448 else 449 return true; 450 } 451 416 452 function bb_is_first( $post_id ) { // First post in thread 417 453 global $bbdb;
Note: See TracChangeset
for help on using the changeset viewer.