2013-05-30 31 views

回答

0

好不容易纔得到這個工作有意見PHP領域:

<?php 
global $base_path; 

if (arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2)) { 
    $node = node_load(arg(1)); 
    $a1 = format_date($node->created, 'custom', 'm/d/Y'); 
    $a2 = date("m/d/Y",strtotime("-2 months",strtotime($a1))); 
    $a3 = format_date($row->created, 'custom', 'm/d/Y'); 

    $b1 = new DateTime($a1); 
    $b2 = new DateTime($a2); 
    $b3 = new DateTime($a3); 

    if ($b3 >= $b2 && $b3 <= $b1) { 
    print '<h2><a href="'. $base_path . 'node/' . $row->nid . '">' . $row->title . '</a></h2>' . $data->field_body[0]['rendered']['#markup']; 
    //dsm($data); 
    } 
} 
?>