Cab Glazing Services Latest News
For our latest news, please open up our news tree.
$readmore = 1;
$news_count = 0;
$rst = mysql_query("SELECT DISTINCT FROM_UNIXTIME(n.created, '%Y') as the_year FROM node n, term_node tn, term_data td WHERE n.type='info_page' AND n.nid = tn.nid and tn.tid = td.tid and td.name = 'News' and td.vid = '8' ORDER BY n.created DESC");
while($row=mysql_fetch_array($rst))
{
echo " ". $row['the_year'] ."
"; if($row['the_year']==date("Y")) { echo "
"; if($row['the_year']==date("Y")) { echo "
";
}
else
{
echo "
\n";
?>
";
}
$rst_month = mysql_query("SELECT DISTINCT FROM_UNIXTIME(n.created, '%M') as the_month FROM node n, term_node tn, term_data td WHERE FROM_UNIXTIME(n.created, '%Y')='".$row['the_year']."' AND n.nid = tn.nid and tn.tid = td.tid and td.name = 'News' and td.vid = '8' ORDER BY n.created DESC");
while($row_month = mysql_fetch_array($rst_month))
{
echo " ". $row_month['the_month'] ."
"; if($row_month['the_month']==date("M") && $row_year['the_year']==date("Y")) { echo "
\n";
echo ""; if($row_month['the_month']==date("M") && $row_year['the_year']==date("Y")) { echo "
";
}
else
{
echo "
\n";
}
echo "";
}
$rst_day = mysql_query("SELECT DISTINCT FROM_UNIXTIME(n.created, '%D') as the_day FROM node n, term_node tn, term_data td WHERE FROM_UNIXTIME(n.created, '%Y')='".$row['the_year']."' AND n.nid = tn.nid and tn.tid = td.tid and td.name = 'News' and td.vid = '8' AND FROM_UNIXTIME(n.created, '%M')='".$row_month['the_month']."' ORDER BY n.created DESC");
while($row_day = mysql_fetch_array($rst_day))
{
$rst_news = mysql_query("SELECT * FROM node n, term_node tn, term_data td WHERE FROM_UNIXTIME(n.created, '%D')='".$row_day['the_day']."' AND FROM_UNIXTIME(n.created, '%M')='".$row_month['the_month']."' AND n.nid = tn.nid and tn.tid = td.tid and td.name = 'News' and td.vid = '8' AND FROM_UNIXTIME(n.created, '%Y')='".$row['the_year']."'");
while($row_news=mysql_fetch_array($rst_news))
{
$news_title = str_replace("'", "'", $row_news['title']);
$news_id = $row_news['nid'];
$news_count ++;
echo " ". $row_day['the_day'] ." - ". $news_title ."
"; echo "
\n";
}
echo ""; echo "
";
echo "
\n";
}
}
echo ""; echo "Close [X]"; echo "
"; $news_node = node_load($news_id); if($news_node->field_headline[0]['value']) { echo "". $news_node->field_headline[0]['value'] ."
";
}
if($news_node->field_body[0]['value'])
{
$para = substr($news_node->field_body[0]['value'],0, 300);
$cut = strrpos($para," ");
$para = substr($para,0,$cut);
echo "". $para ."...
";
}
if($readmore==1)
{
echo "";
}
echo ""; echo "Close [X]"; echo "
"; echo "