array('string'),'REQUEST_URI'=>array('string'),'REDIRECT_URL'=>array('string','mandatory'=>false)); Validator::validateArray($_SERVER,$basicIV); include_once '../../config.php'; function checkPeriod($period){ if(is_numeric($period)){ $year=0; $month=1; $day=1; switch(strlen($period)){ case 8: $day=substr($period,6,2); case 6: $month=substr($period,4,2); case 4: $year=substr($period,0,4); return checkdate($month,$day,$year); } } return false; } function getTimeFromPeriod($period){ if(is_numeric($period)){ $year=0; $month=1; $day=1; switch(strlen($period)){ case 8: $day=substr($period,6,2); case 6: $month=substr($period,4,2); case 4: $year=substr($period,0,4); if(checkdate($month,$day,$year)) return mktime(0,0,0,$month,$day,$year); } } return false; } function addPeriod($period,$inc=1){ if(checkPeriod($period)!==false){ switch(strlen($period)){ case 4: return strftime('%Y',mktime(0,0,0,1,1,$period+$inc)); case 6: return strftime('%Y%m',mktime(0,0,0,substr($period,4)+$inc,1,substr($period,0,4))); case 8: return strftime('%Y%m%d',mktime(0,0,0,substr($period,4,2),substr($period,6,2)+$inc,substr($period,0,4))); } } return false; } function getPeriodLabel($period){ $name=strval($period); switch(strlen($name)){ case 4: return $name; case 6: return substr($name,0,4).'/'.substr($name,4); case 8: return substr($name,0,4).'/'.substr($name,4,2).'/'.substr($name,6).''; } } function escapeJSInAttribute($str){ return htmlspecialchars(str_replace(array('\\','\r','\n','\''),array('\\\\','\\r','\\n','\\\''),$str)); } function escapeJSInCData($str){ return preg_replace(array('//','/\r*\n|\r/'),array('\x3C','\x3E','\\\\$0'),addslashes($str)); } function addLinkSense($text,$attributes=''){ return ereg_replace("(^| |\t|\r|\n|\"|')(http://[^ \t\r\n\"']+)","\\1\\2",$text); } function addProtocolSense($url,$protocol='http://'){ return ereg('^[[:alnum:]]+:',$url)?$url:$protocol.$url; } function decorateSrcInObejct($html){ $count=preg_match_all('@src="(.+)"@iU',$html,$matches,PREG_PATTERN_ORDER); while($count>0){ $orig=$matches[0][$count-1]; $filename=$matches[1][$count-1]; if(strncasecmp($filename,'http://',7)!=0){ $html=str_replace($orig,substr($orig,0,4).'"http://'.$_SERVER['HTTP_HOST'].$filename.'"',$html); } $count--; } return $html; } function avoidFlashBorder($html,$tag='object'){ $pos1=$pos2=0; $str=strtolower($html); $result=''; while(($pos1=strpos($str,"<$tag",$pos2))!==false){ $result.=substr($html,$pos2,$pos1-$pos2); $pos2=$pos1; while(true){ if(($pos2=strpos($str,"",$pos2))===false) return $result.'_'; $pos2+=strlen($tag)+3; $chunk=substr($str,$pos1,$pos2-$pos1); if(substr_count($chunk,"<$tag")==substr_count($chunk,"")) break; } $result.='_'; } return $result.substr($html,$pos2); } function fetchQueryAll($query,$type=MYSQL_BOTH){ $rows=array(); if($result=mysql_query($query)){ while($row=mysql_fetch_array($result,$type)) array_push($rows,$row); mysql_free_result($result); } return $rows; } function fetchQueryRow($query){ if($result=mysql_query($query)){ if($row=mysql_fetch_array($result)){ mysql_free_result($result); return $row; } mysql_free_result($result); } return ; } function fetchQueryColumn($query){ $column=array(); if($result=mysql_query($query)){ while($row=mysql_fetch_row($result)) array_push($column,$row[0]); mysql_free_result($result); } return $column; } function fetchQueryCell($query){ if($result=mysql_query($query)){ list($cell)=mysql_fetch_row($result); mysql_free_result($result); return $cell; } return ; } function doesExistTable($tablename){ $likeEscape=array('/_/','/%/'); $likeReplace=array('\\_','\\%'); $escapename=preg_replace($likeEscape,$likeReplace,$tablename); $result=mysql_query("SHOW TABLES LIKE '$escapename' "); if($result==false) return false; if(mysql_num_rows($result)>0) return true; return false; } function getFileExtension($path){ for($i=strlen($path)-1;$i>=0;$i--){ if($path{$i}=='.') return strtolower(substr($path,$i+1)); if(($path{$i}=='/')||($path{$i}=='\\')) break; } return ''; } function getAttributesFromString($str){ $attributes=array(); preg_match_all('/([^=\s]+)\s*=\s*"([^"]*)/',$str,$matches); for($i=0;$iopen($xml,$service['encoding']); if($xmls->getValue('/skin/default/contentWidth')){ $contentWidth=$xmls->getValue('/skin/default/contentWidth'); } } return $contentWidth; } function getWaterMarkPosition(){ $waterMarkPosition=getUserSetting("waterMarkPosition","left=10|bottom=10"); list($horizontalPos,$verticalPos)=explode("|",$waterMarkPosition); $horizontalPos=explode("=",$horizontalPos); $verticalPos=explode("=",$verticalPos); if($horizontalPos[0]=="left"){ if($horizontalPos[1]>0){ $horizontalValue=$horizontalPos[1]; }else{ $horizontalValue="left"; } }elseif($horizontalPos[0]=="center"){ $horizontalValue="center"; }elseif($horizontalPos[0]=="right"){ if($horizontalPos[1]>0){ $horizontalValue=$horizontalPos[1]-$horizontalPos[1]*2; }else{ $horizontalValue="right"; } } if($verticalPos[0]=="top"){ if($verticalPos[1]>0){ $verticalValue=$verticalPos[1]; }else{ $verticalValue="top"; } }elseif($verticalPos[0]=="middle"){ $verticalValue="middle"; }elseif($verticalPos[0]=="bottom"){ if($verticalPos[1]>0){ $verticalValue=$verticalPos[1]-$verticalPos[1]*2; }else{ $verticalValue="bottom"; } } return "$horizontalValue $verticalValue"; } function getWaterMarkGamma(){ return 100; } function getThumbnailPadding(){ $thumbnailPadding=getUserSetting("thumbnailPadding",false); if($thumbnailPadding==false){ return array("top"=>0,"right"=>0,"bottom"=>0,"left"=>0); }else{ $tempArray=explode("|",$thumbnailPadding); return array("top"=>intval($tempArray[0]),"right"=>intval($tempArray[1]),"bottom"=>intval($tempArray[2]),"left"=>intval($tempArray[3])); } } function getThumbnailPaddingColor(){ return getUserSetting("thumbnailPaddingColor","FFFFFF"); } function makeThumbnail($imgString,$originSrc,$paddingArray,$waterMarkArray,$useAbsolutePath){ global $database,$owner,$blogURL,$serviceURL,$pathURL; if(is_null(getUserSetting("resamplingDefault"))){ return $imgString; }else{ $waterMarkOn=getUserSetting("waterMarkDefault","no"); } requireComponent('Tattertools.Function.Image'); if(!is_dir("../../cache/thumbnail")){ @mkdir("../../cache/thumbnail"); @chmod("../../cache/thumbnail",0777); } if(!is_dir("../../cache/thumbnail/$owner")){ @mkdir("../../cache/thumbnail/$owner"); @chmod("../../cache/thumbnail/$owner",0777); } $contentWidth=getContentWidth(); if(preg_match('/class="(tt-resampling|tt-watermark)"/i',$imgString,$temp)){ $originFileName=basename($originSrc); switch($temp[1]){ case "tt-resampling": $resampleType="resampled"; break; case "tt-watermark": if($waterMarkOn=='no') $resampleType="resampled"; else $resampleType="watermarked"; break; } if(preg_match('/width="([1-9][0-9]*)"/i',$imgString,$temp)){ $tempWidth=$temp[1]; } if(preg_match('/height="([1-9][0-9]*)"/i',$imgString,$temp)){ $tempHeight=$temp[1]; } $newTempFileName=preg_replace("/\.([[:alnum:]]+)$/i",".w{$tempWidth}-h{$tempHeight}.{$resampleType}.\\1",$originFileName); $tempSrc=ROOT."/cache/thumbnail/$owner/".$newTempFileName; $tempURL=$pathURL."/thumbnail/$owner/".$newTempFileName; if($useAbsolutePath==true){ $tempURL="$serviceURL/cache/thumbnail/$owner/$newTempFileName"; } $checkResult=Image::checkExistingThumbnail($originSrc,$tempSrc,$tempWidth,$tempHeight,$paddingArray,$waterMarkArray); switch($checkResult){ case 1: deleteFilesByRegExp("../../cache/thumbnail/$owner/","^".preg_replace("/\.([[:alnum:]]+)$/i","\.",$originFileName)); case 2: $isSuccessful=true; $AttachedImage=new Image(); $AttachedImage->imageFile=$originSrc; if($AttachedImage->resample($tempWidth,$tempHeight,$paddingArray)){ if($resampleType=="watermarked"&&$waterMarkOn=="yes"){ $waterMarkType=$AttachedImage->getImageType($waterMarkArray['path']); $AttachedImage->impressWaterMark($waterMarkArray['path'],$waterMarkArray['position'],$waterMarkArray['gamma']); } if($AttachedImage->createThumbnailIntoFile($tempSrc)){ $imgString=preg_replace('/src="([^"]+)"/i','src="'.$tempURL.'"',$imgString); $imgString=preg_replace('/width="([^"]+)"/i','width="'.$tempWidth.'"',$imgString); $imgString=preg_replace('/height="([^"]+)"/i','height="'.$tempHeight.'"',$imgString); switch($resampleType){ case "resampled": @unlink(str_replace(".resampled.",".watermarked.",$tempSrc)); break; case "watermarked": if($waterMarkOn=="yes") @unlink(str_replace(".watermarked.",".resampled.",$tempSrc)); break; } $originImageInfo=getimagesize($originSrc); $tempFileName=preg_replace("/\.([[:alnum:]]+)$/i",".w{$originImageInfo[0]}-h{$originImageInfo[1]}.{$resampleType}.\\1",$originFileName); if($resampleType=="watermarked"&&$waterMarkOn=="yes"){ if($AttachedImage->resample($originImageInfo[0],$originImageInfo[1],NULL)){ $AttachedImage->impressWaterMark($waterMarkArray['path'],$waterMarkArray['position'],$waterMarkArray['gamma']); if($AttachedImage->createThumbnailIntoFile("../../cache/thumbnail/$owner/$tempFileName")){ @unlink(ROOT."/cache/thumbnail/$owner/".str_replace(".watermarked.",".resampled.",$tempFileName)); $imgString=preg_replace('/onclick="open_img\(\'([^\']+)\'\)"/',"onclick=\"open_img('$blogURL/thumbnail/$owner/$tempFileName')\"",$imgString); } } }else{ @unlink(ROOT."/cache/thumbnail/$owner/".str_replace(".resampled.",".watermarked.",$tempFileName)); } }else{ $isSuccessful=false; } }else{ $isSuccessful=false; } if($isSuccessful==false){ $imgString=preg_replace('/width="([^"]+)"/i','width="'.$tempWidth.'"',$imgString); $imgString=preg_replace('/height="([^"]+)"/i','height="'.$tempHeight.'"',$imgString); } unset($AttachedImage); break; default: $imgString=preg_replace('/src="([^"]+)"/i','src="'.$tempURL.'"',$imgString); $imgString=preg_replace('/width="([^"]+)"/i','width="'.$tempWidth.'"',$imgString); $imgString=preg_replace('/height="([^"]+)"/i','height="'.$tempHeight.'"',$imgString); $originImageInfo=getimagesize($originSrc); $tempFileName=preg_replace("/\.([[:alnum:]]+)$/i",".w{$originImageInfo[0]}-h{$originImageInfo[1]}.{$resampleType}.\\1",$originFileName); if($resampleType=="watermarked"){ if(file_exists("../../cache/thumbnail/$owner/$tempFileName")){ $imgString=preg_replace('/onclick="open_img\(\'([^\']+)\'\)"/',"onclick=\"open_img('$blogURL/thumbnail/$owner/$tempFileName')\"",$imgString); }elseif(file_exists(ROOT."/cache/thumbnail/$owner/".str_replace(".watermarked.",".resampled.",$tempFileName))){ $imgString=preg_replace('/onclick="open_img\(\'([^\']+)\'\)"/',"onclick=\"open_img('$blogURL/thumbnail/$owner/".str_replace(".watermarked.",".resampled.",$tempFileName)."')\"",$imgString); } }elseif($resampleType=="resampled"&&file_exists("../../cache/thumbnail/$owner/$tempFileName")){ $imgString=preg_replace('/onclick="open_img\(\'([^\']+)\'\)"/',"onclick=\"open_img('$blogURL/thumbnail/$owner/$tempFileName')\"",$imgString); } break; } } return $imgString; } function deleteFilesByRegExp($path,$regexp){ $path=eregi("/$",$path,$temp)?$path:$path."/"; if(!file_exists($path)) return false; $handle=opendir($path); while($tempFile=readdir($handle)){ if(($regexp=="*"||eregi("$regexp",$tempFile,$temp))&&($tempFile!="."&&$tempFile!="..")){ @unlink($path.$tempFile); } } return true; } mysql_connect($database['server'],$database['username'],$database['password']); mysql_select_db($database['database']); # MySQL 4.0->4.1 로 변경하면서 생긴 인코딩 문제 해결 # if(mysql_query('SET CHARACTER SET utf8')){ # $database['utf8']=true; # function mysql_lessen($str,$length=255,$tail='..'){ # return UTF8::lessen($str,$length,$tail); # } # }else{ # $database['utf8']=false; # function mysql_lessen($str,$length=255,$tail='..'){ # return UTF8::lessenAsByte($str,$length,$tail); # } # } @mysql_query('SET SESSION collation_connection = \'utf8_general_ci\''); if(function_exists('mysql_real_escape_string')&&(mysql_real_escape_string('ㅋ')=='ㅋ')){ function mysql_tt_escape_string($string,$link=null){ return is_null($link)?mysql_real_escape_string($string):mysql_real_escape_string($string,$link); } }else{ function mysql_tt_escape_string($string,$link=null){ return mysql_escape_string($string); } } function getOwner($name){ global $database; return fetchQueryCell("select owner from {$database['prefix']}BlogSettings where name = '$name'"); } function getOwnerBySecondaryDomain($domain){ global $database; return DBQuery::queryCell("SELECT owner FROM {$database['prefix']}BlogSettings WHERE secondaryDomain = '$domain' OR secondaryDomain = '".(substr($domain,0,4)=='www.'?substr($domain,4):'www.'.$domain)."'"); } function getBlogSetting($owner){ global $database; if($result=mysql_query("select * from {$database['prefix']}BlogSettings where owner = $owner")){ return mysql_fetch_array($result); } return false; } function getSkinSetting($owner){ global $database,$service; if($result=mysql_query("SELECT * FROM {$database['prefix']}SkinSettings WHERE owner = $owner")){ $retval=mysql_fetch_array($result); if($retval!=FALSE){ if(!Validator::directory($retval['skin'])&&($retval['skin']!="customize/$owner")){ $retval['skin']=$service['skin']; } return $retval; } } $retval=array('owner'=>$owner,'skin'=>$service['skin'],'entriesOnRecent'=>5,'commentsOnRecent'=>5,'commentsOnGuestbook'=>5,'tagsOnTagbox'=>30,'tagboxAlign'=>3,'trackbacksOnRecent'=>5,'expandComment'=>1,'expandTrackback'=>1,'recentNoticeLength'=>25,'recentEntryLength'=>30,'recentCommentLength'=>30,'recentTrackbackLength'=>30,'linkLength'=>30,'showListOnCategory'=>1,'showListOnArchive'=>1,'tree'=>'base','colorOnTree'=>'000000','bgColorOnTree'=>'','activeColorOnTree'=>'FFFFFF','activeBgColorOnTree'=>'00ADEF','labelLengthOnTree'=>27,'showValueOnTree'=>1); return $retval; } function getDefaultURL($uid){ global $database,$service; $blog=DBQuery::queryRow("SELECT name, secondaryDomain, defaultDomain FROM {$database['prefix']}BlogSettings WHERE owner = $uid"); switch($service['type']){ case 'domain': if($blog['defaultDomain']&&$blog['secondaryDomain']) return ('http://'.$blog['secondaryDomain'].(isset($service['port'])?':'.$service['port']:'').$service['path']); else return ('http://'.$blog['name'].'.'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$service['path']); case 'path': return ('http://'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$service['path'].'/'.$blog['name']); case 'single': default: return ('http://'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$service['path']); } } function getArchives($owner){ global $database; $archives=array(); $visibility=doesHaveOwnership()?'':'AND visibility > 0'; $query=mysql_query("SELECT archivesOnPage FROM {$database['prefix']}SkinSettings WHERE owner = $owner"); $row=mysql_fetch_row($query); $archivesOnPage=$row[0]; $result=mysql_query("SELECT EXTRACT(year_month FROM FROM_UNIXTIME(published)) period, COUNT(*) count FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category >= 0 GROUP BY period ORDER BY period DESC LIMIT $archivesOnPage"); if($result){ while($archive=mysql_fetch_array($result)) array_push($archives,$archive); } return $archives; } function getCalendar($owner,$period){ global $database; $calendar=array('days'=>array()); if(($period===true)||!checkPeriod($period)) $period=Timestamp::getYearMonth(); $calendar['period']=$period; $calendar['year']=substr($period,0,4); $calendar['month']=substr($period,4,2); $visibility=doesHaveOwnership()?'':'AND visibility > 0'; $result=mysql_query("SELECT DISTINCT DAYOFMONTH(FROM_UNIXTIME(published)) FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category >= 0 AND YEAR(FROM_UNIXTIME(published)) = {$calendar['year']} AND MONTH(FROM_UNIXTIME(published)) = {$calendar['month']}"); if($result){ while(list($day)=mysql_fetch_array($result)) array_push($calendar['days'],$day); } $calendar['days']=array_flip($calendar['days']); return $calendar; } function getAttachmentByOnlyName($owner,$name){ global $database; $name=mysql_tt_escape_string($name); return fetchQueryRow("select * from {$database['prefix']}Attachments where owner = $owner and name = '$name'"); } function getCategoryNameById($owner,$id){ global $database; $result=fetchQueryCell("SELECT name FROM {$database['prefix']}Categories WHERE owner = $owner AND id = $id"); if(is_null($result)) return _text('전체'); else return $result; } function getCategoryBodyIdById($owner,$id){ global $database; $result=fetchQueryCell("SELECT bodyId FROM {$database['prefix']}Categories WHERE owner = $owner AND id = $id"); if(($id===0)||($result=='')||($id===null)) return 'tt-body-category'; return $result; } function getCategories($owner){ global $database; $rows=fetchQueryAll("SELECT * FROM {$database['prefix']}Categories WHERE owner = $owner AND id > 0 ORDER BY parent, priority"); $categories=array(); foreach($rows as $category){ if($category['parent']==null){ $category['children']=array(); $categories[$category['id']]=$category; }elseif(isset($categories[$category['parent']])) array_push($categories[$category['parent']]['children'],$category); } return $categories; } function getCategoriesSkin(){ global $database; global $owner,$service; $sql="select * from {$database['prefix']}SkinSettings where owner = $owner"; $setting=fetchQueryRow($sql); $skin=array('name'=>"{$setting['skin']}",'url'=>$service['path']."/image/tree/{$setting['tree']}",'labelLength'=>$setting['labelLengthOnTree'],'showValue'=>$setting['showValueOnTree'],'itemColor'=>"{$setting['colorOnTree']}",'itemBgColor'=>"{$setting['bgColorOnTree']}",'activeItemColor'=>"{$setting['activeColorOnTree']}",'activeItemBgColor'=>"{$setting['activeBgColorOnTree']}",); return $skin; } function getCommentsWithPagingForGuestbook($owner,$page,$count){ global $database; $sql="SELECT * FROM {$database['prefix']}Comments WHERE owner = $owner"; $sql.=' AND entry = 0 AND parent is null AND isFiltered = 0'; $sql.=' ORDER BY written DESC'; return fetchWithPaging($sql,$page,$count); } function getComments($entry){ global $database,$owner; $comments=array(); $authorized=doesHaveOwnership(); $aux=($entry==0?'ORDER BY written DESC':'order by id ASC'); $sql="select * from {$database['prefix']}Comments where owner = $owner and entry = $entry and parent is null and isFiltered = 0 $aux"; if($result=mysql_query($sql)){ while($comment=mysql_fetch_array($result)){ if(($comment['secret']==1)&&!$authorized){ $comment['name']=''; $comment['homepage']=''; $comment['comment']=_text('관리자만 볼 수 있는 댓글입니다.'); } array_push($comments,$comment); } } return $comments; } function getCommentComments($parent){ global $database,$owner; $comments=array(); $authorized=doesHaveOwnership(); if($result=mysql_query("select * from {$database['prefix']}Comments where owner = $owner and parent = $parent and isFiltered = 0 order by id")){ while($comment=mysql_fetch_array($result)){ if(($comment['secret']==1)&&!$authorized){ $comment['name']=''; $comment['homepage']=''; $comment['comment']=_text('관리자만 볼 수 있는 댓글입니다.'); } array_push($comments,$comment); } } return $comments; } function getRecentComments($owner){ global $skinSetting,$database; $comments=array(); $sql=doesHaveOwnership()?"SELECT * FROM {$database['prefix']}Comments WHERE owner = $owner AND entry>0 AND isFiltered = 0 ORDER BY written DESC LIMIT {$skinSetting['commentsOnRecent']}":"SELECT r.* FROM {$database['prefix']}Comments r, {$database['prefix']}Entries e WHERE r.owner = $owner AND r.owner = e.owner AND r.entry = e.id AND e.draft = 0 AND e.visibility >= 2 AND entry > 0 AND isFiltered = 0 ORDER BY r.written DESC LIMIT {$skinSetting['commentsOnRecent']}"; if($result=mysql_query($sql)){ while($comment=mysql_fetch_array($result)){ if(($comment['secret']==1)&&!doesHaveOwnership()){ $comment['name']=''; $comment['homepage']=''; $comment['comment']=_text('관리자만 볼 수 있는 댓글입니다.'); } array_push($comments,$comment); } } return $comments; } function getCommentCountPart($commentCount,&$skin){ $noneCommentMessage=$skin->noneCommentMessage; $singleCommentMessage=$skin->singleCommentMessage; if($commentCount==0&&!empty($noneCommentMessage)){ dress('article_rep_rp_cnt',0,$noneCommentMessage); $commentView=$noneCommentMessage; }elseif($commentCount==1&&!empty($singleCommentMessage)){ dress('article_rep_rp_cnt',1,$singleCommentMessage); $commentView=$singleCommentMessage; }else{ $commentPart=$skin->commentCount; dress('article_rep_rp_cnt',$commentCount,$commentPart); $commentView=$commentPart; } return array("rp_count",$commentView); } function getEntriesTotalCount($owner){ global $database; $visibility=doesHaveOwnership()?'':'AND visibility > 0'; return fetchQueryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category >= 0"); } function getEntriesWithPagingByNotice($owner,$page,$count){ global $database,$folderURL,$suri; $visibility=doesHaveOwnership()?'':'AND visibility = 2'; $sql="SELECT *, '"._text('공지')."' categoryLabel FROM {$database['prefix']}Entries WHERE owner = $owner $visibility AND category = -2 ORDER BY published DESC"; return fetchWithPaging($sql,$page,$count,"$folderURL/{$suri['value']}"); } function getRecentEntries($owner){ global $database,$skinSetting; $entries=array(); $visibility=doesHaveOwnership()?'':'AND visibility > 0'; $result=mysql_query("SELECT id, title, comments FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category >= 0 ORDER BY published DESC LIMIT {$skinSetting['entriesOnRecent']}"); while($entry=mysql_fetch_array($result)){ array_push($entries,$entry); } return $entries; } function getEntryVisibilityName($visibility){ switch(abs($visibility)){ case 0: return _text('비공개'); case 1: return _text('보호'); case 2: return _text('공개'); case 3: default: return _text('발행'); } } function getKeywordNames($owner){ global $database; $names=array(); $visibility=doesHaveOwnership()?'':'AND visibility > 0'; $result=mysql_query("SELECT title FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category = -1"); while(list($name)=mysql_fetch_array($result)) array_push($names,$name); return $names; } function getNotices($owner){ global $database; $visibility=doesHaveOwnership()?'':'AND visibility = 2'; return fetchQueryAll("SELECT id, title, published FROM {$database['prefix']}Entries WHERE owner = $owner AND draft = 0 $visibility AND category = -2 ORDER BY published DESC"); } function getLinks($owner){ global $database; $links=array(); if($result=mysql_query("select * from {$database['prefix']}Links where owner = $owner ORDER BY name")){ while($link=mysql_fetch_array($result)) array_push($links,$link); } return $links; } function fetchWithPaging($sql,$page,$count,$url=null,$prefix='?page='){ global $folderURL; if($url===null) $url=$folderURL; $paging=array('url'=>$url,'prefix'=>$prefix,'postfix'=>''); if(empty($sql)) return array(array(),$paging); if(eregi('[[:space:]]{1}(FROM.*)$',$sql,$matches)) $from=$matches[1]; else return array(array(),$paging); $paging['total']=fetchQueryCell("SELECT COUNT(*) $from"); if($paging['total']===null) return array(array(),$paging); $paging['pages']=intval(ceil($paging['total']/$count)); $paging['page']=is_numeric($page)?$page:1; if($paging['page']>$paging['pages']){ $paging['page']=$paging['pages']; if($paging['pages']>0) $paging['prev']=$paging['pages']-1; } if($paging['page']>1) $paging['prev']=$paging['page']-1; if($paging['page']<$paging['pages']) $paging['next']=$paging['page']+1; $offset=($paging['page']-1)*$count; if($offset<0) $offset=0; return array(fetchQueryAll("$sql LIMIT $offset, $count"),$paging); } function getCurrentSetting($name){ global $database,$owner,$activePlugins; if(!in_array($name,$activePlugins)) return false; $name=mysql_tt_escape_string($name); $result=mysql_query("SELECT settings FROM {$database['prefix']}Plugins WHERE owner = $owner AND name = '$name'"); if(false===$result) return false; $out=mysql_fetch_array($result); return $out['settings']; } function treatPluginTable($plugin,$name,$fields,$keys,$version){ global $database; if(doesExistTable($database['prefix'].$name)){ $keyname='Database_'.$name; $value=$plugin; $query="SELECT value FROM {$database['prefix']}ServiceSettings WHERE name='{$keyname}'"; $result=DBQuery::queryCell($query); if(is_null($result)){ $keyname=mysql_tt_escape_string(mysql_lessen($keyname,32)); $value=mysql_tt_escape_string(mysql_lessen($plugin.'/'.$version,255)); DBQuery::execute("INSERT INTO {$database['prefix']}ServiceSettings SET name='$keyname', value ='$value'"); }else{ $keyname=mysql_tt_escape_string(mysql_lessen($keyname,32)); $value=mysql_tt_escape_string(mysql_lessen($plugin.'/'.$version,255)); $values=explode('/',$result,2); if(strcmp($plugin,$values[0])!=0){ return false; }elseif(strcmp($version,$values[1])!=0){ DBQuery::execute("UPDATE {$database['prefix']}ServiceSettings SET value ='$value' WHERE name='$keyname'"); $eventName='UpdateDB_'.$name; fireEvent($eventName,$values[1]); } } return true; }else{ $query="CREATE TABLE {$database['prefix']}{$name} (owner int(11) NOT NULL default '0',"; foreach($fields as $field){ $isNull=($field['isnull']==0)?' NOT NULL ':' NULL '; $defaultValue=is_null($field['default'])?'':" DEFAULT '".mysql_tt_escape_string($field['default'])."' "; $fieldLength=($field['length']>=0)?"(".$field['length'].")":''; $sentence=$field['name']." ".$field['attribute'].$fieldLength.$isNull.$defaultValue.","; $query.=$sentence; } array_unshift($keys,'owner'); $query.=" PRIMARY KEY (".implode(',',$keys).")"; $query.=") TYPE=MyISAM DEFAULT CHARSET=utf8"; if(DBQuery::execute($query)){ $keyname=mysql_tt_escape_string(mysql_lessen('Database_'.$name,32)); $value=mysql_tt_escape_string(mysql_lessen($plugin.'/'.$version,255)); DBQuery::execute("INSERT INTO {$database['prefix']}ServiceSettings SET name='$keyname', value ='$value'"); return true; }else return false; } return true; } function getSidebarModuleOrderData($sidebarCount){ if(!is_null($tempValue=getUserSetting("sidebarOrder",NULL))){ $emptyArray=unserialize($tempValue); }else{ $emptyArray=false; } if($emptyArray===false) return ; return $emptyArray; } function getUserSetting($name,$default=null){ global $database,$owner; $value=DBQuery::queryCell("SELECT value FROM {$database['prefix']}UserSettings WHERE user = $owner AND name = '".mysql_tt_escape_string($name)."'"); return ($value===null)?$default:$value; } function setUserSetting($name,$value){ global $database,$owner; $name=mysql_tt_escape_string($name); $value=mysql_tt_escape_string($value); return DBQuery::execute("REPLACE INTO {$database['prefix']}UserSettings VALUES($owner, '$name', '$value')"); } function getStatistics($owner){ global $database; $stats=array('total'=>0,'today'=>0,'yesterday'=>0); $result=mysql_query("select visits from {$database['prefix']}BlogStatistics where owner = $owner"); if(mysql_num_rows($result)==1) list($stats['total'])=mysql_fetch_array($result); $result=mysql_query("select visits from {$database['prefix']}DailyStatistics where owner = $owner and `date` = ".Timestamp::getDate()); if(mysql_num_rows($result)==1) list($stats['today'])=mysql_fetch_array($result); $result=mysql_query("select visits from {$database['prefix']}DailyStatistics where owner = $owner and `date` = ".Timestamp::getDate(time()-86400)); if(mysql_num_rows($result)==1) list($stats['yesterday'])=mysql_fetch_array($result); return $stats; } function updateVisitorStatistics($owner){ global $database,$blogURL; if(!fireEvent('UpdatingVisitorStatistics',true)) return ; if(doesHaveOwnership()) return ; $id=session_id(); $result=mysql_query("select blog from {$database['prefix']}SessionVisits where id = '$id' and address = '{$_SERVER['REMOTE_ADDR']}' and blog = $owner"); if($result&&(mysql_num_rows($result)>0)) return ; if(mysql_query("insert into {$database['prefix']}SessionVisits values('$id', '{$_SERVER['REMOTE_ADDR']}', $owner)")&&(mysql_affected_rows()>0)){ mysql_query("update {$database['prefix']}BlogStatistics set visits = visits + 1 where owner = $owner"); if(mysql_affected_rows()==0){ if(mysql_query("update {$database['prefix']}BlogStatistics set visits = visits + 1 where owner = $owner")||(mysql_affected_rows()==0)) mysql_query("insert into {$database['prefix']}BlogStatistics values($owner, 1)"); } $period=Timestamp::getDate(); mysql_query("update {$database['prefix']}DailyStatistics set visits = visits + 1 where owner = $owner and `date` = $period"); if(mysql_affected_rows()==0){ if(!mysql_query("insert into {$database['prefix']}DailyStatistics values($owner, $period, 1)")||(mysql_affected_rows()==0)) mysql_query("update {$database['prefix']}DailyStatistics set visits = visits + 1 where owner = $owner and `date` = $period"); } if(!empty($_SERVER['HTTP_REFERER'])){ $referer=parse_url($_SERVER['HTTP_REFERER']); if(!empty($referer['host'])&&(($referer['host']!=$_SERVER['HTTP_HOST'])||(strncmp($referer['path'],$blogURL,strlen($blogURL))!=0))){ requireComponent('Tattertools.Data.Filter'); if(Filter::isFiltered('ip',$_SERVER['REMOTE_ADDR'])||Filter::isFiltered('url',$_SERVER['HTTP_REFERER'])) return ; if(!fireEvent('AddingRefererLog',true,array('host'=>$referer['host'],'url'=>$_SERVER['HTTP_REFERER']))) return ; $host=mysql_tt_escape_string(mysql_lessen($referer['host'],64)); $url=mysql_tt_escape_string(mysql_lessen($_SERVER['HTTP_REFERER'],255)); mysql_query("insert into {$database['prefix']}RefererLogs values($owner, '$host', '$url', UNIX_TIMESTAMP())"); mysql_query("delete from {$database['prefix']}RefererLogs where referred < UNIX_TIMESTAMP() - 604800"); if(!mysql_query("update {$database['prefix']}RefererStatistics set count = count + 1 where owner = $owner and host = '$host'")||(mysql_affected_rows()==0)) mysql_query("insert into {$database['prefix']}RefererStatistics values($owner, '$host', 1)"); } } } } function getTrackbacks($entry){ global $database,$owner; $trackbacks=array(); $result=mysql_query("select * from {$database['prefix']}Trackbacks where owner = $owner AND entry = $entry AND isFiltered = 0 order by written"); while($trackback=mysql_fetch_array($result)) array_push($trackbacks,$trackback); return $trackbacks; } function getRecentTrackbacks($owner){ global $database; global $skinSetting; $trackbacks=array(); $sql=doesHaveOwnership()?"SELECT * FROM {$database['prefix']}Trackbacks WHERE owner = $owner AND isFiltered = 0 ORDER BY written DESC LIMIT {$skinSetting['trackbacksOnRecent']}":"SELECT t.* FROM {$database['prefix']}Trackbacks t, {$database['prefix']}Entries e WHERE t.owner = $owner AND t.owner = e.owner AND t.entry = e.id AND e.draft = 0 AND e.visibility >= 2 AND isFiltered = 0 ORDER BY t.written DESC LIMIT {$skinSetting['trackbacksOnRecent']}"; if($result=mysql_query($sql)){ while($trackback=mysql_fetch_array($result)) array_push($trackbacks,$trackback); } return $trackbacks; } function getTrackbackCountPart($trackbackCount,&$skin){ $noneTrackbackMessage=$skin->noneTrackbackMessage; $singleTrackbackMessage=$skin->singleTrackbackMessage; if($trackbackCount==0&&!empty($noneTrackbackMessage)){ dress('article_rep_tb_cnt',0,$noneTrackbackMessage); $trackbackView=$noneTrackbackMessage; }elseif($trackbackCount==1&&!empty($singleTrackbackMessage)){ dress('article_rep_tb_cnt',1,$singleTrackbackMessage); $trackbackView=$singleTrackbackMessage; }else{ $trackbackPart=$skin->trackbackCount; dress('article_rep_tb_cnt',$trackbackCount,$trackbackPart); $trackbackView=$trackbackPart; } return array("tb_count",$trackbackView); } function getTags($entry){ global $database,$owner; $tags=array(); if(doesHaveOwnership()) $result=mysql_query("SELECT * FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r WHERE t.id = r.tag AND r.entry = $entry AND r.owner = $owner GROUP BY r.tag ORDER BY t.name"); else $result=mysql_query("SELECT * FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.entry = $entry AND r.owner = $owner GROUP BY r.tag ORDER BY t.name"); if($result){ while($tag=mysql_fetch_array($result)) array_push($tags,$tag); } return $tags; } function getRandomTags($owner){ global $database,$skinSetting; $tags=array(); $aux=($skinSetting['tagsOnTagbox']==-1)?'':"limit {$skinSetting['tagsOnTagbox']}"; if($skinSetting['tagboxAlign']==1){ if(doesHaveOwnership()) $result=mysql_query("SELECT `name`, count(*) `cnt` FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r WHERE t.id = r.tag and r.owner = $owner GROUP BY r.tag ORDER BY cnt DESC $aux"); else $result=mysql_query("SELECT `name`, count(*) `cnt` FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.owner = $owner GROUP BY r.tag ORDER BY `cnt` DESC $aux"); }elseif($skinSetting['tagboxAlign']==2){ if(doesHaveOwnership()) $result=mysql_query("SELECT DISTINCT name FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r WHERE t.id = r.tag AND r.owner = $owner GROUP BY r.tag ORDER BY t.name $aux"); else $result=mysql_query("SELECT DISTINCT name FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.owner = $owner GROUP BY r.tag ORDER BY t.name $aux"); }else{ if(doesHaveOwnership()) $result=mysql_query("SELECT `name` FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r WHERE t.id = r.tag AND r.owner = $owner GROUP BY r.tag ORDER BY RAND() $aux"); else $result=mysql_query("SELECT `name` FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.owner = $owner GROUP BY r.tag ORDER BY RAND() $aux"); } if($result){ while(list($tag)=mysql_fetch_row($result)) array_push($tags,$tag); } return $tags; } function getTagFrequencyRange(){ global $database,$owner; $max=$min=0; if(doesHaveOwnership()) $result=mysql_query("SELECT count(r.entry) `cnt` FROM `{$database['prefix']}TagRelations` r WHERE r.owner = $owner GROUP BY r.tag ORDER BY `cnt` DESC LIMIT 1"); else $result=mysql_query("SELECT count(r.entry) `cnt` FROM `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND r.owner = $owner GROUP BY r.tag ORDER BY `cnt` DESC LIMIT 1"); if($result){ if(list($count)=mysql_fetch_array($result)) $max=$count; } if(doesHaveOwnership()) $result=mysql_query("SELECT count(r.entry) `cnt` FROM `{$database['prefix']}TagRelations` r WHERE r.owner = $owner GROUP BY r.tag ORDER BY `cnt` LIMIT 1"); else $result=mysql_query("SELECT count(r.entry) `cnt` FROM `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND r.owner = $owner GROUP BY r.tag ORDER BY `cnt` LIMIT 1"); if($result){ if(list($count)=mysql_fetch_array($result)) $min=$count; } return array($max,$min); } function getTagFrequency($tag,$max,$min){ global $database,$owner; if(doesHaveOwnership()) $count=fetchQueryCell("SELECT count(*) FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r WHERE t.id = r.tag AND r.owner = $owner AND t.name = '".mysql_tt_escape_string($tag)."'"); else $count=fetchQueryCell("SELECT count(*) FROM `{$database['prefix']}Tags` t, `{$database['prefix']}TagRelations` r, `{$database['prefix']}Entries` e WHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.owner = $owner AND t.name = '".mysql_tt_escape_string($tag)."'"); $dist=$max/3; if($count==$min) return 5; elseif($count==$max) return 1; elseif($count>=$min+($dist*2)) return 2; elseif($count>=$min+$dist) return 3; else return 4; } $url=isset($_SERVER['REDIRECT_URL'])?$_SERVER['REDIRECT_URL']:$_SERVER['SCRIPT_NAME']; $suri=array('url'=>$url,'value'=>''); $owner=null; $depth=substr_count($service['path'],'/'); if($depth>0){ if(ereg("^((/+[^/]+){{$depth}})(.*)$",$url,$matches)) $url=$matches[3]; else respondNotFoundPage(); } if($service['type']=='single'){ $owner=1; }else{ if($service['type']=='domain'){ if($_SERVER['HTTP_HOST']==$service['domain']){ $owner=1; }else{ $domain=explode('.',$_SERVER['HTTP_HOST'],2); if($domain[1]==$service['domain']){ $owner=getOwner($domain[0]); if($owner===null) $owner=getOwnerBySecondaryDomain($_SERVER['HTTP_HOST']); }else{ $owner=getOwnerBySecondaryDomain($_SERVER['HTTP_HOST']); } } }else{ if($url=='/'){ $owner=1; }elseif(ereg('^/+([^/]+)(.*)$',$url,$matches)){ $owner=getOwner($matches[1]); if($owner===null) $owner=1; $url=$matches[2]; }else{ respondNotFoundPage(); } } if($owner===null) respondNotFoundPage(); } $blog=getBlogSetting($owner); $skinSetting=getSkinSetting($owner); $depth=substr_count(ROOT,'/'); if($depth>0){ if(ereg("^((/+[^/]+){{$depth}})/*(.*)$",$url,$matches)){ $suri['directive']=$matches[1]; if($matches[3]!==false) $suri['value']=$matches[3]; }else respondNotFoundPage(); }else{ $suri['directive']='/'; $suri['value']=ltrim($url,'/'); } if(is_numeric($suri['value'])) $suri['id']=$suri['value']; $suri['page']=empty($_POST['page'])?(empty($_GET['page'])?true:$_GET['page']):$_POST['page']; if(!isset($serviceURL)) $serviceURL='http://'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$service['path']; switch($service['type']){ case 'domain': $pathURL=$service['path']; if($blog['defaultDomain']&&$blog['secondaryDomain']){ $defaultURL='http://'.$blog['secondaryDomain'].(isset($service['port'])?':'.$service['port']:'').$pathURL; if($_SERVER['HTTP_HOST']==$blog['secondaryDomain']) $baseURL=$service['path']; else $baseURL=$defaultURL; }else{ $defaultURL='http://'.$blog['name'].'.'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$pathURL; if($_SERVER['HTTP_HOST']==($blog['name'].'.'.$service['domain'])) $baseURL=$service['path']; else $baseURL=$defaultURL; } break; case 'path': $pathURL=$service['path'].'/'.$blog['name']; $defaultURL='http://'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$pathURL; if($_SERVER['HTTP_HOST']==$service['domain']) $baseURL=$service['path'].'/'.$blog['name']; else $baseURL=$defaultURL; break; case 'single': default: $pathURL=$service['path']; $defaultURL='http://'.$service['domain'].(isset($service['port'])?':'.$service['port']:'').$pathURL; if($_SERVER['HTTP_HOST']==$service['domain']) $baseURL=$service['path']; else $baseURL=$defaultURL; break; } $hostURL='http://'.$_SERVER['HTTP_HOST'].(isset($service['port'])?':'.$service['port']:''); $blogURL=$pathURL; $folderURL=rtrim($blogURL.$suri['directive'],'/'); unset($url,$domain); $adminSkinSetting=array(); $adminSkinSetting['skin']="/style/admin/".getUserSetting("adminSkin","default"); if(file_exists("../../skin/{$skinSetting['skin']}/wysiwyg.css")) $adminSkinSetting['editorTemplate']="/skin/{$skinSetting['skin']}/wysiwyg.css"; else $adminSkinSetting['editorTemplate']="/style/default-wysiwyg.css"; if(file_exists("../../attach/$owner/watermark.gif")){ $waterMarkPath="../../attach/$owner/watermark.gif"; }else{ $waterMarkPath=NULL; } $waterMarkArray=array(); $waterMarkArray['path']=$waterMarkPath; $waterMarkArray['position']=getWaterMarkPosition(); $waterMarkArray['gamma']=getWaterMarkGamma(); $paddingArray=array(); $padding=getThumbnailPadding(); $paddingArray['top']=$padding['top']; $paddingArray['right']=$padding['right']; $paddingArray['bottom']=$padding['bottom']; $paddingArray['left']=$padding['left']; $paddingArray['bgColor']=getThumbnailPaddingColor(); unset($padding); unset($waterMarkPath); if(!file_exists('../../config.php')){ header('Location: '.'../../setup.php'); exit; } function respondNotFoundPage(){ header('HTTP/1.1 404 Not Found'); header("Connection: close"); exit; } function getMicrotimeAsFloat(){ list($usec,$sec)=explode(" ",microtime()); return ($usec+$sec); } $sessionMicrotime=getMicrotimeAsFloat(); function openSession($savePath,$sessionName){ return true; } function closeSession(){ return true; } function readSession($id){ global $database,$service; if($result=sessionQuery("SELECT data FROM {$database['prefix']}Sessions WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}' AND updated >= (UNIX_TIMESTAMP() - {$service['timeout']})")){ if($session=mysql_fetch_array($result)) return $session['data']; } return ''; } function writeSession($id,$data){ global $database; global $sessionMicrotime; if(strlen($id)<32) return false; $userid=isset($_SESSION['userid'])?$_SESSION['userid']:'null'; $data=mysql_tt_escape_string($data); $server=mysql_tt_escape_string($_SERVER['HTTP_HOST']); $request=mysql_tt_escape_string($_SERVER['REQUEST_URI']); $referer=isset($_SERVER['HTTP_REFERER'])?mysql_tt_escape_string($_SERVER['HTTP_REFERER']):''; $timer=getMicrotimeAsFloat()-$sessionMicrotime; $result=mysql_query("UPDATE {$database['prefix']}Sessions SET userid = $userid, data = '$data', server = '$server', request = '$request', referer = '$referer', timer = $timer, updated = UNIX_TIMESTAMP() WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'"); if($result&&(mysql_affected_rows()==1)) return true; return false; } function destroySession($id,$setCookie=false){ global $database; if(!isset($_SESSION['userid'])) return ; @mysql_query("DELETE FROM {$database['prefix']}Sessions WHERE id = '$id' AND address = '{$_SERVER['REMOTE_ADDR']}'"); gcSession(); } function gcSession($maxLifeTime=false){ global $database,$service; @mysql_query("DELETE FROM {$database['prefix']}Sessions WHERE updated < (UNIX_TIMESTAMP() - {$service['timeout']})"); $result=@sessionQuery("SELECT DISTINCT v.id, v.address FROM {$database['prefix']}SessionVisits v LEFT JOIN {$database['prefix']}Sessions s ON v.id = s.id AND v.address = s.address WHERE s.id IS NULL AND s.address IS NULL"); if($result){ $gc=array(); while($g=mysql_fetch_row($result)) array_push($gc,$g); foreach($gc as $g) @mysql_query("DELETE FROM {$database['prefix']}SessionVisits WHERE id = '{$g[0]}' AND address = '{$g[1]}'"); } return true; } function getAnonymousSession(){ global $database; $result=sessionQuery("SELECT id FROM {$database['prefix']}Sessions WHERE address = '{$_SERVER['REMOTE_ADDR']}' AND userid IS NULL AND preexistence IS NULL"); if($result&&(list($id)=mysql_fetch_array($result))) return $id; return false; } function newAnonymousSession(){ global $database; for($i=0;$i<100;$i++){ if(($id=getAnonymousSession())!==false) return $id; $id=dechex(rand(0x10000000,0x7FFFFFFF)).dechex(rand(0x10000000,0x7FFFFFFF)).dechex(rand(0x10000000,0x7FFFFFFF)).dechex(rand(0x10000000,0x7FFFFFFF)); mysql_query("INSERT INTO {$database['prefix']}Sessions(id, address, created, updated) VALUES('$id', '{$_SERVER['REMOTE_ADDR']}', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())"); if(mysql_affected_rows()>0) return $id; } return false; } function setSessionAnonymous($currentId){ $id=getAnonymousSession(); if($id!==false){ if($id!=$currentId) session_id($id); return true; } $id=newAnonymousSession(); if($id!==false){ session_id($id); return true; } return false; } function isSessionAuthorized($id){ global $database; $result=mysql_query("select id from {$database['prefix']}Sessions where id = '$id' and address = '{$_SERVER['REMOTE_ADDR']}' and (userid is not null or preexistence is not null)"); if($result&&(mysql_num_rows($result)==1)) return true; return false; } function setSession(){ $id=empty($_COOKIE[session_name()])?'':$_COOKIE[session_name()]; if((strlen($id)<32)||!isSessionAuthorized($id)) setSessionAnonymous($id); } function sessionQuery($sql){ global $database,$sessionDBRepair; $result=mysql_query($sql); if($result===false){ if(!isset($sessionDBRepair)){ mysql_query("REPAIR TABLE {$database['prefix']}Sessions"); $result=mysql_query($sql); $sessionDBRepair=true; } } return $result; } session_name('TSSESSION'); setSession(); session_set_save_handler('openSession','closeSession','readSession','writeSession','destroySession','gcSession'); session_cache_expire(1); session_set_cookie_params(0,'/',$service['domain']); if(session_start()!==true){ header('HTTP/1.1 503 Service Unavailable'); } function doesHaveMembership(){ return empty($_SESSION['userid'])?false:true; } function getUserId(){ return empty($_SESSION['userid'])?false:$_SESSION['userid']; } function doesHaveOwnership(){ global $owner; if(empty($_SESSION['userid'])||($_SESSION['userid']!=$owner)) return false; return true; } if(doesHaveMembership()){ $user=array('id'=>getUserId()); $user['name']=DBQuery::queryCell("SELECT name FROM {$database['prefix']}Users WHERE userid = {$user['id']}"); $user['homepage']=getDefaultURL($user['id']); }else{ $user=null; } Timezone::set(isset($blog['timezone'])?$blog['timezone']:$service['timezone']); mysql_query('SET time_zone = \''.Timezone::getCanonical().'\''); Locale::setDirectory('../../language'); Locale::set(isset($blog['language'])?$blog['language']:$service['language']); if(!isset($blog['blogLanguage'])){ $blog['blogLanguage']=$service['language']; } if(is_file($__locale['directory'].'/'.$blog['blogLanguage'].".php")){ $__outText=getOutLanguage($__locale['directory'].'/'.$blog['blogLanguage'].".php"); } function getOutLanguage($languageFile){ include ($languageFile); return $__text; } function _text($t){ global $__outText; if(isset($__outText)&&isset($__outText[$t])){ return $__outText[$t]; }else{ return $t; } } $activePlugins=array(); $eventMappings=array(); $tagMappings=array(); $sidebarMappings=array(); $centerMappings=array(); $storageMappings=array(); $storageKeymappings=array(); $adminMenuMappings=array(); $adminHandlerMappings=array(); $configMappings=array(); $baseConfigPost=$service['path'].'/owner/setting/plugins/currentSetting'; $configPost=''; $configVal=''; $typeSchema=null; if(!empty($owner)){ $activePlugins=fetchQueryColumn("SELECT name FROM {$database['prefix']}Plugins WHERE owner = $owner"); $xmls=new XMLStruct(); foreach($activePlugins as $plugin){ $manifest=@file_get_contents("../../plugins/$plugin/index.xml"); if($manifest&&$xmls->open($manifest)){ $version=''; if($xmls->doesExist('/plugin/version')){ $version=$xmls->getValue('/plugin/version'); } if($xmls->doesExist('/plugin/storage')){ foreach($xmls->selectNodes('/plugin/storage/table') as $table){ $storageMappings=array(); $storageKeymappings=array(); if(empty($table['name'][0]['.value'])) continue; $tableName=htmlspecialchars($table['name'][0]['.value']); if(!empty($table['fields'][0]['field'])){ foreach($table['fields'][0]['field'] as $field){ if(!isset($field['name'])) continue; $fieldName=$field['name'][0]['.value']; if(!isset($field['attribute'])) continue; $fieldAttribute=$field['attribute'][0]['.value']; $fieldLength=isset($field['length'])?$field['length'][0]['.value']:-1; $fieldIsNull=isset($field['isnull'])?$field['isnull'][0]['.value']:1; $fieldDefault=isset($field['default'])?$field['default'][0]['.value']:null; array_push($storageMappings,array('name'=>$fieldName,'attribute'=>$fieldAttribute,'length'=>$fieldLength,'isnull'=>$fieldIsNull,'default'=>$fieldDefault)); } } if(!empty($table['key'][0]['.value'])){ foreach($table['key'] as $key){ array_push($storageKeymappings,$key['.value']); } } treatPluginTable($plugin,$tableName,$storageMappings,$storageKeymappings,$version); unset($tableName); unset($storageMappings); unset($storageKeymappings); } } if($xmls->doesExist('/plugin/binding/listener')){ foreach($xmls->selectNodes('/plugin/binding/listener') as $listener){ if(!empty($listener['.attributes']['event'])&&!empty($listener['.value'])){ if(!isset($eventMappings[$listener['.attributes']['event']])) $eventMappings[$listener['.attributes']['event']]=array(); array_push($eventMappings[$listener['.attributes']['event']],array('plugin'=>$plugin,'listener'=>$listener['.value'])); } } unset($listener); } if($xmls->doesExist('/plugin/binding/tag')){ foreach($xmls->selectNodes('/plugin/binding/tag') as $tag){ if(!empty($tag['.attributes']['name'])&&!empty($tag['.attributes']['handler'])){ if(!isset($tagMappings[$tag['.attributes']['name']])) $tagMappings[$tag['.attributes']['name']]=array(); array_push($tagMappings[$tag['.attributes']['name']],array('plugin'=>$plugin,'handler'=>$tag['.attributes']['handler'])); } } unset($tag); } if($xmls->doesExist('/plugin/binding/center')){ $title=htmlspecialchars($xmls->getValue('/plugin/title[lang()]')); foreach($xmls->selectNodes('/plugin/binding/center') as $center){ if(!empty($center['.attributes']['handler'])){ array_push($centerMappings,array('plugin'=>$plugin,'handler'=>$center['.attributes']['handler'],'title'=>$title)); } } unset($title); unset($center); } if($xmls->doesExist('/plugin/binding/sidebar')){ $title=htmlspecialchars($xmls->getValue('/plugin/title[lang()]')); foreach($xmls->selectNodes('/plugin/binding/sidebar') as $sidebar){ if(!empty($sidebar['.attributes']['handler'])){ $parameters=array(); if(isset($sidebar['params'])&&isset($sidebar['params'][0])&&isset($sidebar['params'][0]['param'])){ foreach($sidebar['params'][0]['param'] as $param){ $parameter=array('name'=>$param['name'][0]['.value'],'type'=>$param['type'][0]['.value'],'title'=>XMLStruct::getValueByLocale($param['title'])); array_push($parameters,$parameter); } } array_push($sidebarMappings,array('plugin'=>$plugin,'title'=>$sidebar['.attributes']['title'],'display'=>$title,'handler'=>$sidebar['.attributes']['handler'],'parameters'=>$parameters)); } } unset($sidebar); } if($xmls->doesExist('/plugin/binding/config')){ $config=$xmls->selectNode('/plugin/binding/config'); if(!empty($config['.attributes']['dataValHandler'])) $configMappings[$plugin]=array('config'=>'ok','dataValHandler'=>$config['.attributes']['dataValHandler']); else $configMappings[$plugin]=array('config'=>'ok'); } if($xmls->doesExist('/plugin/binding/adminMenu')){ $title=htmlspecialchars($xmls->getValue('/plugin/title[lang()]')); if($xmls->doesExist('/plugin/binding/adminMenu/viewMethods')){ foreach($xmls->selectNodes('/plugin/binding/adminMenu/viewMethods/method') as $adminViewMenu){ $menutitle=htmlspecialchars(XMLStruct::getValueByLocale($adminViewMenu['title'])); if(empty($menutitle)) continue; $menuposition=empty($adminViewMenu['position'][0]['.value'])?'menu-plugin':$adminViewMenu['position'][0]['.value']; $menuhelpurl=empty($adminViewMenu['helpurl'][0]['.value'])?'':$adminViewMenu['helpurl'][0]['.value']; if(!isset($adminViewMenu['handler'][0]['.value'])) continue; $viewhandler=htmlspecialchars($adminViewMenu['handler'][0]['.value']); if(empty($viewhandler)) continue; $params=array(); if(isset($adminViewMenu['params'][0]['param'])){ foreach($adminViewMenu['params'][0]['param'] as $methodParam){ if(!isset($methodParam['name'][0]['.value'])||!isset($methodParam['type'][0]['.value'])) continue; array_push($params,array('name'=>$methodParam['name'][0]['.value'],'type'=>$methodParam['type'][0]['.value'],'mandatory'=>@$methodParam['mandatory'][0]['.value'],'default'=>@$methodParam['default'][0]['.value'])); } } $adminMenuMappings[$plugin.'/'.$viewhandler]=array('plugin'=>$plugin,'title'=>$menutitle,'position'=>$menuposition,'handler'=>$viewhandler,'params'=>$params,'helpurl'=>$menuhelpurl); } } unset($menutitle); unset($viewhandler); unset($adminViewMenu); unset($params); if($xmls->doesExist('/plugin/binding/adminMenu/methods')){ foreach($xmls->selectNodes('/plugin/binding/adminMenu/methods/method') as $adminMethods){ $method=array(); $method['plugin']=$plugin; if(!isset($adminMethods['handler'][0]['.value'])) continue; $method['handler']=$adminMethods['handler'][0]['.value']; $method['params']=array(); if(isset($adminMethods['params'][0]['param'])){ foreach($adminMethods['params'][0]['param'] as $methodParam){ if(!isset($methodParam['name'][0]['.value'])||!isset($methodParam['type'][0]['.value'])) continue; array_push($method['params'],array('name'=>$methodParam['name'][0]['.value'],'type'=>$methodParam['type'][0]['.value'],'mandatory'=>@$methodParam['mandatory'][0]['.value'],'default'=>@$methodParam['default'][0]['.value'])); } } $adminHandlerMappings[$plugin.'/'.$method['handler']]=$method; } } unset($method); unset($methodParam); unset($adminMethods); } }else{ $plugin=mysql_tt_escape_string($plugin); mysql_query("DELETE FROM {$database['prefix']}Plugins WHERE owner = $owner AND name = '$plugin'"); } } unset($xmls); unset($plugin); } function fireEvent($event,$target=null,$mother=null,$condition=true){ global $service,$eventMappings,$pluginURL,$pluginPath,$configMappings,$configVal; if(!$condition) return $target; if(!isset($eventMappings[$event])) return $target; foreach($eventMappings[$event] as $mapping){ include_once ("../../plugins/{$mapping['plugin']}/index.php"); if(function_exists($mapping['listener'])){ if(!empty($configMappings[$mapping['plugin']]['config'])) $configVal=getCurrentSetting($mapping['plugin']); else $configVal=null; $pluginURL="{$service['path']}/plugins/{$mapping['plugin']}"; $pluginPath="../../plugins/{$mapping['plugin']}"; $target=call_user_func($mapping['listener'],$target,$mother); } } return $target; } function handleTags(&$content){ global $service,$tagMappings,$pluginURL,$pluginPath,$configMappings,$configVal; if(preg_match_all('/\[##_(\w+)_##\]/',$content,$matches)){ foreach($matches[1] as $tag){ if(!isset($tagMappings[$tag])) continue; $target=''; foreach($tagMappings[$tag] as $mapping){ include_once ("../../plugins/{$mapping['plugin']}/index.php"); if(function_exists($mapping['handler'])){ if(!empty($configMappings[$mapping['plugin']]['config'])) $configVal=getCurrentSetting($mapping['plugin']); else $configVal=''; $pluginURL="{$service['path']}/plugins/{$mapping['plugin']}"; $pluginPath="../../plugins/{$mapping['plugin']}"; $target=call_user_func($mapping['handler'],$target); } } dress($tag,$target,$content); } } } function handleSidebars(&$sval,&$obj,$previewMode){ global $service,$pluginURL,$pluginPath,$configVal,$configMappings; $newSidebarAllOrders=array(); $sidebarCount=count($obj->sidebarBasicModules); $sidebarAllOrders=getSidebarModuleOrderData($sidebarCount); if($previewMode==true) $sidebarAllOrders=null; for($i=0;$i<$sidebarCount;$i++){ $str=""; if((!is_null($sidebarAllOrders))&&((array_key_exists($i,$sidebarAllOrders)))){ $currentSidebarOrder=$sidebarAllOrders[$i]; for($j=0;$jsidebarBasicModules[$skini])&&isset($obj->sidebarBasicModules[$skini][$skinj])){ $str.=$obj->sidebarBasicModules[$skini][$skinj]['body']; } }elseif($currentSidebarOrder[$j]['type']==2){ }elseif($currentSidebarOrder[$j]['type']==3){ $plugin=$currentSidebarOrder[$j]['id']['plugin']; $handler=$currentSidebarOrder[$j]['id']['handler']; include_once ("../../plugins/{$plugin}/index.php"); if(function_exists($handler)){ $str.="[##_temp_sidebar_element_{$i}_{$j}_##]"; $parameters=$currentSidebarOrder[$j]['parameters']; $pluginURL="{$service['path']}/plugins/{$plugin}"; $pluginPath="../../plugins/{$plugin}"; if(!empty($configMappings[$plugin]['config'])) $configVal=getCurrentSetting($plugin); else $configVal=''; if(function_exists($handler)){ $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"]=call_user_func($handler,$parameters); }else{ $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"]=""; } } }else{ } } }else{ $newSidebarAllOrders[$i]=array(); for($j=0;$jsidebarBasicModules[$i]);$j++){ $str.=$obj->sidebarBasicModules[$i][$j]['body']; array_push($newSidebarAllOrders[$i],array('type'=>'1','id'=>"$i",'parameters'=>"$j")); } } dress("sidebar_{$i}",$str,$sval); } if(count($newSidebarAllOrders)>0){ if($previewMode==false) setUserSetting("sidebarOrder",serialize($newSidebarAllOrders)); } } function fetchConfigVal($DATA){ $xmls=new XMLStruct(); $outVal=array(); if(!$xmls->open($DATA)){ unset($xmls); return ; } if(is_null($xmls->selectNodes('/config/field'))){ unset($xmls); return ; } foreach($xmls->selectNodes('/config/field') as $field){ if(empty($field['.attributes']['name'])||empty($field['.attributes']['type'])){ unset($xmls); return ; } $outVal[$field['.attributes']['name']]=$field['.value']; } unset($xmls); return ($outVal); } function respondErrorPage($message=NULL,$buttonValue=NULL,$buttonLink=NULL){ global $service;?> <?php echo TATTERTOOLS_NAME;?>

