is->escape( $v ); else $data[$k] = $this->_weak_escape( $v ); } } else { $data = $this->_weak_escape( $data ); } return $data; } /** * Escapes content by reference for insertion into the database, for security * * @since 2.3.0 * * @param string $s */ function escape_by_ref(&$string) { $string = $this->_real_escape( $string ); } /** * Prepares a SQL query for safe execution. Uses sprintf()-like syntax. * * This function only supports a small subset of the sprintf syntax; it only supports %d (decimal number), %s (string). * Does not support sign, padding, alignment, width or precision specifiers. * Does not support argument numbering/swapping. * * May be called like {@link http://php.net/sprintf sprintf()} or like {@link http://php.net/vsprintf vsprintf()}. * * Both %d and %s should be left unquoted in the query string. * * * wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", "foo", 1337 ) * * * @link http://php.net/sprintf Description of syntax. * @since 2.3.0 * * @param string $query Query statement with sprintf()-like placeholders * @param array|mixed $args The array of variables to substitute into the query's placeholders if being called like {@link http://php.net/vsprintf vsprintf()}, or the first variable to substitute into the query's placeholders if being called like {@link http://php.net/sprintf sprintf()}. * @param mixed $args,... further variables to substitute into the query's placeholders if being called like {@link http://php.net/sprintf sprintf()}. * @return null|string Sanitized query string */ function prepare($query = null) { // ( $query, *$args ) if ( is_null( $query ) ) return; $args = func_get_args(); array_shift($args); // If args were passed as an array (as in vsprintf), move them up if ( isset($args[0]) && is_array($args[0]) ) $args = $args[0]; $query = str_replace("'%s'", '%s', $query); // in case someone mistakenly already singlequoted it $query = str_replace('"%s"', '%s', $query); // doublequote unquoting $query = str_replace('%s', "'%s'", $query); // quote the strings array_walk($args, array(&$this, 'escape_by_ref')); return @vsprintf($query, $args); } /** * Print SQL/DB error. * * @since 0.71 * @global array $EZSQL_ERROR Stores error information of query and error string * * @param string $str The error to display * @return bool False if the showing of errors is disabled. */ function print_error($str = '') { global $EZSQL_ERROR; if (!$str) $str = mysql_error($this->dbh); $EZSQL_ERROR[] = array ('query' => $this->last_query, 'error_str' => $str); if ( $this->suppress_errors ) return false; if ( $caller = $this->get_caller() ) $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR_FULL*/'WordPress database error %1$s for query %2$s made by %3$s'/*/WP_I18N_DB_QUERY_ERROR_FULL*/, $str, $this->last_query, $caller); else $error_str = sprintf(/*WP_I18N_DB_QUERY_ERROR*/'WordPress database error %1$s for query %2$s'/*/WP_I18N_DB_QUERY_ERROR*/, $str, $this->last_query); $log_error = true; if ( ! function_exists('error_log') ) $log_error = false; $log_file = @ini_get('error_log'); if ( !empty($log_file) && ('syslog' != $log_file) && !@is_writable($log_file) ) $log_error = false; if ( $log_error ) @error_log($error_str, 0); // Is error output turned on or not.. if ( !$this->show_errors ) return false; $str = htmlspecialchars($str, ENT_QUOTES); $query = htmlspecialchars($this->last_query, ENT_QUOTES); // If there is an error then take note of it print "

WordPress database error: [$str]
$query

"; } /** * Enables showing of database errors. * * This function should be used only to enable showing of errors. * wpdb::hide_errors() should be used instead for hiding of errors. However, * this function can be used to enable and disable showing of database * errors. * * @since 0.71 * * @param bool $show Whether to show or hide errors * @return bool Old value for showing errors. */ function show_errors( $show = true ) { $errors = $this->show_errors; $this->show_errors = $show; return $errors; } /** * Disables showing of database errors. * * @since 0.71 * * @return bool Whether showing of errors was active or not */ function hide_errors() { $show = $this->show_errors; $this->show_errors = false; return $show; } /** * Whether to suppress database errors. * * @param unknown_type $suppress * @return unknown */ function suppress_errors( $suppress = true ) { $errors = $this->suppress_errors; $this->suppress_errors = $suppress; return $errors; } /** * Kill cached query results. * * @since 0.71 */ function flush() { $this->last_result = array(); $this->col_info = null; $this->last_query = null; } /** * Perform a MySQL database query, using current database connection. * * More information can be found on the codex page. * * @since 0.71 * * @param string $query * @return int|false Number of rows affected/selected or false on error */ function query($query) { if ( ! $this->ready ) return false; // filter the query, if filters are available // NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method if ( function_exists('apply_filters') ) $query = apply_filters('query', $query); // initialise return $return_val = 0; $this->flush(); // Log how the function was called $this->func_call = "\$db->query(\"$query\")"; // Keep track of the last query for debug.. $this->last_query = $query; // Perform the query via std mysql_query function.. if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->timer_start(); $this->result = @mysql_query($query, $this->dbh); ++$this->num_queries; if ( defined('SAVEQUERIES') && SAVEQUERIES ) $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() ); // If there is an error then take note of it.. if ( $this->last_error = mysql_error($this->dbh) ) { $this->print_error(); return false; } if ( preg_match("/^\\s*(insert|delete|update|replace|alter) /i",$query) ) { $this->rows_affected = mysql_affected_rows($this->dbh); // Take note of the insert_id if ( preg_match("/^\\s*(insert|replace) /i",$query) ) { $this->insert_id = mysql_insert_id($this->dbh); } // Return number of rows affected $return_val = $this->rows_affected; } else { $i = 0; while ($i < @mysql_num_fields($this->result)) { $this->col_info[$i] = @mysql_fetch_field($this->result); $i++; } $num_rows = 0; while ( $row = @mysql_fetch_object($this->result) ) { $this->last_result[$num_rows] = $row; $num_rows++; } @mysql_free_result($this->result); // Log number of rows the query returned $this->num_rows = $num_rows; // Return number of rows selected $return_val = $this->num_rows; } return $return_val; } /** * Insert a row into a table. * * * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) * * * @since 2.5.0 * @see wpdb::prepare() * * @param string $table table name * @param array $data Data to insert (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). * @param array|string $format (optional) An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%s' (decimal number, string). If omitted, all values in $data will be treated as strings. * @return int|false The number of rows inserted, or false on error. */ function insert($table, $data, $format = null) { $formats = $format = (array) $format; $fields = array_keys($data); $formatted_fields = array(); foreach ( $fields as $field ) { if ( !empty($format) ) $form = ( $form = array_shift($formats) ) ? $form : $format[0]; elseif ( isset($this->field_types[$field]) ) $form = $this->field_types[$field]; else $form = '%s'; $formatted_fields[] = $form; } $sql = "INSERT INTO `$table` (`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')"; return $this->query( $this->prepare( $sql, $data) ); } /** * Update a row in the table * * * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) ) * * * @since 2.5.0 * @see wpdb::prepare() * * @param string $table table name * @param array $data Data to update (in column => value pairs). Both $data columns and $data values should be "raw" (neither should be SQL escaped). * @param array $where A named array of WHERE clauses (in column => value pairs). Multiple clauses will be joined with ANDs. Both $where columns and $where values should be "raw". * @param array|string $format (optional) An array of formats to be mapped to each of the values in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%s' (decimal number, string). If omitted, all values in $data will be treated as strings. * @param array|string $format_where (optional) An array of formats to be mapped to each of the values in $where. If string, that format will be used for all of the items in $where. A format is one of '%d', '%s' (decimal number, string). If omitted, all values in $where will be treated as strings. * @return int|false The number of rows updated, or false on error. */ function update($table, $data, $where, $format = null, $where_format = null) { if ( !is_array( $where ) ) return false; $formats = $format = (array) $format; $bits = $wheres = array(); foreach ( (array) array_keys($data) as $field ) { if ( !empty($format) ) $form = ( $form = array_shift($formats) ) ? $form : $format[0]; elseif ( isset($this->field_types[$field]) ) $form = $this->field_types[$field]; else $form = '%s'; $bits[] = "`$field` = {$form}"; } $where_formats = $where_format = (array) $where_format; foreach ( (array) array_keys($where) as $field ) { if ( !empty($where_format) ) $form = ( $form = array_shift($where_formats) ) ? $form : $where_format[0]; elseif ( isset($this->field_types[$field]) ) $form = $this->field_types[$field]; else $form = '%s'; $wheres[] = "`$field` = {$form}"; } $sql = "UPDATE `$table` SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ); return $this->query( $this->prepare( $sql, array_merge(array_values($data), array_values($where))) ); } /** * Retrieve one variable from the database. * * Executes a SQL query and returns the value from the SQL result. * If the SQL result contains more than one column and/or more than one row, this function returns the value in the column and row specified. * If $query is null, this function returns the value in the specified column and row from the previous SQL result. * * @since 0.71 * * @param string|null $query SQL query. If null, use the result from the previous query. * @param int $x (optional) Column of value to return. Indexed from 0. * @param int $y (optional) Row of value to return. Indexed from 0. * @return string Database query result */ function get_var($query=null, $x = 0, $y = 0) { $this->func_call = "\$db->get_var(\"$query\",$x,$y)"; if ( $query ) $this->query($query); // Extract var out of cached results based x,y vals if ( !empty( $this->last_result[$y] ) ) { $values = array_values(get_object_vars($this->last_result[$y])); } // If there is a value return it else return null return (isset($values[$x]) && $values[$x]!=='') ? $values[$x] : null; } /** * Retrieve one row from the database. * * Executes a SQL query and returns the row from the SQL result. * * @since 0.71 * * @param string|null $query SQL query. * @param string $output (optional) one of ARRAY_A | ARRAY_N | OBJECT constants. Return an associative array (column => value, ...), a numerically indexed array (0 => value, ...) or an object ( ->column = value ), respectively. * @param int $y (optional) Row to return. Indexed from 0. * @return mixed Database query result in format specifed by $output */ function get_row($query = null, $output = OBJECT, $y = 0) { $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; if ( $query ) $this->query($query); else return null; if ( !isset($this->last_result[$y]) ) return null; if ( $output == OBJECT ) { return $this->last_result[$y] ? $this->last_result[$y] : null; } elseif ( $output == ARRAY_A ) { return $this->last_result[$y] ? get_object_vars($this->last_result[$y]) : null; } elseif ( $output == ARRAY_N ) { return $this->last_result[$y] ? array_values(get_object_vars($this->last_result[$y])) : null; } else { $this->print_error(/*WP_I18N_DB_GETROW_ERROR*/" \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N"/*/WP_I18N_DB_GETROW_ERROR*/); } } /** * Retrieve one column from the database. * * Executes a SQL query and returns the column from the SQL result. * If the SQL result contains more than one column, this function returns the column specified. * If $query is null, this function returns the specified column from the previous SQL result. * * @since 0.71 * * @param string|null $query SQL query. If null, use the result from the previous query. * @param int $x Column to return. Indexed from 0. * @return array Database query result. Array indexed from 0 by SQL result row number. */ function get_col($query = null , $x = 0) { if ( $query ) $this->query($query); $new_array = array(); // Extract the column values for ( $i=0; $i < count($this->last_result); $i++ ) { $new_array[$i] = $this->get_var(null, $x, $i); } return $new_array; } /** * Retrieve an entire SQL result set from the database (i.e., many rows) * * Executes a SQL query and returns the entire SQL result. * * @since 0.71 * * @param string $query SQL query. * @param string $output (optional) ane of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. With one of the first three, return an array of rows indexed from 0 by SQL result row number. Each row is an associative array (column => value, ...), a numerically indexed array (0 => value, ...), or an object. ( ->column = value ), respectively. With OBJECT_K, return an associative array of row objects keyed by the value of each row's first column's value. Duplicate keys are discarded. * @return mixed Database query results */ function get_results($query = null, $output = OBJECT) { $this->func_call = "\$db->get_results(\"$query\", $output)"; if ( $query ) $this->query($query); else return null; if ( $output == OBJECT ) { // Return an integer-keyed array of row objects return $this->last_result; } elseif ( $output == OBJECT_K ) { // Return an array of row objects with keys from column 1 // (Duplicates are discarded) foreach ( $this->last_result as $row ) { $key = array_shift( get_object_vars( $row ) ); if ( !isset( $new_array[ $key ] ) ) $new_array[ $key ] = $row; } return $new_array; } elseif ( $output == ARRAY_A || $output == ARRAY_N ) { // Return an integer-keyed array of... if ( $this->last_result ) { $i = 0; foreach( (array) $this->last_result as $row ) { if ( $output == ARRAY_N ) { // ...integer-keyed row arrays $new_array[$i] = array_values( get_object_vars( $row ) ); } else { // ...column name-keyed row arrays $new_array[$i] = get_object_vars( $row ); } ++$i; } return $new_array; } } } /** * Retrieve column metadata from the last query. * * @since 0.71 * * @param string $info_type one of name, table, def, max_length, not_null, primary_key, multiple_key, unique_key, numeric, blob, type, unsigned, zerofill * @param int $col_offset 0: col name. 1: which table the col's in. 2: col's max length. 3: if the col is numeric. 4: col's type * @return mixed Column Results */ function get_col_info($info_type = 'name', $col_offset = -1) { if ( $this->col_info ) { if ( $col_offset == -1 ) { $i = 0; foreach( (array) $this->col_info as $col ) { $new_array[$i] = $col->{$info_type}; $i++; } return $new_array; } else { return $this->col_info[$col_offset]->{$info_type}; } } } /** * Starts the timer, for debugging purposes. * * @since 1.5.0 * * @return true */ function timer_start() { $mtime = microtime(); $mtime = explode(' ', $mtime); $this->time_start = $mtime[1] + $mtime[0]; return true; } /** * Stops the debugging timer. * * @since 1.5.0 * * @return int Total time spent on the query, in milliseconds */ function timer_stop() { $mtime = microtime(); $mtime = explode(' ', $mtime); $time_end = $mtime[1] + $mtime[0]; $time_total = $time_end - $this->time_start; return $time_total; } /** * Wraps errors in a nice header and footer and dies. * * Will not die if wpdb::$show_errors is true * * @since 1.5.0 * * @param string $message * @return false|void */ function bail($message) { if ( !$this->show_errors ) { if ( class_exists('WP_Error') ) $this->error = new WP_Error('500', $message); else $this->error = $message; return false; } wp_die($message); } /** * Whether or not MySQL database is at least the required minimum version. * * @since 2.5.0 * @uses $wp_version * * @return WP_Error */ function check_database_version() { global $wp_version; // Make sure the server has MySQL 4.0 if ( version_compare($this->db_version(), '4.0.0', '<') ) return new WP_Error('database_version',sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); } /** * Whether of not the database supports collation. * * Called when WordPress is generating the table scheme. * * @since 2.5.0 * * @return bool True if collation is supported, false if version does not */ function supports_collation() { return $this->has_cap( 'collation' ); } /** * Generic function to determine if a database supports a particular feature * @param string $db_cap the feature * @param false|string|resource $dbh_or_table (not implemented) Which database to test. False = the currently selected database, string = the database containing the specified table, resource = the database corresponding to the specified mysql resource. * @return bool */ function has_cap( $db_cap ) { $version = $this->db_version(); switch ( strtolower( $db_cap ) ) : case 'collation' : // @since 2.5.0 case 'group_concat' : // @since 2.7 case 'subqueries' : // @since 2.7 return version_compare($version, '4.1', '>='); break; endswitch; return false; } /** * Retrieve the name of the function that called wpdb. * * Requires PHP 4.3 and searches up the list of functions until it reaches * the one that would most logically had called this method. * * @since 2.5.0 * * @return string The name of the calling function */ function get_caller() { // requires PHP 4.3+ if ( !is_callable('debug_backtrace') ) return ''; $bt = debug_backtrace(); $caller = array(); $bt = array_reverse( $bt ); foreach ( (array) $bt as $call ) { if ( @$call['class'] == __CLASS__ ) continue; $function = $call['function']; if ( isset( $call['class'] ) ) $function = $call['class'] . "->$function"; $caller[] = $function; } $caller = join( ', ', $caller ); return $caller; } /** * The database version number * @param false|string|resource $dbh_or_table (not implemented) Which database to test. False = the currently selected database, string = the database containing the specified table, resource = the database corresponding to the specified mysql resource. * @return false|string false on failure, version number on success */ function db_version() { return preg_replace('/[^0-9.].*/', '', mysql_get_server_info( $this->dbh )); } } if ( ! isset($wpdb) ) { /** * WordPress Database Object, if it isn't set already in wp-content/db.php * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database * @since 0.71 */ $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); } ?> echo ""; } } /** * PHP4 constructor; Calls PHP 5 style constructor * * @since 2.0.0 * * @return WP_Object_Cache */ function WP_Object_Cache() { return $this->__construct(); } /** * Sets up object properties; PHP 5 style constructor * * @since 2.0.8 * @return null|WP_Object_Cache If cache is disabled, returns null. */ function __construct() { /** * @todo This should be moved to the PHP4 style constructor, PHP5 * already calls __destruct() */ register_shutdown_function(array(&$this, "__destruct")); } /** * Will save the object cache before object is completely destroyed. * * Called upon object destruction, which should be when PHP ends. * * @since 2.0.8 * * @return bool True value. Won't be used by PHP */ function __destruct() { return true; } } ?>
Parse error: parse error, unexpected T_ENDIF in /home/bee/public_html/karper-crain/courses/eng231/wp-includes/functions.php on line 2685
ed_links_extra', 3); add_action('wp_head', 'rsd_link'); add_action('wp_head', 'wlwmanifest_link'); add_action('wp_head', 'index_rel_link'); add_action('wp_head', 'parent_post_rel_link', 10, 0); add_action('wp_head', 'start_post_rel_link', 10, 0); add_action('wp_head', 'adjacent_posts_rel_link', 10, 0); add_action('wp_head', 'locale_stylesheet'); add_action('publish_future_post', 'check_and_publish_future_post', 10, 1); add_action('wp_head', 'noindex', 1); add_action('wp_head', 'wp_print_styles', 8); add_action('wp_head', 'wp_print_head_scripts', 9); add_action('wp_head', 'wp_generator'); add_action('wp_footer', 'wp_print_footer_scripts'); if(!defined('DOING_CRON')) add_action('sanitize_comment_cookies', 'wp_cron'); add_action('do_feed_rdf', 'do_feed_rdf', 10, 1); add_action('do_feed_rss', 'do_feed_rss', 10, 1); add_action('do_feed_rss2', 'do_feed_rss2', 10, 1); add_action('do_feed_atom', 'do_feed_atom', 10, 1); add_action('do_pings', 'do_all_pings', 10, 1); add_action('do_robots', 'do_robots'); add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('admin_print_scripts', 'print_head_scripts', 20); add_action('admin_print_footer_scripts', 'print_footer_scripts', 20); add_action('admin_print_styles', 'print_admin_styles', 20); add_action('init', 'smilies_init', 5); add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); add_action( 'shutdown', 'wp_ob_end_flush_all', 1); add_action( 'pre_post_update', 'wp_save_post_revision' ); add_action('publish_post', '_publish_post_hook', 5, 1); add_action('future_post', '_future_post_hook', 5, 2); add_action('future_page', '_future_post_hook', 5, 2); add_action('save_post', '_save_post_hook', 5, 2); add_action('transition_post_status', '_transition_post_status', 5, 3); add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); // Redirect Old Slugs add_action('template_redirect', 'wp_old_slug_redirect'); add_action('edit_post', 'wp_check_for_changed_slugs'); add_action('edit_form_advanced', 'wp_remember_old_slug'); add_action('init', '_show_post_preview'); add_filter('pre_option_gmt_offset','wp_timezone_override_offset'); ?> e not role names and assign to $this->roles if ( is_array( $this->caps ) ) $this->roles = array_filter( array_keys( $this->caps ), array( &$wp_roles, 'is_role' ) ); //Build $allcaps from role caps, overlay user's $caps $this->allcaps = array(); foreach ( (array) $this->roles as $role ) { $role =& $wp_roles->get_role( $role ); $this->allcaps = array_merge( (array) $this->allcaps, (array) $role->capabilities ); } $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); } /** * Add role to user. * * Updates the user's meta data option with capabilities and roles. * * @since 2.0.0 * @access public * * @param string $role Role name. */ function add_role( $role ) { $this->caps[$role] = true; update_usermeta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); } /** * Remove role from user. * * @since 2.0.0 * @access public * * @param string $role Role name. */ function remove_role( $role ) { if ( empty( $this->roles[$role] ) || ( count( $this->roles ) <= 1 ) ) return; unset( $this->caps[$role] ); update_usermeta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); } /** * Set the role of the user. * * This will remove the previous roles of the user and assign the user the * new one. You can set the role to an empty string and it will remove all * of the roles from the user. * * @since 2.0.0 * @access public * * @param string $role Role name. */ function set_role( $role ) { foreach ( (array) $this->roles as $oldrole ) unset( $this->caps[$oldrole] ); if ( !empty( $role ) ) { $this->caps[$role] = true; $this->roles = array( $role => true ); } else { $this->roles = false; } update_usermeta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); } /** * Choose the maximum level the user has. * * Will compare the level from the $item parameter against the $max * parameter. If the item is incorrect, then just the $max parameter value * will be returned. * * Used to get the max level based on the capabilities the user has. This * is also based on roles, so if the user is assigned the Administrator role * then the capability 'level_10' will exist and the user will get that * value. * * @since 2.0.0 * @access public * * @param int $max Max level of user. * @param string $item Level capability name. * @return int Max Level. */ function level_reduction( $max, $item ) { if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) { $level = intval( $matches[1] ); return max( $max, $level ); } else { return $max; } } /** * Update the maximum user level for the user. * * Updates the 'user_level' user metadata (includes prefix that is the * database table prefix) with the maximum user level. Gets the value from * the all of the capabilities that the user has. * * @since 2.0.0 * @access public */ function update_user_level_from_caps() { global $wpdb; $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 ); update_usermeta( $this->ID, $wpdb->prefix.'user_level', $this->user_level ); } /** * Add capability and grant or deny access to capability. * * @since 2.0.0 * @access public * * @param string $cap Capability name. * @param bool $grant Whether to grant capability to user. */ function add_cap( $cap, $grant = true ) { $this->caps[$cap] = $grant; update_usermeta( $this->ID, $this->cap_key, $this->caps ); } /** * Remove capability from user. * * @since 2.0.0 * @access public * * @param string $cap Capability name. */ function remove_cap( $cap ) { if ( empty( $this->caps[$cap] ) ) return; unset( $this->caps[$cap] ); update_usermeta( $this->ID, $this->cap_key, $this->caps ); } /** * Remove all of the capabilities of the user. * * @since 2.1.0 * @access public */ function remove_all_caps() { global $wpdb; $this->caps = array(); update_usermeta( $this->ID, $this->cap_key, '' ); update_usermeta( $this->ID, $wpdb->prefix.'user_level', '' ); $this->get_role_caps(); } /** * Whether user has capability or role name. * * This is useful for looking up whether the user has a specific role * assigned to the user. The second optional parameter can also be used to * check for capabilities against a specfic post. * * @since 2.0.0 * @access public * * @param string|int $cap Capability or role name to search. * @param int $post_id Optional. Post ID to check capability against specific post. * @return bool True, if user has capability; false, if user does not have capability. */ function has_cap( $cap ) { if ( is_numeric( $cap ) ) $cap = $this->translate_level_to_cap( $cap ); $args = array_slice( func_get_args(), 1 ); $args = array_merge( array( $cap, $this->ID ), $args ); $caps = call_user_func_array( 'map_meta_cap', $args ); // Must have ALL requested caps $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args ); foreach ( (array) $caps as $cap ) { //echo "Checking cap $cap
"; if ( empty( $capabilities[$cap] ) || !$capabilities[$cap] ) return false; } return true; } /** * Convert numeric level to level capability name. * * Prepends 'level_' to level number. * * @since 2.0.0 * @access public * * @param int $level Level number, 1 to 10. * @return string */ function translate_level_to_cap( $level ) { return 'level_' . $level; } } /** * Map meta capabilities to primitive capabilities. * * This does not actually compare whether the user ID has the actual capability, * just what the capability or capabilities are. Meta capability list value can * be 'delete_user', 'edit_user', 'delete_post', 'delete_page', 'edit_post', * 'edit_page', 'read_post', or 'read_page'. * * @since 2.0.0 * * @param string $cap Capability name. * @param int $user_id User ID. * @return array Actual capabilities for meta capability. */ function map_meta_cap( $cap, $user_id ) { $args = array_slice( func_get_args(), 2 ); $caps = array(); switch ( $cap ) { case 'delete_user': $caps[] = 'delete_users'; break; case 'edit_user': if ( !isset( $args[0] ) || $user_id != $args[0] ) { $caps[] = 'edit_users'; } break; case 'delete_post': $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
"; $post = get_post( $args[0] ); if ( 'page' == $post->post_type ) { $args = array_merge( array( 'delete_page', $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } $post_author_data = get_userdata( $post->post_author ); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
"; // If the user is the author... if ( $user_id == $post_author_data->ID ) { // If the post is published... if ( 'publish' == $post->post_status ) $caps[] = 'delete_published_posts'; else // If the post is draft... $caps[] = 'delete_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'delete_others_posts'; // The post is published, extra cap required. if ( 'publish' == $post->post_status ) $caps[] = 'delete_published_posts'; elseif ( 'private' == $post->post_status ) $caps[] = 'delete_private_posts'; } break; case 'delete_page': $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
"; $page = get_page( $args[0] ); $page_author_data = get_userdata( $page->post_author ); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
"; // If the user is the author... if ( $user_id == $page_author_data->ID ) { // If the page is published... if ( $page->post_status == 'publish' ) $caps[] = 'delete_published_pages'; else // If the page is draft... $caps[] = 'delete_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'delete_others_pages'; // The page is published, extra cap required. if ( $page->post_status == 'publish' ) $caps[] = 'delete_published_pages'; elseif ( $page->post_status == 'private' ) $caps[] = 'delete_private_pages'; } break; // edit_post breaks down to edit_posts, edit_published_posts, or // edit_others_posts case 'edit_post': $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
"; $post = get_post( $args[0] ); if ( 'page' == $post->post_type ) { $args = array_merge( array( 'edit_page', $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } $post_author_data = get_userdata( $post->post_author ); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
"; // If the user is the author... if ( $user_id == $post_author_data->ID ) { // If the post is published... if ( 'publish' == $post->post_status ) $caps[] = 'edit_published_posts'; else // If the post is draft... $caps[] = 'edit_posts'; } else { // The user is trying to edit someone else's post. $caps[] = 'edit_others_posts'; // The post is published, extra cap required. if ( 'publish' == $post->post_status ) $caps[] = 'edit_published_posts'; elseif ( 'private' == $post->post_status ) $caps[] = 'edit_private_posts'; } break; case 'edit_page': $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
"; $page = get_page( $args[0] ); $page_author_data = get_userdata( $page->post_author ); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
"; // If the user is the author... if ( $user_id == $page_author_data->ID ) { // If the page is published... if ( 'publish' == $page->post_status ) $caps[] = 'edit_published_pages'; else // If the page is draft... $caps[] = 'edit_pages'; } else { // The user is trying to edit someone else's page. $caps[] = 'edit_others_pages'; // The page is published, extra cap required. if ( 'publish' == $page->post_status ) $caps[] = 'edit_published_pages'; elseif ( 'private' == $page->post_status ) $caps[] = 'edit_private_pages'; } break; case 'read_post': $post = get_post( $args[0] ); if ( 'page' == $post->post_type ) { $args = array_merge( array( 'read_page', $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } if ( 'private' != $post->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata( $user_id ); $post_author_data = get_userdata( $post->post_author ); if ( $user_id == $post_author_data->ID ) $caps[] = 'read'; else $caps[] = 'read_private_posts'; break; case 'read_page': $page = get_page( $args[0] ); if ( 'private' != $page->post_status ) { $caps[] = 'read'; break; } $author_data = get_userdata( $user_id ); $page_author_data = get_userdata( $page->post_author ); if ( $user_id == $page_author_data->ID ) $caps[] = 'read'; else $caps[] = 'read_private_pages'; break; default: // If no meta caps match, return the original cap. $caps[] = $cap; } return apply_filters('map_meta_cap', $caps, $cap, $user_id, $args); } /** * Whether current user has capability or role. * * @since 2.0.0 * * @param string $capability Capability or role name. * @return bool */ function current_user_can( $capability ) { $current_user = wp_get_current_user(); if ( empty( $current_user ) ) return false; $args = array_slice( func_get_args(), 1 ); $args = array_merge( array( $capability ), $args ); return call_user_func_array( array( &$current_user, 'has_cap' ), $args ); } /** * Retrieve role object. * * @see WP_Roles::get_role() Uses method to retrieve role object. * @since 2.0.0 * * @param string $role Role name. * @return object */ function get_role( $role ) { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); return $wp_roles->get_role( $role ); } /** * Add role, if it does not exist. * * @see WP_Roles::add_role() Uses method to add role. * @since 2.0.0 * * @param string $role Role name. * @param string $display_name Display name for role. * @param array $capabilities List of capabilities. * @return null|WP_Role WP_Role object if role is added, null if already exists. */ function add_role( $role, $display_name, $capabilities = array() ) { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); return $wp_roles->add_role( $role, $display_name, $capabilities ); } /** * Remove role, if it exists. * * @see WP_Roles::remove_role() Uses method to remove role. * @since 2.0.0 * * @param string $role Role name. * @return null */ function remove_role( $role ) { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); return $wp_roles->remove_role( $role ); } ?> urn array Fixed array with all lowercase keys */ function wp_kses_array_lc($inarray) { $outarray = array (); foreach ( (array) $inarray as $inkey => $inval) { $outkey = strtolower($inkey); $outarray[$outkey] = array (); foreach ( (array) $inval as $inkey2 => $inval2) { $outkey2 = strtolower($inkey2); $outarray[$outkey][$outkey2] = $inval2; } # foreach $inval } # foreach $inarray return $outarray; } /** * Removes the HTML JavaScript entities found in early versions of Netscape 4. * * @since 1.0.0 * * @param string $string * @return string */ function wp_kses_js_entities($string) { return preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string); } /** * Handles parsing errors in wp_kses_hair(). * * The general plan is to remove everything to and including some whitespace, * but it deals with quotes and apostrophes as well. * * @since 1.0.0 * * @param string $string * @return string */ function wp_kses_html_error($string) { return preg_replace('/^("[^"]*("|$)|\'[^\']*(\'|$)|\S)*\s*/', '', $string); } /** * Sanitizes content from bad protocols and other characters. * * This function searches for URL protocols at the beginning of $string, while * handling whitespace and HTML entities. * * @since 1.0.0 * * @param string $string Content to check for bad protocols * @param string $allowed_protocols Allowed protocols * @return string Sanitized content */ function wp_kses_bad_protocol_once($string, $allowed_protocols) { global $_kses_allowed_protocols; $_kses_allowed_protocols = $allowed_protocols; $string2 = preg_split('/:|:|:/i', $string, 2); if ( isset($string2[1]) && !preg_match('%/\?%', $string2[0]) ) $string = wp_kses_bad_protocol_once2($string2[0]) . trim($string2[1]); else $string = preg_replace_callback('/^((&[^;]*;|[\sA-Za-z0-9])*)'.'(:|:|&#[Xx]3[Aa];)\s*/', 'wp_kses_bad_protocol_once2', $string); return $string; } /** * Callback for wp_kses_bad_protocol_once() regular expression. * * This function processes URL protocols, checks to see if they're in the * white-list or not, and returns different data depending on the answer. * * @access private * @since 1.0.0 * * @param mixed $matches string or preg_replace_callback() matches array to check for bad protocols * @return string Sanitized content */ function wp_kses_bad_protocol_once2($matches) { global $_kses_allowed_protocols; if ( is_array($matches) ) { if ( ! isset($matches[1]) || empty($matches[1]) ) return ''; $string = $matches[1]; } else { $string = $matches; } $string2 = wp_kses_decode_entities($string); $string2 = preg_replace('/\s/', '', $string2); $string2 = wp_kses_no_null($string2); $string2 = preg_replace('/\xad+/', '', $string2); # deals with Opera "feature" $string2 = strtolower($string2); $allowed = false; foreach ( (array) $_kses_allowed_protocols as $one_protocol) if (strtolower($one_protocol) == $string2) { $allowed = true; break; } if ($allowed) return "$string2:"; else return ''; } /** * Converts and fixes HTML entities. * * This function normalizes HTML entities. It will convert "AT&T" to the correct * "AT&T", ":" to ":", "&#XYZZY;" to "&#XYZZY;" and so on. * * @since 1.0.0 * * @param string $string Content to normalize entities * @return string Content with normalized entities */ function wp_kses_normalize_entities($string) { # Disarm all entities by converting & to & $string = str_replace('&', '&', $string); # Change back the allowed entities in our entity whitelist $string = preg_replace('/&([A-Za-z][A-Za-z0-9]{0,19});/', '&\\1;', $string); $string = preg_replace_callback('/&#0*([0-9]{1,5});/', 'wp_kses_normalize_entities2', $string); $string = preg_replace_callback('/&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});/', 'wp_kses_normalize_entities3', $string); return $string; } /** * Callback for wp_kses_normalize_entities() regular expression. * * This function helps wp_kses_normalize_entities() to only accept 16 bit values * and nothing more for &#number; entities. * * @access private * @since 1.0.0 * * @param array $matches preg_replace_callback() matches array * @return string Correctly encoded entity */ function wp_kses_normalize_entities2($matches) { if ( ! isset($matches[1]) || empty($matches[1]) ) return ''; $i = $matches[1]; return ( ( ! valid_unicode($i) ) || ($i > 65535) ? "&#$i;" : "&#$i;" ); } /** * Callback for wp_kses_normalize_entities() for regular expression. * * This function helps wp_kses_normalize_entities() to only accept valid Unicode * numeric entities in hex form. * * @access private * * @param array $matches preg_replace_callback() matches array * @return string Correctly encoded entity */ function wp_kses_normalize_entities3($matches) { if ( ! isset($matches[2]) || empty($matches[2]) ) return ''; $hexchars = $matches[2]; return ( ( ! valid_unicode(hexdec($hexchars)) ) ? "&#x$hexchars;" : "&#x$hexchars;" ); } /** * Helper function to determine if a Unicode value is valid. * * @param int $i Unicode value * @return bool true if the value was a valid Unicode number */ function valid_unicode($i) { return ( $i == 0x9 || $i == 0xa || $i == 0xd || ($i >= 0x20 && $i <= 0xd7ff) || ($i >= 0xe000 && $i <= 0xfffd) || ($i >= 0x10000 && $i <= 0x10ffff) ); } /** * Convert all entities to their character counterparts. * * This function decodes numeric HTML entities (A and A). It doesn't do * anything with other entities like ä, but we don't need them in the URL * protocol whitelisting system anyway. * * @since 1.0.0 * * @param string $string Content to change entities * @return string Content after decoded entities */ function wp_kses_decode_entities($string) { $string = preg_replace_callback('/&#([0-9]+);/', create_function('$match', 'return chr($match[1]);'), $string); $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/', create_function('$match', 'return chr(hexdec($match[1]));'), $string); return $string; } /** * Sanitize content with allowed HTML Kses rules. * * @since 1.0.0 * @uses $allowedtags * * @param string $data Content to filter * @return string Filtered content */ function wp_filter_kses($data) { global $allowedtags; return addslashes( wp_kses(stripslashes( $data ), $allowedtags) ); } /** * Sanitize content for allowed HTML tags for post content. * * Post content refers to the page contents of the 'post' type and not $_POST * data from forms. * * @since 2.0.0 * @uses $allowedposttags * * @param string $data Post content to filter * @return string Filtered post content with allowed HTML tags and attributes intact. */ function wp_filter_post_kses($data) { global $allowedposttags; return addslashes ( wp_kses(stripslashes( $data ), $allowedposttags) ); } /** * Strips all of the HTML in the content. * * @since 2.1.0 * * @param string $data Content to strip all HTML from * @return string Filtered content without any HTML */ function wp_filter_nohtml_kses($data) { return addslashes ( wp_kses(stripslashes( $data ), array()) ); } /** * Adds all Kses input form content filters. * * All hooks have default priority. The wp_filter_kses() function is added to * the 'pre_comment_content' and 'title_save_pre' hooks. * * The wp_filter_post_kses() function is added to the 'content_save_pre', * 'excerpt_save_pre', and 'content_filtered_save_pre' hooks. * * @since 2.0.0 * @uses add_filter() See description for what functions are added to what hooks. */ function kses_init_filters() { // Normal filtering. add_filter('pre_comment_content', 'wp_filter_kses'); add_filter('title_save_pre', 'wp_filter_kses'); // Post filtering add_filter('content_save_pre', 'wp_filter_post_kses'); add_filter('excerpt_save_pre', 'wp_filter_post_kses'); add_filter('content_filtered_save_pre', 'wp_filter_post_kses'); } /** * Removes all Kses input form content filters. * * A quick procedural method to removing all of the filters that kses uses for * content in WordPress Loop. * * Does not remove the kses_init() function from 'init' hook (priority is * default). Also does not remove kses_init() function from 'set_current_user' * hook (priority is also default). * * @since 2.0.6 */ function kses_remove_filters() { // Normal filtering. remove_filter('pre_comment_content', 'wp_filter_kses'); remove_filter('title_save_pre', 'wp_filter_kses'); // Post filtering remove_filter('content_save_pre', 'wp_filter_post_kses'); remove_filter('excerpt_save_pre', 'wp_filter_post_kses'); remove_filter('content_filtered_save_pre', 'wp_filter_post_kses'); } /** * Sets up most of the Kses filters for input form content. * * If you remove the kses_init() function from 'init' hook and * 'set_current_user' (priority is default), then none of the Kses filter hooks * will be added. * * First removes all of the Kses filters in case the current user does not need * to have Kses filter the content. If the user does not have unfiltered html * capability, then Kses filters are added. * * @uses kses_remove_filters() Removes the Kses filters * @uses kses_init_filters() Adds the Kses filters back if the user * does not have unfiltered HTML capability. * @since 2.0.0 */ function kses_init() { kses_remove_filters(); if (current_user_can('unfiltered_html') == false) kses_init_filters(); } add_action('init', 'kses_init'); add_action('set_current_user', 'kses_init'); function safecss_filter_attr( $css, $deprecated = '' ) { $css = wp_kses_no_null($css); $css = str_replace(array("\n","\r","\t"), '', $css); if ( preg_match( '%[\\(&]|/\*%', $css ) ) // remove any inline css containing \ ( & or comments return ''; $css_array = split( ';', trim( $css ) ); $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', 'border-left-color', 'border-left-style', 'border-left-width', 'border-right', 'border-right-color', 'border-right-style', 'border-right-width', 'border-spacing', 'border-style', 'border-top', 'border-top-color', 'border-top-style', 'border-top-width', 'border-width', 'caption-side', 'clear', 'cursor', 'direction', 'font', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'height', 'letter-spacing', 'line-height', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'overflow', 'padding', 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', 'text-decoration', 'text-indent', 'vertical-align', 'width' ) ); if ( empty($allowed_attr) ) return $css; $css = ''; foreach ( $css_array as $css_item ) { if ( $css_item == '' ) continue; $css_item = trim( $css_item ); $found = false; if ( strpos( $css_item, ':' ) === false ) { $found = true; } else { $parts = split( ':', $css_item ); if ( in_array( trim( $parts[0] ), $allowed_attr ) ) $found = true; } if ( $found ) { if( $css != '' ) $css .= ';'; $css .= $css_item; } } return $css; } string $wp_version */ $wp_version = '2.8.4'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * * @global int $wp_db_version */ $wp_db_version = 11548; /** * Holds the TinyMCE version * * @global string $tinymce_version */ $tinymce_version = '3241-1141'; /** * Holds the cache manifest version * * @global string $manifest_version */ $manifest_version = '20090616'; ; $this->weekday_initial[__('Friday')] = __('F_Friday_initial'); $this->weekday_initial[__('Saturday')] = __('S_Saturday_initial'); foreach ($this->weekday_initial as $weekday_ => $weekday_initial_) { $this->weekday_initial[$weekday_] = preg_replace('/_.+_initial$/', '', $weekday_initial_); } // Abbreviations for each day. $this->weekday_abbrev[__('Sunday')] = __('Sun'); $this->weekday_abbrev[__('Monday')] = __('Mon'); $this->weekday_abbrev[__('Tuesday')] = __('Tue'); $this->weekday_abbrev[__('Wednesday')] = __('Wed'); $this->weekday_abbrev[__('Thursday')] = __('Thu'); $this->weekday_abbrev[__('Friday')] = __('Fri'); $this->weekday_abbrev[__('Saturday')] = __('Sat'); // The Months $this->month['01'] = __('January'); $this->month['02'] = __('February'); $this->month['03'] = __('March'); $this->month['04'] = __('April'); $this->month['05'] = __('May'); $this->month['06'] = __('June'); $this->month['07'] = __('July'); $this->month['08'] = __('August'); $this->month['09'] = __('September'); $this->month['10'] = __('October'); $this->month['11'] = __('November'); $this->month['12'] = __('December'); // Abbreviations for each month. Uses the same hack as above to get around the // 'May' duplication. $this->month_abbrev[__('January')] = __('Jan_January_abbreviation'); $this->month_abbrev[__('February')] = __('Feb_February_abbreviation'); $this->month_abbrev[__('March')] = __('Mar_March_abbreviation'); $this->month_abbrev[__('April')] = __('Apr_April_abbreviation'); $this->month_abbrev[__('May')] = __('May_May_abbreviation'); $this->month_abbrev[__('June')] = __('Jun_June_abbreviation'); $this->month_abbrev[__('July')] = __('Jul_July_abbreviation'); $this->month_abbrev[__('August')] = __('Aug_August_abbreviation'); $this->month_abbrev[__('September')] = __('Sep_September_abbreviation'); $this->month_abbrev[__('October')] = __('Oct_October_abbreviation'); $this->month_abbrev[__('November')] = __('Nov_November_abbreviation'); $this->month_abbrev[__('December')] = __('Dec_December_abbreviation'); foreach ($this->month_abbrev as $month_ => $month_abbrev_) { $this->month_abbrev[$month_] = preg_replace('/_.+_abbreviation$/', '', $month_abbrev_); } // The Meridiems $this->meridiem['am'] = __('am'); $this->meridiem['pm'] = __('pm'); $this->meridiem['AM'] = __('AM'); $this->meridiem['PM'] = __('PM'); // Numbers formatting // See http://php.net/number_format /* translators: $decimals argument for http://php.net/number_format, default is 0 */ $trans = __('number_format_decimals'); $this->number_format['decimals'] = ('number_format_decimals' == $trans) ? 0 : $trans; /* translators: $dec_point argument for http://php.net/number_format, default is . */ $trans = __('number_format_decimal_point'); $this->number_format['decimal_point'] = ('number_format_decimal_point' == $trans) ? '.' : $trans; /* translators: $thousands_sep argument for http://php.net/number_format, default is , */ $trans = __('number_format_thousands_sep'); $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; // Import global locale vars set during inclusion of $locale.php. foreach ( (array) $this->locale_vars as $var ) { if ( isset($GLOBALS[$var]) ) $this->$var = $GLOBALS[$var]; } } /** * Retrieve the full translated weekday word. * * Week starts on translated Sunday and can be fetched * by using 0 (zero). So the week starts with 0 (zero) * and ends on Saturday with is fetched by using 6 (six). * * @since 2.1.0 * @access public * * @param int $weekday_number 0 for Sunday through 6 Saturday * @return string Full translated weekday */ function get_weekday($weekday_number) { return $this->weekday[$weekday_number]; } /** * Retrieve the translated weekday initial. * * The weekday initial is retrieved by the translated * full weekday word. When translating the weekday initial * pay attention to make sure that the starting letter does * not conflict. * * @since 2.1.0 * @access public * * @param string $weekday_name * @return string */ function get_weekday_initial($weekday_name) { return $this->weekday_initial[$weekday_name]; } /** * Retrieve the translated weekday abbreviation. * * The weekday abbreviation is retrieved by the translated * full weekday word. * * @since 2.1.0 * @access public * * @param string $weekday_name Full translated weekday word * @return string Translated weekday abbreviation */ function get_weekday_abbrev($weekday_name) { return $this->weekday_abbrev[$weekday_name]; } /** * Retrieve the full translated month by month number. * * The $month_number parameter has to be a string * because it must have the '0' in front of any number * that is less than 10. Starts from '01' and ends at * '12'. * * You can use an integer instead and it will add the * '0' before the numbers less than 10 for you. * * @since 2.1.0 * @access public * * @param string|int $month_number '01' through '12' * @return string Translated full month name */ function get_month($month_number) { return $this->month[zeroise($month_number, 2)]; } /** * Retrieve translated version of month abbreviation string. * * The $month_name parameter is expected to be the translated or * translatable version of the month. * * @since 2.1.0 * @access public * * @param string $month_name Translated month to get abbreviated version * @return string Translated abbreviated month */ function get_month_abbrev($month_name) { return $this->month_abbrev[$month_name]; } /** * Retrieve translated version of meridiem string. * * The $meridiem parameter is expected to not be translated. * * @since 2.1.0 * @access public * * @param string $meridiem Either 'am', 'pm', 'AM', or 'PM'. Not translated version. * @return string Translated version */ function get_meridiem($meridiem) { return $this->meridiem[$meridiem]; } /** * Global variables are deprecated. For backwards compatibility only. * * @deprecated For backwards compatibility only. * @access private * * @since 2.1.0 */ function register_globals() { $GLOBALS['weekday'] = $this->weekday; $GLOBALS['weekday_initial'] = $this->weekday_initial; $GLOBALS['weekday_abbrev'] = $this->weekday_abbrev; $GLOBALS['month'] = $this->month; $GLOBALS['month_abbrev'] = $this->month_abbrev; } /** * PHP4 style constructor which calls helper methods to set up object variables * * @uses WP_Locale::init() * @uses WP_Locale::register_globals() * @since 2.1.0 * * @return WP_Locale */ function WP_Locale() { $this->init(); $this->register_globals(); } } ?> s" folder in WPINC. * * @since 2.1.0 */ if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH if (!defined('LANGDIR')) { // Old static relative path maintained for limited backwards compatibility - won't work in some cases define('LANGDIR', 'wp-content/languages'); } } else { define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH if (!defined('LANGDIR')) { // Old relative path maintained for backwards compatibility define('LANGDIR', WPINC . '/languages'); } } } require (ABSPATH . WPINC . '/compat.php'); require (ABSPATH . WPINC . '/functions.php'); require (ABSPATH . WPINC . '/classes.php'); require_wp_db(); if ( !empty($wpdb->error) ) dead_db(); /** * Format specifiers for DB columns. Columns not listed here default to %s. * @since 2.8.0 * @see wpdb:$field_types * @see wpdb:prepare() * @see wpdb:insert() * @see wpdb:update() */ $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d'); $prefix = $wpdb->set_prefix($table_prefix); if ( is_wp_error($prefix) ) wp_die(/*WP_I18N_BAD_PREFIX*/'ERROR: $table_prefix in wp-config.php can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/); /** * Copy an object. * * Returns a cloned copy of an object. * * @since 2.7.0 * * @param object $object The object to clone * @return object The cloned object */ function wp_clone( $object ) { static $can_clone; if ( !isset( $can_clone ) ) { $can_clone = version_compare( phpversion(), '5.0', '>=' ); } return $can_clone ? clone( $object ) : $object; } if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) { require_once (WP_CONTENT_DIR . '/object-cache.php'); $_wp_using_ext_object_cache = true; } else { require_once (ABSPATH . WPINC . '/cache.php'); $_wp_using_ext_object_cache = false; } wp_cache_init(); if ( function_exists('wp_cache_add_global_groups') ) { wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta')); wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); } require (ABSPATH . WPINC . '/plugin.php'); require (ABSPATH . WPINC . '/default-filters.php'); include_once(ABSPATH . WPINC . '/pomo/mo.php'); require_once (ABSPATH . WPINC . '/l10n.php'); if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { if ( defined('WP_SITEURL') ) $link = WP_SITEURL . '/wp-admin/install.php'; elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; else $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; require_once(ABSPATH . WPINC . '/kses.php'); require_once(ABSPATH . WPINC . '/pluggable.php'); require_once(ABSPATH . WPINC . '/formatting.php'); wp_redirect($link); die(); // have to die here ~ Mark } require (ABSPATH . WPINC . '/formatting.php'); require (ABSPATH . WPINC . '/capabilities.php'); require (ABSPATH . WPINC . '/query.php'); require (ABSPATH . WPINC . '/theme.php'); require (ABSPATH . WPINC . '/user.php'); require (ABSPATH . WPINC . '/general-template.php'); require (ABSPATH . WPINC . '/link-template.php'); require (ABSPATH . WPINC . '/author-template.php'); require (ABSPATH . WPINC . '/post.php'); require (ABSPATH . WPINC . '/post-template.php'); require (ABSPATH . WPINC . '/category.php'); require (ABSPATH . WPINC . '/category-template.php'); require (ABSPATH . WPINC . '/comment.php'); require (ABSPATH . WPINC . '/comment-template.php'); require (ABSPATH . WPINC . '/rewrite.php'); require (ABSPATH . WPINC . '/feed.php'); require (ABSPATH . WPINC . '/bookmark.php'); require (ABSPATH . WPINC . '/bookmark-template.php'); require (ABSPATH . WPINC . '/kses.php'); require (ABSPATH . WPINC . '/cron.php'); require (ABSPATH . WPINC . '/version.php'); require (ABSPATH . WPINC . '/deprecated.php'); require (ABSPATH . WPINC . '/script-loader.php'); require (ABSPATH . WPINC . '/taxonomy.php'); require (ABSPATH . WPINC . '/update.php'); require (ABSPATH . WPINC . '/canonical.php'); require (ABSPATH . WPINC . '/shortcodes.php'); require (ABSPATH . WPINC . '/media.php'); require (ABSPATH . WPINC . '/http.php'); require (ABSPATH . WPINC . '/widgets.php'); if ( !defined('WP_CONTENT_URL') ) define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up /** * Allows for the plugins directory to be moved from the default location. * * @since 2.6.0 */ if ( !defined('WP_PLUGIN_DIR') ) define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash /** * Allows for the plugins directory to be moved from the default location. * * @since 2.6.0 */ if ( !defined('WP_PLUGIN_URL') ) define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash /** * Allows for the plugins directory to be moved from the default location. * * @since 2.1.0 */ if ( !defined('PLUGINDIR') ) define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. /** * Allows for the mu-plugins directory to be moved from the default location. * * @since 2.8.0 */ if ( !defined('WPMU_PLUGIN_DIR') ) define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash /** * Allows for the mu-plugins directory to be moved from the default location. * * @since 2.8.0 */ if ( !defined('WPMU_PLUGIN_URL') ) define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash /** * Allows for the mu-plugins directory to be moved from the default location. * * @since 2.8.0 */ if ( !defined( 'MUPLUGINDIR' ) ) define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. if ( is_dir( WPMU_PLUGIN_DIR ) ) { if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { while ( ( $plugin = readdir( $dh ) ) !== false ) { if ( substr( $plugin, -4 ) == '.php' ) { include_once( WPMU_PLUGIN_DIR . '/' . $plugin ); } } } } do_action('muplugins_loaded'); /** * Used to guarantee unique hash cookies * @since 1.5 */ define('COOKIEHASH', md5(get_option('siteurl'))); /** * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php * @since 2.5.0 */ $wp_default_secret_key = 'put your unique phrase here'; /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('USER_COOKIE') ) define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('PASS_COOKIE') ) define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.5.0 */ if ( !defined('AUTH_COOKIE') ) define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('SECURE_AUTH_COOKIE') ) define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('LOGGED_IN_COOKIE') ) define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); /** * It is possible to define this in wp-config.php * @since 2.3.0 */ if ( !defined('TEST_COOKIE') ) define('TEST_COOKIE', 'wordpress_test_cookie'); /** * It is possible to define this in wp-config.php * @since 1.2.0 */ if ( !defined('COOKIEPATH') ) define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); /** * It is possible to define this in wp-config.php * @since 1.5.0 */ if ( !defined('SITECOOKIEPATH') ) define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('ADMIN_COOKIE_PATH') ) define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('PLUGINS_COOKIE_PATH') ) define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); /** * It is possible to define this in wp-config.php * @since 2.0.0 */ if ( !defined('COOKIE_DOMAIN') ) define('COOKIE_DOMAIN', false); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('FORCE_SSL_ADMIN') ) define('FORCE_SSL_ADMIN', false); force_ssl_admin(FORCE_SSL_ADMIN); /** * It is possible to define this in wp-config.php * @since 2.6.0 */ if ( !defined('FORCE_SSL_LOGIN') ) define('FORCE_SSL_LOGIN', false); force_ssl_login(FORCE_SSL_LOGIN); /** * It is possible to define this in wp-config.php * @since 2.5.0 */ if ( !defined( 'AUTOSAVE_INTERVAL' ) ) define( 'AUTOSAVE_INTERVAL', 60 ); require (ABSPATH . WPINC . '/vars.php'); // make taxonomies available to plugins and themes // @plugin authors: warning: this gets registered again on the init hook create_initial_taxonomies(); // Check for hacks file if the option is enabled if ( get_option('hack_file') ) { if ( file_exists(ABSPATH . 'my-hacks.php') ) require(ABSPATH . 'my-hacks.php'); } $current_plugins = get_option('active_plugins'); if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) { foreach ( $current_plugins as $plugin ) { // check the $plugin filename // Validate plugin filename if ( validate_file($plugin) // $plugin must validate as file || '.php' != substr($plugin, -4) // $plugin must end with '.php' || !file_exists(WP_PLUGIN_DIR . '/' . $plugin) // $plugin must exist ) continue; include_once(WP_PLUGIN_DIR . '/' . $plugin); } unset($plugin); } unset($current_plugins); require (ABSPATH . WPINC . '/pluggable.php'); /* * In most cases the default internal encoding is latin1, which is of no use, * since we want to use the mb_ functions for utf-8 strings */ if (function_exists('mb_internal_encoding')) { if (!@mb_internal_encoding(get_option('blog_charset'))) mb_internal_encoding('UTF-8'); } if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) wp_cache_postload(); do_action('plugins_loaded'); $default_constants = array( 'WP_POST_REVISIONS' => true ); foreach ( $default_constants as $c => $v ) @define( $c, $v ); // will fail if the constant is already defined unset($default_constants, $c, $v); // If already slashed, strip. if ( get_magic_quotes_gpc() ) { $_GET = stripslashes_deep($_GET ); $_POST = stripslashes_deep($_POST ); $_COOKIE = stripslashes_deep($_COOKIE); } // Escape with wpdb. $_GET = add_magic_quotes($_GET ); $_POST = add_magic_quotes($_POST ); $_COOKIE = add_magic_quotes($_COOKIE); $_SERVER = add_magic_quotes($_SERVER); do_action('sanitize_comment_cookies'); /** * WordPress Query object * @global object $wp_the_query * @since 2.0.0 */ $wp_the_query =& new WP_Query(); /** * Holds the reference to @see $wp_the_query * Use this global for WordPress queries * @global object $wp_query * @since 1.5.0 */ $wp_query =& $wp_the_query; /** * Holds the WordPress Rewrite object for creating pretty URLs * @global object $wp_rewrite * @since 1.5.0 */ $wp_rewrite =& new WP_Rewrite(); /** * WordPress Object * @global object $wp * @since 2.0.0 */ $wp =& new WP(); /** * WordPress Widget Factory Object * @global object $wp_widget_factory * @since 2.8.0 */ $wp_widget_factory =& new WP_Widget_Factory(); do_action('setup_theme'); /** * Web Path to the current active template directory * @since 1.5.0 */ define('TEMPLATEPATH', get_template_directory()); /** * Web Path to the current active template stylesheet directory * @since 2.1.0 */ define('STYLESHEETPATH', get_stylesheet_directory()); // Load the default text localization domain. load_default_textdomain(); /** * The locale of the blog * @since 1.5.0 */ $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; if ( is_readable($locale_file) ) require_once($locale_file); // Pull in locale data after loading text domain. require_once(ABSPATH . WPINC . '/locale.php'); /** * WordPress Locale object for loading locale domain date and various strings. * @global object $wp_locale * @since 2.1.0 */ $wp_locale =& new WP_Locale(); // Load functions for active theme. if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) include(STYLESHEETPATH . '/functions.php'); if ( file_exists(TEMPLATEPATH . '/functions.php') ) include(TEMPLATEPATH . '/functions.php'); /** * Runs just before PHP shuts down execution. * * @access private * @since 1.2.0 */ function shutdown_action_hook() { do_action('shutdown'); wp_cache_close(); } register_shutdown_function('shutdown_action_hook'); $wp->init(); // Sets up current user. // Everything is loaded and initialized. do_action('init'); ?> Business Communication (Fall 2005)

Business Communication (Fall 2005)

Notes and Activities for December 5

Today, we’ll:

1) Discuss presentation protocols.

  • Situation: consider the time and place of where you are giving the presentation.
  • Purpose: this refers to the goal the speaker hopes to achieve with his or her presentation.
  • Audience: consider the people to whom the presentation is directed.
  • Method: which methods will best accomplish the purpose.

