function RefererURLBeautifier_handler($target, $mother) { $keyword = false; if (preg_match('/\\W(q|query|k|keyword|search|stext|nlia|aqa|wd)(?:=|%3D)([^&]+)/i', $mother['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[2])); } else { if (strpos($mother['host'], 'images.google.') !== false && preg_match('/%3Fsearch%3D([^&]+)/i', $mother['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[1])); } else { if (strpos($mother['host'], 'yahoo.') !== false && preg_match('/\\Wp=([^&]+)/i', $mother['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[1])); } else { if (preg_match('@/search/(?:\\w+/)*([^/?]+)@i', $mother['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[1])); } } } } if (!UTF8::validate($keyword)) { $keyword = UTF8::correct(UTF8::bring($keyword)); } $keyword = UTF16UrlDecode($keyword); $url = rawurldecode(substr($mother['url'], 7)); if (!UTF8::validate($url)) { $url = UTF8::correct(UTF8::bring($url)); } //return '<img src="http://'.$mother['host'].'/favicon.ico" width="16" height="16" alt="Favicon" onerror="this.parentNode.removeChild(this)" style="vertical-align: middle"/> ' . (($keyword) ? '<span style="font-weight: bold; color: #594">['.htmlspecialchars($keyword).']</span> ' . UTF8::lessenAsEm($url, 65 - UTF8::lengthAsEm($keyword)) : UTF8::lessenAsEm($url, 65)); return $keyword ? '<span style="font-weight: bold; color: #594">[' . htmlspecialchars($keyword) . ']</span> ' . htmlspecialchars(UTF8::lessenAsEm($url, 70 - UTF8::lengthAsEm($keyword))) : htmlspecialchars(UTF8::lessenAsEm($url, 70)); }
function ViewCounterList($target) { global $database, $blogid, $blogURL, $skinSetting; $result = POD::queryAll("SELECT b.id, b.title, a.readcounts FROM {$database['prefix']}EntryReadCount a INNER JOIN {$database['prefix']}Entries b ON a.blogid = b.blogid AND a.id = b.id WHERE a.blogid={$blogid} AND b.visibility >= 2 AND b.draft = 0 AND b.category >=0 ORDER BY a.readcounts DESC LIMIT 0,5"); $target = "<ul>"; foreach ((array) $result as $row) { $articleid = $row['id']; $articletitle = htmlspecialchars(UTF8::lessenAsEm($row['title'], $skinSetting['recentEntryLength'])); $readcounts = $row['readcounts']; $rsurl = "{$blogURL}/{$articleid}"; $target .= "<li><a href=\"{$rsurl}\">{$articletitle}</a> <span class=\"cnt\">({$readcounts})</span></li>\n"; } $target .= "</ul>"; return $target; }
function PN_BlogStatisticsProcess($target) { global $blogid, $pluginURL, $defaultURL, $blog; if (doesHaveOwnership()) { include_once 'lib/open-flash-chart.php'; $grpStyle = $_GET['grpStyle']; $grpData = explode("|", $_GET['grpData']); $grpTotal = $_GET['grpTotal']; $grpYear = $_GET['grpYear']; $grpTypeName = $_GET['grpTypeName']; $grpLinkType = $_GET['grpLinkType']; $grpXLabelType = isset($_GET['grpXLabelType']) ? $_GET['grpXLabelType'] : 0; $grpLabel = explode("|", $_GET['grpLabel']); $grpSubTitle = array(); $grpLabelTemp = array(); if (!empty($_GET['grpData'])) { if ($grpTypeName == "category") { for ($i = 0; $i < count($grpLabel); $i++) { $grpSubTitle[] = rawurlencode($grpLabel[$i] == 0 ? _t('분류없음') : htmlspecialchars(UTF8::lessenAsEm(getCategoryNameById($blogid, $grpLabel[$i]), 15))); } } else { if ($grpTypeName == "hits" || $grpTypeName == "cmmax" || $grpTypeName == "tbmax" || $grpTypeName == "tagmax") { for ($i = 0; $i < count($grpLabel); $i++) { $grpSubTitle[] = rawurlencode(htmlspecialchars(UTF8::lessenAsEm(str_replace(",", "-", getEntryTitleById($blogid, $grpLabel[$i])), 25))); } } else { if ($grpTypeName == "commenter" || $grpTypeName == "tag") { for ($i = 0; $i < count($grpLabel); $i++) { $grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15)); $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 6, '')); } $grpLabel = $grpLabelTemp; } else { if ($grpTypeName == "time") { for ($i = 0; $i < count($grpLabel); $i++) { $grpSubTitle[] = rawurlencode($grpLabel[$i] . "시"); } } else { if ($grpTypeName == "refer") { for ($i = 0; $i < count($grpLabel); $i++) { $tmpHost = explode('.', $grpLabel[$i]); $tmpHostCnt = count($tmpHost) - 1; $tmpDomain = (strlen($tmpHost[$tmpHostCnt]) < 3 ? $tmpHost[$tmpHostCnt - 2] . '.' : '') . $tmpHost[$tmpHostCnt - 1] . '.' . $tmpHost[$tmpHostCnt]; $cutDomain = explode('.', $tmpDomain); $grpSubTitle[] = htmlspecialchars($grpLabel[$i]); $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($cutDomain[0], 6, '')); } $grpLabel = $grpLabelTemp; } else { if ($grpTypeName == "referkey") { for ($i = 0; $i < count($grpLabel); $i++) { $tmpLabel = explode('(', $grpLabel[$i]); $grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15)); $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($tmpLabel[0], 6, '')); } $grpLabel = $grpLabelTemp; } } } } } } $g = new graph(); $g->bg_colour = '#FFFFFF'; if ($grpStyle == "pie") { $grpClickLink = ""; $grpPercent = array(); $grpLink = array(); for ($i = 0; $i < count($grpData); $i++) { $grpPercent[] = round($grpData[$i] / $grpTotal * 100, 0); } if ($grpLinkType == "archiveYear") { for ($i = 0; $i < count($grpLabel); $i++) { $permalink = $defaultURL . "/archive/" . substr($grpLabel[$i], 0, 4); $grpLink[] = "javascript:window.open('{$permalink}');void(0)"; } $grpClickLink = "<br>click on the pie."; } else { if ($grpLinkType == "archiveMonth" && $grpYear != "9999") { for ($i = 0; $i < count($grpLabel); $i++) { $cutMonth = str_replace("월", "", $grpLabel[$i]); $tmpMonth = strlen($cutMonth) == 1 ? "0" . $cutMonth : $cutMonth; $permalink = $defaultURL . "/archive/" . $grpYear . $tmpMonth; $grpLink[] = "javascript:window.open('{$permalink}');void(0)"; } $grpClickLink = "<br>click on the pie."; } else { if ($grpLinkType == "category") { for ($i = 0; $i < count($grpLabel); $i++) { $permalink = $defaultURL . "/category/" . getCategoryLabelById($blogid, $grpLabel[$i]); $grpLink[] = "javascript:window.open('{$permalink}');void(0)"; } $grpClickLink = "<br>click on the pie."; } else { if ($grpLinkType == "entry") { for ($i = 0; $i < count($grpLabel); $i++) { $permalink = $defaultURL . ($blog['useSlogan'] ? "/entry/" . getEntrySloganById($blogid, $grpLabel[$i]) : "/" . $grpLabel[$i]); $grpLink[] = "javascript:window.open('{$permalink}');void(0)"; } $grpClickLink = "<br>click on the pie."; } else { if ($grpLinkType == "tag") { for ($i = 0; $i < count($grpLabel); $i++) { $permalink = $defaultURL . "/tag/" . $grpLabel[$i]; $grpLink[] = "javascript:window.open('{$permalink}');void(0)"; } $grpClickLink = "<br>click on the pie."; } } } } } $g->pie(75, '#ffffff', '#000000', false, 1); $g->pie_values($grpData, $grpLabel, $grpLink, $grpSubTitle); $g->pie_slice_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D')); $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#(#percent#%25)' . $grpClickLink); } else { if ($grpStyle == "bar") { $g->title(' ', '{font-size:12px; color:#000000;margin-top:0px;padding:3px;}'); $g->set_data($grpData); $g->set_bar_titles($grpSubTitle); $g->bar_glass(70, '#68B1D9', '#62A0C1', '', 12); $g->bar_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D')); $g->x_axis_colour('#909090', '#D2D2FB'); $g->y_axis_colour('#909090', '#D2D2FB'); $g->set_x_labels($grpLabel); $g->set_x_label_style(10, '#000000', $grpXLabelType, -1); $g->set_y_label_style(9, '#888888'); $tmp_data_max = floor(Max($grpData) * 1.2); if ($tmp_y_max = $tmp_data_max % 10) { $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max); } $g->set_y_max($tmp_data_max); $g->set_y_legend('', 11, '#736AFF'); $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#'); } else { if ($grpStyle == "line") { $g->title('', '{font-size:1px; color:#000000;}'); $g->set_data($grpData); $g->line_dot(2, 4, '#6FBBC6', _t('최근 7일간 방문자 수'), 11); // <-- 3px thick + dots $g->set_x_labels($grpLabel); $g->set_x_label_style(8, '#333333', $grpXLabelType, -1); $g->x_axis_colour('#909090', '#e7e7e7'); $g->y_axis_colour('#909090', '#e7e7e7'); $tmp_data_max = floor(Max($grpData) * 1.2); if ($tmp_y_max = $tmp_data_max % 10) { $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max); } $g->set_y_max($tmp_data_max); $g->set_y_legend('', 1, '#736AFF'); $g->y_label_steps(4); $g->set_y_label_style(8, '#333333', $grpXLabelType, -1); $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#'); } } } echo $g->render(); flush(); } } }
function printIphoneLinksView($links) { global $blogURL, $skinSetting, $suri, $pathURL; if (rtrim($suri['url'], '/') == $pathURL) { $home = true; } else { $home = false; } foreach ($links as $link) { if (!doesHaveOwnership() && $link['visibility'] == 0 || !doesHaveMembership() && $link['visibility'] < 2) { continue; } $linkView .= '<li><a href="' . htmlspecialchars($link['url']) . '" class="link" target="_blank">' . htmlspecialchars(UTF8::lessenAsEm($link['name'], $skinSetting['linkLength'])) . '</a></li>' . CRLF; } return $linkView; }
<div class="ftitle<?php if(!$noVerifier) {?> noftool<?php } ?>"> <a href="<?php echo $service['path'];?>/admin/blog/list?read=<?php echo $feed['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes($feed['title']), 25);?></a> <?php echo ($isNew?' <img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle"/>':'');?> </div> <div class="clear"></div> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'bloglist_title','data'=> $content )); // 블로그 최근업데이트 ob_start(); if(!empty($lastPost)) { ?> <a href="<?php echo $service['path'];?>/admin/blog/entrylist/?read=<?php echo $lastPost['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($lastPost['title'])),20);?></a> <span class="date"> : <?php echo date('y.m.d H:i:s', $feed['lastUpdate']);?> (<?php echo $stringDate;?>) </span> <?php } else { ?> <span class="empty"><?php echo _t('수집된 글이 없습니다.');?></span> <?php } $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'bloglist_update','data'=> $content )); // 블로그 등록 글 수 array_push($data['datas'], array('class'=>'bloglist_count','data'=> '<a href="'.$service['path'].'/admin/blog/entrylist/?type=blogURL&keyword='.rawurlencode($feed['blogURL']).'" title="'._t('전체보기').'">'.$feed['feedCount'].'</a>' ));
<?php /// Copyright (c) 2004-2011, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) define('__TEXTCUBE_IPHONE__', true); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); if (empty($suri['id'])) { printIphoneHtmlHeader(); ?> <ul id="home" title="<?php echo htmlspecialchars(UTF8::lessenAsEm($blog['title'], 30)); ?> " selected="true"> <?php $blogAuthor = User::getBlogOwnerName($blogid); $blogLogo = !empty($blog['logo']) ? printIphoneImageResizer($blogid, $blog['logo'], 80) : "{$service['path']}/resources/style/iphone/image/textcube_logo.png"; $itemsView = '<li class="blog_info">' . CRLF; $itemsView .= ' <div class="logo"><img src="' . $blogLogo . '" /></div>' . CRLF; $itemsView .= ' <div class="blog_container">' . CRLF; $itemsView .= ' <span class="title">' . htmlspecialchars($blog['title']) . '</span>' . CRLF; $itemsView .= ' <span class="author">by ' . $blogAuthor . '</span>' . CRLF; $itemsView .= ' <span class="description">' . htmlspecialchars($blog['description']) . '</span>' . CRLF; $itemsView .= ' </div>' . CRLF; $itemsView .= '</li>' . CRLF; print $itemsView; ?> <li><a href="<?php echo $blogURL;
function longURLtoShort($url,$checkURL=55,$leftURL=39,$rightURL=8) { //$checkURL = 55; // 체크할 URL 길이 //$leftURL = 39; // '...'의 왼쪽에 나타낼 URL 길이 //$rightURL = 8; // '...'의 오른쪽에 나타낼 URL의 길이 $link = $url; $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url); $url = "http://".htmlspecialchars($url); $url = strtolower(str_replace("http://http://","http://",$url)); $templink = strip_tags($link); $templink = "http://".htmlspecialchars($templink); $templink = strtolower(str_replace("http://http://","http://",$templink)); if (strpos($url, 'www.') === 0) $full_url = 'http://'.$full_url; else if (strpos($url, 'ftp.') === 0) $full_url = 'ftp://'.$full_url; else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah)) $full_url = 'http://'.$full_url; $link = ($templink == '' || $templink == $url) ? ((strlen($url) > $checkURL) ? UTF8::lessenAsEm($url, $leftURL, '').' … '.substr(rawurlencode($url), ($rightURL*-1)) : stripslashes($link)) : stripslashes($link); return $link; }
function getNoticePage($input, $config) { global $database, $db, $event, $service; if(!isAdmin()) { ?> <?php return $input; } $blogId = isset($config['blog'])?$config['blog']:0; $tag = isset($config['tag'])?$config['tag']:''; $pluginURL = $event->pluginURL; $params = ''; if(!empty($blogId)) { $pageCount = 15; // 페이지갯수 $page = isset($_GET['page']) ? $_GET['page'] : 1; if(!isset($page) || empty($page)) $page = 1; list($posts, $totalFeedItems) = getNoticeFeedItems($blogId,$page,$pageCount); $paging = Func::makePaging($page, $pageCount, $totalFeedItems); ob_start(); ?> <link rel="stylesheet" href="<?php echo $pluginURL;?>/style.css" type="text/css" /> <script type="text/javascript"> var is_checked = false; function toggleCheckAll(className) { is_checked = !is_checked; $("."+className).each( function() { this.checked = is_checked; }); } function deleteItem(id) { if(confirm("<?php echo _t('이 글을 삭제하시겠습니까?');?>")) { $.ajax({ type: "POST", url: '<?php echo $pluginURL;?>/delete.php', data: 'id=' + id, dataType: 'xml', success: function(msg){ error = $("response error", msg).text(); if(error == "0") { document.location.reload(); } else { alert($("response message", msg).text()); } }, error: function(msg) { alert('unknown error'); } }); } } function deleteAllItem(className) { var ids = ''; $("."+className).each( function() { if(this.checked) { ids += $(this).val() + ','; } }); if(ids == '') { return false; } if(confirm("<?php echo _t('선택된 모든 글을 삭제하시겠습니까?');?>")) { $.ajax({ type: "POST", url: '<?php echo $pluginURL;?>/delete.php', data: 'id=' + ids, dataType: 'xml', success: function(msg){ error = $("response error", msg).text(); if(error == "0") { document.location.reload(); } else { alert($("response message", msg).text()); } }, error: function(msg) { alert('unknown error'); } }); } } </script> <div class="title_wrap"> <h3><?php echo _t('공지사항');?> <span class="cnt">(<?php echo $totalFeedItems;?>)</span></h3> </div> <div class="notice_wrap"> <?php $headers = array(array('title'=>_t('선택'),'class'=>'entrylist_select','width'=>'50px'), array('title'=>_t('날짜'),'class'=>'entrylist_date','width'=>'100px'), array('title'=>_t('제목'),'class'=>'entrylist_title','width'=>'790px'), array('title'=>_t('실행'),'class'=>'entrylist_execute','width'=>'auto')); $datas = array(); if(count($posts)>0) { foreach($posts as $post) { $data = array(); $date = Func::dateToString($post['written']); $feedvisibility = Feed::get($post['feed'], 'visibility'); $data['id'] = 'list_item_'.$post['id']; $data['class'] = ($post['visibility']=='n'?'list_item_hide':'').($post['id']==$read?' list_item_select':''); $data['datas'] = array(); // 글 선택 array_push($data['datas'], array('class'=>'noticelist_select','data'=> '<input type="checkbox" class="postid" value="'.$post['id'].'" />' )); // 글 등록날짜 ob_start(); ?> <?php echo date('y.m.d H:i:s', $post['written']);?><br /> <span class="date_text">(<?php echo $date;?>)</span> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'noticelist_date','data'=> $content )); // 글 제목 ob_start(); ?> <?php $desc = UTF8::lessenAsEm(str_replace(' ','',func::stripHTML($post['description'])),82); if(empty($desc)) { $desc = '<span class="empty">'._t('내용이 비어있거나 HTML로만 작성되어 있습니다.').'</span>'; } $isNew = Func::isNew($post['written'],1); ?> <div class="title"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 60);?> <?php echo ($isNew?' <img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div> <?php echo $desc?> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'noticelist_title','data'=> $content )); // 글 실행 ob_start(); ?> <a href="#" class="microbutton alertbutton" onclick="deleteItem(<?php echo $post['id'];?>); return false;"><span><?php echo _t('삭제');?></span></a> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'noticelist_execute','data'=> $content )); array_push($datas, $data); } } else { array_push( $datas, array( 'class'=>"list_empty", 'datas'=>array(array('data'=>empty($keyword)?_t('공지사항이 없습니다.'):_t('검색된 공지사항이 없습니다.')) )) ); } ob_start(); ?> <div class="select"> <a href="#" onclick="toggleCheckAll('postid'); return false;"><img src="<?php echo $service['path'];?>/images/admin/bt_arrow.gif" /></a> </div> <div class="action"> <strong><a href="#" onclick="deleteAllItem('postid'); return false;"><?php echo _t('삭제');?></a></strong> </div> <div class="clear"></div> <?php $footers = ob_get_contents(); ob_end_clean(); echo makeTableBox('noticelist', $headers, $datas, $footers); ?> </div> <div class="wrap"> <br /> <div class="paging"> <?php echo func::printPaging($paging, $params);?> </div> </div> <?php $input .= ob_get_contents(); ob_end_clean(); } return $input; }
?> <div class="data<?php echo !empty($thumbnailFile)?'':' no_thumbnail_data';?>"> <div class="title"><a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo UTF8::lessenAsEm(stripcslashes(func::stripHTML($post['title'])), 36);?></a><?php echo ($isNew?'<img src="'.$service['path'].'/images/admin/icon_new.gif" alt="new" align="absmiddle" class="new" />':'');?></div> <a href="<?php echo $service['path'];?>/admin/blog/entrylist?read=<?php echo $post['id'];?>"><?php echo $desc?></a> </div> <div class="clear"></div> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'entrylist_title','data'=> $content )); // 글 블로그 ob_start(); ?> <a href="<?php echo $service['path'];?>/admin/blog/list?read=<?php echo $post['feed'];?>" title="<?php echo _f('\'%1\' 정보보기', stripcslashes(Feed::get($post['feed'], 'title')));?>"><?php echo UTF8::lessenAsEm(stripcslashes(Feed::get($post['feed'], 'title')), 30);?></a> <?php echo $feedvisibility=='n'?'<span class="hide">'._t('(비공개)').'</span>':'';?> <?php $content = ob_get_contents(); ob_end_clean(); array_push($data['datas'], array('class'=>'entrylist_blog','data'=> $content )); // 글 랭크 $rank = Boom::getRank($post['id']); array_push($data['datas'], array('class'=>'entrylist_rank','data'=> '<span class="rank'.$rank.'">'.$rank.'</span>' )); // 글 읽은 수 array_push($data['datas'], array('class'=>'entrylist_hit','data'=> $post['click'])); // 글 실행