Download Mp3/Mp3 MusicTop Chartsdownload R.E.M. music lyricdownload Leona Lewis music lyricdownload Portishead music lyricdownload Iron Maiden music lyricdownload Led Zeppelin music lyricdownload Beth Rowley music lyricdownload Mariah Carey music lyricdownload Bruce Springsteen music lyricdownload AC/DC music lyricdownload Linkin Park music lyricdownload OneRepublic music lyricdownload Bob Dylan music lyricdownload Metallica music lyricdownload The Who music lyricdownload Rihanna music lyricdownload Al Green music lyricdownload The Kooks music lyricdownload U2 music lyricdownload David Bowie music lyricdownload Prince music lyricdownload Alanis Morissette music lyricdownload Putumayo music lyricdownload Elvis Presley music lyricdownload Willie Nelson music lyricdownload Jon Bon Jovi music lyrichardcore fucking pic gallery hardcore fucking pic gallery object dorset escorts dorset escorts build greenville escorts sc greenville escorts sc know my first counseling session my first counseling session glad extreme animal sex extreme animal sex a doctor hentai doctor hentai my naked straight men naked straight men proper celebrities nude sex indian celebrities nude sex indian help men underwear in locker men underwear in locker don't hentai dickgirls forum hentai dickgirls forum food superbeauty blowjobs superbeauty blowjobs a phillipine babe tgp phillipine babe tgp system modern family nudist pictures modern family nudist pictures tell grannie watersport porn grannie watersport porn able famous hentai simpsons famous hentai simpsons fill sperm kara denham sperm kara denham sent hot oriental whores hot oriental whores group spring break gangbang spring break gangbang include nude businesswomen nude businesswomen arrive jenna jameson pantyhose jenna jameson pantyhose look nasty whores gang bangs nasty whores gang bangs iron pic whore mania pic whore mania steam bdsm greetings bdsm greetings grew gay model boys gay model boys finger programs for teen mothers programs for teen mothers temperature all men porn all men porn insect hentai tale 6 hentai tale 6 ago hike naked t shirts hike naked t shirts get britney s cunt pictures britney s cunt pictures brown shemale mastrubating shemale mastrubating forest tgp movie interracial tgp movie interracial dad milf lessons emma starr milf lessons emma starr voice diy beauty videos diy beauty videos silver facial orlando florida pedicure facial orlando florida pedicure radio black negro sex black negro sex before gw slut gw slut the kiteboard fat chick kiteboard fat chick opposite cum gangbang cumloads facial cum gangbang cumloads facial energy medical fetish doctor medical fetish doctor by gay film floundering gay film floundering stream ebony big dick bootie ebony big dick bootie great no trans fatty acids no trans fatty acids opposite wrestling female lesbian wrestling female lesbian character naked black vagina naked black vagina soft naked milf s naked milf s parent myspace gay pride icons myspace gay pride icons dead hens and chicks seed hens and chicks seed same raunchy role bang raunchy role bang pattern xxx true babes xxx true babes differ patriot eye strips patriot eye strips organ love birthdays poems love birthdays poems wash slutty sex games slutty sex games will woman gush an orgasm woman gush an orgasm rise sensual masage in dallas sensual masage in dallas area the sex pistols wikipedia the sex pistols wikipedia us female anal pleasure female anal pleasure silver gay cop stories gay cop stories danger aching dick aching dick stood estim placement sex estim placement sex nose chicas xxx chicas xxx fig pussy wide open pussy wide open strong 22 bullet penetration 22 bullet penetration get swing arm bushings neoprene swing arm bushings neoprene them lesbian love layouts lesbian love layouts fast kiss preglued nails kiss preglued nails die breast cancer in horses breast cancer in horses done matthew passion bernstein matthew passion bernstein born austin facial rejuvenation austin facial rejuvenation measure spread pussy masturbate spread pussy masturbate wire sum puzzy sum puzzy vowel huge black pussy pics huge black pussy pics continent prolong bleeding after sex prolong bleeding after sex among border punch strips dcwv border punch strips dcwv main teen porn dalleries free teen porn dalleries free got jessica simpson upskirt jessica simpson upskirt enemy to another housewife poem to another housewife poem my big girl butts big girl butts of naked men celebs naked men celebs had pokiemon trainer sex pokiemon trainer sex hole haliburton and dick cheney haliburton and dick cheney block hollywood transvestites hollywood transvestites real big titty bitch big titty bitch plan korean granny sex korean granny sex now teen pink porn video teen pink porn video burn drunk guys naked drunk guys naked with slut jokes slut jokes over gay hunk chat gay hunk chat mix nude outdoor girls nude outdoor girls interest facial massage instructions facial massage instructions pull extreme female penetration extreme female penetration which extreme gapers extreme gapers off pretty asian nude girls pretty asian nude girls smile uncontrollable jog knob productions uncontrollable jog knob productions money tiava handjob movies tiava handjob movies soldier milf blowjob big tits milf blowjob big tits table hentai rapage hentai rapage fine guys fuck a fleshlight guys fuck a fleshlight gather booty camp shirt booty camp shirt air lesbian pussy lick own lesbian pussy lick own visit melyssa ford fuck melyssa ford fuck fit erotic hotels erotic hotels cover teen gexo teen gexo matter anim fetish search engine anim fetish search engine cat weenie tots weenie tots heat umemaro lewd and busty umemaro lewd and busty history women s nude selection women s nude selection noon desi mama sex stories desi mama sex stories more myspace ur a whore myspace ur a whore print camp blanding teens camp blanding teens basic pool group sex pool group sex lay decatur il porn star decatur il porn star master gameshark coeds gameshark coeds am amateur non nude teens amateur non nude teens sister woprld granny sex woprld granny sex instrument after pron clubs after pron clubs may spanked ass mature spanked ass mature grow carol burnett lesbian carol burnett lesbian whether colorado springs webcam colorado springs webcam wave ana lou nude ana lou nude operate hentai piss hentai piss star pornstar booty pornstar booty kill aspergers in love aspergers in love last arguments about gay marriages arguments about gay marriages chance nude schools nude schools high couple sedue teens couple sedue teens seat game charicters hentai game charicters hentai kill dating bengladesh dating bengladesh happy busty angel valentine busty angel valentine save homeric erotic homeric erotic by ebony teen anal ebony teen anal life erotic adventures of candy erotic adventures of candy anger vids of tits vids of tits act hariy pussy hariy pussy wide delta force sex change delta force sex change war women hardcore wrestlnig women hardcore wrestlnig control fuck friends mom fuck friends mom friend school of cunnilingus school of cunnilingus woman live webcams springfield massachusetts live webcams springfield massachusetts light hollow man nude scene hollow man nude scene short pron bloopers pron bloopers ready teen sports statistics teen sports statistics molecule wild g vibrator wild g vibrator spread sewing bias binding strips sewing bias binding strips insect bewitched housewives video bewitched housewives video remember teenage girl strip video teenage girl strip video phrase nude screenshots on rise nude screenshots on rise young teen girl next door teen girl next door match high school boobs high school boobs own naked women sites naked women sites late love thy enemies love thy enemies happy jessica fisher tgp jessica fisher tgp cut dick bugsy mann dick bugsy mann land puerto rico women sex puerto rico women sex best royally fucked teens royally fucked teens first busty japenese busty japenese hand hot leg tgp hot leg tgp speech russian teen cams russian teen cams a dogging melbourne dogging melbourne first large dick gay large dick gay shall joe loves crappy mvies joe loves crappy mvies measure sophia bush erotic sophia bush erotic weight mocha pornstar mocha pornstar then paulina james black cock paulina james black cock during clothes catalogs for teens clothes catalogs for teens shell gang facials mpg gang facials mpg men interratial twinks interratial twinks though uniform lesbian moviea uniform lesbian moviea determine gay kerry ireland gay kerry ireland month tight sweet teen tight sweet teen wire double breasted crop jacket double breasted crop jacket ten causes voyeurism causes voyeurism matter banger pump teen banger pump teen choose belfast transexual belfast transexual dead san diego escort bbw san diego escort bbw yard booties brazil aurora booties brazil aurora can olsen twin sex pictures olsen twin sex pictures egg ben moody s cock ben moody s cock company g spot ejaculation toys g spot ejaculation toys solve marriage counseling new york marriage counseling new york late dating a widoe dating a widoe pound domanatrix nude domanatrix nude character julia loggins lesbian julia loggins lesbian practice sex offenders sachse sex offenders sachse wave tina marie breast tina marie breast feet miget escorts miget escorts here dick jennings dick jennings the 100 000 porn gallery 100 000 porn gallery trip butts cum licking butts cum licking success atlanta bondage atlanta bondage value football paraphrase of love football paraphrase of love did adult amateur ohio adult amateur ohio post eat multiple creampie eat multiple creampie yellow very young thong very young thong take sex una tau sex una tau score nude myspace teen girls nude myspace teen girls five basic baked chicken breasts basic baked chicken breasts idea nude exercise video preview nude exercise video preview better blue white striped tights blue white striped tights some lloydminster singles lloydminster singles every virgen del pilar virgen del pilar bear sleeping beauty pink sleeping beauty pink house male dog porn male dog porn hunt curved penis sex curved penis sex has blonde cutie porn blonde cutie porn track st louis phone sex st louis phone sex danger pussy connections pussy connections choose leather mistress boots leather mistress boots tone rubber fetish forum rubber fetish forum dictionary booty hunt booty hunt exercise nude celebs of hoollywood nude celebs of hoollywood draw acward lesbian acward lesbian coast non piercing nipple jewelry non piercing nipple jewelry ring mistress arina mistress arina knew roick of love roick of love wild asian young men sex asian young men sex four laser vaginal reconstruction laser vaginal reconstruction still horny chat free horny chat free term lesbians nude free lesbians nude free only hsv2 oral sex transmission hsv2 oral sex transmission small crest renewal white strips crest renewal white strips heavy mistress daughter mistress daughter bad my porn dump my porn dump set girls naked in pool girls naked in pool arm fetis sex fetis sex share leo dicaprio naked leo dicaprio naked plane busted display pictures busted display pictures speed b cup breasts b cup breasts post brazilian hottie brazilian hottie island forced sex roll play forced sex roll play that teen making bad choices teen making bad choices decide exercise for erection exercise for erection and arabic sex clips arabic sex clips pretty erotic love stories online erotic love stories online body filthy young teen filthy young teen create extreme penetration free previue extreme penetration free previue my kleer strip kleer strip an aim love icaons aim love icaons claim physicals fetish physicals fetish baby sponsored porn sponsored porn interest smoking multiple fetish smoking multiple fetish teach jessica simpsons breasts jessica simpsons breasts charge nude femail art nude femail art blue vanessa hudgens nudes photos vanessa hudgens nudes photos experience christian romance writers christian romance writers foot cock in vacume cock in vacume shine dick pettit dick pettit ever purchase porn videos purchase porn videos snow love song poem love song poem ride nude men skinny dipping nude men skinny dipping except sex slave convention sex slave convention subject cowboy joke lesbian cowboy joke lesbian charge subliminal sex flash subliminal sex flash continent hidden camera sex pics hidden camera sex pics allow laura s mpg laura s mpg quiet gay men fingering buts gay men fingering buts from guji porn punjab guji porn punjab first husband naked humiliation husband naked humiliation feet nasty rat sex nasty rat sex sea sex gamee sex gamee his kinky leg tease kinky leg tease rose ameteur breast whipping video ameteur breast whipping video symbol ebony girls get fucked ebony girls get fucked behind innocent dickgirls innocent dickgirls between karate blonde karate blonde save used cumming after cooler used cumming after cooler sing advanced group counseling syllabus advanced group counseling syllabus heat sexy teen asian tease sexy teen asian tease band alexis texas fucked alexis texas fucked tone clasic inocent nudes clasic inocent nudes song virgin pre paid cell phones virgin pre paid cell phones cost sucking yoing cock sucking yoing cock flow black object masturbation movie black object masturbation movie think urethral sounding porn urethral sounding porn feed tthe safety chick tthe safety chick hand girls with no breasts girls with no breasts far white naked ladies white naked ladies believe andrew blake erotic films andrew blake erotic films state nipple yeast infections nipple yeast infections subject mona s asian shemales mona s asian shemales board couples in l ove couples in l ove sense counseling mistakes counseling mistakes enter nude woman gas ferrari nude woman gas ferrari beauty gay sex cruising florida gay sex cruising florida bell societysm tgp societysm tgp big japanese prone sex japanese prone sex too webcams in helen georgia webcams in helen georgia duck man love polar bear man love polar bear suffix gay gambit gay gambit port amature sex with strangers amature sex with strangers up stick fuger sex stick fuger sex score hentai shemale fuck hentai shemale fuck men janesville escorts janesville escorts written beyonce breasts at concert beyonce breasts at concert king love your lungs love your lungs share laura n chick said laura n chick said planet mega pornstar videos mega pornstar videos planet transexual models san diego transexual models san diego have ass eating of porn ass eating of porn organ vivid and mercedez facial vivid and mercedez facial history 38 eee tits 38 eee tits settle female escort spain granada female escort spain granada us hot naked sex parties hot naked sex parties walk ugly guy sex ugly guy sex card swing table uses treemodel swing table uses treemodel language steamy sex fantasy stories steamy sex fantasy stories month japanese teen films japanese teen films term dare to get naked dare to get naked would gangbang latin gangbang latin arrange mom son nude bath mom son nude bath exercise micro thong sites micro thong sites am guys wrestle nude guys wrestle nude gold female models in thongs female models in thongs space laois escorts laois escorts caught vinessa shaw nude pic vinessa shaw nude pic fraction 13 teen models 13 teen models product passions 1999 passions 1999 branch lesbians doggie style lesbians doggie style sat pleasure pools french lick pleasure pools french lick pay pictures of ebony booties pictures of ebony booties clock gay tranny xxx videos gay tranny xxx videos after big breast guide big breast guide jump belinda butts belinda butts captain gay twinks cum shot gay twinks cum shot cover black teenage lesbians black teenage lesbians figure unfaithful wives sex stories unfaithful wives sex stories oh shemale foot fetish erotica shemale foot fetish erotica might king down of gay king down of gay hold muscrat love lyrics muscrat love lyrics certain xxx dcd xxx dcd told knitting with fabric strips knitting with fabric strips tail mens nylon swim bikini mens nylon swim bikini store sex toys kinky sex toys kinky trouble physical effects of vibrators physical effects of vibrators change 2 hotties barber shop 2 hotties barber shop decide make your own facials make your own facials yes sex worker bay area sex worker bay area feel grave bone sex machine grave bone sex machine edge sex with back pain sex with back pain or anal record lee anal record lee range backwards cowgirl porn backwards cowgirl porn class search pornstar movies search pornstar movies crease hentai leia princess hentai leia princess seven gay rich millionare gay rich millionare save i love billy label i love billy label long david lee roth gay david lee roth gay anger sixx action sports sex sixx action sports sex branch youmg porn youmg porn am curvey teen porn curvey teen porn does luke s bookmarks sucks luke s bookmarks sucks oxygen anal school girl anal school girl experience in pussy hole in pussy hole art anthony samad on relationships anthony samad on relationships pass charcoal sketch naked woman charcoal sketch naked woman simple maka beauty supply maka beauty supply wait plaid skirt nude woman plaid skirt nude woman page big natural boobs movies big natural boobs movies one naked girls amatures naked girls amatures short women looking for transvestites women looking for transvestites state asian sweethearts suck younow asian sweethearts suck younow whole tgp sissy males tgp sissy males part woman fingering asshole woman fingering asshole supply pamela tommy fuck video pamela tommy fuck video develop nude mature lingerie models nude mature lingerie models the pregnant nude models photos pregnant nude models photos more shot myself nudes shot myself nudes late older milf older milf dog sex dundee prostitute sex dundee prostitute large seamless children underwear seamless children underwear cry runaway virgins runaway virgins whether wild teen parties wild teen parties ready hentia movies free hentia movies free gold plants love acid soil plants love acid soil collect gay sex group florida gay sex group florida oh naked celebrites videos naked celebrites videos baby teen swimming party teen swimming party camp hot lesbo pic s hot lesbo pic s anger endoscopic strip craniectomy endoscopic strip craniectomy grow educational and counseling psychology educational and counseling psychology supply celebrity nude senses celebrity nude senses govern crippled porn crippled porn son family nudist gallery family nudist gallery next porn with multipule partners porn with multipule partners wrong bnp diastolic dysfunction bnp diastolic dysfunction sit jonas brotherd porn jonas brotherd porn rose my nipples through sheer my nipples through sheer off rebecca dee nude rebecca dee nude west pictures of straight cunnilingus pictures of straight cunnilingus more amateur softball league amateur softball league by 6 blue crystal knobs 6 blue crystal knobs are escorted europe escorted europe under meat tarts meat tarts suggest hot latinas sex videos hot latinas sex videos nose male sex thums male sex thums provide teen shopping catalogs teen shopping catalogs up teen diaper support teen diaper support up footjobs in nylon footjobs in nylon carry volumptuous xxx pics volumptuous xxx pics bought little chicks get fucked little chicks get fucked cow foreplay magazines foreplay magazines happy porn star ann porn star ann brought vintage nylon history pictures vintage nylon history pictures soft nylon bags nylon bags now topless beach sweden topless beach sweden press naughty fat sex naughty fat sex current swedish beauty moisturizer swedish beauty moisturizer meat christian marriage relationship christian marriage relationship apple frre porn clips frre porn clips create perfect nude amazon perfect nude amazon mean teen pageant videos teen pageant videos tube wwe sunny naked wwe sunny naked element galveston strip clubs galveston strip clubs pound married personals uk married personals uk steam
web pages new iPod take advantage family member two years later little bit good dog staple philosophical tools snow blower sexual activity ice matter circle pair get back New York National Park black bra network marketing family member their diseases and treatment sex drive for why one finds better health and a make use real life yellow gun allow stop now interest rate name bio good chance would like Australian republic feels good little bit nine truck noise dry food best friend sexual desire home schooling free music Product Manager long term tight ass Richard Rorty Variety Access Westminster system Liberal Party staple philosophical tools community centres straight face business plan slide easily ethnic groups car enthusiast cock off new MLS that is derived form sentence great clear view investigate religion's get back public school get pregnant leaned back last minute mortgage insurance two terms great choice Western Europe reproduction Davion developing countries female body Yahoo Search good idea pet health came across closer look wide variety dogs cock to in human life Intelligent Urbanism heart disease hard shaft they led to tractor snow Jeff Combs hybrid car team wire cost casino dealer facial hair online high Labor Party daily basis practice separate related emotions baby boy didnt say Port Douglas wide variety my feminine relatives good education New York data entry moms ass what consequences the self is a concept dry dog cum load and the latter
foods of belgium quiet compositions traditional foods slovakia Serviced Apartment italia blue bitch you got talent clothe strange consumer reports on vacuum food sealers Jewish composers you tube stewei wacthes the teletubbies New York quickcrete concrete form tubes legs around m16 auto sear hole Atlantic City aks kindergarten people find e l wills rebar fresno ca fish oil artist clyde cole thing see him two has look concepto entrevista home remedies vanesa gusman desnuda solid foods pictures of christa pike web hosting cooking temperature for pork tenderloin The stuff atlanta georgia where is desiree cousteau Atlantic City craigs list casa grande find good haine ptr femei went home pictures of food presentation so does sheep gestation period deep throat pictures of jason voorhees online casinos evil monkey from family guy gif new apartment buko pie recipes Italian bedroom brenda stafford foundation body language vinnie of american chopper debt consolidation used trek bicycles for sale Internet connection young boylover music videos asus l8400 models great deal worksheets on compound subjects and predicates Kaths anus jenny reid peachyforum LED lights asma ul husna car accessories super one food rathdrum idaho tap water efukt home page gas mileage flats for rent in malmo auto responder pointsettas trim levels disney latino com Australian English geico caveman costume makeup wedding invitation toddlers healthy recipes couldnt see litlle lupe movies kept thinking verbage for performance appraisals Port Douglas treaty of 1213 england cricket games canadian tire e flyer online gambling latin candid vocational schools krause ladders parts Berg and others tia leonie who had preceded bookworm game blackberry activation code beautiful woman brindis ni jose rizal got walk example ease ww1 military food shop around male masterbaton technics modern computers honey and mumford little bit crispy chocolate chip cookies recipe would push winco weekly ad body weight sauvage truth or dare bikini magnificent wildlife true life of candace camron long distance cave restaurant in edgewater nj would like eta 2836 2 watch movement filthy slut king kutter food and vegetable cutter female body acaeronet air canada World War abby winters username password reason why porno orgias On a third occasion buy garden snake food pony tail rescued puppies in nc cry dark machine note ayers fine finishing pet health milkmans bok people find light colored poop going through phonak wax trap vertical blinds etec mp3 player went over 2073d online music mojave foods corp folic acid foods to remove arterial plaque get away wintuk promotional codes touch grew cent mix fairy lustre ware internet connection oi skinhead clothing pet insurance impedimentos auditivos easily available jillian beyor videos shih tzu marmite chicken recipe amy beh Barrier Reef lyrics queen in my defense couldnt wait
... "; dress('paging_rep_link_num','1',$itemView); dress('paging_rep_link',"href='$url$prefix{$paging['first']}$postfix'",$itemView); print ($itemView); }elseif($paging['page']>5){ $itemView="$itemTemplate ... "; dress('paging_rep_link_num','1',$itemView); dress('paging_rep_link',"href='$url{$prefix}1$postfix'",$itemView); print ($itemView); } if(isset($paging['before'])) $page=$paging['page']-count($paging['before']); else $page=$paging['page']<5?1:$paging['page']-4; if(isset($paging['before'])){ foreach($paging['before'] as $value){ $itemView=$itemTemplate; dress('paging_rep_link_num',"$page",$itemView); dress('paging_rep_link',"href='$url$prefix$value$postfix'",$itemView); print ($itemView); $page++; } }else{ for($i=0;($i<4)&&($page<$paging['page']);$i++){ $itemView=$itemTemplate; dress('paging_rep_link_num',"$page",$itemView); dress('paging_rep_link',"href='$url$prefix$page$postfix'",$itemView); print ($itemView); $page++; } } if(($page==$paging['page'])&&($page<=$paging['pages'])){ $itemView=$itemTemplate; dress('paging_rep_link_num',"$page",$itemView); dress('paging_rep_link','',$itemView); print ($itemView); $page++; } if(isset($paging['before'])){ foreach($paging['after'] as $value){ $itemView=$itemTemplate; dress('paging_rep_link_num',"$page",$itemView); dress('paging_rep_link',"href='$url$prefix$value$postfix'",$itemView); print ($itemView); $page++; } }else{ for($i=0;($i<4)&&($page<=$paging['pages']);$i++){ $itemView=$itemTemplate; dress('paging_rep_link_num',"$page",$itemView); dress('paging_rep_link',"href='$url$prefix$page$postfix'",$itemView); print ($itemView); $page++; } } if(isset($paging['last'])){ $itemView=" ... $itemTemplate"; dress('paging_rep_link_num',"{$paging['pages']}",$itemView); dress('paging_rep_link',"href='$url$prefix{$paging['last']}$postfix'",$itemView); print ($itemView); }elseif(($paging['pages']-$paging['page'])>4){ $itemView=" ... $itemTemplate"; dress('paging_rep_link_num',"{$paging['pages']}",$itemView); dress('paging_rep_link',"href='$url$prefix{$paging['pages']}$postfix'",$itemView); print ($itemView); } $itemsView=ob_get_contents(); ob_end_clean(); $view=$template; dress('prev_page',isset($paging['prev'])?"href='$url$prefix{$paging['prev']}$postfix'":'',$view); dress('paging_rep',$itemsView,$view); dress('next_page',isset($paging['next'])?"href='$url$prefix{$paging['next']}$postfix'":'',$view); dress('no_more_prev',isset($paging['prev'])?'':'no-more-prev',$view); dress('no_more_next',isset($paging['next'])?'':'no-more-next',$view); return $view; } function dress($tag,$value,&$contents){ if(eregi("\[##_{$tag}_##\]",$contents,$temp)){ $contents=str_replace("[##_{$tag}_##]",$value,$contents); return true; }else{ return false; } } function getUpperView($paging){ global $service,$blogURL; ob_start();?> _ _ _ _ trackbackContainer; $trackbacksView=''; $trackbacks=getTrackbacks($entryId); foreach($trackbacks as $trackback){ $trackbackView=$skin->trackback; dress('tb_rep_title',htmlspecialchars($trackback['subject']),$trackbackView); dress('tb_rep_site',htmlspecialchars($trackback['site']),$trackbackView); dress('tb_rep_url',htmlspecialchars($trackback['url']),$trackbackView); dress('tb_rep_desc',htmlspecialchars($trackback['excerpt']),$trackbackView); dress('tb_rep_onclick_delete',"deleteTrackback({$trackback['id']}, $entryId)",$trackbackView); dress('tb_rep_date',fireEvent('ViewTrackbackDate',Timestamp::format5($trackback['written'])),$trackbackView); if(dress('tb_rep_id','trackback'.$trackback['id'],$trackbackView)==false){ $trackbackView="".$trackbackView; } $trackbacksView.=$trackbackView; } if(count($trackbacks)>0){ dress('tb_rep',$trackbacksView,$trackbacksContainer); }else{ $trackbacksContainer=''; } if($skinSetting['expandTrackback']==1||(($suri['url']!=$blogURL.'/index.php'&&$suri['url']!=$service['path'].'/index.php')&&($suri['directive']=='/'||$suri['directive']=='/entry')&&$suri['value']!='')){ $style='block'; }else{ $style='none'; } $trackbacksView="
".str_replace('[##_tb_container_##]',$trackbacksContainer,$skin->trackbacks).'
'; dress('tb_address',"$defaultURL/trackback/$entryId",$trackbacksView); return $trackbacksView; } function getCommentView($entryId,&$skin){ global $database,$blogURL,$service,$owner,$suri,$paging,$blog; $authorized=doesHaveOwnership(); $skinValue=getSkinSetting($owner); $blogSetting=getBlogSetting($owner); if($entryId>0){ $prefix1='rp'; $isComment=true; $SubItem='commentSubItem'; }else{ $prefix1='guest'; $isComment=false; $SubItem='guestSubItem'; } $commentView=($isComment?$skin->comment:$skin->guest); $commentItemsView=''; if($isComment==false){ list($comments,$paging)=getCommentsWithPagingForGuestbook($owner,$suri['page'],$skinValue['commentsOnGuestbook']); foreach($comments as $key=>$value){ if($value['secret']==1&&!$authorized){ $comments[$key]['name']=''; $comments[$key]['homepage']=''; $comments[$key]['comment']=_text('관리자만 볼 수 있는 댓글입니다.'); } } }else{ $comments=getComments($entryId); } foreach($comments as $commentItem){ $commentItemView=($isComment?$skin->commentItem:$skin->guestItem); $commentSubItemsView=''; $subComments=getCommentComments($commentItem['id']); foreach($subComments as $commentSubItem){ $commentSubItemView=($isComment?$skin->commentSubItem:$skin->guestSubItem); if(empty($commentSubItem['homepage'])){ dress($prefix1.'_rep_name',fireEvent(($isComment?'ViewCommenter':'ViewGuestCommenter'),htmlspecialchars($commentSubItem['name']),$commentSubItem),$commentSubItemView); }else{ dress($prefix1.'_rep_name',fireEvent(($isComment?'ViewCommenter':'ViewGuestCommenter'),''.htmlspecialchars($commentSubItem['name']).'',$commentSubItem),$commentSubItemView); } dress($prefix1.'_rep_desc',fireEvent(($isComment?'ViewCommentContent':'ViewGuestCommentContent'),nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment']),' onclick="return openLinkInNewWindow(this)"')),$commentSubItem),$commentSubItemView); dress($prefix1.'_rep_date',fireEvent(($isComment?'ViewCommentDate':'ViewGuestCommentDate'),Timestamp::format5($commentSubItem['written'])),$commentSubItemView); dress($prefix1.'_rep_link',"$blogURL/{$entryId}#comment{$commentSubItem['id']}",$commentSubItemView); dress($prefix1.'_rep_onclick_delete',"deleteComment({$commentSubItem['id']}); return false;",$commentSubItemView); $rp_class=$prefix1.'_general'; if($owner==$commentSubItem['replier']) $rp_class=$prefix1.'_admin'; elseif($commentSubItem['secret']==1){ $rp_class=$prefix1.'_secret'; if(!$authorized) $rp_class.=' hiddenComment'; } dress($prefix1.'_rep_class',$rp_class,$commentSubItemView); if(dress($prefix1.'_rep_id','comment'.$commentSubItem['id'],$commentSubItemView)==false){ $commentSubItemView="".$commentSubItemView; } $commentSubItemsView.=$commentSubItemView; } $commentSubContainer=($isComment?$skin->commentSubContainer:$skin->guestSubContainer); dress(($isComment?'rp2_rep':'guest_reply_rep'),$commentSubItemsView,$commentSubContainer); if(count($subComments)>0){ dress(($isComment?'rp2_container':'guest_reply_container'),$commentSubContainer,$commentItemView); } if(empty($commentItem['homepage'])){ dress($prefix1.'_rep_name',fireEvent(($isComment?'ViewCommenter':'ViewGuestCommenter'),htmlspecialchars($commentItem['name']),$commentItem),$commentItemView); }else{ dress($prefix1.'_rep_name',fireEvent(($isComment?'ViewCommenter':'ViewGuestCommenter'),''.htmlspecialchars($commentItem['name']).'',$commentItem),$commentItemView); } dress($prefix1.'_rep_desc',fireEvent(($isComment?'ViewCommentContent':'ViewGuestCommentContent'),nl2br(addLinkSense(htmlspecialchars($commentItem['comment']),' onclick="return openLinkInNewWindow(this)"')),$commentItem),$commentItemView); dress($prefix1.'_rep_date',fireEvent(($isComment?'ViewCommentDate':'ViewGuestCommentDate'),Timestamp::format5($commentItem['written'])),$commentItemView); if($prefix1=='guest'&&$authorized!=true&&$blogSetting['allowWriteDoubleCommentOnGuestbook']==0){ $doubleCommentPermissionScript='alert(\''._text('댓글을 사용할 수 없습니다.').'\'); return false;'; }else{ $doubleCommentPermissionScript=''; } dress($prefix1.'_rep_onclick_reply',$doubleCommentPermissionScript."commentComment({$commentItem['id']}); return false",$commentItemView); dress($prefix1.'_rep_onclick_delete',"deleteComment({$commentItem['id']});return false",$commentItemView); dress($prefix1.'_rep_link',"$blogURL/{$entryId}#comment{$commentItem['id']}",$commentItemView); $rp_class=$prefix1.'_general'; if($owner==$commentItem['replier']) $rp_class=$prefix1.'_admin'; elseif($commentItem['secret']==1){ $rp_class=$prefix1.'_secret'; if(!$authorized) $rp_class.=' hiddenComment'; } dress($prefix1.'_rep_class',$rp_class,$commentItemView); if(dress($prefix1.'_rep_id','comment'.$commentItem['id'],$commentItemView)==false){ $commentItemView="".$commentItemView; } $commentItemsView.=$commentItemView; } $commentContainer=($isComment?$skin->commentContainer:$skin->guestContainer); dress(($isComment?'rp_rep':'guest_rep'),$commentItemsView,$commentContainer); if(count($comments)>0){ dress($prefix1.'_container',$commentContainer,$commentView); } $acceptComment=fetchQueryCell("SELECT `acceptComment` FROM `{$database['prefix']}Entries` WHERE `id` = $entryId"); $useForm=false; if($isComment){ if(!($skin->commentForm=='')){ $commentRrevView=$commentView; $commentView=$skin->commentForm; $useForm=true; } }else{ if(!($skin->guestForm=='')){ $commentRrevView=$commentView; $commentView=$skin->guestForm; $useForm=true; } } if(doesHaveOwnership()||($isComment&&$acceptComment==1)||($isComment==false)||($useForm==false)){ if(!doesHaveOwnership()){ $commentMemberView=($isComment?$skin->commentMember:$skin->guestMember); if(!doesHaveMembership()){ $commentGuestView=($isComment?$skin->commentGuest:$skin->guestGuest); dress($prefix1.'_input_name','name',$commentGuestView); dress($prefix1.'_input_password','password',$commentGuestView); dress($prefix1.'_input_homepage','homepage',$commentGuestView); if(!empty($_POST["name_$entryId"])) $guestName=htmlspecialchars($_POST["name_$entryId"]); elseif(!empty($_COOKIE['guestName'])) $guestName=htmlspecialchars($_COOKIE['guestName']); else $guestName=''; dress('guest_name',$guestName,$commentGuestView); if(!empty($_POST["homepage_$entryId"])&&$_POST["homepage_$entryId"]!='http://'){ if(strpos($_POST["homepage_$entryId"],'http://')===0) $guestHomepage=htmlspecialchars($_POST["homepage_$entryId"]); else $guestHomepage='http://'.htmlspecialchars($_POST["homepage_$entryId"]); }elseif(!empty($_COOKIE['guestHomepage'])) $guestHomepage=htmlspecialchars($_COOKIE['guestHomepage']); else $guestHomepage='http://'; dress('guest_homepage',$guestHomepage,$commentGuestView); dress($prefix1.($isComment?'_guest':'_form'),$commentGuestView,$commentMemberView); } dress($prefix1.'_input_is_secret','secret',$commentMemberView); dress($prefix1.'_member',$commentMemberView,$commentView); } dress($prefix1.'_input_comment','comment',$commentView); dress($prefix1.'_onclick_submit',"addComment(this, $entryId); return false;",$commentView); dress($prefix1.'_textarea_body','comment',$commentView); dress($prefix1.'_textarea_body_value','',$commentView); }elseif($useForm==true){ $commentView=''; } if($useForm==true){ dress($prefix1.'_input_form',"
".$commentView.'
',$commentRrevView); $commentView=$commentRrevView; }else{ $commentView="
".$commentView.'
'; } return $commentView; } function getCategoriesView($totalPosts,$categories,$selected,$xhtml=false){ global $blogURL,$owner; $tree=array('id'=>0,'label'=>getCategoryNameById($owner,0),'value'=>$totalPosts,'link'=>"$blogURL/category",'children'=>array()); foreach($categories as $category1){ $children=array(); foreach($category1['children'] as $category2){ array_push($children,array('id'=>$category2['id'],'label'=>$category2['name'],'value'=>(doesHaveOwnership()?$category2['entriesInLogin']:$category2['entries']),'link'=>"$blogURL/category/".encodeURL($category2['label']),'children'=>array())); } array_push($tree['children'],array('id'=>$category1['id'],'label'=>$category1['name'],'value'=>(doesHaveOwnership()?$category1['entriesInLogin']:$category1['entries']),'link'=>"$blogURL/category/".encodeURL($category1['label']),'children'=>$children)); } ob_start(); printTreeView($tree,$selected,false,$xhtml); $view=ob_get_contents(); ob_end_clean(); return $view; } function printTreeView($tree,$selected,$embedJava=false,$xhtml=false){ global $skinSetting; $skin=$skinSetting; if($embedJava==false){ $skin=getCategoriesSkin(); } if($xhtml){ echo ''; return ; } $action=0;?> cellpadding="0" cellspacing="0" style="width: 100%;">
cellpadding="0" cellspacing="0">
>
({$tree['value']})";?>
id="category_" cellpadding="0" cellspacing="0">
>
({$row['value']})";?>
=$week*7&&($today+$firstWeekday)<($week+1)*7){ echo ' '.CRLF; }else{ echo ' '.CRLF; } for($weekday=0;$weekday<7;$weekday++){ $day++; $dayString=isset($calendar['days'][$day])?''.$day.'':$day; switch($weekday){ case 0: $className=" cal_day cal_day_sunday"; break; case 1: case 2: case 3: case 4: case 5: case 6: $className=" cal_day"; break; } $className.=$day==$today?" cal_day4":" cal_day3"; if($week==0){ if($weekday<$firstWeekday){ $day--; echo ' '.CRLF; }else{ echo ' '.CRLF; } }elseif($week==($lastWeek-1)){ if($day<=$lastDay){ echo ' '.CRLF; }else{ echo ' '.CRLF; } }else{ echo ' '.CRLF; } } echo ' '.CRLF; if($day>=$lastDay){ break; } }?>
«     »
 '.$dayString.''.$dayString.' '.$dayString.'
