$NT_A[subject]($NT_A[startdate])"; }else{ $notice=''; } $forumdb=$catedb=array(); unset($tposts); if($db_forumdir){ require_once(R_P.'require/dirname.php'); }elseif(is_numeric($cateid)){ $cateinfo=$db->get_one("SELECT style FROM pw_forums WHERE fid='$cateid'"); if(!empty($cateinfo['style']) && file_exists(D_P."data/style/$cateinfo[style].php")){ $skin=$cateinfo['style']; } $threadcate=" AND (f.fid='$cateid' OR f.fup='$cateid')"; } else{ $threadcate=""; } require_once(R_P.'require/header.php'); $c_htm=0; $cmsadd=$db_showcms ? '' : "AND f.cms!='1'"; $topics=$article=$tposts=0; $query = $db->query("SELECT f.fid,f.fup,f.type,f.logo,f.name, f.descrip,f.forumadmin,f.across,f.allowhtm,f.password,f.allowvisit,f.f_type,f.cms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.top1,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.ifsub='0' $cmsadd $threadcate ORDER BY f.vieworder"); while($forums = $db->fetch_array($query)){ if($forums['type']==='category'){ if(strpos($_COOKIE['deploy'],"\t".$forums['fid']."\t")===false){ $forums['deploy_img']='fold'; }else{ $forums['deploy_img']='open'; $forums['tbody_style']='display:none;'; } if($forums['forumadmin']){ $forumadmin=explode(",",$forums['forumadmin']); foreach($forumadmin as $key => $value){ if($value){ if ($key==10) {$forums['admin'].='...'; break;} $forums['admin'].="$value "; } } } $forums['name']=preg_replace("/\<(.+?)\>/is","",$forums['name']); $catedb[]=$forums; } elseif($forums['type']==='forum'){ $forums['topics']=$forums['topic']+$forums['subtopic']; if($db_topped){ $forums['topics']+=$forums['top1']; $forums['article']+=$forums['top1']; } $article+=$forums['article']; $topics+=$forums['topics']; $tposts+=$forums['tpost']; if(empty($forums['password']) && (empty($forums['allowvisit']) || strpos($forums['allowvisit'],','.$groupid.',')!==false)){ list($f_a,$forums['au'],$f_c,$forums['ft'])=explode("\t",$forums['lastpost']); $forums['pic'] = $winddb['lastvisit']<$f_c && ($f_c+172800>$timestamp) ? 'new' : 'old'; $forums['newtitle']=get_date($f_c); $forums['t']=substrs($f_a,21); } else{ if($forums['f_type']==='hidden' && $groupid != 3){ continue; } $forums['pic']="lock"; } $forums['allowhtm']==1 && $c_htm=1; if($db_indexfmlogo==2){ $forums['llogo']=$forums['logo']!='' ? "":''; } elseif($db_indexfmlogo==1){ $forumlogofile="$stylepath/forumlogo/$forums[fid].gif"; file_exists("$imgdir/$forumlogofile") && $forums['llogo']=""; } $adminarray=explode("\t",$forums['forumadmin']); if($adminarray[0]){ $forumadmin=explode(",",$adminarray[0]); foreach($forumadmin as $key => $value){ if($value){ if(!$db_adminshow){ $forums['admin'].="$value "; } else{ $forums['admin'].=""; } } } } $forumdb[$forums['fup']][]=$forums; } } $db->free_result($query); unset($forums); /** * Share union */ if($db_indexmqshare){ $sharelink="$sharelink"; } if(strpos($_COOKIE['deploy'],"\t".info."\t")===false){ $cate_img='fold'; }else{ $cate_img='open'; $cate_info='display:none;'; } if(strpos($_COOKIE['deploy'],"\t".notice."\t")===false){ $notice_img='fold'; }else{ $notice_img='open'; $cate_notice='display:none;'; } /** * oline users */ Update_ol(); @include_once(D_P.'data/bbscache/olcache.php'); $usertotal=$guestinbbs+$userinbbs; if($windid==$manager || $usertotal<2000){ $online1 = GetCookie('online1'); if($online){ $online1=$online; Cookie('online1',$online); } if($db_indexonline && $online1!='no'){ $doonlinefu=1; } elseif($online1=='yes'){ $doonlinefu=1; } } $showgroup = explode(",",$db_showgroup); @extract($db->get_one("SELECT * FROM pw_bbsinfo WHERE id=1")); $rawnewuser=rawurlencode($newmember); if($tdtcontrol!=$tdtime){ if($db_hostweb == 1 && !$cateid && $groupid != 'guest'){ $db->update("UPDATE pw_bbsinfo SET yposts='$tposts', tdtcontrol='$tdtime' WHERE id=1"); $db->update("UPDATE pw_forumdata SET tpost=0 WHERE tpost<>'0'"); } if(file_exists(D_P.'data/bbscache/ip_cache.php')){ P_unlink(D_P.'data/bbscache/ip_cache.php'); } } /** * sendtop10 **/ $year = date ("Y"); $month = date ("m"); $day = date ("d"); $today = mktime(0,0,0,$month,$day,$year)-30*86400; $query = $db->query("SELECT count(*) as tot,lastposter FROM pw_threads where lastpost>".$today." group by lastposter order by tot desc limit 0,10"); $sendtopten = array(); $i=0; while($sch = $db->fetch_array($query)){ $sendtopten[$i]["tot"]=$sch["tot"]; $sendtopten[$i]["lastposter"]=$sch["lastposter"]; $i++; } $minute = date("m"); include("mysql.php"); $db1 = new DB_Sql(); include "config/index.book.cfg.php"; if($RandomShowType==false){ for($mm=1;$mm<=5;$mm++){ $showlist[($mm-1)]=${"ShowBOOK".$mm}; } //var_dump($showlist); } else { if($minute%$FlashGap==0 || !file_exists("config/toppic.cfg.php") || (time()-filemtime("config/toppic.cfg.php"))>($FlashGap*60)){ $sql="SELECT bn,bigimgremote FROM `sdb_mall_goods` where bigimgremote<>'' and storage>0 order by uptime limit 0,".$ShowTimeGap; for($i=0;$i<$ShowTimeGap;$i++){ $a[$i]=$i; } $randlist = array_rand ($a, 5); $db1->query($sql); //$db1->next_record(); for($s=0;$sseek($randlist[$s]); //echo $randlist[$s]; $db1->next_record(); $booklist.=$db1->f("bn")."##"; if($s==4){ $bigbn = $db1->f("bn"); $bigpic = "http://www.kidsbook.cn/babybooks/syssite/home/shop/1/pictures/productsimg/big/".$db1->f("bigimgremote"); } } $fp = fopen("config/toppic.cfg.php","w"); //echo $booklist; fwrite($fp,$booklist); fclose($fp); } $fp = fopen("config/toppic.cfg.php","r"); $content = fread($fp,filesize("config/toppic.cfg.php")); fclose($fp); $showlist = explode("##",$content); } $newpic = array(); $i=0; for($s=0;$s<5;$s++){ $sql = "select * from `sdb_mall_goods` where bn='".$showlist[$s]."'"; //echo $sql."
"; $db1->query($sql); $db1->next_record(); //echo $s; if($s==4){ $bigbn = $db1->f("bn"); //echo $bigbn; $bigpic = "http://www.kidsbook.cn/babybooks/syssite/home/shop/1/pictures/productsimg/big/".$db1->f("bigimgremote"); } else { $newpic[$i]["subject"]="http://www.kidsbook.cn/babybooks/syssite/home/shop/1/pictures/productsimg/small/".$db1->f("bigimgremote"); $newpic[$i]["tid"]=$db1->f("bn"); } $i++; } //echo "_________".count($newpic); //exit; mysql_connect('localhost', 'baobooks_f','tongshi'); mysql_select_db("baobooks"); $today = mktime(0,0,0,$month,$day,$year); function substrext($str,$max){ return strlen($str)>$max?substr($str,0,$max)."...":$str; } /** * ͼƬ **/ $sq = getseqence(); $f = file("everydaybook/".$today); for($s=0;$s<10;$s++){ $tmp = explode("######",$f[$sq]); if(strstr($tmp[2],".jpg")){ $picpath = $tmp[2]; $picid = $tmp[1]; break; } else { $sq++; if($sq==10){ $sq=0; } } } /** * update posts hits */ if($c_htm || $db_hithour){ $db_hithour==0 && $db_hithour=4; $hit_wtime=$hit_control*$db_hithour; if($hit_wtime>24)$hit_wtime=0; $hitsize=@filesize(D_P."data/bbscache/hits.txt"); if(($timestamp-$hit_tdtime)>$hit_wtime*3600 || $hitsize>1024){ require_once(R_P.'require/hitupdate.php'); } } if($higholnum<$usertotal){ $db->update("UPDATE pw_bbsinfo SET higholnum='$usertotal',higholtime='$timestamp' WHERE id=1"); $higholnum=$usertotal; } if($hposts<$tposts){ $db->update("UPDATE pw_bbsinfo SET hposts='$tposts' WHERE id=1"); $hposts=$tposts; } $mostinbbstime=get_date($higholtime); if($db_onlinelmt!=0 && $usertotal>=$db_onlinelmt && !$ol_offset){ Cookie('ol_offset','',0); Showmsg('most_online'); } list($db_moneyname,$db_moneyunit,$db_rvrcname,$db_rvrcunit,$db_creditname,$db_creditunit)=explode("\t",$db_credits); function getseqence(){ $year = date ("Y"); $month = date ("m"); $day = date ("d"); $today = mktime(0,0,0,$month,$day,$year); $passed = time()-$today; $tmpcur = floor($passed/1800); while($tmpcur>10){ $tmpcur = $tmpcur%10; } return $tmpcur; } require_once PrintEot('index');footer(); ?>