Handouts enable the audience to

  • Concentrate on the ideas without having to take notes
  • Capture any non-verbal data accurately
  • Personalize the presentation with notes of their own ideas
  • Hear, see and apply the presentation
  • Increase their speed of comprehension
  • Retain new ideas longer
  • Apply the information to specific tasks
  • Find the information when they need it at a later date”

What content can go on a handout?

  • Your name
  • The date
  • Outline of key points, concepts, or ideas
  • Charts, graphs, diagrams, illustrations, or visuals
  • Contact information
  • List of sources or references

How do I make a useful handout? (From “Why and How to Avoid Trashy Handouts“)

  • Plan your handout as you plan your presentation.
    Keep main ideas, metaphors and summary information in the presentation. Add details, complexity, explanations and applications in the handout.
  • Make them aesthetically pleasing and practical.
  • Design to support the purpose of your presentation and the audience.
  • Avoid rehashing your presentation verbatim, with the exception of testifying before a government agency or presenting a scientific paper.
  • Organize information into sections based on content.
  • Use headings to signal the beginnings of sections.
  • Put white space between headings and body text.
  • Use lists to organize related content.
  • Use only one or two fonts.
  • Make sure that images don’t overlap with text.
  • Make sure images or visuals are clearly labeled and captioned.

Visuals should (as we saw last Wednesday):

  • Be easy to understand from a distance.
  • Follow the “Rule of Seven” for text: No more than seven words per line; no more than seven lines per visual.
  • Clearly describe or illustrate a concept to the reader.
  • Not undermine the tone of your presentation.
  • Use the principles of contrast, repetition, alignment, and proximity.

