File: /var/www/html/wp-content/themes/frameMyrskyNew/myrsky_home.txt
<?php
/**
 * @package WordPress
 * @subpackage frameMyrsky_Theme
 */
/*
Template Name: Myrsky Home 
*/
?>
<?php get_header() ?>
<?php 
/* if (have_posts()) : while (have_posts()) : the_post(); 
	$erp_page_path = get_the_content(); 
	wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
endwhile; endif; 
echo "http://".$_SERVER['SERVER_NAME'].'/'.$erp_page_path; 
*/			
?> 
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/js/jquery-1.4.2.min.js" ></script>  
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/js/jquery.cookie.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/js/led.js"></script>
<div id="ifocus">
	<div id="ifocus_pic">
		<div id="ifocus_piclist" style="left:0; top:0;">
			<ul>
				<?php 
				//首页图片以post_excerpt升序显示,注意该字段是字符串类型 
				global $wpdb;
				$attachments = $wpdb->get_results($wpdb->prepare("SELECT DISTINCT `ID`,`post_title`,`guid`,`post_content` FROM $wpdb->posts WHERE post_type = 'attachment' and post_parent='$post->ID' order by (post_excerpt+0) asc limit 4"));
				//ECHO "SELECT DISTINCT `ID`,`post_title`,`guid`,`post_content` FROM $wpdb->posts WHERE post_type = 'attachment' and post_parent='$post->ID' order by (post_excerpt+0) asc limit 4";
				if(empty($attachments)){
					$args = array(   
						'post_type' => 'attachment',   
						'numberposts' => 4,   
						'post_status' => null,   
						'post_parent' => $post->ID,
						'orderby' => 'post_date',
						'order' => 'DESC'
					);   
					$attachments = get_posts($args); 
				}					
				//var_dump($attachments);		die("调试代码中,请稍后刷新再试-lxq.");	
				foreach($attachments as $focusKey => $attachment){
					$post_title = $attachment->post_title;
					$post_content = $attachment->post_content;
					$post_src = $attachment->guid;
					
				//}
				$ifocusClass    = 0==$focusKey ? 'current':'normal';			
				?>		 
				<li><a href="#" target="_blank"><img src="<?php echo $post_src;?>"/></a></li>
				<?php
				}
				?>
			</ul>
		</div>
		<!-- 图片下方阴影--> 
		<div id="ifocus_opdiv"></div>
		 <div id="ifocus_tx">
			<ul>		
			<?php 
			foreach($attachments as $focusKey => $attachment){
					$post_title = $attachment->post_title;
					$post_content = $attachment->post_content;
					$post_src = $attachment->guid;
					
				//}
				$ifocusClass    = 0==$focusKey ? 'current':'normal';
			?>	
			 <li class="<?php echo $ifocusClass;?>">
			<!--  <h2><?php echo $post_title;?></h2>-->
			  <p class="text_display_home"><?php echo $post_content;?></p>
			</li> 
			<?php } ?>
			</ul>
		</div>   
	</div>
	<div id="ifocus_btn">
		<ul>
			<?php 		
				foreach($attachments as $focusKey => $attachment){					
					$post_title = $attachment->post_title;
					$post_content = $attachment->post_content;
					$post_src = $attachment->guid;
					
				//}
				$ifocusClass    = 0==$focusKey ? 'current':'normal';
			?>
			<li class="<?php echo $ifocusClass;?>"><img src="<?php echo $post_src?>" alt="<?php echo $post_title;?>" /></li>
			<?php }?>
		</ul>
	</div>
</div>  
<div class="left_sidebar">
	<div class="left_top"></div>
	<div class="left_mid" style=""><?php get_sidebar(); ?>		
	</div>
