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) » 2005 » September

Business Communication (Fall 2005)

Notes and Activities for October 3

Today, we’ll:

1) Go over the weekly agenda.

2) Go over the guidelines for the Documenting a Process project.

3) Discuss what documentation is and does.

Documentation explains how to use something, how to make something, or how to do something. It can be short (such as a quick reference card), long (such as a software manual), and exist in print, video, audio or digital formats. It is often written by technical writers, and usually addresses a specific audience.

Documentation often includes:

  • Descriptions of how an object works (Description of your toaster oven and what it does)
  • Descriptions of all of the parts and functions of an object (Diagram of your toaster oven, with explanation of what each part does)
  • Descriptions of how a process works (How Toast Is Made)
  • Instructions for how to complete a process that will lead to a specific result (How to Make Toast in Your Toaster Oven)

4) Do an activity where you write documentation.

On the laptops (or a laptop), please download the writing documentation activity and follow the instructions. Please work in groups of three or four to complete the activity.

After you’ve completed the activity, please e-mail a copy of your documentation to the instructor. We’ll be testing your documentation after you’ve finished it.

5) Do an activity where you use documentation.

Individually, please download the documentation reading activity to your laptop and follow the instructions using the documentation that the instructor gives you.

6) Analyze documentation and determine its common features.

Please complete the “Comparing Documentation” section of the documentation reading activity, using the documentation given to you by the instructor.

7) Brainstorm ideas for a process for you to document.

Assignment for Next Class

1. Choose process to document; e-mail instructor (ekarper@niagara.edu) with brief description.
2. Read pp. 485-487 and 503-512 in textbook.

Printer-Friendly Version

Documenting a Process: Assignment Guidelines

In the workplace, you may be asked to write documentation or to document processes for a variety of reasons. You may need to explain your tasks or duties to someone else as part of training. You may need to explain the functions of a product or how to use a service that your company provides. Your audience may be people in your workplace or specific segments of the public.

Writing good documentation requires being able to effectively analyze a process, to use precise language, to imagine the reader’s perspective, and to test and revise for usability. This assignment seeks to help you learn more about each of these elements.

Specifics

This project will require you to:

  • Identify a process or event in your personal, social, or professional life that needs to be documented.

    The process should be a short, specific set of tasks in which you have expertise that achieves a specific result. Examples include: Creating a mail merge in Word, Knitting a scarf, Baking a loaf of bread, Scanning a photo and saving it to your hard drive, Taking a picture with a digital camera, Sending an e-mail with an attachment.

  • Create detailed written and visual documentation that explains the process at an audience-appropriate level

    Your documentation should be at least two (2) pages long but not longer than five (5) pages and contain a detailed list of steps that guides the reader through the process. It should also contain at least two (2) visual elements (such as diagrams, illustrations, or pictures) to help the reader understand specific parts of the process.

    You will write an initial draft of your documentation and conduct usability testing on it. The initial draft will not be graded, but you will receive peer and instructor feedback. Then you will produce a final draft, which will be graded.

  • Test the documentation with your target audience and revise it based on the results of your testing.

    You will conduct usability testing in class (and outside of class) on the first draft of your documentation and produce a usability testing report, which will be graded. Guidelines for the usability testing report will be given out during that phase of the project.

  • Produce a print or digital version of your documentation (depending on the needs of your audience).

    You will decide whether your audience would be better served by having a print version of the documentation or a digital version of the documentation such as a Web page or PDF file. The instructor will help you produce the appropriate versions when you have made your choice.

You can earn a total of 250 points for this project, out of the 1000 points total for the class.

Grading Criteria

This project will be graded based on how well you:

  • Consider the needs of your audience and write from a reader-centered perspective.
  • Analyze your process and break it down into usable steps.
  • Use precise language to describe each step.
  • Create clear and precise visuals to help your reader understand and complete the task.
  • Test your documentation, report on the testing, and revise based on the results of your testing.

Specific grading rubrics will be attached to your usability testing report and final draft which explain grading criteria and how your grade was calculated.

Project Goals

This project helps you to meet the following course goals:

  • Identify needs for information in business communication: analyze audiences and their information needs, determine appropriate genres and formats for your documentation.
  • Access information: conduct research (if necessary) to help document your process.
  • Evaluate information: assess which information needs to be presented to the reader, evaluate how readers use your documentation, provide oral and written feedback on documentation
  • Use information: learn about the functions and features of documentation, design and present written and visual information in a print or digital format, develop effective style and tone for your audience, create usable and visually effective document designs.
  • Attribute information: consider the ethical implications of poorly written documentation.