2) Work on developing materials for your presentations and finishing your reports.

3) Conduct course evaluations.

Assignment for Next Class

Be prepared to give your presentation, including providing handouts and visuals. Final version of your recommendation report is due by Friday, December 9.

Printer-Friendly Version

Notes and Activities for November 30

Today, we’ll:

1) Discuss strategies for presenting and formatting reports.

Guidelines for Formatting Report Pages

  • Use only two fonts.
  • Don’t indent paragraphs; use white space to separate them.
  • Use single line spacing or 1.5 line spacing instead of double-spacing.
  • Include page numbers on all pages except for the first page.
  • Align all text to the left unless it is on a title page.
  • Place visuals near the text they represent.
  • Don’t use random clip art.

Good Example || Bad Example

2) Go over the oral presentation guidelines.

3) Discuss a case study related to the use of PowerPoint and other communication tools in business communication.

Assignment for Next Class

Read p. 336-346 in textbook; work on recommendation report.

Printer-Friendly Version

Recommendation Report: Oral Presentation Guidelines

An important part of business communication is being able to speak informatively and persuasively to an audience. For this assignment, you will present the research and recommendations you have developed throughout the semester to an audience of your peers and clients.
Specifics

Your group will give a 10-15 minute oral presentation where you:

  • Give an overview of the communication situation you studied
  • Discuss and provide context for the communication problems you noticed
  • Describe and explain the solution(s) you would recommend to solve the problem
  • Justify your recommendations
  • Respond to questions from the audience

