本文整理汇总了PHP中yarpp_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP yarpp_get_option函数的具体用法?PHP yarpp_get_option怎么用?PHP yarpp_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了yarpp_get_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
global $post;
if (!is_singular()) {
return;
}
extract($args);
$instance['post_type'] = $post->post_type == 'page' ? array('page') : array('post');
if (yarpp_get_option('cross_relate')) {
$instance['post_type'] = array('post', 'page');
}
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget;
if (!$instance['use_template']) {
echo $before_title;
if ($title) {
echo $title;
} else {
_e('Related Posts (YARPP)', 'yarpp');
}
echo $after_title;
}
$instance['domain'] = 'widget';
echo yarpp_related(null, $instance, false);
echo $after_widget;
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:26,代码来源:class-widget.php
示例2: yarpp_make_optin_classy
function yarpp_make_optin_classy($classes)
{
if (!yarpp_get_option('optin')) {
$classes[] = 'yarpp_attention';
}
return $classes;
}
开发者ID:WackoMako,项目名称:stonedape,代码行数:7,代码来源:yarpp_meta_boxes_hooks.php
示例3: related_pages_exist
function related_pages_exist($args = array(), $reference_ID = false)
{
$args['post_type'] = array('page');
if (yarpp_get_option('cross_relate')) {
$args['post_type'] = array('post', 'page');
}
return yarpp_related_exist($reference_ID, $args);
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:8,代码来源:related-functions.php
示例4: display
public function display()
{
global $yarpp;
echo "<div style='overflow:auto'>";
echo '<div class="yarpp_code_display"';
if (!$yarpp->get_option('code_display')) {
echo ' style="display: none;"';
}
echo '><strong>' . __("Website display code example", 'yarpp') . '</strong><br /><small>' . __("(Update options to reload.)", 'yarpp') . "</small><br/><div id='display_demo_web'></div></div>";
echo "<div class='yarpp_form_row yarpp_form_post_types'><div>";
echo 'Automatically display related content from YARPP Basic on: ';
echo " <span class='yarpp_help' data-help='" . esc_attr(__("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 <code>related_posts()</code> or variants (<code>related_pages()</code> and <code>related_entries()</code>) into your theme files.", 'yarpp')) . "'> </span> ";
echo "</div><div>";
$post_types = yarpp_get_option('auto_display_post_types');
foreach ($yarpp->get_post_types('objects') as $post_type) {
echo "<label for='yarpp_post_type_{$post_type->name}'><input id='yarpp_post_type_{$post_type->name}' name='auto_display_post_types[{$post_type->name}]' type='checkbox' ";
checked(in_array($post_type->name, $post_types));
echo "/> {$post_type->labels->name}</label> ";
}
echo "</div></div>";
$this->checkbox('auto_display_archive', __("Also display in archives", 'yarpp'));
$this->textbox('limit', __('Maximum number of related posts:', 'yarpp'));
$this->template_checkbox(false);
echo "</div>";
$chosen_template = yarpp_get_option("template");
$choice = false === $chosen_template ? 'builtin' : ($chosen_template == 'thumbnails' ? 'thumbnails' : 'custom');
echo "<div class='postbox yarpp_subbox template_options_custom'";
if ($choice != 'custom') {
echo ' style="display: none;"';
}
echo ">";
echo '<div class="yarpp_form_row"><div>' . $this->template_text . '</div></div>';
$this->template_file(false);
echo "</div>";
echo "<div class='postbox yarpp_subbox template_options_thumbnails'";
if ($choice != 'thumbnails') {
echo ' style="display: none;"';
}
echo ">";
$this->textbox('thumbnails_heading', __('Heading:', 'yarpp'), 40);
$this->textbox('thumbnails_default', __('Default image (URL):', 'yarpp'), 40);
$this->textbox('no_results', __('Default display if no results:', 'yarpp'), 40, 'sync_no_results');
echo "</div>";
echo "<div class='postbox yarpp_subbox template_options_builtin'";
if ($choice != 'builtin') {
echo ' style="display: none;"';
}
echo ">";
$this->beforeafter(array('before_related', 'after_related'), __("Before / after related entries:", 'yarpp'), 15, '', __("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'), 'show_excerpt');
$this->textbox('excerpt_length', __('Excerpt length (No. of words):', 'yarpp'), 10, 'excerpted');
$this->beforeafter(array('before_post', 'after_post'), __("Before / after (excerpt):", 'yarpp'), 10, 'excerpted', __("For example:", 'yarpp') . ' <li></li>' . __(' or ', 'yarpp') . '<dl></dl>');
$this->textbox('no_results', __('Default display if no results:', 'yarpp'), 40, 'sync_no_results');
echo "</div>";
$this->displayorder('order');
$this->checkbox('promote_yarpp', __("Help promote Yet Another Related Posts Plugin?", 'yarpp') . '<span class="yarpp_help" data-help="' . 'This option will add the line “powered by AdBistro” beneath the related posts section. ' . 'This link is greatly appreciated."></span>');
}
开发者ID:slavic18,项目名称:cats,代码行数:58,代码来源:YARPP_Meta_Box_Display_Web.php
示例5: display
public function display()
{
$output = '<p>' . 'Enable the free <a href="http://www.yarpp.com" target="_blank">YARPP Pro enhancements</a> to add even ' . 'more power to your blog or website!' . '<br/><br/>' . '<a href="' . plugins_url('/', dirname(__FILE__)) . 'includes/yarpp_switch.php" class="yarpp_switch_button button" data-go="pro">Turn them on now</a> ' . '<a href="http://www.yarpp.com" target="_blank" style="float:right;text-decoration:underline">Learn more</a>' . '</p>' . '<p>' . 'We can continue to improve the YARPP product for you if we know how it's used. Please help us by ' . 'allowing usage data to be sent back.' . '<br/>' . '</p>' . '<input
type="checkbox"
id="yarpp-optin"
name="optin"
value="true" ' . checked(yarpp_get_option('optin') == 1, true, false) . ' ' . '/>' . '<label for="yarpp-optin">Send usage data back.</label>' . '<a href="#" id="yarpp-optin-learnmore" style="float:right;text-decoration:underline">Learn More</a>';
echo $output;
}
开发者ID:slavic18,项目名称:cats,代码行数:9,代码来源:YARPP_Meta_Box_Optin.php
示例6: yarpp_ajax_display_demo_rss
function yarpp_ajax_display_demo_rss()
{
global $wpdb, $post, $userdata, $yarpp_demo_time, $wp_query, $id, $page, $pages, $yarpp_limit;
header("Content-Type: text/html; charset=utf-8");
$yarpp_limit = yarpp_get_option('rss_limit');
$return = yarpp_related(array('post'), array(), false, false, 'demo_rss');
unset($yarpp_limit);
echo ereg_replace("[\n\r]", '', nl2br(htmlspecialchars($return)));
exit;
}
开发者ID:812studio,项目名称:812studio,代码行数:10,代码来源:services.php
示例7: where_filter
function where_filter($arg)
{
global $wpdb;
$threshold = yarpp_get_option('threshold');
if ($this->yarpp_time) {
$arg = str_replace("{$wpdb->posts}.ID = ", "yarpp.score >= {$threshold} and yarpp.reference_ID = ", $arg);
if (yarpp_get_option("recent_only")) {
$arg .= " and post_date > date_sub(now(), interval " . yarpp_get_option("recent_number") . " " . yarpp_get_option("recent_units") . ") ";
}
}
return $arg;
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:12,代码来源:cache-tables.php
示例8: displayorder
public function displayorder($option, $class = null)
{
echo "<div class='yarpp_form_row yarpp_form_select {$class}'><div class='yarpp_form_label'>";
_e("Order results:", 'yarpp');
echo "</div><div><select name='{$option}' id='<?php echo {$option}; ?>'>";
$order = yarpp_get_option($option);
?>
<option value="score DESC" <?php
echo $order == 'score DESC' ? ' selected="selected"' : '';
?>
><?php
_e("score (high relevance to low)", 'yarpp');
?>
</option>
<option value="score ASC" <?php
echo $order == 'score ASC' ? ' selected="selected"' : '';
?>
><?php
_e("score (low relevance to high)", 'yarpp');
?>
</option>
<option value="post_date DESC" <?php
echo $order == 'post_date DESC' ? ' selected="selected"' : '';
?>
><?php
_e("date (new to old)", 'yarpp');
?>
</option>
<option value="post_date ASC" <?php
echo $order == 'post_date ASC' ? ' selected="selected"' : '';
?>
><?php
_e("date (old to new)", 'yarpp');
?>
</option>
<option value="post_title ASC" <?php
echo $order == 'post_title ASC' ? ' selected="selected"' : '';
?>
><?php
_e("title (alphabetical)", 'yarpp');
?>
</option>
<option value="post_title DESC" <?php
echo $order == 'post_title DESC' ? ' selected="selected"' : '';
?>
><?php
_e("title (reverse alphabetical)", 'yarpp');
?>
</option>
<?php
echo "</select></div></div>";
}
开发者ID:slavic18,项目名称:cats,代码行数:52,代码来源:YARPP_Meta_Box.php
示例9: where_filter
public function where_filter($arg)
{
global $wpdb;
$threshold = yarpp_get_option('threshold');
if ($this->yarpp_time) {
$arg = str_replace("{$wpdb->posts}.ID = ", "yarpp.score >= {$threshold} and yarpp.reference_ID = ", $arg);
$recent = yarpp_get_option('recent');
if (!!$recent) {
$arg .= " and post_date > date_sub(now(), interval {$recent}) ";
}
}
return $arg;
}
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:13,代码来源:cache-tables.php
示例10: yarpp_ajax_display_distags
function yarpp_ajax_display_distags()
{
global $wpdb;
header("HTTP/1.1 200");
header("Content-Type: text/html; charset=UTF-8");
$distags = explode(',', yarpp_get_option('distags'));
array_unshift($distags, ' ');
foreach ($wpdb->get_results("select {$wpdb->terms}.term_id, name from {$wpdb->terms} natural join {$wpdb->term_taxonomy} where {$wpdb->term_taxonomy}.taxonomy = 'post_tag' order by name") as $tag) {
echo "<input type='checkbox' name='distags[{$tag->term_id}]' value='true'" . (array_search($tag->term_id, $distags) ? ' checked="checked"' : '') . " /> <label>{$tag->name}</label> ";
// for='distags[$tag->term_id]'
}
exit;
}
开发者ID:hypenotic,项目名称:slowfood,代码行数:13,代码来源:services.php
示例11: where_filter
/**
* MAGIC FILTERS
*/
public function where_filter($arg)
{
global $wpdb;
// modify the where clause to use the related ID list.
if (!count($this->related_IDs)) {
$this->related_IDs = array(0);
}
$arg = preg_replace("!{$wpdb->posts}.ID = \\d+!", "{$wpdb->posts}.ID in (" . join(',', $this->related_IDs) . ")", $arg);
// if recent is set, add an additional condition
$recent = yarpp_get_option('recent');
if (!!$recent) {
$arg .= " and post_date > date_sub(now(), interval {$recent}) ";
}
return $arg;
}
开发者ID:ni-hao,项目名称:myhomework,代码行数:18,代码来源:cache-postmeta.php
示例12: where_filter
/**
* MAGIC FILTERS
*/
public function where_filter($arg)
{
global $wpdb;
$threshold = yarpp_get_option('threshold');
// modify the where clause to use the related ID list.
if (!count($this->related_IDs)) {
$this->related_IDs = array(0);
}
$arg = preg_replace("!{$wpdb->posts}.ID = \\d+!", "{$wpdb->posts}.ID in (" . join(',', $this->related_IDs) . ")", $arg);
// if we have "recent only" set, add an additional condition
if (yarpp_get_option("recent_only")) {
$arg .= " and post_date > date_sub(now(), interval " . yarpp_get_option("recent_number") . " " . yarpp_get_option("recent_units") . ") ";
}
return $arg;
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:18,代码来源:cache-postmeta.php
示例13: display
public function display()
{
global $yarpp;
echo "<div style='overflow:auto'>";
echo '<div class="rss_displayed yarpp_code_display"';
if (!$yarpp->get_option('code_display')) {
echo ' style="display: none;"';
}
echo '><b>' . __("RSS display code example", 'yarpp') . '</b><br /><small>' . __("(Update options to reload.)", 'yarpp') . "</small><br/><div id='display_demo_rss'></div></div>";
$this->checkbox('rss_display', __("Display related posts in feeds?", 'yarpp') . " <span class='yarpp_help' data-help='" . esc_attr(__("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.", 'yarpp')) . "'> </span>", '');
$this->checkbox('rss_excerpt_display', __("Display related posts in the descriptions?", 'yarpp') . " <span class='yarpp_help' data-help='" . esc_attr(__("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')) . "'> </span>", 'rss_displayed');
$this->textbox('rss_limit', __('Maximum number of related posts:', 'yarpp'), 2, 'rss_displayed');
$this->template_checkbox(true, 'rss_displayed');
echo "</div>";
$chosen_template = yarpp_get_option("rss_template");
$choice = false === $chosen_template ? 'builtin' : ($chosen_template == 'thumbnails' ? 'thumbnails' : 'custom');
echo "<div class='postbox yarpp_subbox template_options_custom rss_displayed'";
if ($choice != 'custom') {
echo ' style="display: none;"';
}
echo ">";
echo '<div class="yarpp_form_row"><div>' . $this->template_text . '</div></div>';
$this->template_file(true);
echo "</div>";
echo "<div class='postbox yarpp_subbox template_options_thumbnails'";
if ($choice != 'thumbnails') {
echo ' style="display: none;"';
}
echo ">";
$this->textbox('rss_thumbnails_heading', __('Heading:', 'yarpp'), 40);
$this->textbox('rss_thumbnails_default', __('Default image (URL):', 'yarpp'), 40);
$this->textbox('rss_no_results', __('Default display if no results:', 'yarpp'), 40, 'sync_rss_no_results');
echo "</div>";
echo "<div class='postbox yarpp_subbox template_options_builtin rss_displayed'";
if ($choice != 'builtin') {
echo ' style="display: none;"';
}
echo ">";
$this->beforeafter(array('rss_before_related', 'rss_after_related'), __("Before / after related entries:", 'yarpp'), 15, '', __("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'), 'show_excerpt');
$this->textbox('rss_excerpt_length', __('Excerpt length (No. of words):', 'yarpp'), 10, 'excerpted');
$this->beforeafter(array('rss_before_post', 'rss_after_post'), __("Before / after (excerpt):", 'yarpp'), 10, 'excerpted', __("For example:", 'yarpp') . ' <li></li>' . __(' or ', 'yarpp') . '<dl></dl>');
$this->textbox('rss_no_results', __('Default display if no results:', 'yarpp'), 40, 'sync_rss_no_results');
echo "</div>";
$this->displayorder('rss_order', 'rss_displayed');
$this->checkbox('rss_promote_yarpp', __("Help promote Yet Another Related Posts Plugin?", 'yarpp') . " <span class='yarpp_help' data-help='" . esc_attr(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'), "<code>" . htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.", 'yarpp'), 'http://www.yarpp.com')) . "</code>")) . "'> </span>", 'rss_displayed');
}
开发者ID:slavic18,项目名称:cats,代码行数:48,代码来源:YARPP_Meta_Box_Display_Feed.php
示例14: exclude
public function exclude($taxonomy, $string)
{
global $yarpp;
echo "<div class='yarpp_form_row yarpp_form_exclude'><div class='yarpp_form_label'>";
echo $string;
echo "</div><div class='yarpp_scroll_wrapper'><div class='exclude_terms' id='exclude_{$taxonomy}'>";
$exclude_tt_ids = wp_parse_id_list(yarpp_get_option('exclude'));
$exclude_term_ids = $yarpp->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 "<input type='checkbox' name='exclude[{$term->term_taxonomy_id}]' id='exclude_{$term->term_taxonomy_id}' value='true' checked='checked' /> <label for='exclude_{$term->term_taxonomy_id}'>" . esc_html($term->name) . "</label> ";
}
}
echo "</div></div></div>";
}
开发者ID:WackoMako,项目名称:stonedape,代码行数:16,代码来源:YARPP_Meta_Box_Pool.php
示例15: yarpp_related_exist
function yarpp_related_exist($type, $args)
{
global $wpdb, $post;
$options = array('threshold' => 'threshold', 'show_pass_post' => 'show_pass_post', 'past_only' => 'past_only');
$optvals = array();
foreach (array_keys($options) as $option) {
if (isset($args[$option])) {
$optvals[$option] = stripslashes($args[$option]);
} else {
$optvals[$option] = stripslashes(stripslashes(yarpp_get_option($options[$option])));
}
}
extract($optvals);
$result = $wpdb->get_var(yarpp_sql($type, $args, false, $domain));
return $result > 0 ? true : false;
}
开发者ID:jcbozonier,项目名称:master,代码行数:16,代码来源:magic.php
示例16: ajax_display_exclude_terms
function ajax_display_exclude_terms()
{
check_ajax_referer('yarpp_display_exclude_terms');
if (!isset($_REQUEST['taxonomy'])) {
return;
}
$taxonomy = (string) $_REQUEST['taxonomy'];
header("HTTP/1.1 200");
header("Content-Type: text/html; charset=UTF-8");
$exclude_tt_ids = wp_parse_id_list(yarpp_get_option('exclude'));
$exclude_term_ids = $this->get_term_ids_from_tt_ids($taxonomy, $exclude_tt_ids);
// if ( 'category' == $taxonomy )
// $exclude .= ',' . get_option( 'default_category' );
$terms = get_terms($taxonomy, array('exclude' => $exclude_term_ids, 'hide_empty' => false, 'hierarchical' => false, 'number' => 100, 'offset' => $_REQUEST['offset']));
if (!count($terms)) {
echo ':(';
// no more :(
exit;
}
foreach ($terms as $term) {
echo "<span><input type='checkbox' name='exclude[{$term->term_taxonomy_id}]' id='exclude_{$term->term_taxonomy_id}' value='true' /> <label for='exclude_{$term->term_taxonomy_id}'>" . esc_html($term->name) . "</label></span> ";
}
exit;
}
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:24,代码来源:class-admin.php
示例17: upgrade_3_5_2b2
function upgrade_3_5_2b2()
{
// fixing the effects of a previous bug affecting non-MyISAM users
if (is_null(yarpp_get_option('weight')) || !is_array(yarpp_get_option('weight'))) {
$weight = $this->default_options['weight'];
// if we're still not using MyISAM
if (!yarpp_get_option('myisam_override') && $this->myisam_check() !== true) {
unset($weight['title']);
unset($weight['body']);
}
yarpp_set_option(array('weight' => $weight));
}
}
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:13,代码来源:class-core.php
示例18: printf
echo '<div class="updated"><p>';
printf(__("There is a new beta (%s) of Yet Another Related Posts Plugin. You can <a href=\"%s\">download it here</a> at your own risk.", "yarpp"), $yarpp_version_info['beta']['version'], $yarpp_version_info['beta']['url']);
echo '</p></div>';
}
}
}
if (isset($_POST['myisam_override'])) {
yarpp_set_option('myisam_override', 1);
echo "<div class='updated'>" . __("The MyISAM check has been overridden. You may now use the \"consider titles\" and \"consider bodies\" relatedness criteria.", 'yarpp') . "</div>";
}
if (!yarpp_get_option('myisam_override')) {
$yarpp_check_return = $yarpp->myisam_check();
if ($yarpp_check_return !== true) {
// if it's not *exactly* true
echo "<div class='updated'>" . sprintf(__("YARPP's \"consider titles\" and \"consider bodies\" relatedness criteria require your <code>%s</code> table to use the <a href='http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html'>MyISAM storage engine</a>, but the table seems to be using the <code>%s</code> engine. These two options have been disabled.", 'yarpp'), $wpdb->posts, $yarpp_check_return) . "<br />" . sprintf(__("To restore these features, please update your <code>%s</code> table by executing the following SQL directive: <code>ALTER TABLE `%s` ENGINE = MyISAM;</code> . No data will be erased by altering the table's engine, although there are performance implications.", 'yarpp'), $wpdb->posts, $wpdb->posts) . "<br />" . sprintf(__("If, despite this check, you are sure that <code>%s</code> is using the MyISAM engine, press this magic button:", 'yarpp'), $wpdb->posts) . "<br />" . "<form method='post'><input type='submit' class='button' name='myisam_override' value='" . __("Trust me. Let me use MyISAM features.", 'yarpp') . "'></input></form>" . "</div>";
$weight = yarpp_get_option('weight');
unset($weight['title']);
unset($weight['body']);
yarpp_set_option(array('weight' => $weight));
$yarpp->myisam = false;
}
}
if ($yarpp->myisam && !$yarpp->enabled()) {
echo '<div class="updated">';
if ($yarpp->activate()) {
_e('The YARPP database had an error but has been fixed.', 'yarpp');
} else {
_e('The YARPP database has an error which could not be fixed.', 'yarpp');
printf(__('Please try <a href="%s" target="_blank">manual SQL setup</a>.', 'yarpp'), 'http://mitcho.com/code/yarpp/sql.php?prefix=' . urlencode($wpdb->prefix));
}
echo '</div>';
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:31,代码来源:options.php
示例19: __
<?php
global $wpdb, $wp_version, $yarpp;
/* Enforce YARPP setup: */
$yarpp->enforce();
if (!$yarpp->enabled() && !$yarpp->activate()) {
echo '<div class="updated">' . __('The YARPP database has an error which could not be fixed.', 'yarpp') . '</div>';
}
/* Check to see that templates are in the right place */
if (!$yarpp->diagnostic_custom_templates()) {
$template_option = yarpp_get_option('template');
if ($template_option !== false && $template_option !== 'thumbnails') {
yarpp_set_option('template', false);
}
$template_option = yarpp_get_option('rss_template');
if ($template_option !== false && $template_option !== 'thumbnails') {
yarpp_set_option('rss_template', false);
}
}
/**
* @since 3.3 Move version checking here, in PHP.
*/
if (current_user_can('update_plugins')) {
$yarpp_version_info = $yarpp->version_info();
/*
* These strings are not localizable, as long as the plugin data on wordpress.org cannot be.
*/
$slug = 'yet-another-related-posts-plugin';
$plugin_name = 'Yet Another Related Posts Plugin';
$file = basename(YARPP_DIR) . '/yarpp.php';
if ($yarpp_version_info['result'] === 'new') {
开发者ID:bu-ist,项目名称:yet-another-related-posts-plugin,代码行数:31,代码来源:yarpp_options.php
示例20: display
function display()
{
global $yarpp;
?>
<table class="form-table" style="margin-top: 0; clear:none;"><tbody>
<?php
$this->checkbox('rss_display', __("Display related posts in feeds?", 'yarpp') . " <a href='#' class='info'>" . __('more>', 'yarpp') . "<span>" . __("This option displays related posts at the end of each item in your RSS and Atom feeds. No template changes are needed.", 'yarpp') . "</span></a>", "<tr valign='top'><th colspan='2' style='width:100%'>", ' class="rss_display"', '<td class="rss_displayed" rowspan="4" style="border-left:8px transparent solid;"><b>' . __("RSS display code example", 'yarpp') . '</b><br /><small>' . __("(Update options to reload.)", 'yarpp') . '</small><br/>' . "<div id='display_demo_rss' style='overflow:auto;width:350px;max-height:500px;'></div></td>");
$this->checkbox('rss_excerpt_display', __("Display related posts in the descriptions?", 'yarpp') . " <a href='#' class='info'>" . __('more>', 'yarpp') . "<span>" . __("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') . "</span></a>", "<tr class='rss_displayed' valign='top'>\n\t\t\t<th class='th-full' colspan='2' scope='row'>");
$this->textbox('rss_limit', __('Maximum number of related posts:', 'yarpp'), 2, "<tr valign='top' class='rss_displayed'>\n\t\t\t\t<th scope='row'>");
$this->checkbox('rss_use_template', __("Display using a custom template file", 'yarpp') . " <!--<span style='color:red;'>" . __('NEW!', 'yarpp') . "</span>--> <a href='#' class='info'>" . __('more>', 'yarpp') . "<span>" . __("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') . "</span></a>", "<tr valign='top' class='rss_displayed'><th colspan='2'>", ' class="rss_template"' . (!(is_array($yarpp->templates) && count($yarpp->templates)) ? ' disabled="disabled"' : ''));
?>
</tbody></table>
<table class="form-table rss_displayed" style="clear:none;">
<tbody>
<tr valign='top' class='rss_templated'>
<th><?php
_e("Template file:", 'yarpp');
?>
</th>
<td>
<select name="rss_template_file" id="rss_template_file">
<?php
foreach (glob(STYLESHEETPATH . '/yarpp-template-*.php') as $template) {
?>
<option value='<?php
echo htmlspecialchars(basename($template));
?>
'<?php
echo basename($template) == yarpp_get_option('rss_template_file') ? " selected='selected'" : '';
?>
><?php
echo htmlspecialchars(basename($template));
?>
</option>
<?php
}
?>
</select>
</td>
</tr>
<?php
$this->beforeafter(array('rss_before_related', 'rss_after_related'), __("Before / after related entries:", 'yarpp'), 15, "<tr class='rss_not_templated' valign='top'>\r\t\t\t\t<th>", __("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, "<tr class='rss_not_templated' valign='top'>\r\t\t\t\t<th>", __("For example:", 'yarpp') . ' <li></li>' . __(' or ', 'yarpp') . '<dl></dl>');
$this->checkbox('rss_show_excerpt', __("Show excerpt?", 'yarpp'), "<tr class='rss_not_templated' valign='top'><th colspan='2'>", ' class="rss_show_excerpt"');
$this->textbox('rss_excerpt_length', __('Excerpt length (No. of words):', 'yarpp'), 10, "<tr class='rss_excerpted' valign='top'>\r\t\t\t\t<th>");
$this->beforeafter(array('rss_before_post', 'rss_after_post'), __("Before / after (excerpt):", 'yarpp'), 10, "<tr class='rss_excerpted' valign='top'>\r\t\t\t\t<th>", __("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', "<tr valign='top' class='rss_not_templated'>\n\t\t\t<th scope='row'>");
?>
<?php
$this->checkbox('rss_promote_yarpp', __("Help promote Yet Another Related Posts Plugin?", 'yarpp') . " <a href='#' class='info'>" . __('more>', 'yarpp') . "<span>" . 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'), "<code>" . htmlspecialchars(sprintf(__("Related posts brought to you by <a href='%s'>Yet Another Related Posts Plugin</a>.", 'yarpp'), 'http://yarpp.org')) . "</code>") . "</span></a>", "<tr valign='top' class='rss_displayed'>\n\t\t\t<th class='th-full' colspan='2' scope='row'>");
?>
</tbody></table>
<?php
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:56,代码来源:options-meta-boxes.php
注:本文中的yarpp_get_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论