Due Dates

  • Topic Due to Instructor (by e-mail): October 3
  • Initial Draft of Documentation Due: October 19
  • Usability Testing Report Due: October 26
  • Final Draft of Documentation Due: October 31
Printer-Friendly Version

Weekly Agenda for October 3-October 7

Monday, October 3

Today we’ll go over the guidelines for the Documenting a Process project. Then we’ll do some activities that explore the roles that writers and readers of documentation play. We’ll also do some brainstorming exercises to help you think of possible processes to document.

Assignments For Next Class

1. Choose process to document; e-mail instructor (ekarper@niagara.edu) with brief description.
2. Read pp. 485-487 and 503-512 in textbook.

Wednesday, October 5

Today we’ll discuss ways of analyzing a process and breaking it down into components. We’ll analyze some sample processes and compare them to how they appear in written documentation.

Assignments For Next Class

For your process, work through “Collecting the Information to Write Instructions” on pp. 488-498 in textbook; bring print and digital copy to class.

Printer-Friendly Version

Notes and Activities for September 28

Today, we’ll:

1) Discuss how to assemble a portfolio.

Necessary elements for a portfolio:

Common look and feel for materials

  • “Professional” appearance
  • Business-appropriate fonts and colors (NO COMIC SANS)
  • For digital versions, choose common fonts (Palatino, Georgia, Times, Garamond, Arial, Trebuchet, Helvetica)
  • Make sure that fonts are clear on the printed page and can be easily skimmed from a distance.
  • Clean and easily readable layout: passes the skim and scan test
  • Emphasis on important information: bold and italics used appropriately
  • Clear and concise presentation of information: headings, lines, and other presentation cues help the reader to easily scan a document
  • Other recommendations as presented in text and document design checklist.

Printed version

  • Laser-printed or printed on a quality inkjet
  • Paper
    • Heavy weight (over 20 lbs)
    • Brightness over 100 lumens for white paper
      Or use a neutral shaded and slightly textured paper such as cream, grey, or sepia
    • Texture: cotton, linen or rag paper that retains ink well
  • Envelopes printed or addressed carefully by hand

Digital versions

  • PDF version to preserve formatting
    PDFs can be created using the Adobe Acrobat plugin.
  • Word version to send as attachment
    Word versions – run the “compatibility checker” when saving and check fonts
  • Plain text or rich text version to paste into e-mails or job sites or to send to people who don’t have Word.
    Rich text or text version: go to File -> Save As and choose “rich text format” or “text format” from the menu. Then go back and edit formatting that’s been changed by the save.

2) Spend some time revising and editing of job materials in order to create print and digital versions.

3) Discuss proofreading strategies.

Proofreading is different from editing. Both types of work are important when creating and revising documents.

  • Editing is changing content and reviewing for large-scale errors. It happens throughout the life cycle of a document. Editing works with documents at the macro and micro levels.
  • Proofreading is careful reading to correct mistakes, and should happen after editing is complete and the document is finished. Proofreading primarily works with documents at the micro level.
  • Proofreaders often use marks to indicate what types of corrections need to be made to a document. They may also use a style guide or style sheet that indicates the “house rules” for style, formatting, and other disputed points of correctness.

4) Practice proofreading using an exercise.

5) Spend time proofreading each other’s work.

Printer-Friendly Version

Notes and Activities for September 26

Today, we’ll:

1) Go over the weekly agenda.

2) Meet in recommendation report groups.

In your groups, please:

  • Discuss initial client contact (if it has happened; schedule it if it hasn’t).
  • Identify the groups and individuals that you think you will need to talk to.
  • Brainstorm a list of initial questions that you have about that communication context.
  • Brainstorm a list of types of communication that you might want to examine in that group.

Be prepared to share parts of this list with the class.

3) Review drafts of your cover letters.

Please e-mail your cover letter to two people in the class.
Next, please read two cover letters and answer the peer review questions for each one.

4) Discuss principles for creating concise writing.

Conciseness is about creating precision. It can be created by:

  • Choosing and using precise language to convey exact meaning.
  • Eliminating filler words.
  • Revising sentences to use less words.

Here are some Web pages that discuss different ways to achieve conciseness:

5) Work on editing your writing for conciseness and clarity.

Assignment for Next Class

1. Read pp. 97-119 in textbook (skim examples).
2. Read over Text and Document Design checklist on p. 126 of textbook.