Each group member should have a speaking role during the presentation. Also, you should provide:

  • A handout for the audience
  • Visuals such as a PowerPoint presentation, poster, drawings, or transparencies

The presentation should be more than reading your report to the audience.

Grading Criteria

You will be graded on how well you:

  • Present information to the audience using appropriate tone and body language
  • Provide adequate and appropriate information and persuasive strategies
  • Provide a well-formatted handout
  • Present information visually to the audience

Due Date

You will give your presentations on December 7.

Printer-Friendly Version

Notes and Activities for November 28

Today, we’ll:

1) Discuss the weekly agenda.

2) Meet as a class to discuss your peer feedback and ask questions of your classmates.

3) Work in groups to revise your report based on feedback from your classmates and the instructor.

4) Make a list of what writing and research tasks need to be completed.

Assignment for Next Class

Read pp. 331-335 in textbook; work on recommendation report.

Printer-Friendly Version

Weekly Agenda for November 28-December 2

Monday, November 28

Today you’ll work in groups and individually to give and receive feedback on your reports. We’ll discuss and generate lists of tasks you need to get done before the final project is due. You’ll also have time to work on responding to feedback, researching, and revising your reports.

Assignment for Next Class

Read pp. 331-335 in textbook; work on recommendation report.

Wednesday, November 30