".($entry['comments']>0?"({$entry['comments']})":'').'',$view); print $view; } $view=ob_get_contents(); ob_end_clean(); return $view; } function getRecentCommentsView($comments,&$template){ global $blogURL,$skinSetting; ob_start(); foreach($comments as $comment){ $view="$template"; dress('rctrp_rep_link',"$blogURL/{$comment['entry']}#comment{$comment['id']}",$view); dress('rctrp_rep_desc',htmlspecialchars(UTF8::lessenAsEm($comment['comment'],$skinSetting['recentCommentLength'])),$view); dress('rctrp_rep_time',fireEvent('ViewRecentCommentDate',Timestamp::format2($comment['written'])),$view); dress('rctrp_rep_name',htmlspecialchars($comment['name']),$view); print $view; } $view=ob_get_contents(); ob_end_clean(); return $view; } function getRecentTrackbacksView($trackbacks,&$template){ global $blogURL,$skinSetting; ob_start(); foreach($trackbacks as $trackback){ $view="$template"; dress('rcttb_rep_link',"$blogURL/{$trackback['entry']}#trackback{$trackback['id']}",$view); dress('rcttb_rep_desc',htmlspecialchars(UTF8::lessenAsEm($trackback['subject'],$skinSetting['recentTrackbackLength'])),$view); dress('rcttb_rep_time',fireEvent('ViewRecentTrackbackDate',Timestamp::format2($trackback['written'])),$view); dress('rcttb_rep_name',htmlspecialchars(UTF8::lessenAsEm($trackback['site'],$skinSetting['recentTrackbackLength'])),$view); print $view; } $view=ob_get_contents(); ob_end_clean(); return $view; } function getLinksView($links,&$template){ global $blogURL,$skinSetting; ob_start(); foreach($links as $link){ $view="$template"; dress('link_url',htmlspecialchars($link['url']),$view); dress('link_site',fireEvent('ViewLink',htmlspecialchars(UTF8::lessenAsEm($link['name'],$skinSetting['linkLength']))),$view); print $view; } $view=ob_get_contents(); ob_end_clean(); return $view; } function getRandomTagsView($tags,&$template){ global $blogURL; ob_start(); list($maxTagFreq,$minTagFreq)=getTagFrequencyRange(); foreach($tags as $tag){ $view=$template; dress('tag_link',"$blogURL/tag/".encodeURL($tag),$view); dress('tag_name',htmlspecialchars($tag),$view); dress('tag_class',"cloud".getTagFrequency($tag,$maxTagFreq,$minTagFreq),$view); print $view; } $view=ob_get_contents(); ob_end_clean(); return $view; } function getEntryContentView($owner,$id,$content,$keywords=array(),$type='Post',$useAbsolutePath=false,$bRssMode=false){ global $service; $path="../../attach/$owner"; $url="{$service['path']}/attach/$owner"; $view=bindAttachments($id,$path,$url,$content,$useAbsolutePath,$bRssMode); $view=is_array($keywords)?bindKeywords($keywords,$view):$view; $view=bindTags($id,$view); if(!$useAbsolutePath) $view=avoidFlashBorder($view); return fireEvent('View'.$type.'Content',$view,$id); } function bindTags($id,$content){ for($no=0;(($start=strpos($content,'[#M_'))!==false)&&(($end=strpos($content,'_M#]',$start+4))!==false);$no++){ $prefix=substr($content,0,$start); list($more,$less,$full)=explode('|',substr($content,$start+4,$end-$start-4),3); if(strlen($more)==0) $more='more..'; if(strlen($less)==0) $less='less..'; $more2=htmlspecialchars(str_replace("\"",""",str_replace("'","'",$more))); $less2=htmlspecialchars(str_replace("\"",""",str_replace("'","'",$less))); $postfix=substr($content,$end+4); $content=$prefix; { $content.="

