Ticket #1268: 1268.3.diff
File 1268.3.diff, 27.9 KB (added by , 14 years ago) |
---|
-
bb-admin/includes/functions.bb-upgrade.php
60 60 $bb_upgrade['messages'][] = bb_upgrade_1100(); // Replace forum_stickies index with stickies (#876) 61 61 $bb_upgrade['messages'][] = bb_upgrade_1110(); // Create plugin directory (#1083) 62 62 $bb_upgrade['messages'][] = bb_upgrade_1120(); // Create theme directory (#1083) 63 $bb_upgrade['messages'][] = bb_upgrade_1130(); // Add subscriptions option and set it to true (#1268) 63 64 64 65 bb_update_db_version(); 65 66 wp_cache_flush(); … … 493 494 return; 494 495 } 495 496 497 // Subscription Option 498 function bb_upgrade_1130() { 499 if ( $dbv = bb_get_option_from_db( 'bb_db_version' ) && $dbv >= 2471 ) 500 return; 501 502 // If the option is already there, then return 503 if ( bb_get_option( 'enable_subscriptions' ) ) 504 return; 505 506 bb_update_option( 'enable_subscriptions', 1 ); 507 508 bb_update_option( 'bb_db_version', 2471 ); 509 510 return 'Added subscriptions option and set its value to true: ' . __FUNCTION__; 511 } 512 496 513 function bb_deslash($content) { 497 514 // Note: \\\ inside a regex denotes a single backslash. 498 515 -
bb-admin/options-discussion.php
7 7 bb_check_admin_referer( 'options-discussion-update' ); 8 8 9 9 // Deal with pingbacks checkbox when it isn't checked 10 if ( !isset($_POST['enable_pingback'])) {10 if ( !isset( $_POST['enable_pingback'] ) ) { 11 11 $_POST['enable_pingback'] = false; 12 12 } 13 13 14 if ( !isset($_POST['enable_loginless'])) {14 if ( !isset( $_POST['enable_loginless'] ) ) { 15 15 $_POST['enable_loginless'] = false; 16 16 } 17 17 18 if ( !isset( $_POST['enable_subscriptions'] ) ) { 19 $_POST['enable_subscriptions'] = false; 20 } 21 18 22 // Deal with avatars checkbox when it isn't checked 19 if ( !isset($_POST['avatars_show'])) {23 if ( !isset( $_POST['avatars_show'] ) ) { 20 24 $_POST['avatars_show'] = false; 21 25 } 22 26 23 27 foreach ( (array) $_POST as $option => $value ) { 24 if ( !in_array( $option, array( '_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {28 if ( !in_array( $option, array( '_wpnonce', '_wp_http_referer', 'action', 'submit' ) ) ) { 25 29 $option = trim( $option ); 26 30 $value = is_array( $value ) ? $value : trim( $value ); 27 31 $value = stripslashes_deep( $value ); … … 58 62 1 => __( 'Allow users to create topics and posts without logging in.' ) 59 63 ), 60 64 ), 65 66 'enable_subscriptions' => array( 67 'title' => __( 'Enable Subscriptions' ), 68 'type' => 'checkbox', 69 'options' => array( 70 1 => __( 'Allow users to subscribe to topics and receive new posts via e-mail.' ) 71 ), 72 ), 61 73 ); 62 74 63 75 $bb_get_option_avatars_show = create_function( '$a', 'return 1;' ); -
bb-includes/action.subscribe.php
3 3 if ( !isset( $_GET['doit'] ) || 'bb-subscribe' != $_GET['doit'] ) // sanity check 4 4 die; 5 5 6 if ( !bb_is_subscriptions_active() ) 7 bb_die( __( 'You can not subscribe to topics.' ) ); 8 6 9 if ( !isset( $_GET['topic_id'] ) ) 7 die( 'Missing topic ID');10 bb_die( __( 'Missing topic ID!' ) ); 8 11 9 12 bb_auth( 'logged_in' ); 10 13 11 14 $topic_id = (int) $_GET['topic_id']; 12 15 13 $topic = get_topic 16 $topic = get_topic( $topic_id ); 14 17 if ( !$topic ) 15 bb_die( __('Topic not found.'));18 bb_die( __( 'Topic not found! What are you subscribing to?' ) ); 16 19 17 20 bb_check_admin_referer( 'toggle-subscribe_' . $topic_id ); 18 21 19 22 // Okay, we should be covered now 20 23 21 if ( 'add' == $_GET['and'] ) { 22 $tt_ids = $wp_taxonomy_object->set_object_terms( $bb_current_user->ID, 'topic-' . $topic->topic_id, 'bb_subscribe', array( 'append' => true, 'user_id' => $bb_current_user->ID ) ); 23 } elseif ( 'remove' == $_GET['and'] ) { 24 // I hate this with the passion of a thousand suns 25 $term_id = $bbdb->get_var( "SELECT term_id FROM $bbdb->terms WHERE slug = 'topic-$topic->topic_id'" ); 26 $term_taxonomy_id = $bbdb->get_var( "SELECT term_taxonomy_id FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" ); 27 $bbdb->query( "DELETE FROM $bbdb->term_relationships WHERE object_id = $bb_current_user->ID AND term_taxonomy_id = $term_taxonomy_id" ); 28 $bbdb->query( "DELETE FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" ); 29 } 24 if ( in_array( $_GET['and'], array( 'add', 'remove' ) ) ) 25 bb_subscription_management( $topic->topic_id, $_GET['and'] ); 30 26 31 wp_redirect( get_topic_link( $topic_id, 0) );27 wp_redirect( get_topic_link( $topic_id, 1 ) ); 32 28 33 29 exit; 30 No newline at end of file -
bb-includes/defaults.bb-filters.php
160 160 161 161 add_filter( 'bb_pre_get_option_gmt_offset', 'wp_timezone_override_offset' ); 162 162 163 add_action( 'bb_new_post', 'bb_notify_subscribers' ); 163 // Subscriptions 164 164 165 if ( bb_is_subscriptions_active() ) { 166 add_action( 'bb_new_post', 'bb_notify_subscribers' ); 167 add_action( 'bb_insert_post', 'bb_user_subscribe_checkbox_update' ); 168 add_action( 'topicmeta', 'bb_user_subscribe_link' ); 169 add_action( 'edit_form', 'bb_user_subscribe_checkbox' ); 170 add_action( 'post_form', 'bb_user_subscribe_checkbox' ); 171 } 172 165 173 add_action( 'post_form_pre_post', 'bb_anonymous_post_form' ); 166 174 167 175 unset( $filters, $filter ); -
bb-includes/functions.bb-meta.php
296 296 $r = $bb_locale->text_direction; 297 297 break; 298 298 case 'version': 299 return '1.1-alpha-24 62'; // Don't filter299 return '1.1-alpha-2471'; // Don't filter 300 300 break; 301 301 case 'bb_db_version' : 302 return '2 078'; // Don't filter302 return '2471'; // Don't filter 303 303 break; 304 304 case 'html_type': 305 305 $r = 'text/html'; … … 465 465 'wp_plugins_cookie_path', 466 466 'wordpress_mu_primary_blog_id', 467 467 'enable_loginless', 468 'enable_subscriptions', 468 469 'enable_xmlrpc', 469 470 'enable_pingback', 470 471 'throttle_time', -
bb-includes/functions.bb-posts.php
470 470 return $post_id; 471 471 } 472 472 473 function bb_notify_subscribers( $post_id ) {474 global $bbdb, $bb_current_user, $bb_ksd_pre_post_status;475 476 if ( !empty( $bb_ksd_pre_post_status ) )477 return false;478 479 if ( !$post = bb_get_post( $post_id ) )480 return false;481 482 if ( !$topic = get_topic( $post->topic_id ) )483 return false;484 485 if ( !$user = bb_get_user( $post->poster_id ) )486 return false;487 488 if ( !$term_id = $bbdb->get_var( "SELECT term_id FROM $bbdb->terms WHERE slug = 'topic-$topic->topic_id'" ) )489 return false;490 491 if ( !$term_taxonomy_id = $bbdb->get_var( "SELECT term_taxonomy_id FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" ) )492 return false;493 494 if ( !$user_ids = $bbdb->get_col( "SELECT object_id FROM $bbdb->term_relationships WHERE term_taxonomy_id = $term_taxonomy_id" ) ) // all the users subscribed to this topic495 return false;496 497 foreach ( $user_ids as $user_id ) {498 if ( $user_id == $post->poster_id )499 continue; // don't send notifications to the person who made the post500 501 $user = bb_get_user( $user_id );502 503 $message = __( "%2\$s wrote:\n\n %3\$s\n\nTopic Link: %4\$s\n\nYou're getting this mail because you subscribed to the topic, visit the topic and login to unsubscribe." );504 bb_mail(505 $user->user_email,506 '[' . bb_get_option('name') . '] ' . get_topic_title( $topic_id ),507 sprintf( $message, get_topic_title( $topic_id ), get_user_name( $post->poster_id ), strip_tags( get_post_text( $post_id ) ), get_post_link( $post_id ) )508 );509 }510 }511 512 473 // Deprecated: expects $post_text to be pre-escaped 513 474 function bb_new_post( $topic_id, $post_text ) { 514 475 $post_text = stripslashes( $post_text ); … … 642 603 643 604 return $post_query->results; 644 605 } 606 607 /** 608 * Sends notification emails for new posts. 609 * 610 * Gets new post's ID and check if there are subscribed 611 * user to that topic, and if there are, send notifications 612 * 613 * @since 1.1 614 * 615 * @param int $post_id ID of new post 616 */ 617 function bb_notify_subscribers( $post_id ) { 618 global $bbdb, $bb_ksd_pre_post_status; 619 620 if ( !empty( $bb_ksd_pre_post_status ) ) 621 return false; 622 623 if ( !$post = bb_get_post( $post_id ) ) 624 return false; 625 626 if ( !$topic = get_topic( $post->topic_id ) ) 627 return false; 628 629 $post_id = $post->post_id; 630 $topic_id = $topic->topic_id; 631 632 if ( !$poster_name = get_post_author( $post_id ) ) 633 return false; 634 635 do_action( 'bb_pre_notify_subscribers', $post_id, $topic_id ); 636 637 if ( !$user_ids = $bbdb->get_col( $bbdb->prepare( "SELECT `$bbdb->term_relationships`.`object_id` 638 FROM $bbdb->term_relationships, $bbdb->term_taxonomy, $bbdb->terms 639 WHERE `$bbdb->term_relationships`.`term_taxonomy_id` = `$bbdb->term_taxonomy`.`term_taxonomy_id` 640 AND `$bbdb->term_taxonomy`.`term_id` = `$bbdb->terms`.`term_id` 641 AND `$bbdb->term_taxonomy`.`taxonomy` = 'bb_subscribe' 642 AND `$bbdb->terms`.`slug` = 'topic-%d'", 643 $topic_id ) ) ) 644 return false; 645 646 foreach ( (array) $user_ids as $user_id ) { 647 if ( $user_id == $post->poster_id ) 648 continue; // don't send notifications to the person who made the post 649 650 $user = bb_get_user( $user_id ); 651 652 if ( !$message = apply_filters( 'bb_subscription_mail_message', __( "%1\$s wrote:\n\n%2\$s\n\nPost Link: %3\$s\n\nYou're getting this mail because you subscribed to the topic, visit the topic and login to unsubscribe." ), $post_id, $topic_id ) ) 653 continue; /* For plugins */ 654 655 bb_mail( 656 $user->user_email, 657 apply_filters( 'bb_subscription_mail_title', '[' . bb_get_option( 'name' ) . '] ' . $topic->topic_title, $post_id, $topic_id ), 658 sprintf( $message, $poster_name, strip_tags( $post->post_text ), get_post_link( $post_id ) ) 659 ); 660 } 661 662 do_action( 'bb_post_notify_subscribers', $post_id, $topic_id ); 663 } 664 665 /** 666 * Updates user's subscription status in database. 667 * 668 * Gets user's new subscription status for topic and 669 * adds new status to database. 670 * 671 * @since 1.1 672 * 673 * @param int $topic_id ID of topic for subscription 674 * @param string $new_status New subscription status 675 */ 676 function bb_subscription_management( $topic_id, $new_status ) { 677 global $bbdb, $wp_taxonomy_object; 678 679 $topic = get_topic( $topic_id ); 680 $user_id = bb_get_current_user_info( 'id' ); 681 682 do_action( 'bb_subscripton_management', $topic_id, $new_status, $user_id ); 683 684 switch ( $new_status ) { 685 case 'add': 686 $tt_ids = $wp_taxonomy_object->set_object_terms( $user_id, 'topic-' . $topic->topic_id, 'bb_subscribe', array( 'append' => true, 'user_id' => $user_id ) ); 687 break; 688 case 'remove': 689 // I hate this with the passion of a thousand suns 690 $term_id = $bbdb->get_var( "SELECT term_id FROM $bbdb->terms WHERE slug = 'topic-$topic->topic_id'" ); 691 $term_taxonomy_id = $bbdb->get_var( "SELECT term_taxonomy_id FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" ); 692 $bbdb->query( "DELETE FROM $bbdb->term_relationships WHERE object_id = $user_id AND term_taxonomy_id = $term_taxonomy_id" ); 693 $bbdb->query( "DELETE FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" ); 694 break; 695 } 696 697 } 698 699 /** 700 * Process subscription checkbox submission. 701 * 702 * Get ID of and new subscription status and pass values to 703 * bb_user_subscribe_checkbox_update function 704 * 705 * @since 1.1 706 * 707 * @param int $post_id ID of new/edited post 708 */ 709 function bb_user_subscribe_checkbox_update( $post_id ) { 710 if ( !bb_is_user_logged_in() ) 711 return false; 712 713 $post = bb_get_post( $post_id ); 714 $topic_id = (int) $post->topic_id; 715 $subscribed = bb_is_user_subscribed( array( 'topic_id' => $topic_id, 'user_id' => $post->poster_id ) ) ? true : false; 716 $check = $_REQUEST['subscription_checkbox']; 717 718 do_action( 'bb_user_subscribe_checkbox_update', $post_id, $topic_id, $subscribe, $check ); 719 720 if ( 'subscribe' == $check && !$subscribed ) 721 bb_subscription_management( $topic_id, 'add' ); 722 elseif ( !$check && $subscribed ) 723 bb_subscription_management( $topic_id, 'remove' ); 724 725 } -
bb-includes/functions.bb-template.php
3437 3437 echo "<span id='favorite-$topic->topic_id'>$pre<a href='$url' class='dim:favorite-toggle:favorite-$topic->topic_id:is-favorite'>$mid</a>$post</span>"; 3438 3438 } 3439 3439 3440 function bb_user_subscribe_link() {3441 global $topic, $bb_current_user, $bbdb, $bb;3442 3443 if ( !bb_is_user_logged_in() )3444 return false;3445 3446 $there = false;3447 if ( $term_id = $bbdb->get_var( "SELECT term_id FROM $bbdb->terms WHERE slug = 'topic-$topic->topic_id'" ) ) {3448 $term_taxonomy_ids = $bbdb->get_col( "SELECT term_taxonomy_id FROM $bbdb->term_taxonomy WHERE term_id = $term_id AND taxonomy = 'bb_subscribe'" );3449 $term_taxonomy_ids = join(',', $term_taxonomy_ids );3450 $there = $bbdb->get_var( "SELECT object_id FROM $bbdb->term_relationships WHERE object_id = $bb_current_user->ID AND term_taxonomy_id IN ( $term_taxonomy_ids )" );3451 }3452 3453 3454 if ( $there )3455 echo '<a href="'. bb_nonce_url( "$bb->uri?doit=bb-subscribe&topic_id=$topic->topic_id&and=remove", 'toggle-subscribe_' . $topic->topic_id ) .'">' . __( 'Unsubscribe from Topic' ) . '</a>';3456 else3457 echo '<a href="'. bb_nonce_url( "$bb->uri?doit=bb-subscribe&topic_id=$topic->topic_id&and=add", 'toggle-subscribe_' . $topic->topic_id ) .'">' . __( 'Subscribe to Topic' ) . '</a>';3458 3459 }3460 3461 3440 function favorites_rss_link( $id = 0, $context = 0 ) { 3462 3441 if (!$context || !is_integer($context)) { 3463 3442 $context = BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_FEED; … … 3497 3476 } 3498 3477 } 3499 3478 3479 //SUBSCRIPTION 3480 3481 /** 3482 * Checks if subscription is enabled. 3483 * 3484 * @since 1.1 3485 * 3486 * @return bool is subscription enabled or not 3487 */ 3488 function bb_is_subscriptions_active() { 3489 return (bool) bb_get_option( 'enable_subscriptions' ); 3490 } 3491 3492 /** 3493 * Checks if user is subscribed to current topic. 3494 * 3495 * @since 1.1 3496 * 3497 * @return bool is user subscribed or not 3498 */ 3499 function bb_is_user_subscribed( $args = null ) { 3500 global $bbdb; 3501 3502 $defaults = array( 3503 'user_id' => bb_get_current_user_info( 'id' ), 3504 'topic_id' => get_topic_id() 3505 ); 3506 $args = wp_parse_args( $args, $defaults ); 3507 extract( $args, EXTR_SKIP ); 3508 3509 $there = $bbdb->get_var( $bbdb->prepare( "SELECT `$bbdb->term_relationships`.`object_id` 3510 FROM $bbdb->term_relationships, $bbdb->term_taxonomy, $bbdb->terms 3511 WHERE `$bbdb->term_relationships`.`object_id` = %d 3512 AND `$bbdb->term_relationships`.`term_taxonomy_id` = `$bbdb->term_taxonomy`.`term_taxonomy_id` 3513 AND `$bbdb->term_taxonomy`.`term_id` = `$bbdb->terms`.`term_id` 3514 AND `$bbdb->term_taxonomy`.`taxonomy` = 'bb_subscribe' 3515 AND `$bbdb->terms`.`slug` = 'topic-%d'", 3516 $user_id, $topic_id ) ); 3517 3518 $there = apply_filters( 'bb_is_user_subscribed', $there, $args ); 3519 3520 if ( $there ) 3521 return true; 3522 3523 return false; 3524 } 3525 3526 /** 3527 * Outputs the subscribe/unsubscibe link. 3528 * 3529 * Checks if user is subscribed and outputs link based on status. 3530 * 3531 * @since 1.1 3532 */ 3533 function bb_user_subscribe_link() { 3534 $topic_id = get_topic_id(); 3535 3536 if ( !bb_is_user_logged_in() ) 3537 return false; 3538 3539 if ( bb_is_user_subscribed() ) 3540 echo '<li id="subscription-toggle"><a href="'. bb_nonce_url( bb_get_uri( null, array( 'doit' => 'bb-subscribe', 'topic_id' => $topic_id, 'and' => 'remove' ) ), 'toggle-subscribe_' . $topic_id ) .'">' . apply_filters( 'bb_user_subscribe_link_unsubscribe', __( 'Unsubscribe from Topic' ) ) . '</a></li>'; 3541 else 3542 echo '<li id="subscription-toggle"><a href="'. bb_nonce_url( bb_get_uri( null, array( 'doit' => 'bb-subscribe', 'topic_id' => $topic_id, 'and' => 'add' ) ), 'toggle-subscribe_' . $topic_id ) .'">' . apply_filters( 'bb_user_subscribe_link_subscribe', __( 'Subscribe to Topic' ) ) . '</a></li>'; 3543 3544 } 3545 3546 /** 3547 * Outputs the post form subscription checkbox. 3548 * 3549 * Checks if user is subscribed and outputs checkbox based on status. 3550 * 3551 * @since 1.1 3552 */ 3553 function bb_user_subscribe_checkbox( $args = null ) { 3554 3555 if ( !bb_is_user_logged_in() ) 3556 return false; 3557 3558 $defaults = array( 'tab' => false ); 3559 $args = wp_parse_args( $args, $defaults ); 3560 $tab = $args['tab'] !== false ? ' tabindex="' . $args['tab'] . '"' : ''; 3561 3562 echo ' 3563 <label for="subscription_checkbox"> 3564 <input name="subscription_checkbox" id="subscription_checkbox" type="checkbox" value="subscribe" ' . checked( true, bb_is_user_subscribed(), false ) . $tab . ' /> 3565 ' . apply_filters( 'bb_user_subscribe_checkbox_label', __( 'Notify me of followup posts via e-mail' ) ) . ' 3566 </label>'; 3567 3568 } 3569 3500 3570 //VIEWS 3501 3571 function view_name( $view = '' ) { // Filtration should be done at bb_register_view() 3502 3572 echo get_view_name( $view ); … … 3590 3660 } 3591 3661 } 3592 3662 } 3663 3664 if ( !function_exists( 'checked' ) ) : 3665 /** 3666 * Outputs the html checked attribute. 3667 * 3668 * Compares the first two arguments and if identical marks as checked 3669 * 3670 * @since 1.1 3671 * 3672 * @param mixed $checked One of the values to compare 3673 * @param mixed $current (true) The other value to compare if not just true 3674 * @param bool $echo Whether to echo or just return the string 3675 * @return string html attribute or empty string 3676 */ 3677 function checked( $checked, $current = true, $echo = true ) { 3678 return __checked_selected_helper( $checked, $current, $echo, 'checked' ); 3679 } 3680 endif; 3681 3682 if ( !function_exists( 'selected' ) ) : 3683 /** 3684 * Outputs the html selected attribute. 3685 * 3686 * Compares the first two arguments and if identical marks as selected 3687 * 3688 * @since 1.1 3689 * 3690 * @param mixed selected One of the values to compare 3691 * @param mixed $current (true) The other value to compare if not just true 3692 * @param bool $echo Whether to echo or just return the string 3693 * @return string html attribute or empty string 3694 */ 3695 function selected( $selected, $current = true, $echo = true ) { 3696 return __checked_selected_helper( $selected, $current, $echo, 'selected' ); 3697 } 3698 endif; 3699 3700 if ( !function_exists( 'disabled' ) ) : 3701 /** 3702 * Outputs the html disabled attribute. 3703 * 3704 * Compares the first two arguments and if identical marks as disabled 3705 * 3706 * @since 1.1 3707 * 3708 * @param mixed $disabled One of the values to compare 3709 * @param mixed $current (true) The other value to compare if not just true 3710 * @param bool $echo Whether to echo or just return the string 3711 * @return string html attribute or empty string 3712 */ 3713 function disabled( $disabled, $current = true, $echo = true ) { 3714 return __checked_selected_helper( $disabled, $current, $echo, 'disabled' ); 3715 } 3716 endif; 3717 3718 if ( !function_exists( '__checked_selected_helper' ) ) : 3719 /** 3720 * Private helper function for checked, selected, and disabled. 3721 * 3722 * Compares the first two arguments and if identical marks as $type 3723 * 3724 * @since 1.1 3725 * @access private 3726 * 3727 * @param any $helper One of the values to compare 3728 * @param any $current (true) The other value to compare if not just true 3729 * @param bool $echo Whether to echo or just return the string 3730 * @param string $type The type of checked|selected|disabled we are doing 3731 * @return string html attribute or empty string 3732 */ 3733 function __checked_selected_helper( $helper, $current, $echo, $type ) { 3734 if ( (string) $helper === (string) $current ) 3735 $result = " $type='$type'"; 3736 else 3737 $result = ''; 3738 3739 if ( $echo ) 3740 echo $result; 3741 3742 return $result; 3743 } 3744 endif; -
bb-templates/kakumei-blue/functions.php
1 <?php 2 /* Functions for Kakumei Blue Theme */ 3 4 /* The below actions are removed because we add our own checkbox (check post-form.php and edit-form.php) */ 5 remove_action( 'post_form', 'bb_user_subscribe_checkbox' ); 6 remove_action( 'edit_form', 'bb_user_subscribe_checkbox' ); -
bb-templates/kakumei/edit-form.php
1 1 2 2 <?php if ( $topic_title ) : ?> 3 3 <p role="main"> 4 <label for="topic"><?php _e('Topic:'); ?><br /> 5 6 <input name="topic" type="text" id="topic" size="50" maxlength="80" value="<?php echo esc_attr( get_topic_title() ); ?>" /> 7 </label> 4 <label for="topic"><?php _e( 'Topic:' ); ?><br /> 5 <input name="topic" type="text" id="topic" size="50" maxlength="80" tabindex="1" value="<?php echo esc_attr( get_topic_title() ); ?>" /> 6 </label> 8 7 </p> 9 8 <?php endif; do_action( 'edit_form_pre_post' ); ?> 10 <p><label for="post_content"><?php _e('Post:'); ?><br /> 11 <textarea name="post_content" cols="50" rows="8" id="post_content"><?php echo apply_filters('edit_text', get_post_text() ); ?></textarea> 12 </label> 9 10 <p> 11 <label for="post_content"><?php _e( 'Post:' ); ?><br /> 12 <textarea name="post_content" cols="50" rows="8" tabindex="2" id="post_content"><?php echo apply_filters( 'edit_text', get_post_text() ); ?></textarea> 13 </label> 13 14 </p> 15 16 <?php if ( bb_is_user_logged_in() && bb_is_subscriptions_active() ) : ?> 17 <p id="post-form-subscription-container" class="left"> 18 <?php bb_user_subscribe_checkbox( 'tab=3' ); ?> 19 </p> 20 <?php endif; ?> 21 14 22 <p class="submit"> 15 <input type="submit" name="Submit" value="<?php echo esc_attr__( 'Edit Post »' ); ?>" />16 <input type="hidden" name="post_id" value="<?php post_id(); ?>" />17 <input type="hidden" name="topic_id" value="<?php topic_id(); ?>" />23 <input type="submit" name="Submit" value="<?php esc_attr_e( 'Edit Post »' ); ?>" tabindex="4" /> 24 <input type="hidden" name="post_id" value="<?php post_id(); ?>" /> 25 <input type="hidden" name="topic_id" value="<?php topic_id(); ?>" /> 18 26 </p> 19 <p><?php _e('Allowed markup:'); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e('Put code in between <code>`backticks`</code>.'); ?></p> 27 28 <p><?php _e( 'Allowed markup:' ); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e( 'Put code in between <code>`backticks`</code>.' ); ?></p> -
bb-templates/kakumei/functions.php
1 <?php 2 /* Functions for Kakumei Theme */ 3 4 /* The below actions are removed because we add our own checkbox (check post-form.php and edit-form.php) */ 5 remove_action( 'post_form', 'bb_user_subscribe_checkbox' ); 6 remove_action( 'edit_form', 'bb_user_subscribe_checkbox' ); -
bb-templates/kakumei/post-form-anonymous.php
1 1 <?php $current_poster = bb_get_current_poster(); ?> 2 2 <p id="post-form-author-container"> 3 3 <label for="author"><?php _e( 'Author (required)' ); ?> 4 <input type="text" name="author" id="author" size="50" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author'] ); ?>" />4 <input type="text" name="author" id="author" size="50" tabindex="2" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author'] ); ?>" /> 5 5 </label> 6 6 </p> 7 7 8 8 <p id="post-form-email-container"> 9 9 <label for="email"><?php _e( 'Email (required)' ); ?> 10 <input type="text" name="email" id="email" size="50" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author_email'] ); ?>" />10 <input type="text" name="email" id="email" size="50" tabindex="3" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author_email'] ); ?>" /> 11 11 </label> 12 12 </p> 13 13 14 14 <p id="post-form-url-container"> 15 15 <label for="url"><?php _e( 'URL' ); ?> 16 <input type="text" name="url" id="url" size="50" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author_url'] ); ?>" />16 <input type="text" name="url" id="url" size="50" tabindex="4" aria-required="true" value="<?php echo esc_attr( $current_poster['post_author_url'] ); ?>" /> 17 17 </label> 18 18 </p> -
bb-templates/kakumei/post-form.php
1 1 <?php if ( !bb_is_topic() ) : ?> 2 2 <p id="post-form-title-container"> 3 <label for="topic"><?php _e( 'Title'); ?>3 <label for="topic"><?php _e( 'Title' ); ?> 4 4 <input name="topic" type="text" id="topic" size="50" maxlength="100" tabindex="1" /> 5 5 </label> 6 6 </p> 7 7 <?php endif; do_action( 'post_form_pre_post' ); ?> 8 8 9 9 <p id="post-form-post-container"> 10 <label for="post_content"><?php _e( 'Post'); ?>11 <textarea name="post_content" cols="50" rows="8" id="post_content" tabindex=" 3"></textarea>10 <label for="post_content"><?php _e( 'Post' ); ?> 11 <textarea name="post_content" cols="50" rows="8" id="post_content" tabindex="5"></textarea> 12 12 </label> 13 13 </p> 14 14 <p id="post-form-tags-container"> 15 <label for="tags-input"><?php printf(__('Tags (comma separated)'), bb_get_tag_page_link())?>16 <input id="tags-input" name="tags" type="text" size="50" maxlength="100" value="<?php bb_tag_name(); ?>" tabindex=" 4" />15 <label for="tags-input"><?php _e( 'Tags (comma separated)' ); ?> 16 <input id="tags-input" name="tags" type="text" size="50" maxlength="100" value="<?php bb_tag_name(); ?>" tabindex="6" /> 17 17 </label> 18 18 </p> 19 19 <?php if ( bb_is_tag() || bb_is_front() ) : ?> 20 20 <p id="post-form-forum-container"> 21 <label for="forum-id"><?php _e( 'Forum'); ?>22 <?php bb_new_topic_forum_dropdown( ); ?>21 <label for="forum-id"><?php _e( 'Forum' ); ?> 22 <?php bb_new_topic_forum_dropdown( 'tab=7' ); ?> 23 23 </label> 24 24 </p> 25 25 <?php endif; ?> 26 27 <?php if ( bb_is_user_logged_in() && bb_is_subscriptions_active() ) : ?> 28 <p id="post-form-subscription-container" class="left"> 29 <?php bb_user_subscribe_checkbox( 'tab=8' ); ?> 30 </p> 31 <?php endif; ?> 32 26 33 <p id="post-form-submit-container" class="submit"> 27 <input type="submit" id="postformsub" name="Submit" value="<?php echo esc_attr__( 'Send Post »' ); ?>" tabindex="4" />34 <input type="submit" id="postformsub" name="Submit" value="<?php esc_attr_e( 'Send Post »' ); ?>" tabindex="9" /> 28 35 </p> 29 36 30 <p id="post-form-allowed-container" class="allowed"><?php _e('Allowed markup:'); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e('You can also put code in between backtick ( <code>`</code> ) characters.'); ?></p> 37 <div class="clear"></div> 38 39 <p id="post-form-allowed-container" class="allowed"><?php _e( 'Allowed markup:' ); ?> <code><?php allowed_markup(); ?></code>. <br /><?php _e( 'You can also put code in between backtick ( <code>`</code> ) characters.' ); ?></p> -
bb-templates/kakumei/style.css
31 31 32 32 .right { float: right; } 33 33 34 .clear { clear: both; } 35 34 36 .delete:hover { 35 37 background-color: #c00; 36 38 color: #fff; -
bb-templates/kakumei/topic.php
16 16 <?php endif; ?> 17 17 <?php if ( bb_is_user_logged_in() ) : ?> 18 18 <li<?php echo $class;?> id="favorite-toggle"><?php user_favorites_link(); ?></li> 19 <li id="subscribe-toggle"><?php bb_user_subscribe_link(); ?></li>20 19 <?php endif; do_action('topicmeta'); ?> 21 20 </ul> 22 21 </div>