Today we’ll discuss strategies for visual design and layout in reports. We’ll also introduce the oral presentation assignment and discuss the requirements for that component.

Assignment for Next Class

Read p. 336-346 in textbook; work on recommendation report.

Printer-Friendly Version

Notes and Activities for November 16

Today, we’ll:

1) Discuss how research is used and cited in recommendation reports.

While workplace writing does give credit when the words and ideas of others are used, the systems used to do so are more variable and less formal than academic citation systems. Sometimes workplaces will use academic citation systems such as APA, IEEE or CBE; other times they will just require that you list your sources and make reference to them in some way. In a specific workplace, you will want to find out if there are any conventions for citing sources and follow those.

Many workplaces use what’s called the “number system,” which combines an academic citation style such as CBE, APA, MLA, or IEEE with bracketed and numbered citations. I’ll be showing you how to do that, and I’ll expect you to use it in your recommendation reports.

References List

In the number system, you format your citations in an academic style of your (or your company’s) choosing. For this course, you can use MLA, APA, or any style that you’ve used in the past and feel comfortable using.

You arrange your citations in alphabetical order, and then number each citation. Here’s an example of a numbered reference list using MLA style.

  1. Doe, John. Personal interview. 11 Nov. 2005.
  2. Jones, James. “Strategies for Motivating Employees.” Business Magazine. 26 Oct. 1999. 28 Oct. 2005. ‹http://www.miscellaneous.com.›
  3. Smyth, Martin. “Motivating Employees Through Autocratic Management.”Journal of Despotry Feb. 2000: 66-72. Expanded Academic ASAP. Gale Group Databases. Niagara University Libraries, Niagara University, NY. 19 February 2005. ‹http://www.infotrac.galegroup.com.›

