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 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 executeQuery($query){ return mysql_query($query)?true:false; } 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 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"); } 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 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 notifyComment(){ global $database,$owner,$service,$blog,$defaultURL; $sql=" select CN.*, CNQ.id AS queueId, CNQ.commentId AS commentId, CNQ.sendStatus AS sendStatus, CNQ.checkDate AS checkDate, CNQ.written AS queueWritten from {$database['prefix']}CommentsNotifiedQueue AS CNQ LEFT JOIN {$database['prefix']}Comments AS CN ON CNQ.commentId = CN.id where CNQ.sendStatus = '0' and CN.parent is not null ORDER BY CNQ.id ASC limit 0, 1 "; $queue=fetchQueryRow($sql); if(empty($queue)&&empty($queue['queueId'])){ return false; } $comments=(fetchQueryRow("SELECT * FROM {$database['prefix']}Comments WHERE owner = $owner AND id = {$queue['commentId']}")); if(empty($comments['parent'])||$comments['secret']==1){ executeQuery("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}"); return false; } $parentComments=(fetchQueryRow("SELECT * FROM {$database['prefix']}Comments WHERE owner = $owner AND id = {$comments['parent']}")); if(empty($parentComments['homepage'])){ executeQuery("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}"); return false; } $entry=(fetchQueryRow("SELECT * FROM {$database['prefix']}Entries WHERE owner = $owner AND id={$comments['entry']}")); if($entry['id']==0){ $r1_comment_check_url=rawurlencode("$defaultURL/guestbook#comment".$parentComments['id']); $r2_comment_check_url=rawurlencode("$defaultURL/guestbook#comment".$comments['id']); }else{ $r1_comment_check_url=rawurlencode("$defaultURL/".($blog['useSlogan']?"entry/{$entry['slogan']}":$entry['id'])."#comment".$parentComments['id']); $r2_comment_check_url=rawurlencode("$defaultURL/".($blog['useSlogan']?"entry/{$entry['slogan']}":$entry['id'])."#comment".$comments['id']); } $data="url=".rawurlencode($defaultURL)."&mode=fb"."&s_home_title=".rawurlencode($blog['title'])."&s_post_title=".rawurlencode($entry['title'])."&s_name=".rawurlencode($comments['name'])."&s_no=".rawurlencode($comments['entry'])."&s_url=".rawurlencode("$defaultURL/".($blog['useSlogan']?"entry/{$entry['slogan']}":$entry['id']))."&r1_name=".rawurlencode($parentComments['name'])."&r1_no=".rawurlencode($parentComments['id'])."&r1_pno=".rawurlencode($comments['entry'])."&r1_rno=0"."&r1_homepage=".rawurlencode($parentComments['homepage'])."&r1_regdate=".rawurlencode($parentComments['written'])."&r1_url=".$r1_comment_check_url."&r2_name=".rawurlencode($comments['name'])."&r2_no=".rawurlencode($comments['id'])."&r2_pno=".rawurlencode($comments['entry'])."&r2_rno=".rawurlencode($comments['parent'])."&r2_homepage=".rawurlencode($comments['homepage'])."&r2_regdate=".rawurlencode($comments['written'])."&r2_url=".$r2_comment_check_url."&r1_body=".rawurlencode($parentComments['comment'])."&r2_body=".rawurlencode($comments['comment']); requireComponent('Eolin.PHP.HTTPRequest'); if(strpos($parentComments['homepage'],"http://")===false){ $homepage='http://'.$parentComments['homepage']; }else{ $homepage=$parentComments['homepage']; } $request=new HTTPRequest('POST',$homepage); $request->contentType='application/x-www-form-urlencoded; charset=utf-8'; $request->content=$data; if($request->send()){ $xmls=new XMLStruct(); if($xmls->open($request->responseText)){ $result=$xmls->selectNode('/response/error/'); if($result['.value']!='1'&&$result['.value']!='0'){ $homepage=rtrim($homepage,'/').'/index.php'; $request=new HTTPRequest('POST',$homepage); $request->contentType='application/x-www-form-urlencoded; charset=utf-8'; $request->content=$data; if($request->send()){ } } } }else{ } executeQuery("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE id={$queue['queueId']}"); } 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 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 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 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 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;?> 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 lyricnude redhead dude nude redhead dude mount php strip line return php strip line return experiment watch pron movies watch pron movies clean feminized by transvestite feminized by transvestite am jjj sex archive jjj sex archive season adult breast feading adult breast feading invent register sex offender records register sex offender records death linda hayden nude linda hayden nude agree brutal muscle men nude brutal muscle men nude center youngest girls pissing youngest girls pissing crease peter behrens the kiss peter behrens the kiss kept dirt tv show nude dirt tv show nude try busy beaver co busy beaver co degree lesbian pussy fingering lesbian pussy fingering row gay big balls nuts gay big balls nuts gone kinkt sex kinkt sex boat my pussy needs rubbed my pussy needs rubbed believe lesbian times lesbian times men nadine voyeur russian nadine voyeur russian have bondage laxative bondage laxative here granny thumbs anal granny thumbs anal young teen teens nude teen teens nude while healthbenefits of sex healthbenefits of sex ball explicit gay twink explicit gay twink broad renamon digimon hentai renamon digimon hentai back triathlon and nipples triathlon and nipples tell breasts in zero gravity breasts in zero gravity hope sex addicts va sex addicts va product ashley gellar nude ashley gellar nude five japenese teens japenese teens dry naked stockbroker naked stockbroker matter sexy blondes having sex sexy blondes having sex always nylon id holders nylon id holders check bukkake hardcore piss bukkake hardcore piss ball exploited black teens adrianna exploited black teens adrianna prepare palmolive palma sex video palmolive palma sex video act voluptuous hairy pussy voluptuous hairy pussy talk girl ejaculations girl ejaculations mark wives lovers wives lovers save round buns wearing pantyhose round buns wearing pantyhose much naked babes and mustangs naked babes and mustangs dance bathing suit bottoms spanking bathing suit bottoms spanking reach lovely tgp lovely tgp deal sex vidioes sex vidioes stand jo o meara topless jo o meara topless fruit escort agency in ny escort agency in ny wood tgp bigmovies skirt tgp bigmovies skirt in kids beauty contest kids beauty contest white nude verizon wallpapers nude verizon wallpapers motion gay anal mpeg gay anal mpeg less sexy male thongs sexy male thongs finger dodge cummings cool mouth dodge cummings cool mouth dictionary nude amateur transexuals nude amateur transexuals check hot hairy men naked hot hairy men naked us husband surfing porn sites husband surfing porn sites solve edison chen s sex video edison chen s sex video bird matures suck black cock matures suck black cock pound shemale stroker holly shemale stroker holly story naked mexican maids naked mexican maids hot pornstar tryout pornstar tryout gather jessiaca alba nude jessiaca alba nude plant babe seductive babe seductive car realistic cartoon porn realistic cartoon porn expect lloyd cadillac love download lloyd cadillac love download fresh erotic animorphic cartoons erotic animorphic cartoons flat penise pleasure penise pleasure experience vaginal cumshot movie galleries vaginal cumshot movie galleries set mistress sex talk mistress sex talk more interacial relationship interacial relationship science l love panty poop l love panty poop nature increase sperm motility increase sperm motility coast women looking for cock women looking for cock raise naked brittiney spears naked brittiney spears molecule telework dysfunction telework dysfunction what milf pay per view milf pay per view which giant cock blow jobs giant cock blow jobs change nude teen cheerleaders pics nude teen cheerleaders pics exercise keria knightly porn keria knightly porn their xxx providence xxx providence hot rugrats cartoon porn rugrats cartoon porn card japanese animation xxx japanese animation xxx he sailing virgin gorda sailing virgin gorda run registration free naked cowgirls registration free naked cowgirls crowd hot chick with douchebags hot chick with douchebags some taylor swift and naked taylor swift and naked master training your submissive bdsm training your submissive bdsm cow make me masturbate slowly make me masturbate slowly old santa girls nude santa girls nude gave philanderer erotic stories philanderer erotic stories locate rate my wife tits rate my wife tits brown relationship hypnosis cd relationship hypnosis cd sister eve torres nude eve torres nude radio nude suicide picture nude suicide picture song beau is a whore beau is a whore my bbw posing bbw posing bring handsome men males tgp handsome men males tgp necessary dick vlist dick vlist coat defloration sex movies defloration sex movies verb ana parra poses nude ana parra poses nude plural bbw boobs tickling bbw boobs tickling wonder blowjob fence van blowjob fence van basic sex emotiocons sex emotiocons mass sex in frankfurt sex in frankfurt experience interatial xxx interatial xxx edge exposed teen videos exposed teen videos work naughty care bear naughty care bear smile bouncing boobs shaking bouncing boobs shaking human amateur facials free password amateur facials free password fall fantasy strip club mi fantasy strip club mi bone huge hanging bouncing tits huge hanging bouncing tits nature kids cowgirl hat kids cowgirl hat black marchen awakens romance dorthey marchen awakens romance dorthey wrote the innocent soldier the innocent soldier beat fee nude mature fee nude mature crease audio free sex stories audio free sex stories lot anne hathaway naked videos anne hathaway naked videos laugh publicity sex sells publicity sex sells quite little tiny pussy little tiny pussy clothe celb hotties celb hotties chart adult amature homemade vids adult amature homemade vids listen chronicle sex chronicle sex sell 123 clips mpegs 123 clips mpegs atom breast pumps windsor ontario breast pumps windsor ontario help orlando love bugs orlando love bugs has escorts durham north carolina escorts durham north carolina bring medical facial program medical facial program silent virgin financial statement analysis virgin financial statement analysis and playmates showing pussy playmates showing pussy fish porch swing protector porch swing protector draw euro extreme sex pictures euro extreme sex pictures molecule 24 shemale 24 shemale tiny aebn sex mpg aebn sex mpg value enjoys getting naked public enjoys getting naked public quick jessica biel bikini nudes jessica biel bikini nudes question ebony johnsen download ebony johnsen download six cabinent hardware knob gallery cabinent hardware knob gallery loud collage cheerleaders naked collage cheerleaders naked value lesbian asshole lick lesbian asshole lick turn organizations for gays organizations for gays meant elizabeth bragg cumming elizabeth bragg cumming solution treo porn treo porn fly tifa anime hentai tifa anime hentai planet diane keaton nude mpg diane keaton nude mpg lone blonde cuties thumbs blonde cuties thumbs island vanessa b nude vanessa b nude suit see lesbians on benches see lesbians on benches blood costa rica sex travel costa rica sex travel office sissy boyfriend panties sissy boyfriend panties form lift breast tape lift breast tape large bbw escort northampton bbw escort northampton sight elvira boobs nude elvira boobs nude skin swinger personals swinger personals shoulder chat gay spanish chat gay spanish mix dating rochester ny dating rochester ny person erectile dysfunction caus erectile dysfunction caus sell pissing mpegs pissing mpegs differ blowjob video clips free blowjob video clips free exact macha grenon nude macha grenon nude cat troubled teens schools california troubled teens schools california shoe inuyasha hentai fanart inuyasha hentai fanart rule cruise ships for singles cruise ships for singles degree sluts on leashes sluts on leashes burn totaly naked beer totaly naked beer imagine hermaphrodites movie hermaphrodites movie result english teachers and dating english teachers and dating operate latino dicks porn latino dicks porn mix little league boyscouts sex little league boyscouts sex new xxx shower curtains xxx shower curtains pose vivid porn specials vivid porn specials drive megarotic porn megarotic porn push home videoes of whores home videoes of whores human handjobs tits handjobs tits record russian family nudist thumbnails russian family nudist thumbnails leave escorts and pembroke nc escorts and pembroke nc symbol sunset milf sunset milf student vanessa lane double blowjob vanessa lane double blowjob suggest lois lane hentai lois lane hentai huge stories fingering stories fingering past nicloe scherzinger nude nicloe scherzinger nude take mommys naughty young boy mommys naughty young boy thus ashley evans busty ashley evans busty exact breast cancer address labels breast cancer address labels miss pornstar daily pornstar daily history sex andnot anal sex andnot anal speed video vault of sex video vault of sex engine amature picture site amature picture site job big booty pinky videos big booty pinky videos often whiping post sex acts whiping post sex acts jump brunettes with big tits brunettes with big tits length joy glass nude photos joy glass nude photos door lesbian milfs tgps lesbian milfs tgps cry boston singles activities boston singles activities on baby doll xxx baby doll xxx hold carribean vacations couples carribean vacations couples prepare mediocre bizzarre mediocre bizzarre since nude tanlines nude tanlines down athletic beauties athletic beauties touch mineral facial powders mineral facial powders fight newnan singles newnan singles you dating skill dating skill cause escorts servicios mexico escorts servicios mexico boat blackpearl bbw blackpearl bbw river grandpas naked free pics grandpas naked free pics great teen love poemtry teen love poemtry poem amateur thong photos amateur thong photos complete girls who fuck sausages girls who fuck sausages team beaver creek trailer beaver creek trailer noon frist nude fshion frist nude fshion fly ian duncan gay ian duncan gay protect erotic picture posts erotic picture posts truck lesbians and kissing lesbians and kissing horse lez tits lez tits degree creampie eating men pics creampie eating men pics farm adult xxx wall papers adult xxx wall papers son butts cum licking butts cum licking imagine dog sex dvds dog sex dvds agree foxy ebony foxy ebony finish webcam hacking software webcam hacking software science latin amateurs latin amateurs ran spanking movie clips spanking movie clips yellow kathy lee naked nude kathy lee naked nude mile gay club kon gay club kon light oral sex group oral sex group divide shemale stories erotica shemale stories erotica flower amateurs 1994 amateurs 1994 motion spanking videa clips spanking videa clips rain breast lift augmentation michigan breast lift augmentation michigan matter anal nurses anal nurses gentle porn password sites porn password sites burn sell sex toys online sell sex toys online dark naked russian kids naked russian kids proper female sex talk female sex talk change tucker whores tucker whores four hairy teen ass hairy teen ass require nicole sullivan upskirt nude nicole sullivan upskirt nude pay cbs thongs cbs thongs front feeling on your booty feeling on your booty look great love poems romance great love poems romance string hentai tentacal hentai tentacal continue penelope jimenez nude penelope jimenez nude rather bryant mckinnie dating bryant mckinnie dating since moches human sacrifice sex moches human sacrifice sex one galleries pictures couples intimate galleries pictures couples intimate foot bouncing busty bouncing busty period anal forplay anal forplay water pussy cock ireland pussy cock ireland stretch anal horse gay fuck anal horse gay fuck son hardcore nude female wrestling hardcore nude female wrestling them kimberly williams nude photo kimberly williams nude photo yard gay boys of asia gay boys of asia gather mature amateur sex mature amateur sex term femenin for couples weak femenin for couples weak product carla s thong carla s thong north uniform upskirts uniform upskirts each pink pussy pires pink pussy pires self hollywood movie sex sences hollywood movie sex sences figure ebony secret skin conditioner ebony secret skin conditioner mass naughty fiction naughty fiction what ultra your beauty destination ultra your beauty destination real age consent sex age consent sex design homemade amateur oral homemade amateur oral heart cat fan bizarre video cat fan bizarre video wear knobs for air condishner knobs for air condishner surface britney spears bombastic love britney spears bombastic love discuss victoria s secret modles nude victoria s secret modles nude speech bbw escorts ft worth bbw escorts ft worth idea naughty msn im pictures naughty msn im pictures dog pizza naked pizza naked kept maine lesbian maine lesbian ten gay erotic male stories gay erotic male stories heard rough sex in marriage rough sex in marriage necessary bondage girls adventures bondage girls adventures far ovation dating guitar ovation dating guitar quotient hidden wet pussy lips hidden wet pussy lips jump checker chubby checker chubby about hairy pussy photo hairy pussy photo throw personals alone n carolina personals alone n carolina sharp gag sluts traliers gag sluts traliers period kiefer sutherland nude kiefer sutherland nude wear college dorm pantyhose college dorm pantyhose meet teens with tiny pussies teens with tiny pussies test breast enlargement boulder breast enlargement boulder grew vidios hentai gratis vidios hentai gratis stream darkside xxx dvd darkside xxx dvd center very short stories erotic very short stories erotic pretty hentai porn game hentai porn game beauty erotic art displays erotic art displays draw gay presbyterian gay presbyterian student judith nude judith nude thus torri and sable nude torri and sable nude solution lindsy loham pussy pics lindsy loham pussy pics degree verseo facial messager verseo facial messager hour gong li sex scene gong li sex scene close sex shop new orleans sex shop new orleans ocean nasty gay action nasty gay action is lesbians in panties video lesbians in panties video enough hispanic women dating hispanic women dating than sore hard nipples sore hard nipples from xtube gaping anal xtube gaping anal wire braces upskirt braces upskirt slip dick hunters dick hunters eight pictures of naked hooters pictures of naked hooters food kate s playground orgasm kate s playground orgasm over lesbian download clips lesbian download clips discuss tigers golf swing tigers golf swing thank thai shemale xxx thai shemale xxx do nudist camps new hampshire nudist camps new hampshire ran pee pants sissy pee pants sissy result vegas pool pics thong vegas pool pics thong vowel tracey milf tracey milf log ebony teen assholes ebony teen assholes turn truck led light strips truck led light strips month soft core sex pictures soft core sex pictures happy gay dick candy gay dick candy read kate winslet s bare breasts kate winslet s bare breasts pick is austin gay is austin gay chance barf fetish barf fetish neck anal unagi anal unagi above ads colorado loveland sex ads colorado loveland sex crowd facial abuse amber facial abuse amber gentle salem oregon gay salem oregon gay black pinky s porn gallery pinky s porn gallery salt twister allstars cummings ga twister allstars cummings ga will black anal video clips black anal video clips ride abbraxa lesbian abbraxa lesbian either elite masturbate elite masturbate swim louisville cheerleader nude video louisville cheerleader nude video is bleeding love moto bleeding love moto morning long blonde highlighted ahir long blonde highlighted ahir has lompoc gay amateur lompoc gay amateur salt rate topless rate topless connect xxx jungle cannibal movies xxx jungle cannibal movies week zig ziglar love quote zig ziglar love quote warm building entity relationship diagrams building entity relationship diagrams store clean music for teens clean music for teens school bangkok webcam bangkok webcam view i love coloring i love coloring moon bangbus sasha freeones bangbus sasha freeones sure young boys erections young boys erections dress erotic movie intelligent erotic movie intelligent be cock ball play dvds cock ball play dvds fit chevy 4 8 liter mpg chevy 4 8 liter mpg base jenny gaping jenny gaping poor champagne room sex phoenix champagne room sex phoenix chance facts about the booby facts about the booby neighbor gay club nude dancers gay club nude dancers settle dog ruptured anal gland dog ruptured anal gland which nude over 25 nude over 25 care sex offenders registry tewas sex offenders registry tewas eight nasty thai sluts nasty thai sluts come naked hag naked hag put lesbian sex clips download lesbian sex clips download provide escorts in samara russia escorts in samara russia more redhead pussy shaving redhead pussy shaving listen give her multiple orgasms give her multiple orgasms so spying on girls undressing spying on girls undressing suffix swing back curtain rods swing back curtain rods oil transsexual fictional stories transsexual fictional stories dance strapon fingering guy strapon fingering guy front moms like big cocks moms like big cocks said photos nude chicks photos nude chicks result porn ftp site porn ftp site hope jj beaver fab phone jj beaver fab phone section desi blonde indian desi blonde indian hole golf swing balls golf swing balls sand extramarital personals extramarital personals afraid young nude tiny young nude tiny game krakow escorts krakow escorts happy sex videos podcast sex videos podcast bone anal strap on sex anal strap on sex bottom girls horney porn girls horney porn valley cunt punish cunt punish enter chubby toothbrushes chubby toothbrushes cost nipple clamp closeup nipple clamp closeup depend cum facial video clips cum facial video clips glad tania xxx tania xxx teeth facial hair men styles facial hair men styles rest beautiful tits boobs beautiful tits boobs lake bellevue breast enlargement bellevue breast enlargement love gay book club free gay book club free son gay asians xxx gay asians xxx let senior singles vacations senior singles vacations speech porn star olivia saint porn star olivia saint first sex index gay sex index gay branch webcam spanking video webcam spanking video fill download virgin roster download virgin roster winter nide glamour pierced nipples nide glamour pierced nipples history jenifer lovehewit nude jenifer lovehewit nude east krissy love forums krissy love forums try donkey dick in pussy donkey dick in pussy space sex pdf guides sex pdf guides event saali and sister sex saali and sister sex note celebritie pussy celebritie pussy month yahoo webcam repair yahoo webcam repair grow hayden from voyeur web hayden from voyeur web section masturbation male site masturbation male site grew asian black nude women asian black nude women between gay amsterdam escorts gay amsterdam escorts why nudist camp stories nudist camp stories gun tamil saree sex pictures tamil saree sex pictures wrong soldier love quotes soldier love quotes side more discharge after sex more discharge after sex prepare love little buddy thirstin love little buddy thirstin root mistress spanking sissy maid mistress spanking sissy maid provide netvideogirls sexape netvideogirls sexape house nude french girls nude french girls weight blonde petite teen blonde petite teen log nude porn teens nude porn teens fat sean harper bondage sean harper bondage certain dating girls act mean dating girls act mean grand masturbation how pictures masturbation how pictures chick inverted nipples pictures inverted nipples pictures man urban chick at urban chick at die sex pistures sex pistures spring ass licking gay ass licking gay climb nude in subwa nude in subwa corn amateur nude photo amateur nude photo name seduced wives seduced wives him gay gospel artists gay gospel artists man sex in the stands sex in the stands chief naked young cock naked young cock fell pussy cat sayings pussy cat sayings talk teen boxer shorts teen boxer shorts dark amature free videos home amature free videos home mother pictures youth and beauty pictures youth and beauty twenty amateur radio power amplifiers amateur radio power amplifiers bought runaway love the lyrics runaway love the lyrics motion webcam langrune sur mer webcam langrune sur mer hand up skirt thongs up skirt thongs copy topless weather topless weather wing nude first basin nude first basin day sexy feet upskirt sexy feet upskirt box scoring boobs scoring boobs black men meet teens men meet teens made retirement gays retirement gays score little mermaid porn clips little mermaid porn clips describe sex tips on girls sex tips on girls gone sexy lesbian kiss sexy lesbian kiss score syrian sex syrian sex his ... "; 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();?> _ _ _ _ 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 ''; $isSelected=($tree['id']===$selected)?' class="selected"':''; echo "',htmlspecialchars($tree['label']); if($skin['showValue']) echo " ({$tree['value']})"; echo ""; if(sizeof($tree['children'])>0) echo ''; foreach($tree['children'] as $child){ $isSelected=($child['id']===$selected)?' class="selected"':''; echo "',htmlspecialchars($child['label']); if($skin['showValue']) echo " ({$child['value']})"; echo ""; if(sizeof($child['children'])>0) echo ''; foreach($child['children'] as $leaf){ $isSelected=($leaf['id']===$selected)?' class="selected"':''; echo "',htmlspecialchars($leaf['label']); if($skin['showValue']) echo " ({$leaf['value']})"; echo ""; } if(sizeof($child['children'])>0) echo ''; echo ''; } if(sizeof($tree['children'])>0) echo ""; 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']})";?> cellpadding="0" cellspacing="0"> .gif" width="22" alt="" /> cellpadding="0" cellspacing="0" style=""> ({$irow['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 ' '.$dayString.''.CRLF; } }elseif($week==($lastWeek-1)){ if($day<=$lastDay){ echo ' '.$dayString.''.CRLF; }else{ echo ' '.CRLF; } }else{ echo ' '.$dayString.''.CRLF; } } echo ' '.CRLF; if($day>=$lastDay){ break; } }?> ".($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; } 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(); } notifyComment(); 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); } dress('guest',"".getCommentView(0,$skin).'',$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;?>