Printer-Friendly Version

Weekly Agenda for September 26-30

Monday, September 26

Today your recommendation report groups will have some time to meet and discuss the arrangments for client visits and research. Next, we’ll review your cover letters for content and formatting. Finally, we’ll discuss and practice revising sentences for conciseness, and discuss issues related to creating appropriate sentences for job search documents.

Assignment For Next Class

1. Read pp. 97-119 in textbook (skim examples).
2. Co over Text and Document Design checklist on p. 126 of textbook.

Wednesday, September 28

Today we’ll discuss the “look and feel” of the printed and electronic versions of job materials, as well as various document design strategies. We’ll also discuss and practice various proofreading strategies in order to eliminate common errors.

Assignment For Next Class

Your job portfolio is due to me during class. Please make sure that you have printed it and assembled it neatly.

Printer-Friendly Version

Notes and Activities for September 21

Today, we’ll:

1) Review the reasons for writing a cover letter.

The point of a cover letter:

  • Make a persusasive argument for why you are a good candidate for the job and how you would fit in at the company.
  • Explain or expand on points covered in your resume (but not to repeat everything on your resume).
  • Convince the person reading it to further investigate your qualifications.
  • Create a positive impression of you as a candidate.

How do you do this? Let’s look at some cover letters and find out.

2) Conduct a rhetorical analysis of sample cover letters and discuss their common features.

Principles for Rhetorical Analysis

Examine:

  • Context
  • Purpose
  • Audience
  • Genre and Conventions
  • Style and Textual Features

Rhetorical Analysis Activity

a) Please download the cover letter analysis activity and complete it.

b) Please compare your answers in groups and create a master document which contains all of your answers.

c) Please e-mail the master document to the instructor (ekarper@niagara.edu) for in-class display and discussion.

3) Discuss points of debate with regard to writing cover letters.

  • How formal or informal should your tone be?
  • How assertive should you be?
  • Do you say you will call/email at a specific day or time?
  • How often should you use I or My to start a sentence?
  • Do you explain why you are switching career fields or leaving a job?

4) Review how and why one would research a company for help in composing a cover letter.

Company Web sites can tell you:

  • To whom you should address your letter (if you don’t have a contact)
  • What the company does
  • Company values and ethics (mission statement, company description, other descriptions)
  • What the company values about its employees/how it treats its employees
  • Other information that can help you shape your cover letter to fit into that context.

5) Research the companies to which your cover letters will be written.

Examine the Web site for the company to which you will be applying. What can you learn about it from their site? Do your impressions of the company change?

Assignment for Next Class

Write draft of cover letter; bring digital and print copy to class.

Printer-Friendly Version

Notes and Activities for September 19

Today we’ll:

1) Go over the research guidelines for the Recommendation Report project.

You’ll have time to meet in your groups and discuss initial client contact.

2) Review each other’s resumes in groups and give written and oral feedback.

Please e-mail your resume to your group members as an attachment.

Please download the peer review document and write your answers in that as well as correcting the electronic version of the person’s resume.

When you have finished, e-mail your answers and the resume to them.

Finally, please discuss your resume feedback with the group.

3) Experiment with different styles and formatting options for your resume.

Try the following experiements to help you think about the styles of your resume:

  • Try changing the placement of your name and contact information — does it look better on the left? In the middle? Where will an audience see it first?
  • Try changing the placements of dates — do they look better in their own column on the right? Next to job information? How much attention should an audience pay to the dates?
  • Try changing the fonts used in your headings and body text. Different combinations of serif or sans-serif fonts can be interesting.
  • Try changing the emphasis used for your headings — try using all caps or small caps, bold, or underlining. Which makes your information stand out while still looking professional?

Quick tip: to reformat styles quickly, set all of your headings to a specific style (heading 1, heading 2, or heading 3) and then use Word’s Modify Styles function to change that style. You can then try out different headings without having to change each one. (To change body text, change the “normal” style.)

Assignment for Next Class

  1. Read pp. 263-273 in textbook
  2. Locate company Web site or other source of information about your job application; write down URL or bring copy to class.
  3. Recommendation Report: At least two client research visits must be conducted before October 26
Printer-Friendly Version

Weekly Agenda for September 19-23

Monday, September 19

Today we’ll work individually and collectively to give you feedback on the text and layout of your resumes. We’ll also discuss arranging for client research visits and dividing research duties for the recommendation report.

Assignments For Next Class