In-Text Citations

When you cite a source in the text, you:

1) Provide an attributive tag that introduces the source.

2) Cite the NUMBER of the source and the page number (if available) in a parenthetical citation.

Here are some examples.

Motivating employees to write can be a difficult process. In a personal interview, John Doe, manager at a local company, described the many problems that he has in getting employees to produce writing, including not meeting deadlines (1). James Jones offers various strategies for motivating employees to write, including creating a climate where employees feel free to share and edit their work (2). Smyth advises adopting a severe managerial style where if employees do not submit work by deadline, they are severely punished (3:67).

2) Discuss difficulties with collaborative writing and editing.

Sam Dragga, in a review of work about collaborative writing, paraphrases David Farkas and offers some reasons why collaborative writing is so difficult:

  • “the documents are complex
  • creating them collaboratively is more complicated than doing them individually
  • the emotions of writers interfere
  • opportunities for revision are infinite
  • collaborators have insufficient terminology with which to discuss their individual visions of a document
  • success is unpredictable or immeasurable.”

How do you avoid these problems or solve them when they occur?

  • Clearly define goals.
  • Clearly assign roles: researcher, writers, editors, fact-checkers, document designers. Roles may fluctuate as you work through the process, but it’s important to have clearly defined roles as you near the end of the project.
  • Set deadlines and stick to them.
  • Agree on a common set of terminology for referring to specific aspects of the project.
  • Agree on your documentation style.
  • Agree on common document formats and communication protocols.

