Exemplo n.º 1
0
function bir_show_search_rss_buttons_iah($id, $custom_field_name, $button_type = "")
{
    // refatorar para incluir idioma
    // refatorar para incluir rss
    if (bir_has_no_empty_custom_field($id, array($custom_field_name))) {
        $href = bir_extract_url_iah_search_expression($id, $custom_field_name);
        if (strlen(urlencode($href)) < 7500 and $href) {
            //strlen check because of 8k limit for GET method
            $url = "?redirect=" . $id . "&what=";
            echo bir_search_rss_html($url . "html", $url . "rss", $button_type);
        } else {
            echo "n/d";
        }
    } else {
        echo "n/d";
    }
    return $html_button;
}
<?php

/**
 * The Template for displaying all single posts.
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
//Start when it is necessary to redirect a RSS url from iah searcah strategy
if (isset($_GET["redirect"]) && ($_GET["what"] == 'html' || $_GET["what"] == 'rss') && strpos($_SERVER["SERVER_NAME"], "bvsalud.org") >= 0) {
    if (bir_has_no_empty_custom_field($_GET["redirect"], array("url_to_search_result"))) {
        $href = bir_extract_url_iah_search_expression($_GET["redirect"], "url_to_search_result");
        if ($href) {
            $href = bir_resolve_link_from_url_shortner($href);
            if (strlen(urlencode($href)) < 7500) {
                if (is_page('lista-de-temas')) {
                    $iahx_other_params = "&source=bir-qsl";
                }
                if (is_single()) {
                    if ($_GET["source"] == 'bir-qsl') {
                        $iahx_other_params = "&source=bir-ss-qsl";
                    } else {
                        $iahx_other_params = "&source=bir-ss";
                    }
                }
                if ($_GET["what"] == 'rss') {
                    $iahx_other_params .= "&output=rss";
                }
                header('Location: ' . $href . $iahx_other_params);
            }