",$inputplus = '',$thplus='') { echo "$tr $desc$thplus "; } function template_checkbox( $rss = false, $trextra = '' ) { global $yarpp; $pre = $rss ? 'rss_' : ''; $chosen_template = yarpp_get_option( "{$pre}template" ); echo "admin->get_templates()), true); checked( !!$chosen_template ); echo " /> " . __("Display using a custom template file",'yarpp')." ".__('more>','yarpp')."".__("This advanced option gives you full power to customize how your related posts are displayed. Templates (stored in your theme folder) are written in PHP.",'yarpp')."" . ""; } function textbox($option,$desc,$size=2,$tr=" ", $note = '') { $value = esc_attr(yarpp_get_option($option)); echo " $tr$desc "; if ( !empty($note) ) echo " {$note}"; echo " "; } function beforeafter($options,$desc,$size=10,$tr=" ", $note = '') { echo " $tr$desc "; $value = esc_attr(yarpp_get_option($options[0])); echo " / "; $value = esc_attr(yarpp_get_option($options[1])); echo ""; if ( !empty($note) ) echo " {$note}"; echo " "; } function tax_weight($taxonomy) { $weight = (int) yarpp_get_option("weight[tax][{$taxonomy->name}]"); $require = (int) yarpp_get_option("require_tax[{$taxonomy->name}]"); echo "{$taxonomy->labels->name}:"; } function weight($option,$desc,$tr="",$inputplus = '') { $weight = (int) yarpp_get_option("weight[$option]"); echo "$tr$desc"; echo ""; } function displayorder( $option, $class = '' ) { ?> valign='top'>
admin->get_term_ids_from_tt_ids( $taxonomy, $exclude_tt_ids ); if ( count($exclude_term_ids) ) { $terms = get_terms($taxonomy, array('include' => $exclude_term_ids)); foreach ($terms as $term) { echo " "; } } ?>

get_taxonomies() as $taxonomy) { $this->exclude($taxonomy->name, sprintf(__('Disallow by %s:','yarpp'), $taxonomy->labels->singular_name)); } $this->checkbox('show_pass_post',__("Show password protected posts?",'yarpp')); $recent = yarpp_get_option('recent'); if ( !!$recent ) { list($recent_number, $recent_units) = explode(' ', $recent); } else { $recent_number = 12; $recent_units = 'month'; } $recent_number = ""; $recent_units = ""; echo ""; ?>
get_post_types( 'label' )); ?>
"; echo str_replace('NUMBER',$recent_number,str_replace('UNITS',$recent_units,__("Show only posts from the past NUMBER UNITS",'yarpp'))); echo "

match threshold.','yarpp');?>