How do you make a document written by many people have one voice?

This is one of the most difficult tasks in collaborative writing. Generally, people edit documents to have one voice by electing a single person to be Master Editor for the final document. This person will read through the documents submitted by the group and:

  • combine all of the elements into one master draft
  • make sure that the document has a clear focus
  • make sure that all parts of the document relate to the focus
  • make sure that there are clear divisions between ideas
  • make sure that the document is using the same terms when referring to the same objects, events, places, or people
  • make changes in how sentences are arranged and language is used to create tone and style so that the document has a similar style
  • correct errors
  • check and verify citations
  • The Master Editor should use Word’s Track Changes feature (or another way of marking changes) to indicate what has been changed or combined on a document.
  • After the first editing pass, he or she should pass the document off to another group member.
  • This group member will verify the changes, indicate any changes that he or she feels are necessary, and sign off on the document.
  • The document then goes to the next group member until all group members have seen it and provided feedback.
  • The Master Editor then does one final edit of the document that incorporates feedback from the other group members.
  • The document then goes to the Document Design member(s) of the team for formatting.

Make sure that you determine a naming scheme for naming files so that you do not overwrite current versions with past versions. Many people will date the filename as part of the name to help avoid this problem, and add their initials to indicate who has seen the document.

3) Work on drafting your reports.

Assignment for Next Class

First draft of report is due.

Printer-Friendly Version

Notes and Activities for November 14

Today, we’ll:

1) Go over the weekly agenda.

2) Discuss the parts of a recommendation report and their functions.

3) Examine some sample recommendation reports and discuss their generic features.

4) Discuss planning strategies.

Outlining/Listing: written organization of content
Mapping/Clustering: visual organization of content

Which work better for you as a learner?

5) Work on planning the content of your report.

Assignment for Next Class

Read pp. 397-408 in textbook.
Outline report.

Printer-Friendly Version

Weekly Agenda for November 14-18

Monday, November 14

Today we’ll discuss the formatting and parts of recommendation reports by analyzing models and critiquing how they make recommendations. You’ll also create an outline or map of the contents of your report.

Assignments For Next Class

Read pp. 397-408 in textbook.
Outline report.

Wednesday, November 16

Today we’ll discuss drafting strategies, consider the problems of writing and editing collaboratively, and learn about how research is used and cited in recommendation reports.

Assignments For Next Class

First draft of report due; bring print and electronic copy to class.

Printer-Friendly Version

Notes and Activities for November 9

Today we’ll:

1) Review your claim and reasons, and discuss the types of evidence you need to collect.

Types of Evidence You Might Use

Information You Gather From People

  • observations
  • interviews
  • survey data

Information You Gather Through Print or Web Sources

  • information about corporate culture
  • information that provides perspectives which complement your observations
  • information about implementations of your solution in other places
  • information about best (or worst) communication practices in businesses
  • information about information technologies that facilitate or hinder corporate communication
  • information about how to implement your recommendations (specific items needed, cost, resources needed, timeline for implementation)
  • any other types of information you think you will need

2) Discuss resources for researching businesses and business communication.

Books

Reference Databases
Note: To search some of these databases from off-campus, you will need to email the library for access to passwords.

  • Business and Company Resource Center offers you access to company profiles, articles, financial data, and company histories.
  • ProQuest provides access to a number of business-related databases that index papers, journals, and newspaper articles, including The Wall Street Journal.
  • EbscoHost offers access to Academic Source Premier and Business Source Elite, both of which contain articles on business practices and business communication.
  • Lexis/Nexis offers access to business and trade journals, newspapers, and legal cases.

Journals

Internet Resources

  • Research links from the Corporate Communication Institute at Farleigh Dickinson University.
  • Niagara’s Library provides a collection of starting points for Web research that includes business links.

3) Begin looking for print and Web sources using keywords that are relevant to your project.

Assignments For Next Class

Send a list of 8 possible sources to instructor by e-mail.

Read pp. 584-588 in textbook.

Printer-Friendly Version

Notes and Activities for November 7

Today, we’ll:

1) Go over the weekly agenda.

2) Discuss strategies for audience analysis.

The heart of a recommendation report is making a persuasive argument that will convince your reader.

Why do you need to consider the needs of your audience when making a persuasive argument?

Thinking about a workplace audience requires you to think about the following concepts as they relate to you and your audience:

  • Relationship/Power

    • Are you writing up, writing across, or writing down?
    • How well do you know your audience?
  • Credibility and Authority
    • Are you the expert, the beginner, or somewhere in between?
    • Why would your audience take you seriously? How can you show them that you know what you’re doing?
  • Attitude
    • How receptive is your audience to hearing this message?
    • How can you anticipate and work with their attitudes?
  • Knowledge
    • What does your audience already know?
    • What does your audience need to know?
    • Is there any misinformation that you need to correct?
  • Values and Beliefs
    • What does your audience value and believe about what you are about to tell them?
    • How does your message fit in to their existing values and beliefs or the existing values and beliefs of their workplace context?

In your groups, please answer the above audience analysis questions for your report audiences.

3) Discuss the parts of an argument.

An argument can be divided into parts.

  • Warrant: the concepts your audience has to assume, feel, think, believe, or otherwise accept in order to believe your claim (also called the bridge)
  • Backing: the circumstances and evidence that describe and develop these concepts
  • Claim: the conclusion or major idea which your audience needs to accept
  • Reasons: the categories of evidence which support your claim
  • Evidence: the facts, opinions, and appeals that develop and justify your reasons (logos, ethos, pathos)
  • Rebuttal: objections to your claim
  • Qualifier: modifications to your claim to take objections into account

Sample claim: “The English department needs to build a greater sense of community among its students.” How would you develop this claim?

3) Discuss how these strategies can be applied to constructing and analyzing arguments.

How can business writers use these strategies to construct an argument?
Kitty Locker offers examples of how office memos make claims in Business and Administrative Communication (1995, pp. 260-264). She and others have observed that when business writers draft (memos, letters, proposals or reports), they often adopt a plan of action consisting of strategies that include elements of Toulmin’s model:

  • Building common ground or rapport.
  • Articulating the problem and offer proof that it exists.
  • Demonstrating how the problem is harming the organization and suggest plausible causes.
  • Rebutting any counterclaims about alternative problems or causes other than the one the writer identifies (i.e., counteracting opposing interpretations and clarifying exceptions).
  • Presenting a particular solution to the problem, in specific terms that are tied to the stated problem and its causes.
  • Constructing a clear picture or description of the problem being solved by application of the proposed solution; depicting a winning situation.
  • Limiting the claims about additional benefits that might accrue to the readers — benefits that might flow from the solution, but that are not guaranteed (i.e., qualifying or making clear the limits of one’s promises).
  • Outlining a plan of action, especially first steps toward arriving at a solution. (From Business Communication)

Let’s look at an example and identify some arguments.

4) Build arguments for your recommendation reports based on this model.

Assignment for Next Class

Read pp. 397-408 in textbook;
Continue working on description of problem and possible solution

Printer-Friendly Version

Weekly Agenda for November 7-11

Monday, November 7

Today we’ll discuss the audience for your recommendation report and how that will affect the recommendations you might make. Then you’ll work to articulate the problem, recommendations, and justifications that you’ll develop in your report.

Assignments For Next Class

Read pp. 397-408 in textbook;
Continue working on description of problem and possible solution

Wednesday, November 9

Today we’ll discuss researching outside sources for your project and how they could be used in your report.

Assignments For Next Class

Send a list of 8 possible sources to instructor by e-mail.
Read pp. 584-588 in textbook.

Printer-Friendly Version

Notes and Activities for November 2

Today, we’ll:

1) Review theories and ideas about organizational communication.