$more

$full
"; } $content.=$postfix; } return $content; } function bindKeywords($keywords,$content){ if(empty($keywords)) return $content; $result=preg_split('@( # ]+ )* )? # end of element > # redundant closure need to keep num of capturing patterns to 4 () | # TT special pattern \[\#\#_.*?_\#\#] )@x',$content,-1,PREG_SPLIT_DELIM_CAPTURE); $stack=array(); $buf=''; $i=0; $pattern=array(); foreach($keywords as $keyword) $pattern[]=preg_quote($keyword,'/'); $pattern='/'.implode('|',$pattern).'/e'; while(true){ if(count($stack)){ $buf.=$result[$i]; }else{ $buf.=preg_replace($pattern,'fireEvent("BindKeyword", "$0")',$result[$i]); } if(++$i>=count($result)) break; if($result[$i]{0}=='<'){ if($result[$i]{1}=='/'){ $index=array_search(strtolower($result[$i+1]),$stack); if($index===false){ $stack=array(); }else{ array_splice($stack,0,$index+1); } }else{ if(!in_array(strtolower($result[$i+1]),array('br','hr','img'))) array_unshift($stack,strtolower($result[$i+1])); } $buf.=$result[$i]; $i+=4; }else{ $buf.=$result[$i++]; } } return $buf; } function bindAttachments($entryId,$folderPath,$folderURL,$content,$useAbsolutePath=false,$bRssMode=false){ global $service,$owner,$hostURL,$blogURL; $view=str_replace('[##_ATTACH_PATH_##]',($useAbsolutePath?"$hostURL{$service['path']}/attach/$owner":$folderURL),$content); $view=str_replace('http://tt_attach_path/',($useAbsolutePath?"$hostURL{$service['path']}/attach/$owner/":($folderURL.'/')),$view); $count=0; $bWritedGalleryJS=false; while((($start=strpos($view,'[##_'))!==false)&&(($end=strpos($view,'_##]',$start+4))!==false)){ $count++; $attributes=explode('|',substr($view,$start+4,$end-$start-4)); $prefix=''; $postfix=''; $buf=''; if($attributes[0]=='Gallery'){ if(count($attributes)%2==1) array_pop($attributes); if(defined('__TATTERTOOLS_MOBILE__')||($bRssMode==true)){ $images=array_slice($attributes,1,count($attributes)-2); for($i=0;$i'; elseif(strlen($images[$i])>0) $buf.="
$images[$i]
"; } } }else{ $id="gallery$entryId$count"; $cssId="tt-gallery-$entryId-$count"; $items=array(); for($i=1;$i'.CRLF; $buf.=' '.CRLF; $buf.=' '.CRLF; $buf.=''.CRLF; } }elseif($attributes[0]=='iMazing'){ if(defined('__TATTERTOOLS_MOBILE__')||($bRssMode==true)){ $images=array_slice($attributes,1,count($attributes)-3); for($i=0;$i'; } $buf.=$attributes[count($attributes)-1]; }else{ $params=getAttributesFromString($attributes[sizeof($attributes)-2]); $id=$entryId.$count; $imgs=array_slice($attributes,1,count($attributes)-3); $imgStr=''; for($i=0;$i'; }else{ $caption=''; } $buf.='
'._text('확대').''; $buf.=''; $buf.=''; $buf.=''; $buf.=''; $buf.='
'; $buf.='
_'; $buf.='
'.$caption.'
'; } }elseif($attributes[0]=='Jukebox'){ { $params=getAttributesFromString($attributes[sizeof($attributes)-2]); foreach($params as $key=>$value){ if($key=='autoPlay'){ unset($params['autoplay']); $params['autoplay']=$value; } } if($params['visible']==1){ $width='250px'; $height='27px'; }else{ $width='0px'; $height='0px'; } $id=$entryId.$count; $imgs=array_slice($attributes,1,count($attributes)-3); $imgStr=''; for($i=0;$i'; }else{ $caption=''; } $buf='
'; $buf.='
'; $buf.='_'; $buf.='
'.$caption.'
'; } }else{ $contentWidth=getContentWidth(); switch(count($attributes)){ case 4: list($newProperty,$onclickFlag)=createNewProperty($attributes[1],$contentWidth,$attributes[2]); { if(trim($attributes[3])==''){ $caption=''; }else{ $caption='

