Exemplo n.º 1
0
    	$title = $post->post_title;
    	$link = get_permalink($post->ID);
    	$shortContentText = $post->post_content;
    	$shortContentText = strip_tags($shortContentText);
    	$shortContentText = substr($shortContentText ,0, 800);
    	$lastSpaceOnEarth = strpos($shortContentText, '.', 10);
    	$shortContentText = substr($shortContentText ,0, $lastSpaceOnEarth+1);
    	$shortContentText = str_replace(".", ".<br/>", $shortContentText);
    	echo  '<div class="boxesSecondLine"><a href="'.$link.'">'.$title.'</a><br/>'.$shortContentText.'</div>';
    
    	endwhile;
    
    	echo '<div class="boxes" style="padding-top:15px;text-align:right;float:right;"> <p class="segnala2"><a href="http://dito.areato.org/home/?cat=138" class="segnala">Tutto il Diario</a></p></div>';*/
} elseif (is_category() && !is_category('43') && !is_category('137') && !is_category('138') && !is_category('141') && !is_category('47') && !is_category('50') && !is_category('142') && !is_category('44') && !is_category('54') && !is_category('55') && !is_category('56') && !is_category('57') && !is_category('45') && !is_category('58') && !is_category('59') && !is_category('60') && !is_category('61') || is_single() && !in_category('42') && !in_category('43') && !in_category('34') && !in_category('35') && !in_category('54') && !in_category('9') && !in_category('49') && !in_category('44') && !in_category('48') && !in_category('47') && !in_category('50') && !in_category('55') && !in_category('56') && !in_category('57') && !in_category('58') && !in_category('59') && !in_category('60') && !in_category('61') && !in_category('12') && !in_category('62') && !in_category('51') && !in_category('137') && !in_category('141') && !in_category('138') && !in_category('51') && !in_category('53') && !in_category('podcast') && !in_category('45') && !in_category('142') && !in_category('63') || is_page_template('map.php') && !is_page_template('videos.php') && !is_page(357)) {
    $c = wp_get_object_terms(get_queried_object_id(), 'category');
    displayLinks(is_single() ? $c[0]->term_id : get_queried_object_id());
    if (!is_page_template('map.php')) {
        if ($forumControl == 'not') {
            echo '<h2 class="blue">Trova servizio</h2>';
        } else {
            echo '<h2 class="blue secondLine">Trova servizio</h2>';
        }
        if ($forumControl == 'not') {
            ?>
<div class="boxes">
<?php 
        } else {
            ?>
<div class="boxesSecondLine">
<?php 
        }
Exemplo n.º 2
0
            case "www.theguardian.com":
                getGuardianArticle($address);
                displayForm($address);
                break;
            default:
                defaultMsg();
                break;
        }
    }
    displayForm($address);
    displayLinks();
} else {
    $address = '';
    echo '<html>';
    displayForm($address);
    displayLinks();
    echo '</html>';
}
function connect2db()
{
    $db_host = "localhost";
    $db_user = "******";
    $db_pass = "";
    $db_name = "db_tom";
    $table_name = "articles";
    try {
        $db_connection = new PDO("mysql:host={$db_host};dbname={$db_name};charset=utf8", $db_user, $db_pass);
    } catch (Exception $errMsg) {
        print "Error: " . $errMsg->getMessage() . "<br/>";
        die;
    }