Information transfer

  • Communication is a tool that people use.
  • Meaning of a message resides with sender; communication transmits that meaning to others.
  • Miscommunication happens when there is information overload, distortion, and ambiguity.
  • Successful information transfer is most important.

Transactional process

  • People encode and decode messages simaltaneously; communication is created through shared meaning.
  • Meaning of a message resides with receiver; people can construct the meaning of messages differently (which leads to miscommunication).
  • Any type of behavior is communication (even non-verbal behaviors).
  • Consensus and sharing is most important.

Strategic control

  • Communication is about achieving specific goals and controlling one’s environment.
  • Meaning of a message is contained in rhetorical goals and accomplishing a specific end.
  • Communicators have social, ethical, and political motivations.
  • Common strategy: specific ambiguity (possibility for miscommunication)
  • Action is most important.

Balance of creativity and constraint

  • Communication is a balance between being creative to respond to organizational constraints and working within the rules and guidelines of an organization which define appropriate behavior, goals, and actions.
  • Meaning of a message is created by social forces and by people working within and against social forces.
  • Keeping a balance is most important.

Communication must be studied in context; a context is how people are currently defining reality.

  • Relationships
  • Situation
  • History
  • Interpretations

People create contexts over time, use the contexts to interpret messages, and change the contexts.

Individuals and how they relate to their situations and balance organizational constraints and their own creativity

Studying the multiple contexts that individuals create as well as haow individuals balance creativity and constraint in order to create meaning can be helpful.

Communication is dialogic.

  • Who has the most powerful voice in an organization?
  • Who has the least powerful voice?
  • How do people create meaning through dialogue?

    Do you see any of these perspectives at work in your organizations? Which ones? How would you describe how these theories relate to what you’ve been seeing?

    2) Work on a case study that asks you to think about and apply these theories.

    3) Answer questions about your situations to help you understand your communication contexts and problems.

    4) Work on client research memo.

    Assignment for Next Class

    1. Client research visit memo due to instructor via email.
    2. Read “Audience Analysis” and do “Audience Planner” (either separately or collectively); email answers to instructor.

  • Printer-Friendly Version

    Notes and Activities for October 31

    Today, we’ll:

    1) Go over the weekly agenda.

    2) Go over the guidelines for the client research memo and the written recommendation report.

    3) Discuss how to analyze a communication problem.

    • Describe the setting
    • Describe the key players
    • Describe the types of communication happening (genres of communication and technologies of communication)
    • Describe the problem
      • What happens
      • Where it happens
      • When it happens
      • To whom it happens
      • Why it happens

    Burke’s Pentad

    Kenneth Burke was a rhetorical theorist who analyzed literature and drama. His five-part method for analyzing a situation has been adapted by communication theorists to help consider the various parts of a communication situation.

    The five parts of the pentad are:

    • Actor
    • Action
    • Setting
    • Method
    • Motive

    4) Analyze communcation problems for your groups.

    Assignment for Next Class

    1. Skim pp. 397-408 in textbook to become familiar with parts of a recommendation report.
    2. Read chapter on organizational communication given out in class.

    Printer-Friendly Version

    Weekly Agenda for October 31-November 4

    Monday, October 31

    Today you’ll turn in the final versions of your documentation and we’ll finish the documentation project. Next, we’ll go over the guidelines for the recommendation report project and discuss what you’ve discovered so far.

    Assignments For Next Class

    1. Skim pp. 397-408 in textbook to become familiar with parts of a recommendation report.
    2. Read chapter on organizational communication given out in class.

    Wednesday, November 2

    Today we’ll analyze the rhetorical situations that you have been studying using different rhetorical tools. We’ll also discuss audience analysis and shaping your report for different audiences. You’ll also have time to work on your client research visit memo.

    Assignments For Next Class

    1. Client research visit memo due to instructor via email.
    2. Read “Audience Analysis” and do “Audience Planner” (either separately or collectively); email answers to instructor.

    Printer-Friendly Version

    Recommendation Report: Written Report Guidelines

    During this semester, you’ve identified a specific workplace communication situation and have used a variety of research methods to understand the situation and identify possible communication problems. Now, it’s time for you to report on your findings.
    Specifics

    Your group will write an 8-10 page recommendation report that:

    • describes the workplace communication situations you observed
    • identifies and explains a specific communication problem (or set of problems)
    • explains the possible causes of the problem
    • discusses the problem in a larger context by citing research related to workplace communication
    • provides a specific set of recommendations to ameliorate the problem
    • justifies these recommendations by citing research and creating appeals that are appropriate to your audience

    Your report should contain the following parts:

    • Title Page
    • Table of Contents
    • Executive Summary
    • Introduction/Background
    • Description of Problem
    • Recommendations
    • Conclusions and Summary
    • List of References
    • Appendix (if necessary)

    You will turn in a print version of this report; it should be collated and stapled.

    Grading Criteria

    This project will be graded based on how well you:

    • describe the workplace communication situations you observed
    • explaine a specific communication problem (or set of problems) and the possible causes of the problem
    • place the problem and recommendations in a larger context by citing research related to workplace communication
    • provide a specific set of recommendations to ameliorate the problem and justify these recommendations
    • pay attention to conventions for writing reports
    • write clearly, concisely, and without errors

    You can earn a possible 250 points for this project (out of 450 points total for the project).

    Project Goals

    This project helps you to:

    • identify needs for information (through observation and discussion within your group and in class)
    • access information (conduct client-based and academic research)
    • evaluate information (draw conclusions from your client visits and academic research)
    • use information (describe the situation, provide background, describe the problem, and make recommendations)
    • attribute information (cite information appropriately).

    Due Dates

    First Draft of Report Due: November 21

    Final Draft of Report Due: December 7

    Printer-Friendly Version

    Recommendation Report: Client Research Memo Guidelines

    Specifics

    Your group will write a short (1-2 page) memo to the instructor which:

    • Briefly describes what your client research visits have been like.
    • Briefly describes any surveys or interviews conducted.
    • Presents any preliminary ideas about communication problems or recommendations that you have gathered so far.
    • Discusses what you still need to learn or discover in order to make a recommendation or understand the problem.

    Grading Criteria

    This project will be graded based on how well you:

    • Report on your research.
    • Present possible findings.
    • Discuss what you will do next.
    • Use memo format.
    • Use conventions for standard written English.

    You can earn 50 points (out of 450 points total for the project) for this memo.

    Project Goals

    This project helps you to identify needs for information, evaluate information, and use information.

    Due Dates

    Memo Due: November 7

    Printer-Friendly Version

    Notes and Activities for October 26

    Today, we’ll:

    1) Learn and practice principles for document design with your documentation.

    The design and appearance of documentation can often affect how well someone is able to use it to follow instructions.

    You’ve been learning about document design and working with documentation for a while. How would you design the most annoying and hard to use documentation possible?

    Please “re-design” your documentation to be as difficult to read and understand as possible. E-mail it to the instructor when you’re done. We’ll look at them as a class and discuss their common problems.

    2) Edit your documentation for content and format.

    Please use the editing checklist to help review your document.

    3) Meet in your report groups (if needed).

    Assignment for Next Class

    Final draft of documentation due.

    Printer-Friendly Version

    Notes and Activities for October 24

    Today, we’ll:

    1) Go over the weekly agenda.

    2) Report on the preliminary results of your usability testing.

    3) Answer any questions you have about usability testing and the first drafts of your documentation.

    4) Work in your recommendation report groups

    In your groups, please discuss your client research visits, talk about future research needs, and to come up with a specific question or idea that will form part of your recommendation report.

    Printer-Friendly Version

    Weekly Agenda for October 24-28

    Monday, October 24

    Today we’ll discuss how your usability testing is going, return your documentation drafts with commentary, and answer any questions you have about your documentation drafts. Then you’ll have time to work in your research report groups to discuss your client research visits and research needs. The instructor will visit each group to find out about your progress and answer any questions you might have.

    Assignments For Next Class

    Usability testing report due.
    Bring two copies of the most current version of your documentation to class.

    Wednesday, October 26

    Assignments For Next Class

    Final draft of documentation due at the beginning of class. Please turn in a print copy if your documentation will be delivered in print form or an electronic copy if your documentation will be delivered in electronic form.

    Printer-Friendly Version

    Notes and Activities for October 19

    Today, we’ll:

    1) Give and receive feedback on your documentation drafts.

    Please download the peer review questions, complete them for a partner’s documentation, and e-mail them to your partner and to the instructor.

    2) Discuss usability testing.

    Usability testing is when people attempt to measure how well people can use documentation (and/or a product) to accomplish an actual and realistic task. The goals are to discover the errors that people make and where they go wrong and determine how the documentation (or the product) should be changed to respond to the user’s needs.

    Usability testing should use as realistic a situation as possible and should always be done with the real documentation, materials and actual tasks that users would attempt to accomplish with a product.

    Nielsen’s Five-User Rule: Testing with five users from your intended audience(s) will identify 95% of your problems. This rule applies mainly to Web usability testing, but user testing with small groups of users can help you to identify problems with other types of scenarios.

    In a usability test, individual users or groups of users who match the profile of the intended audience(s) are asked to complete a task. They are provided with materials, documentation, and brief guidelines, and encouraged to talk aloud as they complete the task.

    People observe the task and take notes on how long it takes users to complete steps, any difficulties the users encounter, and any surprising findings. The observers do not
    interfere with the user or help the user unless it is an emergency.

    Occasionally, users will participate in focus groups after the testing to talk more about their experience.

    After observing a number of users, the observers write up their findings in a usability testing report which documents what they learned and how the documentation will need to be changed.

    How to conduct a usability test:

    • Identify the target audience(s) for your documentation. Describe what you think they know and how long you think it will take them to complete the task.
    • Recruit users from that population.
    • Determine what task the users will be doing to test the documentation. If it’s a tutorial, obviously they’ll be following the tutorial. For references or more open-ended documentation, a specific and realistic task should be determined.
    • Write brief guidelines (to be given orally or in writing) explaining what users need to do.
    • Provide users with the documentation and materials. Go over the guidelines.
    • Stand back and watch the users do the task. Take notes and time various tasks.
    • Thank the users for their time when the task has been completed.
    • Identify areas of the documentation where users had problems.
    • Prepare a usability testing report about your findings.

    3) Go over the usability testing report guidelines.

    4) Practice conducting usability tests.

    Half of the class will act as users and the other half will act as observers in a usability test of some sample documentation; then you’ll switch places.

    5) Work on developing the guidelines for your usability tests.

    Printer-Friendly Version