'.$attributes[3].'

'; } switch($attributes[0]){ case '1L': $prefix='
'; break; case '1R': $prefix='
'; break; case '1C': default: $prefix='
'; break; } $buf=$prefix.getAttachmentBinder($attributes[1],$newProperty,$folderPath,$folderURL,1,$useAbsolutePath,$bRssMode,$onclickFlag).$caption.'
'; } break; case 7: $eachImageWidth=floor(($contentWidth-5*3)/2); list($newProperty1,$onclickFlag1)=createNewProperty($attributes[1],$eachImageWidth,$attributes[2]); list($newProperty2,$onclickFlag2)=createNewProperty($attributes[4],$eachImageWidth,$attributes[5]); { $cap1=strlen(trim($attributes[3]))>0?'

'.$attributes[3].'

':''; $cap2=strlen(trim($attributes[6]))>0?'

'.$attributes[6].'

':''; $buf='
'.getAttachmentBinder($attributes[1],$newProperty1,$folderPath,$folderURL,2,$useAbsolutePath,$bRssMode,$onclickFlag1).$cap1.''.getAttachmentBinder($attributes[4],$newProperty2,$folderPath,$folderURL,2,$useAbsolutePath,$bRssMode,$onclickFlag2).$cap2.'
'; } break; case 10: $eachImageWidth=floor(($contentWidth-5*4)/3); list($newProperty1,$onclickFlag1)=createNewProperty($attributes[1],$eachImageWidth,$attributes[2]); list($newProperty2,$onclickFlag2)=createNewProperty($attributes[4],$eachImageWidth,$attributes[5]); list($newProperty3,$onclickFlag3)=createNewProperty($attributes[7],$eachImageWidth,$attributes[8]); { $cap1=strlen(trim($attributes[3]))>0?'