1. Read pp. 263-273 in textbook
2. Locate company Web site or other source of information about your job application; write down URL or bring copy to class.
3. Recommendation Report: At least two client research visits must be conducted before October 26

Wednesday, September 21

Today we’ll discuss the components of a cover letter as well as strategies for researching companies to get information for the cover letter and analyzing model cover letters.

Assignments For Next Class

1. First Draft of Cover Letter Due; please bring digital and print copy to class; email copy to instructor at ekarper@niagara.edu.

Printer-Friendly Version

Recommendation Report: Research Guidelines

Your group has now chosen a client for the project, and now you must begin to observe their communication practices and collect information about their communication problems and the recommendations that you might make to fix them.
Specifics

You will conduct two types of research for this project: client-based research and academic research.

Client Research

First, you need to establish contact with your client and receive their approval for your project. The client may have an existing question or problem that they wish you to investigate, or you may have to observe their practices and discover a communication issue which needs to be resolved.

After you establish contact with your client, your group should schedule some research visits. These visits will be times that are convenient for members of your group and for the client where you can sit and observe the communication practices of your client. When you observe the client, you should record your observations and any ideas you have that stem from these observations so that they can be shared with the group.

You may also want to interview or survey certain people or groups of people who work for your client or whom your client serves. Please make sure that the instructor reviews your research questions or surveys before you send them out.

You will be expected to use and attribute this research in the recommendation report.

Academic Research

In addition to your research at the client site, your group will need to conduct library and online research to:

  • Complement your on-site observations
  • Provide perspective and context for the communication problems that you have observed, including possible causes or similar problems at other workplaces
  • Discover and describe solutions to the problem

You will be expected to use and attribute this research in your recommendation report. While there is no maximum number of sources, your group is required to cite at least six sources in the report.

Grading Criteria

These project components will not be graded; instead, they will contribute to the quantity and quality of your final report and their presence (or absence) there will be graded. Should you have any questions about the research process, please ask the instructor as soon as possible.

Project Goals

This project helps you to identify needs for information (through observation and discussion within your group and in class); access information (design strategies for client and academic research and conduct said research); evaluate information (draw conclusions from your client visits and academic research); and use information (include information in the final report).

Due Dates

At least two client research visits must be completed by October 26.

Printer-Friendly Version

Weekly Agenda for September 12-16

Monday, September 12

Today we’ll discuss different aspects of creating resumes, including the different types and formats available for resumes and the different sections that resumes contain. We’ll also analyze sample resumes from your field of study and discuss how they are similar and how they are different. The possible clients for the recommendation report will also be available for voting.

Assignments For Next Class:

1. Choose a specific job for which to apply.
2. Choose the type of resume that would be most appropriate for your chosen job.
3. Draft your resume sections (bring a digital and a print copy to class).

Wednesday, September 14

Today we’ll discuss and practice writing text, creating lists, and describing skills on your resumes. We’ll use your sample resume sections for review and practice of these concepts.

Assignments For Next Class

1. First Draft of Resume Due. Please bring a digital copy and a print copy to class.
2. Online readingS: “Resume Design” and “Top Ten Resume Peeves

Printer-Friendly Version

Notes and Activities for September 14

Today we’ll:

1) Meet in Recommendation Report groups and exchange contact information and possible meeting times.

College of Arts and Sciences Office

Rebecca, Jaymie, Angela, Kristen S.

Admissions Office

Molly,
Tom,
Kerrie,
Aaron

WRT 100 Program

Kristin P.,
Christine,
Jennifer, Nicole

2) Talk about the features of resume text.

Resumes use:

  • Sentence fragments rather than sentences; text is as concise as possible
    Avoids “I” and “My” (since the resume is about you, they’re implied)

  • Verb-heavy phrases and clauses that use “action verbs” or “power verbs

    Implemented treatment plans, documented patient progress and wrote reports, prepared paperwork for appropriate state and local agencies.

  • Keywords and phrases from field and from job ad

    Square D Company
    Human Resources Intern
    Prepared several written Affirmative Action plans to meet EEO guidelines. Researched and analyzed census data. Created queries using HRIS software. Screened and interviewed candidates using behavioral based interviewing techniques. Assisted with the administration of workmen’s compensation claims.

  • Bulleted lists with parallel structure:
    • All nouns or all verbs to start each phrase; verbs must be in the same tense
    • Skills are most often written as nouns or noun phrases
    • Job tasks or duties are most often written as verb phrases.

    Good Example

    • Assisted patients with daily living tasks.
    • Led group meetings.
    • Reported patient behaviors and affect.



    Bad Example

    • Designed and published a Web site with FrontPage and HTML
    • Internet manager who maintained a Web page for a business
    • Knowledgable with HTML, CGI, Javascript

  • Subheadings to group related skills and talents.
    Computer Skills
    Writing/Editing Skills
    Language Skills

