<?php include 'header.php';?>
<card title="最新更新 - <?php echo setting('webname');?>">
<p align="left">
<a href="<?php echo url('over');?>">全本</a>|<a href="<?php echo url('type');?>">书库</a>|<a href="<?php echo url('member/index');?>">书架</a>|<a href="<?php echo url('lianzai');?>">连载</a>
<br/>
<?php mymy_ad("WhrhPzRpJbfVQqyhjyCpgQpq")?>
<br/>
<?php if (empty($new)):?>
    暂无数据<br/>
<?php else:?>
    <?php foreach ($new as $value):?>
        [<a href="<?php echo url('booktype', array('tid'=>$value['typeid']));?>"><?php echo $value['typename'];?></a>]<a href="<?php echo url('bookshow', array('tid'=>$value['typeid'], 'bid'=>$value['bookid']));?>">《<?php echo $value['bookname'];?>》</a><br/>
        最新章节:<a href="<?php echo url('read', array('tid'=>$value['typeid'], 'bid'=>$value['bookid'], 'cid'=>$value['chapterid']));?>"><?php echo $value['chaptername'];?></a><br/>
        更新时间:<?php echo substr($value['createdate'], 0, 10);?><br/>------------------<br/>
    <?php endforeach;?>
<?php endif;?>
*<?php orange_ad();?><br/>
<?php echo $pageinfo;?>
<br/>
<?php echo $go;?>
<br/>*<?php orange_ad();?><br/>
【搜索小说】
<br/>
<input name='key' title='搜索内容' type='text' size='6'/>搜<anchor>书名<go href='<?php echo url('search');?>' accept-charset='utf-8' method='post'><postfield name='class' value='1'/><postfield name='key' value='$(key)'/></go></anchor>|<anchor>作者<go href='<?php echo url('search');?>' accept-charset='utf-8' method='post'><postfield name='class' value='2'/><postfield name='key' value='$(key)'/></go></anchor>
<br/>
*<?php orange_ad();?>
<br/>
<?php include_once 'footer.php';?>
<?php
function mymy_ad($siteid) {
  	$myad_mode = 'live'; 
  	$myad_ua = urlencode(getenv("HTTP_USER_AGENT"));
 		$myad_ip = urlencode($_SERVER['REMOTE_ADDR']);

    $myad_m = '';
    if ($myad_mode=='test')
      	$myad_m = '&m=test';
    $myad_a = 0;	//OPTIONAL - user_age: 0-100
    $myad_g = '';	//OPTIONAL - user_gender:M or F
    $myad_e = '';	//OPTIONAL - user_education
      	
		$myad_url = 'http://www.mymyad.cn/SiteAd.php?sid='.$siteid.'&i='.$myad_ip.'&u='.$myad_ua.$myad_m.'&a='.$myad_a.'&g='.$myad_g.'&e='.$myad_e;

  	$myad_contents = '';
  	$alt_ad_text = '<a href="http://www.mymyad.com">WAP Advertising Marketplace</a>'; 	
  		
  	if (function_exists('curl_init')) {
	 
	    $ch = curl_init();
	    $timeout = 5; 	
	    curl_setopt($ch, CURLOPT_URL, $myad_url);
	  	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	  	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	 		$myad_contents = curl_exec($ch);
	  	curl_close($ch);
	  	
	  	if (isset($myad_contents) && (trim($myad_contents) !='')) {
		    	echo $myad_contents;
		  }else{
		    	echo $alt_ad_text;
		  }

  	} else if (ini_get('allow_url_fopen') == 1) {
	
		$timeout = 5;  
		$old = ini_set('default_socket_timeout', $timeout);
		$myad_ad_server = @fopen($myad_url, 'r');
		ini_set('default_socket_timeout', $old);

		if ($myad_ad_server == false) {
		    echo $alt_ad_text;
		} else {
		    stream_set_timeout($myad_ad_server, $timeout);
		    stream_set_blocking($myad_ad_server, 0);
		    while (!feof($myad_ad_server)) {
		    	$myad_contents .= fread($myad_ad_server, 1024);
		    }
		    fclose($myad_ad_server);
	
		    if (isset($myad_contents) && (trim($myad_contents) !='')) {
		    	echo $myad_contents;
		  	}else{
		    	echo $alt_ad_text;
		  	}
		}
  	} else {
			echo $alt_ad_text;
  	}
}
?>