1, // The depth we start to roll up the comments from. 'stylesheet' => '%3$s/style/comments.css', 'credit' => true, 'title' => 'Comments', 'trackback' => 'Trackbacks', 'form_title' => 'Post a comment', 'polling' => 30, // Frequency to poll the server for new comments in seconds. 'update' => false, // Do we want to auto update or not. 'form_avatar' => true, 'link_button' => true, 'quote_button' => true, 'quote_select' => false, 'quote_target' => '.hentry', 'tc_scroll_offset' => 0 ); var $stuff_boxes = array(); function init() { $this->add_stuff_box( array( 'title' => __( 'Rollup Depth', SPEC_COMMENT_DOM ), 'callback' => 'comment_nest_depth' ) ); $this->add_stuff_box( array( 'title' => __( 'Titles and form', SPEC_COMMENT_DOM ), 'callback' => 'titles' ) ); $this->add_stuff_box( array( 'title' => __( 'Stylesheet', SPEC_COMMENT_DOM ), 'callback' => 'stylesheet' ) ); $this->add_stuff_box( array( 'title' => __( 'Comment update', SPEC_COMMENT_DOM ), 'callback' => 'polling' ) ); $this->add_stuff_box( array( 'title' => __( 'Buttons', SPEC_COMMENT_DOM ), 'callback' => 'buttons' ) ); $this->add_stuff_box( array( 'title' => __( 'Our credit', SPEC_COMMENT_DOM ), 'callback' => 'credit' ) ); } function buttons( $options = '' ) { ?>



:(
interconnecit/it

defaults; } else { // My options $output[ 'title' ] = html_entity_decode( stripcslashes( $options[ 'title' ] ) ); $output[ 'trackback' ] = html_entity_decode( stripcslashes( $options[ 'trackback' ] ) ); $output[ 'form_title' ] = html_entity_decode( stripcslashes( $options[ 'form_title' ] ) ); $output[ 'comments_nest_depth' ] = intval( $options[ 'comments_nest_depth' ] ) >= 0 && intval( $options[ 'comments_nest_depth' ] ) <= 10 ? intval( $options[ 'comments_nest_depth' ] ) : $this->defaults[ 'comments_nest_depth' ]; $output[ 'polling' ] = intval( $options[ 'polling' ] ) >= 10 && intval( $options[ 'polling' ] ) <= 999 ? intval( $options[ 'polling' ] ) : $this->defaults[ 'polling' ]; $output[ 'quote_target' ] = preg_match( '/^(\.|#)?[a-zA-Z0-9-_]+$/is', $options[ 'quote_target' ] ) ? $options[ 'quote_target' ] : $this->defaults[ 'quote_target' ]; $output[ 'tc_scroll_offset' ] = isset( $options[ 'tc_scroll_offset' ] ) && is_numeric( $options[ 'tc_scroll_offset' ] ) ? $options[ 'tc_scroll_offset' ] : 0; $output[ 'credit' ] = isset( $options[ 'credit' ] ) ? true : false; $output[ 'update' ] = isset( $options[ 'update' ] ) ? true : false; $output[ 'form_avatar' ] = isset( $options[ 'form_avatar' ] ) ? true : false; $output[ 'link_button' ] = isset( $options[ 'link_button' ] ) ? true : false; $output[ 'quote_button' ] = isset( $options[ 'quote_button' ] ) ? true : false; $output[ 'quote_select' ] = isset( $options[ 'quote_select' ] ) ? true : false; $stylesheets = spec_stylesheet_find(); if ( strtolower( $options[ 'stylesheet' ] ) === 'disabled' ) { $output[ 'stylesheet' ] = 'disabled'; } else if ( isset( $stylesheets[ $options[ 'stylesheet' ] ][ 'url' ] ) ) { $output[ 'stylesheet' ] = $stylesheets[ $options[ 'stylesheet' ] ][ 'url' ]; } else { $output[ 'stylesheet' ] = $this->defaults[ 'stylesheet' ]; } return $output; } } /* ++++++++++++++++++++++ Shouldn't need to edit beyond here ++++++++ */ /* Output the that goes in the name or ID field just for the sake of lazy. */ function item_attrib( $value, $name = false ) { if ( $name ) { echo esc_attr( SPEC_COMMENT_OPT . "[{$value}]" ); } else { echo esc_attr( SPEC_COMMENT_OPT . "_{$value}" ); } } function add_options_pages() { register_setting( SPEC_COMMENT_OPT, SPEC_COMMENT_OPT, array( $this, 'validate_options' ) ); add_options_page( __( 'Spectacu.la Discussion', SPEC_COMMENT_DOM ), __( 'Spectacu.la Discussion', SPEC_COMMENT_DOM ), 'manage_options', SPEC_COMMENT_OPT, array( $this, 'options_page' ) ); } public function __construct() { global $wp_version; if ( !defined( 'SPEC_COMMENT_OPT' ) ) { define( 'SPEC_COMMENT_OPT', 'spectacula_threaded_comments' ); } if ( !defined( 'SPEC_COMMENT_DOM' ) ) { define( 'SPEC_COMMENT_DOM', 'spectacula-threaded-comments' ); } $this->defaults = apply_filters( 'spec_discussion_defaults', $this->defaults ); foreach ( $this->defaults as $key => $value ) { if ( is_string( $value ) ) { $this->defaults[ $key ] = sprintf( $value, get_bloginfo( 'template_url' ), get_template_directory(), SPEC_COMMENT_URL, SPEC_COMMENT_PTH ); } } $this->options = wp_parse_args( get_option( SPEC_COMMENT_OPT ), $this->defaults ); add_action( 'init', array( $this, 'init' ) ); add_action( 'admin_menu', array( $this, 'add_options_pages' ) ); } function retrieve_comment_option( $option_name ) { if ( isset( $this->options[ $option_name ] ) ) { return $this->options[ $option_name ]; } else { return false; } } function do_stuff_boxes() { foreach ( ( array )$this->stuff_boxes as $box ) { if ( isset( $box[ 'callback' ] ) && is_callable( array( $this, $box[ 'callback' ] ) ) ) { ?>

options, $box[ 'title' ] ) ); ?>
'Stuff Box', 'callback' => '' ); $r = wp_parse_args( $args, $defaults ); if ( isset( $r[ 'callback' ] ) ) { $this->stuff_boxes[] = $r; } } function options_page() { ?>

do_stuff_boxes(); ?>
retrieve_comment_option( $option_name ); } } } ?>