</div>
<div class="right_content" >
	<div class="lm-title gsjj_lm"> </div>
	<div id="gsjj_content">
		<div id="gsjj_content_left"><a href="<?php echo $r_href; ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/gsjj_pic2.jpg" width="240" height="132" /></a></div>
		<div id="gsjj_content_right" class="font12_gray2">
			<p>    迈瑞凯电子(深圳)有限公司基于电子商务(E-business)平台,提供完善、一体的电子产品样品和中小批量加工服务。快速提供各类电路板(PCB)、电路板焊接(PCBA)、连接电缆(Cable)以及壳体原型。本公司拥有5-6千种常规元件库存。可代客户从中国境外直接订购元器件。</p> 
			<p>    公司严格按照ISO质量管理体系运作,产品符...        <a href="<?php bloginfo("url");?>/公司简介/"  class="font12_gray">>>更多</a> </p>  
		</div>
	</div>
	<div style="clear:both;"></div>
	
	<div class="lm-title gscp_lm"> </div>
	<div id="product_content">
		<div class="product_content_item">
			<ul>
			<li><span width="24" height="22"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/bit.jpg" width="11" height="10" /></span>
			<span width="216" align="left" class="font14b_blank">	空白线路板(PCB)<?php echo $r_mode_name;  ?></span>
			<span width="60">
			<!--<a href="<?php echo $r_href;?>"  class="font12_gray">>>更多</a>-->
			</span></li>
			<li  class="p_top"></li>
			<li  class="p_content font12_gray2"><p>
			 生产能力 生产种类高TG,高频板,厚铜板,挠性板,刚挠结合板,盲/埋孔板等 多层能力硬板1-20层, 软板1-4层, 刚挠结合板4-6层,1-2层铝基板 最小线宽/线距 3mils/4mils 板厚 0.2MM-6MM 阻抗控制 ±10% 其他化学沉金、锡、银,全板镀金及局部镀金,无铅喷锡,防氧化 交货期 普通双面板 3天交货 四...    
			        <a href="<?php bloginfo("url");?>/加工业务/空白线路板(pcb)/"  class="font12_gray">>>更多</a>
			</p>
			</li>
			<li class="p_bottom"></li>
			</ul>
		</div>
		<div class="product_content_item">
			<ul>
			<li><span width="24" height="22"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/bit.jpg" width="11" height="10" /></span>
			<span width="216" align="left" class="font14b_blank">		焊接板(PCBA)<?php echo $r_mode_name;  ?></span>
			<span width="60">
			<!--<a href="<?php echo $r_href;?>"  class="font12_gray">>>更多</a>-->
			</span></li>
			<li  class="p_top"></li>
			<li  class="p_content font12_gray2"><p>
			             生产能力 设备介绍全自动印刷机,JUKI高速贴片机,十温区回流焊炉,AOI视觉检测机,双波峰焊锡炉,PTH组装线等专业生产设备 贴装能力可双面贴装小至0201的元件和BGA等高端产品 SMT 贴片加工范围 0201~0.3mm间距,QFP、CSP、QFN、BGA等元件 其他 X-RAY 检测、钢网制作、芯片烧录;治具及测试架设计、制作 ... 
			       <a href="<?php bloginfo("url");?>/加工业务/焊接板(pcba)/"  class="font12_gray">>>更多</a></p>
			</li>
			<li class="p_bottom"></li>
			</ul>
		</div>		
	
	</div>
	<div style="clear:both;"></div>
	<div class="lm-title cptp_lm"> </div>
	<!--产品图片展示-->
	<!--下面是向右滚动代码-->
	<div id="product_display">
	<?php 
	$args = array(		
		'post_title' => '产品展示',
		'post_type' => 'page'		
	);
	$pages = get_posts($args);
	//显示的图片地址路径
	$pic_paths = array("/加工业务/焊接板(pcba)/产品展示","/加工业务/空白线路板(pcb)/产品展示");
	foreach($pic_paths as $path){
		$pages = get_page_by_path($path);
		$page_id_arr[] = $pages->ID;
	}
	//找出需要显示的图片
	$attachments_arr = array();
	foreach($page_id_arr as $page_id){
		$args = array(   
	   'post_type' => 'attachment',   
	   'numberposts' => -1,   
	   'post_status' => null,   
	   'post_parent' => $page_id   
	   );   
	   
		$attachments_arr = array_merge($attachments_arr,get_posts($args));  
	}
	//var_dump($pages);
	//echo $pages->ID;
	?>
		<table cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td id="colee_right1" valign="top" align="center">
					<table cellpadding="2" cellspacing="0" border="0">
					<tr align="center">
						<?php 
							foreach($attachments_arr as $attach){
							echo "<td><p><a target='_blank' href=\"".$attach->guid."\"><img alt=\"".$attach->post_title."\" style=\"width:129px;height:118px;\" src=\"". $attach->guid."\" /></a></p>
							<p><a target='_blank' href=\"".$attach->guid."\">".$attach->post_title."</a></p></td>";
							}
						?>
						<!--<td><p><img style="width:129px;height:118px;" src="<?php bloginfo('stylesheet_directory'); ?>/images/product.jpg"></p></td>
						<td><p><img style="width:129px;height:118px;" src="<?php bloginfo('stylesheet_directory'); ?>/images/product_list-1.jpg"></p></td>
						<td><p><img style="width:129px;height:118px;" src="<?php bloginfo('stylesheet_directory'); ?>/images/product_list-2.jpg"></p></td>
						<td><p><img style="width:129px;height:118px;" src="<?php bloginfo('stylesheet_directory'); ?>/images/product_list-3.jpg"></p></td>
						<td><p><img style="width:129px;height:118px;" src="<?php bloginfo('stylesheet_directory'); ?>/images/product_list-4.jpg"></p></td>-->
					</tr>
					</table>
				</td>
				<td id="colee_right2" valign="top"></td>
			</tr>
		</table>
	</div>
	<script>
		var speed=30//速度数值越大速度越慢
		var colee_right2=document.getElementById("colee_right2");
		var colee_right1=document.getElementById("colee_right1");
		var colee_right=document.getElementById("product_display");
		colee_right2.innerHTML=colee_right1.innerHTML
		function Marquee4(){
			if(colee_right.scrollLeft<=0)
				colee_right.scrollLeft+=colee_right2.offsetWidth
			else{
				colee_right.scrollLeft--
			}
		}
		var MyMar4=setInterval(Marquee4,speed)
		colee_right.onmouseover=function() {clearInterval(MyMar4)}
		colee_right.onmouseout=function() {MyMar4=setInterval(Marquee4,speed)}
	</script>
	<!--向右滚动代码结束-->
</div>
<?php get_footer() ?>