'.$attributes[3].'

':''; $cap2=strlen(trim($attributes[6]))>0?'

'.$attributes[6].'

':''; $cap3=strlen(trim($attributes[9]))>0?'

'.$attributes[9].'

':''; $buf='
'.getAttachmentBinder($attributes[1],$newProperty1,$folderPath,$folderURL,3,$useAbsolutePath,$bRssMode,$onclickFlag1).$cap1.''.getAttachmentBinder($attributes[4],$newProperty2,$folderPath,$folderURL,3,$useAbsolutePath,$bRssMode,$onclickFlag2).$cap2.''.getAttachmentBinder($attributes[7],$newProperty3,$folderPath,$folderURL,3,$useAbsolutePath,$bRssMode,$onclickFlag3).$cap3.'
'; } break; } } $view=substr($view,0,$start).$buf.substr($view,$end+4); } return $view; } function getAttachmentBinder($filename,$property,$folderPath,$folderURL,$imageBlocks=1,$useAbsolutePath=false,$bRssMode=false,$onclickFlag=false){ global $database,$skinSetting,$service,$owner,$blogURL,$hostURL,$waterMarkArray,$paddingArray,$serviceURL; $path="$folderPath/$filename"; if($useAbsolutePath) $url="$serviceURL/attach/$owner/$filename"; else $url="$folderURL/$filename"; $fileInfo=getAttachmentByOnlyName($owner,$filename); switch(getFileExtension($filename)){ case 'jpg': case 'jpeg': case 'gif': case 'png': case 'bmp': $bPassing=false; { if(($onclickFlag==true)&&($bRssMode==false)&&($bPassing==false)){ $imageStr=''; }else{ $imageStr=''; } return makeThumbnail(fireEvent('ViewAttachedImage',$imageStr,$path),$path,$paddingArray,$waterMarkArray,$useAbsolutePath); } break; case 'swf': $id=md5($url).rand(1,10000); if(($useAbsolutePath)&&(strncasecmp($url,'http://',7)==0)) $url=substr($url,7); return "_"; break; case 'wmv': case 'avi': case 'asf': case 'mpg': case 'mpeg': $id=md5($url).rand(1,10000); if(($useAbsolutePath)&&(strncasecmp($url,'http://',7)==0)) $url=substr($url,7); return "_"; break; case 'mp3': case 'mp2': case 'wma': case 'wav': case 'mid': case 'midi': $id=md5($url).rand(1,10000); if(($useAbsolutePath)&&(strncasecmp($url,'http://',7)==0)) $url=substr($url,7); return "_"; break; case 'mov': $id=md5($url).rand(1,10000); return "_"; break; default: if(file_exists(ROOT.'/image/extension/'.getFileExtension($filename).'.gif')){ return ''.fireEvent('ViewAttachedFileExtension','').' '.htmlspecialchars($fileInfo['label']).''; }else{ return ''.fireEvent('ViewAttachedFileExtension','').' '.htmlspecialchars($fileInfo['label']).''; } break; } } function printScript($filename,$obfuscate=true){ global $service,$hostURL,$blogURL; if(!$file=@file_get_contents("../../script/$filename")) return ''; $file=""; } function createNewProperty($filename,$imageWidth,$property){ global $owner; if(!file_exists("../../attach/$owner/$filename")) return array($property,false); if($tempInfo=getimagesize("../../attach/$owner/$filename")){ list($originWidth,$originHeight,$type,$attr)=$tempInfo; }else{ return array($property,false); } if(eregi('width="([0-9]*%?)"',$property,$temp)){ $currentWidth=$temp[1]; if(eregi("^([0-9]+)%$",$currentWidth)){ $currentWidth=$originWidth*($temp[1]/100); } }else{ $property.=' width="1"'; } if(eregi('height="([0-9]*%?)"',$property,$temp)){ $currentHeight=$temp[1]; if(eregi("^([0-9]+)%$",$currentHeight)){ $currentHeight=$originHeight*($temp[1]/100); } }else{ $property.=' height="1"'; } if(isset($currentWidth)&&!isset($currentHeight)){ $currentHeight=floor($originHeight*$currentWidth/$originWidth); }elseif(!isset($currentWidth)&&isset($currentHeight)){ $currentWidth=floor($originWidth*$currentHeight/$originHeight); }elseif(!isset($currentWidth)&&!isset($currentHeight)){ $currentWidth=$originWidth; $currentHeight=$originHeight; } if($currentWidth>$imageWidth){ $tempWidth=$imageWidth; $tempHeight=floor($currentHeight*$imageWidth/$currentWidth); }else{ $tempWidth=$currentWidth; $tempHeight=$currentHeight; } $property=eregi_replace('(^| )width="([0-9]+%?)"','\1width="'.$tempWidth.'"',$property); $property=eregi_replace('(^| )height="([0-9]+%?)"','\1height="'.$tempHeight.'"',$property); if($originWidth>$tempWidth||$originHeight>$tempHeight){ $onclickFlag=true; }else{ $onclickFlag=false; } return array($property,$onclickFlag); } class Skin{ var $outter; var $skin; var $list; var $listItem; var $commentList; var $commentListItem; var $rss; var $rss_date; var $rss_rep; var $keywordItem; var $keywordGroup; var $keyword; var $noticeItem; var $recentNotice; var $recentNoticeItem; var $locative; var $locativeSpot; var $locativeEntry; var $guest; var $guestForm; var $guestGuest; var $guestMember; var $guestContainer; var $guestItem; var $guestSubContainer; var $guestSubItem; var $search; var $recentEntry; var $recentComments; var $recentTrackback; var $management; var $entryProtected; var $entry; var $paging; var $pagingItem; var $archive; var $s_ps; var $s_ps_rep; var $comment; var $commentCount; var $commentForm; var $commentGuest; var $commentMember; var $commentContainer; var $commentItem; var $commentSubContainer; var $commentSubItem; var $trackbacks; var $trackbackContainer; var $trackback; var $trackbackCount; var $tagLabel; var $siteTag; var $siteTagItem; var $randomTags; var $s_link_rep; var $aux; var $sidebarBasicModules=array(); var $sidebarStorage=array(); var $sidebarOriginalContent=array(); var $sidebarName=array(); var $noneCommentMessage; var $singleCommentMessage; var $noneTrackbackMessage; var $singleTrackbackMessage; function Skin($name,$previewMode=false){ global $service,$blogURL; global $owner; $this->noneCommentMessage=getUserSetting('noneCommentMessage'); $this->singleCommentMessage=getUserSetting('singleCommentMessage'); $this->noneTrackbackMessage=getUserSetting('noneTrackbackMessage'); $this->singleTrackbackMessage=getUserSetting('singleTrackbackMessage'); if(strncmp($name,'customize/',10)==0){ $name="customize/$owner"; }else{ $name=Path::getBaseName($name); } if(($name=='.')||($name=='..')){ respondErrorPage(_text('스킨 정보가 존재하지 않습니다.'),_text('로그인'),$blogURL."/owner"); } $filename="../../skin/$name/skin.html"; if(!is_file($filename)){ respondErrorPage(_text('스킨 정보가 존재하지 않습니다.'),_text('로그인'),$blogURL."/owner"); } if(!$sval=file_get_contents($filename)) respondErrorPage(_text('스킨 정보가 존재하지 않습니다.'),_text('로그인'),$blogURL."/owner"); $sval=replaceSkinTag($sval,'html'); $sval=replaceSkinTag($sval,'head'); $sval=replaceSkinTag($sval,'body'); handleTags($sval); $sidebarCount=0; $noNameCount=1; while(ereg("",$sval)){ if(!isset($this->sidebarBasicModules[$sidebarCount])) $this->sidebarBasicModules[$sidebarCount]=array(); list($sval,$this->sidebarOriginalContent[$sidebarCount])=$this->cutSkinTag($sval,"sidebar","[##_sidebar_{$sidebarCount}_##]"); $moduleCount=0; $matchcount=preg_match_all('@.*@isU',$this->sidebarOriginalContent[$sidebarCount],$matches); if($matchcount!==false){ $rgSidebarContent=$matches[0]; }else{ $rgSidebarContent=array(); } for($i=0;$i/",$rgSidebarContent[$i],$temp); if(isset($temp[1])){ $tempTitle=trim($temp[1]); }else{ $tempTitle=_f('(이름 없음 %1)',$noNameCount); $noNameCount++; } $this->sidebarBasicModules[$sidebarCount][$moduleCount]=array('title'=>$tempTitle,'body'=>$rgSidebarContent[$i]); $moduleCount++; } $matchcount=preg_match('@@',$this->sidebarOriginalContent[$sidebarCount],$matches,PREG_OFFSET_CAPTURE); if($matchcount===false){ $firstPos=strlen($this->sidebarOriginalContent[$sidebarCount]); }else{ $firstPos=$matches[0][1]; } preg_match("//",substr($this->sidebarOriginalContent[$sidebarCount],0,$firstPos-1),$temp); if(isset($temp[1])){ $tempTitle=trim($temp[1]); }else{ $tempTitle=_t('사이드바').' '.($sidebarCount+1); } $this->sidebarName[$sidebarCount]=$tempTitle; $sidebarCount++; } handleSidebars($sval,$this,$previewMode); $sval=str_replace('./',"{$service['path']}/skin/$name/",$sval); list($sval,$this->listItem)=$this->cutSkinTag($sval,'list_rep'); list($sval,$this->list)=$this->cutSkinTag($sval,'list'); list($sval,$this->commentListItem)=$this->cutSkinTag($sval,'rplist_rep'); list($sval,$this->commentList)=$this->cutSkinTag($sval,'rplist'); list($sval,$this->rss_rep)=$this->cutSkinTag($sval,'rss_rep'); list($sval,$this->rss_date)=$this->cutSkinTag($sval,'rss_date'); list($sval,$this->rss)=$this->cutSkinTag($sval,'rss'); list($sval,$this->keywordItem)=$this->cutSkinTag($sval,'keyword_rep'); list($sval,$this->keywordGroup)=$this->cutSkinTag($sval,'keyword_date_rep'); list($sval,$this->keyword)=$this->cutSkinTag($sval,'keyword'); list($sval,$this->noticeItem)=$this->cutSkinTag($sval,'notice_rep'); list($sval,$this->recentNoticeItem)=$this->cutSkinTag($sval,'rct_notice_rep'); list($sval,$this->recentNotice)=$this->cutSkinTag($sval,'rct_notice'); list($sval,$this->locativeEntry)=$this->cutSkinTag($sval,'local_info_rep'); list($sval,$this->locativeSpot)=$this->cutSkinTag($sval,'local_spot_rep'); list($sval,$this->locative)=$this->cutSkinTag($sval,'local'); list($sval,$this->guestSubContainer)=$this->cutSkinTag($sval,'guest_reply_container'); if($this->guestSubContainer==''){ $this->guestSubContainer='[##_guest_reply_rep_##]'; list($sval,$this->guestSubItem)=$this->cutSkinTag($sval,'guest_reply_rep','[##_guest_reply_container_##]'); }else{ list($this->guestSubContainer,$this->guestSubItem)=$this->cutSkinTag($this->guestSubContainer,'guest_reply_rep'); } list($sval,$this->guestContainer)=$this->cutSkinTag($sval,'guest_container'); if($this->guestContainer==''){ $this->guestContainer='[##_guest_rep_##]'; list($sval,$this->guestItem)=$this->cutSkinTag($sval,'guest_rep','[##_guest_container_##]'); }else{ list($this->guestContainer,$this->guestItem)=$this->cutSkinTag($this->guestContainer,'guest_rep'); } list($sval,$this->guestGuest)=$this->cutSkinTag($sval,'guest_form'); list($sval,$this->guestMember)=$this->cutSkinTag($sval,'guest_member'); list($sval,$this->guestForm)=$this->cutSkinTag($sval,'guest_input_form'); list($sval,$this->guest)=$this->cutSkinTag($sval,'guest'); list($sval,$this->entryProtected)=$this->cutSkinTag($sval,'article_protected'); list($sval,$this->management)=$this->cutSkinTag($sval,'ad_div'); list($sval,$this->trackbackCount)=$this->cutSkinTag($sval,'tb_count'); if($this->trackbackCount==''){ list($sval,$this->trackbackCount)=$this->cutSkinReplacer($sval,'article_rep_tb_cnt','[##_tb_count_##]'); $this->noneTrackbackMessage=''; $this->singleTrackbackMessage=''; } list($sval,$this->commentCount)=$this->cutSkinTag($sval,'rp_count'); if($this->commentCount==''){ list($sval,$this->commentCount)=$this->cutSkinReplacer($sval,'article_rep_rp_cnt','[##_rp_count_##]'); $this->noneCommentMessage=''; $this->singleCommentMessage=''; } list($sval,$this->trackbackContainer)=$this->cutSkinTag($sval,'tb_container'); if($this->trackbackContainer==''){ $this->trackbackContainer='[##_tb_rep_##]'; list($sval,$this->trackback)=$this->cutSkinTag($sval,'tb_rep','[##_tb_container_##]'); }else{ list($this->trackbackContainer,$this->trackback)=$this->cutSkinTag($this->trackbackContainer,'tb_rep'); } list($sval,$this->trackbacks)=$this->cutSkinTag($sval,'tb'); list($sval,$this->tagLabel)=$this->cutSkinTag($sval,'tag_label'); list($sval,$this->siteTagItem)=$this->cutSkinTag($sval,'tag_rep'); list($sval,$this->siteTag)=$this->cutSkinTag($sval,'tag'); list($sval,$this->randomTags)=$this->cutSkinTag($sval,'random_tags'); list($sval,$this->commentSubContainer)=$this->cutSkinTag($sval,'rp2_container'); if($this->commentSubContainer==''){ $this->commentSubContainer='[##_rp2_rep_##]'; list($sval,$this->commentSubItem)=$this->cutSkinTag($sval,'rp2_rep','[##_rp2_container_##]'); }else{ list($this->commentSubContainer,$this->commentSubItem)=$this->cutSkinTag($this->commentSubContainer,'rp2_rep'); } list($sval,$this->commentContainer)=$this->cutSkinTag($sval,'rp_container'); if($this->commentContainer==''){ $this->commentContainer='[##_rp_rep_##]'; list($sval,$this->commentItem)=$this->cutSkinTag($sval,'rp_rep','[##_rp_container_##]'); }else{ list($this->commentContainer,$this->commentItem)=$this->cutSkinTag($this->commentContainer,'rp_rep'); } list($sval,$this->commentGuest)=$this->cutSkinTag($sval,'rp_guest'); list($sval,$this->commentMember)=$this->cutSkinTag($sval,'rp_member'); list($sval,$this->commentForm)=$this->cutSkinTag($sval,'rp_input_form'); list($sval,$this->comment)=$this->cutSkinTag($sval,'rp'); list($sval,$this->entry)=$this->cutSkinTag($sval,'article_rep'); list($sval,$this->pagingItem)=$this->cutSkinTag($sval,'paging_rep'); list($sval,$this->paging)=$this->cutSkinTag($sval,'paging'); list($sval,$this->archive)=$this->cutSkinTag($sval,'archive_rep'); list($sval,$this->search)=$this->cutSkinTag($sval,'search'); list($sval,$this->recentEntry)=$this->cutSkinTag($sval,'rctps_rep'); list($sval,$this->recentComments)=$this->cutSkinTag($sval,'rctrp_rep'); list($sval,$this->recentTrackback)=$this->cutSkinTag($sval,'rcttb_rep'); list($sval,$this->s_link_rep)=$this->cutSkinTag($sval,'link_rep'); list($sval,$this->skin)=$this->cutSkinTag($sval,'t3'); $this->outter=$sval; } function cutSkinTag($contents,$tag,$replace=null){ if(is_null($replace)){ $replace="[##_{$tag}_##]"; } $tagSize=strlen($tag)+4; $begin=strpos($contents,""); if($begin===false) return array($contents,NULL); $end=strpos($contents,"",$begin+4); if($end===false) return array($contents,NULL); $inner=substr($contents,$begin+$tagSize,$end-$begin-$tagSize); $outter=substr($contents,0,$begin).$replace.substr($contents,$end+$tagSize+1); return array($outter,$inner); } function cutSkinReplacer($contents,$tag,$replace=null){ if(is_null($replace)){ $replace="[##_{$tag}_##]"; } $tagSize=strlen("[##_{$tag}_##]"); $pos=strpos($contents,"[##_{$tag}_##]"); if($pos===false){ return array($contents,''); } $inner="[##_{$tag}_##]"; $outter=substr($contents,0,$pos).$replace.substr($contents,$pos+$tagSize); return array($outter,$inner); } } function removeAllTags($contents){ $contents=preg_replace('/\[#M_[^|]*\|[^|]*\|/Us','',str_replace('_M#]','',preg_replace('/\[##_.+_##\]/Us','',$contents))); $contents=preg_replace('@(@','',$contents); return $contents; } function replaceSkinTag($contents,$tag){ $pattern[]='/(<'.$tag.'.*>)\r?\n/Ui'; $pattern[]='/<\/'.$tag.'>/Ui'; $replacement[]='$1'.CRLF.'[##_SKIN_'.$tag.'_start_##]'; $replacement[]='[##_SKIN_'.$tag.'_end_##]$0'; return preg_replace($pattern,$replacement,$contents); } header('Content-Type: text/html; charset=utf-8'); if(false){ fetchConfigVal(); } list($entries,$paging)=getEntriesWithPagingByNotice($owner,$suri['page'],$blog['entriesOnPage']); updateVisitorStatistics($owner); $stats=getStatistics($owner); if(!empty($entries)&&(count($entries)==1)) $pageTitle=$entries[0]['title']; else $pageTitle=''; if(!isset($skin)) $skin=new Skin($skinSetting['skin']); $view=str_replace('[##_t3_##]',getUpperView(isset($paging)?$paging:null).$skin->skin.getLowerView().getScriptsOnFoot(),$skin->outter); if($suri['directive']=='/'){ dress('body_id',"tt-body-page",$view); }elseif(!empty($category)){ dress('body_id',getCategoryBodyIdById($owner,$category)?getCategoryBodyIdById($owner,$category):'tt-body-category',$view); }elseif(!empty($search)){ dress('body_id',"tt-body-search",$view); }elseif(!empty($period)){ dress('body_id',"tt-body-archive",$view); }else{ dress('body_id',"tt-body-".ltrim($suri['directive'],'/'),$view); } $entriesView=''; foreach($entries as $entry){ if($suri['directive']=='/notice') $permalink="$blogURL/notice/{$entry['id']}"; elseif($suri['directive']=='/page') $permalink="$blogURL/page/{$entry['id']}"; else $permalink="$blogURL/".($blog['useSlogan']?"entry/".encodeURL($entry['slogan']):$entry['id']); if($entry['category']==-2){ $entryView=$skin->noticeItem; dress('notice_rep_date',fireEvent('ViewNoticeDate',Timestamp::format5($entry['published'])),$entryView); dress('notice_rep_title',htmlspecialchars(fireEvent('ViewNoticeTitle',$entry['title'],$entry['id'])),$entryView); if($suri['directive']=='/notice') dress('notice_rep_link',"$blogURL/notice/{$entry['id']}",$entryView); else dress('notice_rep_link',"$blogURL/page/{$entry['id']}",$entryView); dress('notice_rep_desc',getEntryContentView($owner,$entry['id'],$entry['content'],getKeywordNames($owner),'Notice'),$entryView); $entriesView.=$entryView; }elseif(doesHaveOwnership()||($entry['visibility']>=2)||(isset($_COOKIE['GUEST_PASSWORD'])&&(trim($_COOKIE['GUEST_PASSWORD'])==trim($entry['password'])))){ $entryView=$skin->entry; dress('tb',getTrackbacksView($entry['id'],$skin),$entryView); if($skinSetting['expandComment']==1||(($suri['url']!=$blogURL.'/index.php'&&$suri['url']!=$service['path'].'/index.php')&&($suri['directive']=='/'||$suri['directive']=='/entry')&&$suri['value']!='')){ $style='block'; }else{ $style='none'; } dress('rp',"
".getCommentView($entry['id'],$skin).'
',$entryView); $tagLabelView=$skin->tagLabel; $entryTags=getTags($entry['id']); if(sizeof($entryTags)>0){ $tags=array(); foreach($entryTags as $entryTag) array_push($tags,"'.htmlspecialchars($entryTag['name']).''); $tags=fireEvent('ViewTagLists',$tags,$entry['id']); dress('tag_label_rep',implode(",\r\n",$tags),$tagLabelView); dress('tag_label',$tagLabelView,$entryView); } if(doesHaveOwnership()){ $managementView=$skin->management; dress('s_ad_m_link',"$blogURL/owner/entry/edit/{$entry['id']}?returnURL=".(@$service['useEncodedURL']?$permalink:str_replace('%2F','/',rawurlencode($permalink))),$managementView); dress('s_ad_m_onclick',"editEntry({$entry['id']},'".(@$service['useEncodedURL']?$permalink:str_replace('%2F','/',rawurlencode($permalink)))."'); return false;",$managementView); dress('s_ad_s1_label',getEntryVisibilityName($entry['visibility']),$managementView); if($entry['visibility']<2){ dress('s_ad_s2_label',_text('공개로 변경합니다'),$managementView); dress('s_ad_s2_onclick',"changeVisibility({$entry['id']}, 2); return false;",$managementView); }else{ dress('s_ad_s2_label',_text('비공개로 변경합니다'),$managementView); dress('s_ad_s2_onclick',"changeVisibility({$entry['id']}, 0); return false;",$managementView); } dress('s_ad_t_onclick',"sendTrackback({$entry['id']}); return false;",$managementView); dress('s_ad_d_onclick',"deleteEntry({$entry['id']}); return false;",$managementView); dress('ad_div',$managementView,$entryView); } dress('article_rep_id',$entry['id'],$entryView); dress('article_rep_link',$permalink,$entryView); dress('article_rep_title',htmlspecialchars(fireEvent('ViewPostTitle',$entry['title'],$entry['id'])),$entryView); dress('article_rep_desc',getEntryContentView($owner,$entry['id'],$entry['content'],getKeywordNames($owner)),$entryView); dress('article_rep_category',htmlspecialchars(empty($entry['category'])?_text('분류없음'):$entry['categoryLabel'],$entry['id']),$entryView); dress('article_rep_category_link',"$blogURL/category/".encodeURL($entry['categoryLabel']),$entryView); dress('article_rep_date',fireEvent('ViewPostDate',Timestamp::format5($entry['published'])),$entryView); dress('entry_archive_link',"$blogURL/archive/".Timestamp::getDate($entry['published']),$entryView); if($entry['acceptComment']||($entry['comments']>0)) dress('article_rep_rp_link',"toggleLayer('entry{$entry['id']}Comment'); return false",$entryView); else dress('article_rep_rp_link',"alert('"._text('이 글에는 댓글을 달 수 없습니다.')."'); return false",$entryView); list($tempTag,$commentView)=getCommentCountPart($entry['comments'],$skin); dress($tempTag,"{$commentView}",$entryView); if($entry['acceptTrackback']||($entry['trackbacks']>0)) dress('article_rep_tb_link',"toggleLayer('entry{$entry['id']}Trackback'); return false",$entryView); else dress('article_rep_tb_link',"alert('"._text('이 글에는 글을 걸 수 없습니다.')."'); return false",$entryView); list($tempTag,$trackbackView)=getTrackbackCountPart($entry['trackbacks'],$skin); dress($tempTag,$trackbackView,$entryView); $entriesView.=$entryView; }else{ $protectedEntryView=$skin->entryProtected; dress('article_rep_id',$entry['id'],$protectedEntryView); dress('article_rep_link',$permalink,$protectedEntryView); dress('article_rep_title',htmlspecialchars(fireEvent('ViewPostTitle',$entry['title'],$entry['id'])),$protectedEntryView); dress('article_rep_date',fireEvent('ViewPostDate',Timestamp::format5($entry['published'])),$protectedEntryView); dress('article_password',"entry{$entry['id']}password",$protectedEntryView); dress('article_dissolve',"reloadEntry({$entry['id']});",$protectedEntryView); if(isset($_POST['partial'])) $entriesView.=$protectedEntryView; else $entriesView.="
$protectedEntryView
"; } } dress('article_rep',$entriesView,$view); $writer=fetchQueryCell("SELECT name FROM {$database['prefix']}Users WHERE userid = $owner"); $pageTitle=trim($pageTitle); dress('page_title',htmlspecialchars($pageTitle),$view); dress('blogger',htmlspecialchars($writer),$view); dress('title',htmlspecialchars($blog['title']),$view); dress('desc',htmlspecialchars($blog['description']),$view); if(!empty($blog['logo'])) dress('image',"{$service['path']}/attach/$owner/{$blog['logo']}",$view); else dress('image',"{$service['path']}/image/spacer.gif",$view); dress('blog_link',"$blogURL/",$view); dress('keylog_link',"$blogURL/keylog",$view); dress('localog_link',"$blogURL/location",$view); dress('taglog_link',"$blogURL/tag",$view); dress('guestbook_link',"$blogURL/guestbook",$view); $searchView=$skin->search; dress('search_name','search',$searchView); dress('search_text',isset($search)?htmlspecialchars($search):'',$searchView); dress('search_onclick_submit',"try{window.location.href='$blogURL/search/' + document.getElementsByName('search')[0].value.replaceAll('%', '%25'); return false;}catch(e){}",$searchView); dress('search',$searchView,$view); $totalPosts=getEntriesTotalCount($owner); $categories=getCategories($owner); dress('category',getCategoriesView($totalPosts,$categories,isset($category)?$category:true),$view); dress('category_list',getCategoriesView($totalPosts,$categories,isset($category)?$category:true,true),$view); dress('count_total',$stats['total'],$view); dress('count_today',$stats['today'],$view); dress('count_yesterday',$stats['yesterday'],$view); dress('archive_rep',getArchivesView(getArchives($owner),$skin->archive),$view); dress('calendar',getCalendarView(getCalendar($owner,isset($period)?$period:true)),$view); dress('random_tags',getRandomTagsView(getRandomTags($owner),$skin->randomTags),$view); $noticeView=$skin->recentNotice; $notices=getNotices($owner); if(sizeof($notices)>0){ $itemsView=''; foreach($notices as $notice){ $itemView=$skin->recentNoticeItem; dress('notice_rep_title',htmlspecialchars(fireEvent('ViewNoticeTitle',UTF8::lessenAsEm($notice['title'],$skinSetting['recentNoticeLength']),$notice['id'])),$itemView); dress('notice_rep_link',"$blogURL/notice/{$notice['id']}",$itemView); $itemsView.=$itemView; } dress('rct_notice_rep',$itemsView,$noticeView); dress('rct_notice',$noticeView,$view); } dress('rctps_rep',getRecentEntriesView(getRecentEntries($owner),$skin->recentEntry),$view); dress('rctrp_rep',getRecentCommentsView(getRecentComments($owner),$skin->recentComments),$view); dress('rcttb_rep',getRecentTrackbacksView(getRecentTrackbacks($owner),$skin->recentTrackback),$view); dress('link_rep',getLinksView(getLinks($owner),$skin->s_link_rep),$view); dress('rss_url',"$blogURL/rss",$view); dress('owner_url',"$blogURL/owner",$view); dress('tattertools_name',TATTERTOOLS_NAME,$view); dress('tattertools_version',TATTERTOOLS_VERSION,$view); if(isset($paging)) dress('paging',getPagingView($paging,$skin->paging,$skin->pagingItem),$view); $sidebarElements=array_keys($skin->sidebarStorage); foreach($sidebarElements as $element){ dress($element,$skin->sidebarStorage[$element],$view); } $view=removeAllTags($view); print $view;?>