textbox('threshold',__('Match threshold:','yarpp')); $this->weight('title',__("Titles: ",'yarpp'),"
",( !$yarpp->myisam ? ' readonly="readonly" disabled="disabled"':'' )); $this->weight('body',__("Bodies: ",'yarpp'),"
",( !$yarpp->myisam ? ' readonly="readonly" disabled="disabled"':'' )); foreach ($yarpp->get_taxonomies() as $taxonomy) { $this->tax_weight($taxonomy); } $this->checkbox('cross_relate',__("Display results from all post types",'yarpp')." ".__('more>','yarpp')."".__("When \"display results from all post types\" is off, only posts will be displayed as related to a post, only pages will be displayed as related to a page, etc.",'yarpp').""); $this->checkbox('past_only',__("Show only previous posts?",'yarpp')); ?>
checkbox('auto_display',__("Automatically display related posts?",'yarpp')." ".__('more>','yarpp')."".__("This option automatically displays related posts right after the content on single entry pages. If this option is off, you will need to manually insert related_posts() or variants (related_pages() and related_entries()) into your theme files.",'yarpp')."",""); $this->textbox('limit',__('Maximum number of related posts:','yarpp')); $this->template_checkbox( false ); ?>
",'',''.__("Website display code example",'yarpp').'
'.__("(Update options to reload.)",'yarpp').'
' ."
beforeafter(array('before_related', 'after_related'),__("Before / after related entries:",'yarpp'),15,"\r\t\t\t\t\r\t\t\t\tdisplayorder('order'); $this->textbox('no_results',__('Default display if no results:','yarpp'),'40',"
", __("For example:",'yarpp') . ' <ol></ol>' . __(' or ','yarpp') . '<div></div>'); $this->beforeafter(array('before_title', 'after_title'),__("Before / after each related entry:",'yarpp'),15,"
", __("For example:",'yarpp') . ' <li></li>' . __(' or ','yarpp') . '<dl></dl>'); $this->checkbox('show_excerpt',__("Show excerpt?",'yarpp'),"
",' class="show_excerpt"'); $this->textbox('excerpt_length',__('Excerpt length (No. of words):','yarpp'),10,"
")?>
/ <li></li><dl></dl>
"); $this->checkbox('promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp') ." ".__('more>','yarpp')."" .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"".htmlspecialchars(sprintf(__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp'), 'http://yarpp.org'))."") .""); ?>
for your website','yarpp'), array(new YARPP_Meta_Box_Display_Web, 'display'), 'settings_page_yarpp', 'normal', 'core'); class YARPP_Meta_Box_Display_Feed extends YARPP_Meta_Box { function display() { global $yarpp; ?> checkbox('rss_display',__("Display related posts in feeds?",'yarpp')." ".__('more>','yarpp')."".__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.",'yarpp')."",""); $this->checkbox('rss_excerpt_display',__("Display related posts in the descriptions?",'yarpp')." ".__('more>','yarpp')."".__("This option displays the related posts in the RSS description fields, not just the content. If your feeds are set up to only display excerpts, however, only the description field is used, so this option is required for any display at all.",'yarpp')."","
",' class="rss_display"',''.__("RSS display code example",'yarpp').'
'.__("(Update options to reload.)",'yarpp').'
' ."
"); $this->textbox('rss_limit',__('Maximum number of related posts:','yarpp'),2, "
"); $this->template_checkbox( true, " class='rss_displayed'" ); ?>
beforeafter(array('rss_before_related', 'rss_after_related'),__("Before / after related entries:",'yarpp'),15,"\r\t\t\t\t\r\t\t\t\t\r\t\t\t\t\r\t\t\t\t
", __("For example:",'yarpp') . ' <ol></ol>' . __(' or ','yarpp') . '<div></div>'); $this->beforeafter(array('rss_before_title', 'rss_after_title'),__("Before / after each related entry:",'yarpp'),15,"
", __("For example:",'yarpp') . ' <li></li>' . __(' or ','yarpp') . '<dl></dl>'); $this->checkbox('rss_show_excerpt',__("Show excerpt?",'yarpp'),"
",' class="rss_show_excerpt"'); $this->textbox('rss_excerpt_length',__('Excerpt length (No. of words):','yarpp'),10,"
"); $this->beforeafter(array('rss_before_post', 'rss_after_post'),__("Before / after (excerpt):",'yarpp'),10,"
", __("For example:",'yarpp') . ' <li></li>' . __(' or ','yarpp') . '<dl></dl>'); $this->displayorder('rss_order', 'rss_displayed'); $this->textbox('rss_no_results',__('Default display if no results:','yarpp'),'40',"
")?> checkbox('rss_promote_yarpp',__("Help promote Yet Another Related Posts Plugin?",'yarpp')." ".__('more>','yarpp')."" .sprintf(__("This option will add the code %s. Try turning it on, updating your options, and see the code in the code example to the right. These links and donations are greatly appreciated.", 'yarpp'),"".htmlspecialchars(sprintf(__("Related posts brought to you by Yet Another Related Posts Plugin.",'yarpp'), 'http://yarpp.org'))."") ."","
"); ?>
for RSS','yarpp'), array(new YARPP_Meta_Box_Display_Feed, 'display'), 'settings_page_yarpp', 'normal', 'core'); class YARPP_Meta_Box_Contact extends YARPP_Meta_Box { function display() { $pluginurl = plugin_dir_url(__FILE__); ?>