3) Work individually and in groups to revise your resume text.

4) Discuss aspects of resume design and presentation.

Ensure that the choices that you make on your resume are consistently repeated throughout the page.

  • Headings and subheadings (same size; same emphasis throughout)
  • Fonts (choose only two; one serif and one sans-serif is good; using a single font is also acceptable)
  • Spacing (place same amount of white space between sections and subsections)
  • Placement of information (arrange information in similar ways in each section; try to have job titles and dates line up in columns)

There are many resume templates out there – sometimes they can be useful, but don’t do everything that the template suggests. Often times you can achieve better results by creating tables in Word to hold your text.

Assignment for Next Class

1. First Draft of Resume Due. Please bring a digital copy and a print copy to class.
2. Online readings: “Resume Design” and “Top Ten Resume Peeves

Printer-Friendly Version

Notes and Activities for September 12

Today, we’ll:

1)Discuss client interests for the recommendation reports and cast a final vote.

Possible Groups:

  • College of Arts & Sciences Office
  • Communications Department
  • WRT 100 Program
  • Admissions Office
  • Niagara Index

Please write your top three choices out of those groups on a piece of paper and submit it to the instructor.

2) Discuss the content and format of resumes.

  • A resume is an argument for why you should get a job or type of job.
  • Employers need to be able to glance at your resume and see if you are qualified for the job. How do they do that?
  • A resume is a rhetorical (persuasive) arrangement of information. You start with information about you and your skills, and then you arrange it to:
    • Highlight the qualifications and skills you have that best match the job description.
    • Display your unique (but relevant) skills and characteristics that qualify you for the job.
    • Include key words and phrases that employers are looking for when they scan a resume.
    • Match with conventions for resumes in your field and expectations that employers have regarding resumes

Common Resume Sections

  • Personal information (very important)
  • Summary (Not always necessary; often used on functional resumes)
  • Objective (Is one always necessary? Debatable.)
  • Education/Training (Do you list your high school education? Do you list classes taken? It depends.)
  • Employment/Work History (Jobs you did, with or without descriptions or dates, depending on type of resume)
  • Skills/Qualifications/Expertise (Things you’re able to do)
  • Activities (Not always necessary; think about the impression they convey)
  • Honors (Not always necessary but are nice – can be folded into other sections such as education or work history)
  • References (can be included on the resume or on a separate page)
  • Other sections (as necessary)

How do you choose appropriate sections for arranging your information?

  • Look at other resumes or guidelines for resumes in your field and see what sections they use (ask students to do this with their sample resumes).
  • Consider which sections will show off your relevant skills and qualifications to their best advantage.

What sections do the sample resumes that you brought to class contain? Why do you think they contain these sections? What kind of an argument is made by combining those sections?

Types of Resumes

  • Functional: presents and highlights skills and abilities; work history and education are subordinate and do not contain dates or details.
  • Chronological: presents and highlights education and work history in reverse order of positions held; work history and education are highlighted in detail, skills and abilities are subordinate and usually just presented as lists.
  • Hybrid/combination: combines features of functional and chronological resumes
  • Creative: shows off artistic talents or specialized skills (not often used)
  • This chart offers a good comparison of resume formats and when they are used.

Students often use functional resumes; employers tend to prefer chronological resumes. What type of resumes are your sample resumes? Why do you think they are arranged that way?

3) Complete and discuss a resume analysis activity.

Printer-Friendly Version

Notes and Activities for September 7

Today we’ll:

1) Set up the laptops and connect to the wireless network.

2) Talk about possible clients for the Recommendation Report project.

Clients you’ve suggested:

  • College of Arts and Sciences Office
  • Communications Department
  • Financial Aid Office
  • Admissions Office
  • One of the course programs at Niagara (WRT 100, HIST 199, ENG 100, etc)
  • Wegmans
  • Aspen Dental Offices (Chain of Offices)
  • Taheri & Todoro, PC

Any other suggestions?

Please e-mail your top three choices out of those choices as well as any other suggestions that you might have to the instructor.

3) Talk about how skills and interests that you have can match up with possible jobs.

