news->default;$disable="disabled=\"true;\"";}if(is_file($System['datadir']."/news/".$_REQUEST['file'].".dat")){ $News=file($System['datadir']."/news/".$_REQUEST['file'].".dat");}else{ $News=array();}if($_REQUEST['action']=="regist"){ $date=jst_time(time(),5);!$_REQUEST['date']&&$_REQUEST['date']=$date;!$_REQUEST['viewdate']&&$_REQUEST['viewdate']=$date;list($y,$m,$d)=preg_split("/[\/\s:]/",$_REQUEST['date']);$_REQUEST['date']=sprintf("%04d/%02d/%02d",$y,$m,$d);list($y,$m,$d,$j,$f)=preg_split("/[\/\s:]/",$_REQUEST['viewdate']);$_REQUEST['viewdate']=sprintf("%04d/%02d/%02d %02d:%02d",$y,$m,$d,$j,$f);list($y,$m,$d,$j,$f)=preg_split("/[\/\s:]/",$_REQUEST['closedate']);$_REQUEST['closedate']&&$_REQUEST['closedate']=sprintf("%04d/%02d/%02d %02d:%02d",$y,$m,$d,$j,$f);$_REQUEST['Summary']=preg_replace("/([\s]| )/","",$_REQUEST['Summary']);$Auth="checked";if(count($Approval)){if($_REQUEST['Approval']){is_array($_REQUEST['Approval'])&&$approval=join(",",$_REQUEST['Approval']);foreach($Approval as $line){if(!in_array($line,$_REQUEST['Approval'])){ $Auth="";break;}}}else{ $Auth="";}if($Init['news_edit_auth']&&$_REQUEST['mode']=='edit'){ /* *監理者又は承認者以外が再編集した場合は全てに承認をリセットし、 *最認証が必要にする */ if($_COOKIE['admin']!='root'&&$_COOKIE['admin']!='superadmin'&&!in_array($_COOKIE['admin'],$Approval)){ $Auth='';$approval='';}}}$value=join("\t",array("Date=".$_REQUEST['date'],"ID=".$_REQUEST['ID'],"Auth=$Auth","Approval=$approval","Viewdate=".$_REQUEST['viewdate'],"Closedate=".$_REQUEST['closedate'],"Subject=".$_REQUEST['Subject'],"Titlelink=".$_REQUEST['Titlelink'],"Icon=".$_REQUEST['Icon'],"Summary=".$_REQUEST['Summary'],"Image=".$_REQUEST['Image'],"Imagetitle=".$_REQUEST['Imagetitle'],"Link=".$_REQUEST['Link'],"Link_mb=".$_REQUEST['Link_mb'],"Link_sp=".$_REQUEST['Link_sp'],"Target=".$_REQUEST['Target'],"Body=".$_REQUEST['Body'],"Uid=".$_COOKIE['admin'],"lastedit=".time(),"\n"));if(count(array_values(preg_grep("/\tID=".$_REQUEST['ID']."\t/",$News)))){ $i=0;foreach($News as $line){if(preg_match("/\tID=".$_REQUEST['ID']."\t/",$line)){array_splice($News,$i,1,$value);break;}$i++;}}else{array_unshift($News,$value);}data_save($System[datadir]."/news/".$_REQUEST['file'].".dat",$News);$_REQUEST['Subject']=strip_tags(tag_decode($_REQUEST['Subject'],true));logregist($Language->news->news->logmsg."(".$_REQUEST['Subject'].")");}elseif($_REQUEST['action']=="delete"){ $i=0;foreach($News as $line){if(preg_match("/\tID=".$_REQUEST['ID']."\t/",$line)){ $news=dbfields($line);array_splice($News,$i,1);break;}$i++;}data_save($System['datadir']."/news/".$_REQUEST['file'].".dat",$News);$_REQUEST['Subject']=strip_tags(tag_decode($_REQUEST['Subject'],true));logregist($Language->news->news->logdelmsg."(".$news['Subject'].")");}elseif($_REQUEST['action']=="alldelete"){if(is_file($System['datadir']."/news/".$_REQUEST['file'].".dat")){unlink($System['datadir']."/news/".$_REQUEST['file'].".dat");logregist($Setup['Name'].$Language->news->news->logalldel);$News=array();}}else if($_REQUEST['action']=="initregist"){if($_REQUEST['Listsummary']==3){ $_REQUEST['nonDesign']="checked";}$value=join("\n",array("[Setup]","Name=".$_REQUEST['Name'],"Creater=".$_REQUEST['Creater'],"groupAuth=".$_REQUEST['groupAuth'],"Template=".$_REQUEST['Template'],"Pageview=".$_REQUEST['Pageview'],"Listview=".$_REQUEST['Listview'],"Pager=".$_REQUEST['Pager'],"Prevbutton=".$_REQUEST['Prevbutton'],"Nextbutton=".$_REQUEST['Nextbutton'],"Listbutton=".$_REQUEST['Listbutton'],"Max=".$_REQUEST['Max'],"Sort=".$_REQUEST['Sort'],"nonDesign=".$_REQUEST['nonDesign'],"Listtitle=".$_REQUEST['Listtitle'],"Listicon=".$_REQUEST['Listicon'],"Icon=".$_REQUEST['Icon'],"Imagewidth=".$_REQUEST['Imagewidth'],"popupimg=".$_REQUEST['popupimg'],"transition=".$_REQUEST['transition'],"speed=".$_REQUEST['speed'],"Dateformat=".$_REQUEST['Dateformat'],"viewdatecalendar=".$_REQUEST['viewdatecalendar'],"Titlelink=".$_REQUEST['Titlelink'],"nonTitle=".$_REQUEST['nonTitle'],"Listsummary=".$_REQUEST['Listsummary'],"more_button=".$_REQUEST['more_button'],"headStr=".$_REQUEST['headStr'],"nonlink=".$_REQUEST['nonlink'],"Lineimg=".$_REQUEST['Lineimg'],"Stress=".$_REQUEST['Stress'],"Stresslimit=".$_REQUEST['Stresslimit'],"comment_user=".$_REQUEST['comment_user'],"form_title=".$_REQUEST['form_title'],"comment_email=".$_REQUEST['comment_email'],"comment_view=".$_REQUEST['comment_view'],"comment_title=".$_REQUEST['comment_title'],"comment_auth=".$_REQUEST['comment_auth'],"email_fld=".$_REQUEST['email_fld'],"email_req=".$_REQUEST['email_req'],"addr_fld=".$_REQUEST['addr_fld'],"addr_req=".$_REQUEST['addr_req'],"tel_fld=".$_REQUEST['tel_fld'],"tel_req=".$_REQUEST['tel_req'],"Mobile_temp=".$_REQUEST['Mobile_temp'],"imgview=".$_REQUEST['imgview'],"sp_temp=".$_REQUEST['sp_temp']));$value=str_replace("\t","",$value);file_put_contents($System['datadir']."/news/".$_REQUEST['file'].".ini",$value);logregist($Language->news->setings->logmsg."(".$_REQUEST['file'].")");}else if($_REQUEST['action']=="groupdelete"){is_file($System['datadir']."/news/".$_REQUEST['file'].".ini")&&unlink($System['datadir']."/news/".$_REQUEST['file'].".ini");is_file($System['datadir']."/news/".$_REQUEST['file'].".dat")&&unlink($System['datadir']."/news/".$_REQUEST['file'].".dat");logregist($Language->news->setings->logdelmsg."(".$_REQUEST['file'].")");}$_REQUEST['action']!="init"&&$group="($Setup[Name])";if($_REQUEST['action']=="init"){ $width="970px";$foldericon='calendar.png';$caption=$Language->news->setings->caption;}elseif(preg_match("/^multi/",$_REQUEST['action'])){ $width="970px";$foldericon='';$caption=$Language->news->multi->caption;}elseif($_REQUEST['action']=="review"){ $width="100%";$foldericon='';$caption=$Language->news->comment->caption." $group";}else{ $width="100%";$foldericon='File.png';$caption=$Language->news->news->caption." $group";}$client=new window;$client->name='client';$client->width=$width;$client->height='';$client->display='block';$client->caption="$caption";$client->drag=true;$client->resize=false;$client->closebutton=true;$client->smallbutton=true;$client->border=false;$client->bgcolor='';$client->foldericon=$foldericon;$client->help=$help->$_REQUEST['cmd'];$client->Lang=$Language;$client->body="
";$html.=$client->show();$script="$Exe[news]news";!$Init['nonExt']&&$script.=".php";$javascript.=" var previewwin;function show_help(){if($('#help').css('display')=='none'){ $('#help').css('display','block');$('#help2').css('display','block');document.getElementById('helpimg').src='images/help_open.png';}else{ $('#help').css('display','none');$('#help2').css('display','none');document.getElementById('helpimg').src='images/help_close.png';}}function preview(id,link){if(link){previewwin=window.open(link,'previewwin');}else{previewwin=window.open('$script/".$_REQUEST['file']."/'+id+'/','previewwin');}previewwin.focus();}function windowGoResize(){var h=$(window).height();document.getElementById('scrool_body').style.height=h-50+'px';}windowGoResize();window.onresize=windowGoResize;";?>