Last Wednesday, we looked at how occupational handbooks describe different types of jobs and the tasks and skills involved. You were asked to look at the descriptions for some job types that might interest you. In general, did your perceptions of the tasks and skills for your job types match up with the descriptions of the job types in the handbook?

4) Discuss how job ads present and describe jobs and the ways they use language.

Of course, occupational handbooks describe the ideal (Platonic) of a job. In the real world, jobs are often described quite differently… In order to determine whether a job would be a good fit for you and what an employer is looking for, you need to learn the language of job ads.

Guidelines for Analyzing a Job Advertisement

You can use these guidelines to help you analyze job ads that you find online and in other places as well as when you write your Job Ad analysis for Monday.

  • Note key terms and keywords in description; define key terms, especially ones that you don’t know
  • Identify and define requirements, experience and necessary skills
  • Identify and define optional skills, experience and proficiencies
  • Note how to apply for the job and who to contact
  • Determine if you are qualified for the job and describe how and why you are qualified (with examples).
  • Compare this job ad with others like it – how are they similar? How are they different?

Common Parts of Job Advertisements

  • Description: Describes position and duties, length of employment (full time, part time, seasonal, temporary, permanent, temp-to-perm, freelance) usually gives job title, often includes benefits and salary information

    What this means to you: Is this a job that you feel qualified to take? Is this a job that would meet your needs?

  • Requirements (also Minimum Requirements, Skills): What an applicant must demonstrate at a bare minimum to get the job. Often includes educational levels that must have been achieved and specific skill sets that applicant must demonstrate.

    What this means to you: Your resume and cover letter must show the employer that you have these skills and provide evidence.

  • Optional Skills (or “A Plus” or “Not Required”): Skills that they would like an applicant to have but which are not required to qualify an applicant for a job.

    What this means to you: If you have any of these optional skills, you should highlight them in your cover letter.

  • How to Apply: Who to contact and what materials to send.

    What this means to you: Pay careful attention to these guidelines and follow them exactly.

Key Terms Used in Job Advertisements

Sometimes jobs describe their required tasks and skills in detail; other times, you need to derive what an employer is looking for from a job description or a general list of skills.

How would you define these terms as they apply to jobs in general and jobs in your field?

  • Education/Certification
  • Experience/Work History (what counts as experience? Not just paid job experience. Should you apply for jobs where you don’t have the minimum amount of experience?)
  • Skills/Proficiencies (“command of” “knowledge of” “proficiency in”)
    • (Oral and written) communication
    • Leadership
    • Management
    • Problem-solving
    • Computer
    • Language
  • Atmosphere/Work Environment (”fast paced,” “challenging,” “deadline oriented,” “under pressure”)

How do you find out more about what a company might be looking for or determine what they mean when they use a broad term such as “skills”?

  • Look at similar ads from other companies
  • Research the company online
  • Look that type of job up in an occupational handbook or Web site and compare the description
  • Network: see if you know anyone who works for the company or holds a similar job elsewhere
  • Contact the company (but you want to be careful and be polite)

How would you demonstrate these skills and qualifications to an employer?

Advice from “Deciphering the Language of Job Ads“:

If the skill offers an official certification, are you certified? If so, list it on your resume. If not, you may want to rethink applying.

If the skill does not offer a certification, would you feel comfortable using the skill on a daily basis? Could someone ask you to perform a relatively simple task using that skill?

When you’re not sure what to say, just be honest. If you speak conversational Spanish, then put “Conversational Spanish” on your resume, not “Fluent Spanish.”

Also: When have you used these skills in the past? Are there projects or documents that demonstrate your skills in these areas? Make a list.

5) Conduct an analysis of some sample job advertisements for the same position. Discuss the analysis as a class.

In your job ad analysis for Monday, I’d like you to examine two ads for jobs that you could have and use the guidelines and the terms that we’ve just talked about to describe their job and their ideal candidate. You should also talk about how you know that you’d be qualified for the job and how you can demonstrate that. You should quote the ad or provide links.

6) Work on searching for jobs that you could use in your analysis and for which you could apply.

Job Finding Resources

These resources are also available in the sidebar under the heading “Job Search Resources.”

General Resources

Field-Specific Resources

Assignments for Next Class

1. First Draft of Job Ad Analysis Due (by email to instructor as a Word Document)
2. Read pp. 243-255 in textbook.
3. Locate a sample resume for a job in your field and bring a copy to class.

Printer-Friendly Version