Esempio n. 1
0
function getPagingView(&$paging, &$template, &$itemTemplate, $useSkinCache = false)
{
    return Paging::getPagingView($paging, $template, $itemTemplate, $useSkinCache);
}
Esempio n. 2
0
									</div>

									<hr class="hidden" />

									<div id="page-section" class="section">
										<h2><?php 
echo _t('페이지 네비게이션');
?>
</h2>

										<div id="page-navigation">
											<span id="page-list">
<?php 
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
echo str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false) . CRLF;
?>
											</span>
											<span id="total-count"><?php 
echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']);
?>
</span>
										</div>
										<div class="page-count">
											<?php 
echo Utils_Misc::getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0);
?>

											<select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()">
<?php 
for ($i = 10; $i <= 30; $i += 5) {
Esempio n. 3
0
    }
}
?>
			</tbody>
		</table>
	</div>
<?php 
$paging = array('url' => "", 'prefix' => '?page=', 'postfix' => '', 'total' => 0, 'pages' => 0, 'page' => 0);
$paging['pages'] = $pages;
$paging['page'] = $page;
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
?>
	<div id="page-navigation">
		<span id="page-list"><?php 
echo Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate);
?>
</span>
		<span id="total-count"><?php 
echo _f('총 %1개의 블로그', $blogcount);
?>
</span>
	</div>
<?php 
require ROOT . '/interface/common/control/footer.php';
?>
<script type="text/javascript">
//<![CDATA[
	try {
		document.getElementById("suggestContainer").innerHTML = '';
		var ctlUserSuggestObj = new ctlUserSuggest(document.getElementById("suggestContainer"),  false);
Esempio n. 4
0
function showEmoticons_getEmoticons($target)
{
    global $blogURL, $pluginURL, $__HCEMO;
    requireModel('reader.common');
    requireComponent('Textcube.Model.Paging');
    requireComponent('Textcube.Function.misc');
    require_once 'emoticons.inc.php';
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="<?php 
    echo $pluginURL;
    ?>
/styles/default.css" />
    </head>
    <script type="text/javascript">
    //<![CDDA[
        function insertHCEMO(_emoticons, _imagessrc){
            var emoTag = '<img src="'+_imagessrc+'" border="0" alt="'+_emoticons+'" longdesc="[##_HCEMO_'+_emoticons+'_##]" />';

            var isWYSIWYG = false;
            try{
                if(parent.editor.editMode == 'WYSIWYG')
                    isWYSIWYG = true;
            }
            catch(e){ }
            if(isWYSIWYG) {
                parent.editor.command('Raw', emoTag);
            }else{
                parent.insertTag(parent.editor.textarea, emoTag);
            }
        }
    //]]>
    </script>
    <body style="margin:0;padding:0;border:none;background-color:#ffffff;">
    <div id="emoticonsBody" style="height:200px;width:100%;overflow-x:hidden;overflow-y:auto;background-color:#fff;">
    <?php 
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    $items = isset($__HCEMO) ? count($__HCEMO) : 0;
    $listLength = 33;
    $paging = HCEMO_getFetchWithPaging($items, $page, $listLength, "{$blogURL}/plugin/getEmoticons");
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##] class="num">[##_paging_rep_link_num_##]</a>';
    if ($items > 0) {
        $counter['start'] = ($page - 1) * $listLength;
        $counter['end'] = $page * $listLength - 1;
        $counter['step'] = 0;
        foreach ($__HCEMO as $key => $images) {
            if ($counter['step'] >= $counter['start'] && $counter['step'] <= $counter['end']) {
                echo "<img class=\"emoticons\" src=\"{$pluginURL}/emoticons/{$images}\" border=\"0\" alt=\"{$key}\" onclick=\"insertHCEMO('{$key}','{$pluginURL}/emoticons/{$images}'); return false\" />";
            }
            $counter['step']++;
        }
    } else {
        echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">No emoticons installed.</p>';
    }
    $prev_page = isset($paging['prev']) ? " href='?page={$paging['prev']}' " : '';
    $next_page = isset($paging['next']) ? " href='?page={$paging['next']}' " : '';
    $no_more_prev = isset($paging['prev']) ? '' : 'no-more-prev';
    $no_more_next = isset($paging['next']) ? '' : 'no-more-next';
    $target = '<div class="paging-list"><a ' . $prev_page . ' class="prev ' . $no_more_prev . '">prev </a>';
    $target .= '<span class="numbox">' . str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . '</span>';
    $target .= '<a ' . $next_page . ' class="next ' . $no_more_next . '"> next</a>';
    $target .= '<div class="totalResults">';
    $target .= 'Total ' . $items . ' icons.';
    $target .= '</div></div>';
    echo $target;
    ?>
    </div>
    </body>
    </html>
    <?php 
}
Esempio n. 5
0
function getCommentView($entry, $skin, $inputBlock = true, $page = 1, $count = null, $listBlock = true)
{
    global $contentContainer;
    static $dressCommentBlock = false;
    $context = Model_Context::getInstance();
    if (is_null($count)) {
        if ($context->getProperty('skin.commentsOnEntry')) {
            $count = $context->getProperty('skin.commentsOnEntry');
        } else {
            $count = 15;
        }
    }
    if (!isset($entry)) {
        $entry['id'] = 0;
    }
    $blogid = getBlogId();
    importlib("model.common.setting");
    importlib("model.blog.entry");
    importlib("model.blog.comment");
    importlib('blogskin');
    $authorized = doesHaveOwnership();
    $useAjaxBlock = $context->getProperty('blog.useAjaxComment', true);
    $useMicroformat = $context->getProperty('blog.useMicroformat', 3);
    $fn = '';
    $fn_nickname = '';
    if ($useMicroformat > 1) {
        $fn = 'class="fn url nickname" ';
        $fn_nickname = 'class="fn nickname" ';
    }
    if ($entry['id'] > 0) {
        $prefix1 = 'rp';
        $isComment = true;
    } else {
        $prefix1 = 'guest';
        $isComment = false;
    }
    $commentView = $isComment ? $skin->comment : $skin->guest;
    $commentItemsView = '';
    if ($listBlock === true) {
        if ($isComment == false) {
            global $comments;
            if (!isset($comments)) {
                list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $context->getProperty('suri.page'), $context->getProperty('skin.commentsOnGuestbook'));
            }
            foreach ($comments as $key => $value) {
                if ($value['secret'] == 1) {
                    if (!$authorized) {
                        if (!doesHaveOpenIDPriv($value)) {
                            $comments[$key]['name'] = _text('비밀방문자');
                            $comments[$key]['homepage'] = '';
                            $comments[$key]['comment'] = _text('관리자만 볼 수 있는 방명록입니다.');
                        } else {
                            $comments[$key]['name'] = _text('비밀방문자') . ' ' . $comments[$key]['name'];
                        }
                    }
                }
            }
        } else {
            if ($useAjaxBlock) {
                list($comments, $paging) = getCommentsWithPagingByEntryId($blogid, $entry['id'], $page, $count, 'loadComment', '(' . $entry['id'] . ',', ',true,true);return false;', null, $context->getProperty('skin.sortCommentsBy', 'ASC'));
            } else {
                $comments = getComments($entry['id'], $context->getProperty('skin.sortCommentsBy', 'ASC'));
            }
        }
        if (empty($skin->dressCommentBlock)) {
            if ($dressCommentBlock) {
                if ($isComment) {
                    $skin->commentGuest = $dressCommentBlock;
                } else {
                    $skin->guestGuest = $dressCommentBlock;
                }
            } else {
                if ($isComment) {
                    $dressCommentBlock = $skin->commentGuest = addOpenIDPannel($skin->commentGuest, 'rp');
                } else {
                    $dressCommentBlock = $skin->guestGuest = addOpenIDPannel($skin->guestGuest, 'guest');
                }
            }
            $skin->dressCommentBlock = true;
        }
        /// Dressing comments
        foreach ($comments as $commentItem) {
            $commentItemView = $isComment ? $skin->commentItem : $skin->guestItem;
            $commentSubItemsView = '';
            $subComments = getCommentComments($commentItem['id'], $commentItem);
            foreach ($subComments as $commentSubItem) {
                $commentSubItemView = $isComment ? $skin->commentSubItem : $skin->guestSubItem;
                $commentSubItem['name'] = htmlspecialchars($commentSubItem['name']);
                $commentSubItem['comment'] = htmlspecialchars($commentSubItem['comment']);
                $rp_class = $prefix1 . '_general';
                if ($blogid == $commentSubItem['replier']) {
                    $rp_class = $prefix1 . '_admin';
                } else {
                    if ($commentSubItem['secret'] == 1) {
                        $rp_class = $prefix1 . '_secret';
                        if ($authorized) {
                            $commentSubItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentSubItem['comment'];
                        } else {
                            $rp_class .= ' hiddenComment';
                            $commentSubItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentSubItem) ? ' ' . $commentSubItem['name'] : '');
                        }
                    }
                }
                dress($prefix1 . '_rep_class', $rp_class, $commentSubItemView);
                if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentSubItem['id'], $commentSubItemView) == false) {
                    $commentSubItemView = "<a id=\"comment{$commentSubItem['id']}\"></a>" . $commentSubItemView;
                }
                if (empty($commentSubItem['homepage']) || $commentSubItem['secret'] == 1 && !doesHaveOwnership()) {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentSubItem['name'] . "</span>", $commentSubItem), $commentSubItemView);
                } else {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentSubItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentSubItem['name'] . '</a>', $commentSubItem), $commentSubItemView);
                }
                $contentContainer["{$prefix1}_{$commentSubItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentSubItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentSubItem);
                dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentSubItem['written']), $commentSubItem['written']), $commentSubItemView);
                dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentSubItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "#comment{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentSubItem['id']}); return false;", $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);
            }
            $commentItem['name'] = htmlspecialchars($commentItem['name']);
            $commentItem['comment'] = htmlspecialchars($commentItem['comment']);
            $rp_class = $prefix1 . '_general';
            if ($blogid == $commentItem['replier']) {
                $rp_class = $prefix1 . '_admin';
            } else {
                if ($commentItem['secret'] == 1) {
                    $rp_class = $prefix1 . '_secret';
                    if ($authorized) {
                        $commentItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentItem['comment'];
                    } else {
                        $rp_class .= ' hiddenComment';
                        $commentItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentItem) ? ' ' . $commentItem['name'] : '');
                    }
                }
            }
            dress($prefix1 . '_rep_class', $rp_class, $commentItemView);
            if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentItem['id'], $commentItemView) == false) {
                $commentItemView = "<a id=\"comment{$commentItem['id']}\"></a>" . $commentItemView;
            }
            if (empty($commentItem['homepage']) || $commentItem['secret'] == 1 && !doesHaveOwnership()) {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentItem['name'] . "</span>", $commentItem), $commentItemView);
            } else {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentItem['name'] . '</a>', $commentItem), $commentItemView);
            }
            $contentContainer["{$prefix1}_{$commentItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentItem);
            dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentItem['id']}"), $commentItemView);
            dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentItem['written']), $commentItem['written']), $commentItemView);
            if (!$context->getProperty('blog.acceptComments', true) || $prefix1 == 'guest' && $authorized != true && $context->getProperty('blog.allowWriteDblCommentOnGuestbook') == 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', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "?commentId=" . $commentItem['id'] . "#comment{$commentItem['id']}"), $commentItemView);
            $commentItemsView .= $commentItemView;
        }
        /// Merging comments with its paging links.
        $commentContainer = $isComment ? $skin->commentContainer : $skin->guestContainer;
        dress($isComment ? 'rp_rep' : 'guest_rep', $commentItemsView, $commentContainer);
        if (count($comments) > 0) {
            if ($isComment && $useAjaxBlock) {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem, false, 'onclick');
            } else {
                $pagingView = '';
            }
            dress($prefix1 . '_container', "<div id=\"entry" . $entry['id'] . "CommentList\">" . $commentContainer . $pagingView . "</div>", $commentView);
        }
    } else {
        dress($prefix1 . '_container', '', $commentView);
    }
    /// Comment write block
    if ($inputBlock == true) {
        if (!empty($entry['acceptcomment'])) {
            $acceptcomment = $entry['acceptcomment'];
        } else {
            $pool = DBModel::getInstance();
            $pool->reset('Entries');
            $pool->setQualifier('blogid', 'equals', $blogid);
            $pool->setQualifier('id', 'equals', $entry['id']);
            $pool->setQualifier('draft', 'equals', 0);
            $acceptcomment = $pool->getCell('acceptcomment');
        }
        $useForm = false;
        $openid_identity = Acl::getIdentity('openid');
        if ($isComment) {
            if (!($skin->commentForm == '')) {
                $commentRrevView = $commentView;
                /// Comment Lists.
                $commentView = $skin->commentForm;
                /// Comment write block.
                $useForm = true;
            }
        } else {
            if (!($skin->guestForm == '')) {
                $commentRrevView = $commentView;
                $commentView = $skin->guestForm;
                $useForm = true;
            }
        }
        $default_guestname = '';
        $default_homepage = '';
        if (doesHaveOwnership() || $isComment && $acceptcomment == 1 && Setting::getBlogSettingGlobal('acceptComments', 1) || $isComment == false || $useForm == false) {
            $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_{$entry['id']}"])) {
                    $guestName = htmlspecialchars($_POST["name_{$entry['id']}"]);
                } else {
                    if (!empty($_SESSION['openid']['nickname'])) {
                        $guestName = htmlspecialchars($_SESSION['openid']['nickname']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName'])) {
                            $guestName = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName']);
                        } else {
                            $guestName = '';
                        }
                    }
                }
                dress('guest_name', $guestName, $commentGuestView);
                if (!empty($_POST["homepage_{$entry['id']}"]) && $_POST["homepage_{$entry['id']}"] != 'http://') {
                    if (strpos($_POST["homepage_{$entry['id']}"], 'http://') === 0) {
                        $guestHomepage = htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    } else {
                        $guestHomepage = 'http://' . htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    }
                } else {
                    if (!empty($_SESSION['openid']['homepage'])) {
                        $guestHomepage = htmlspecialchars($_SESSION['openid']['homepage']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestHomepage'])) {
                            $guestHomepage = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . '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, {$entry['id']}); return false;", $commentView);
            dress($prefix1 . '_textarea_body', 'comment', $commentView);
            dress($prefix1 . '_textarea_body_value', '', $commentView);
        } else {
            if ($useForm == true) {
                $commentView = '';
            }
        }
        if ($useForm == true) {
            dress($prefix1 . '_input_form', "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>', $commentRrevView);
            $commentView = $commentRrevView;
        } else {
            $commentView = "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>';
        }
    } else {
        dress($prefix1 . '_input_form', "", $commentView);
    }
    /// Adding feed links.
    dress('article_rep_rp_atomurl', $context->getProperty('uri.default') . '/atom/comment/' . $entry['id'], $commentView);
    dress('article_rep_rp_rssurl', $context->getProperty('uri.default') . '/rss/comment/' . $entry['id'], $commentView);
    return $commentView;
}
Esempio n. 6
0
function PN_Referer_Default()
{
    global $pluginMenuURL, $pluginSelfParam;
    if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['page'])) {
        $_GET['page'] = $_POST['page'];
    }
    $page = Setting::getBlogSetting('RowsPerPageReferer', 20);
    if (empty($_POST['perPage'])) {
        $perPage = $page;
    } else {
        if ($page != $_POST['perPage']) {
            Setting::setBlogSetting('RowsPerPageReferer', $_POST['perPage']);
            $perPage = $_POST['perPage'];
        } else {
            $perPage = $_POST['perPage'];
        }
    }
    ?>
						<div id="part-statistics-rank" class="part">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("리퍼러 순위");
    ?>
</span></h2>
							
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="number"><span class="text"><?php 
    echo _t("순위");
    ?>
</span></th>
										<th class="site"><span class="text"><?php 
    echo _t("리퍼러");
    ?>
</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $temp = Statistics::getRefererStatistics(getBlogId());
    for ($i = 0; $i < count($temp); $i++) {
        $record = $temp[$i];
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($temp) - 1 ? ' last-line' : '';
        ?>
									<tr class="<?php 
        echo $className;
        ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
										<td class="rank"><?php 
        echo $i + 1;
        ?>
.</td>
										<td class="site"><a href="http://<?php 
        echo Utils_Misc::escapeJSInAttribute($record['host']);
        ?>
" onclick="window.open(this.href); return false;"><?php 
        echo htmlspecialchars($record['host']);
        ?>
</a> <span class="count">(<?php 
        echo $record['count'];
        ?>
)</span></td>
									</tr>
<?php 
    }
    ?>
								</tbody>
							</table>
						</div>
						
						<hr class="hidden" />
						
						<form id="part-statistics-log" class="part" method="post" action="<?php 
    echo $pluginMenuURL;
    ?>
">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("리퍼러 로그");
    ?>
</span></h2>
							
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="number"><span class="text">날짜</span></th>
										<th class="site"><span class="text">주소</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $more = false;
    list($referers, $paging) = Statistics::getRefererLogsWithPage($_GET['page'], $perPage);
    for ($i = 0; $i < count($referers); $i++) {
        $record = $referers[$i];
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($referers) - 1 ? ' last-line' : '';
        ?>
									<tr class="<?php 
        echo $className;
        ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
										<td class="date"><?php 
        echo Timestamp::formatDate($record['referred']);
        ?>
</td>
										<td class="address"><a href="<?php 
        echo Utils_Misc::escapeJSInAttribute($record['url']);
        ?>
" onclick="window.open(this.href); return false;" title="<?php 
        echo htmlspecialchars($record['url']);
        ?>
"><?php 
        echo fireEvent('ViewRefererURL', htmlspecialchars(Utils_Unicode::lessenAsEm($record['url'], 70)), $record);
        ?>
</a></td>
									</tr>
<?php 
    }
    ?>
								</tbody>
							</table>
							
							<div class="data-subbox">
								<div id="page-section" class="section">
									<div id="page-navigation">
										<span id="page-list">
<?php 
    $paging['prefix'] = $pluginSelfParam . '&page=';
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>';
    echo str_repeat("\t", 8) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . CRLF;
    ?>
										</span>
									</div>
									<div class="page-count">
										<?php 
    echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 0);
    ?>
										<select name="perPage" onchange="document.getElementById('part-statistics-log').submit()">					
<?php 
    for ($i = 10; $i <= 30; $i += 5) {
        if ($i == $perPage) {
            ?>
											<option value="<?php 
            echo $i;
            ?>
" selected="selected"><?php 
            echo $i;
            ?>
</option>
<?php 
        } else {
            ?>
											<option value="<?php 
            echo $i;
            ?>
"><?php 
            echo $i;
            ?>
</option>
<?php 
        }
    }
    ?>
										</select>
										<?php 
    echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 1);
    ?>
									</div>
								</div>
							</div>
						</form>
						
						<div class="clear"></div>
<?php 
}
Esempio n. 7
0
										<input type="submit" class="revert-button input-button" value="<?php 
echo _t('복구');
?>
" onclick="revertComments(); return false;" />
									</div>

									<div id="page-section" class="section">
										<div id="page-navigation">
											<span id="page-list">
<?php 
//$paging['url'] = 'document.getElementById('list-form').page.value=';
//$paging['prefix'] = '';
//$paging['postfix'] = '; document.getElementById('list-form').submit()';
$pagingTemplate = '[##_paging_rep_##]';
$pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>';
print Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false);
?>
											</span>
											<span id="total-count"><?php 
echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']);
?>
</span>
										</div>
										<div class="page-count">
											<?php 
echo Utils_Misc::getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0);
?>
											<select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()">
<?php 
for ($i = 10; $i <= 30; $i += 5) {
    if ($i == $perPage) {
Esempio n. 8
0
function MT_Cover_getRecentEntries($parameters)
{
    global $skin;
    $context = Model_Context::getInstance();
    $data = $context->getProperty('plugin.config');
    importlib("model.blog.entry");
    importlib("model.blog.tag");
    $data['coverMode'] = !isset($data['coverMode']) ? 1 : $data['coverMode'];
    if (Utils_Misc::isMetaBlog() != true) {
        $data['coverMode'] = 1;
    }
    $data['screenshot'] = !isset($data['screenshot']) ? 1 : $data['screenshot'];
    $data['screenshotSize'] = !isset($data['screenshotSize']) ? 90 : $data['screenshotSize'];
    $data['paging'] = !isset($data['paging']) ? '2' : $data['paging'];
    $data['contentLength'] = !isset($data['contentLength']) ? 250 : $data['contentLength'];
    if (isset($parameters['preview'])) {
        // preview mode
        $retval = '표지에 최신 글 목록을 추가합니다.';
        return htmlspecialchars($retval);
    }
    $entryLength = isset($parameters['entryLength']) ? $parameters['entryLength'] : 10;
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail")) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail");
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail", 0777);
    }
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'))) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'));
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'), 0777);
    }
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/")) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/");
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/", 0777);
    }
    $page = $data['paging'] == '1' && !empty($_GET['page']) ? intval($_GET['page']) : 1;
    $cache = new PageCache();
    $cache->name = 'MT_Cover_RecentPS';
    if ($cache->load()) {
        //If successful loads
        $cache->contents = unserialize($cache->contents);
        // If coverpage is single mode OR coverpage is coverblog and cache is not expired, return cache contents.
        if (($data['coverMode'] == 1 || $data['coverMode'] == 2) && array_key_exists($page, $cache->contents) && Timestamp::getUNIXtime() - $cache->dbContents < 300) {
            return $cache->contents[$page];
        }
    }
    $pool = DBModel::getInstance();
    $pool->reset("BlogSettings");
    $pool->setQualifier("name", "eq", 'visibility', true);
    $pool->setQualifier("value", "<", 2);
    $privateBlogId = $pool->getCell("blogid");
    $pool->reset("Entries");
    $pool->join("Categories", "left", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id")));
    $pool->setQualifier("e.draft", "eq", 0);
    $pool->setQualifier("e.category", "beq", 0);
    if ($privateBlogId) {
        $pool->setQualifier("e.blogid", "hasnoneof", $privateBlogId);
    }
    if (Utils_Misc::isMetaBlog() == true && doesHaveOwnership() && $context->getProperty('service.type', 'single') != 'single') {
        $pool->setQualifier("e.visibility", ">", 1);
        $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
    } else {
        if (!doesHaveOwnership()) {
            $pool->setQualifier("e.visibility", ">", 1);
            $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0));
        }
    }
    if ($data['coverMode'] != 2) {
        $pool->setQualifier("e.blogid", "eq", $context->getProperty("blog.id"));
    }
    list($entries, $paging) = Paging::fetch($pool, $page, $entryLength);
    $html = '';
    foreach ((array) $entries as $entry) {
        $tagLabelView = "";
        $blogid = $data['coverMode'] == 2 ? $entry['blogid'] : $context->getProperty('blog.id');
        $entryTags = getTags($blogid, $entry['id']);
        $defaultURL = getDefaultURL($blogid);
        if (sizeof($entryTags) > 0) {
            $tags = array();
            foreach ($entryTags as $entryTag) {
                $tags[$entryTag['name']] = "<a href=\"{$defaultURL}/tag/" . (Setting::getBlogSettingGlobal('useSloganOnTag', true) ? URL::encode($entryTag['name'], $service['useEncodedURL']) : $entryTag['id']) . '">' . htmlspecialchars($entryTag['name']) . '</a>';
            }
            $tagLabelView = "<div class=\"post_tags\"><span>TAG : </span>" . implode(",\r\n", array_values($tags)) . "</div>";
        }
        if (empty($entry['category'])) {
            $entry['label'] = _text('분류없음');
            $entry['link'] = "{$defaultURL}/category";
        } else {
            $entry['link'] = "{$defaultURL}/category/" . (Setting::getBlogSettingGlobal('useSloganOnCategory', true) ? URL::encode($entry['label'], $service['useEncodedURL']) : $entry['category']);
        }
        $permalink = "{$defaultURL}/" . (Setting::getBlogSettingGlobal('useSloganOnPost', true) ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL', false)) : $entry['id']);
        $html .= '<div class="coverpost">' . CRLF;
        if ($imageName = MT_Cover_getAttachmentExtract($entry['content'])) {
            if (($tempImageSrc = MT_Cover_getImageResizer($blogid, $imageName, $data['screenshotSize'])) && $data['screenshot'] == 1) {
                $html .= '<div class="img_preview"><a href="' . $permalink . '"><img src="' . $tempImageSrc . '" alt="" /></a></div>' . CRLF;
            }
        }
        $html .= '	<div class="content_box">';
        $html .= '		<h2><a href="' . $permalink . '">' . htmlspecialchars($entry['title']) . '</a></h2>' . CRLF;
        $html .= '		<div class="post_info">' . CRLF;
        $html .= '			<span class="category"><a href="' . htmlspecialchars($entry['link']) . '">' . htmlspecialchars($entry['label']) . '</a></span>' . CRLF;
        $html .= '			<span class="date">' . Timestamp::format5($entry['published']) . '</span>' . CRLF;
        $html .= '			<span class="author"><span class="preposition">by </span>' . User::getName($entry['userid']) . '</span>' . CRLF;
        $html .= '		</div>' . CRLF;
        $html .= '		<div class="post_content">' . htmlspecialchars(Utils_Unicode::lessenAsEm(removeAllTags(stripHTML($entry['content'])), $data['contentLength'])) . '</div>' . CRLF;
        $html .= $tagLabelView;
        $html .= '		<div class="clear"></div>' . CRLF;
        $html .= '	</div>';
        $html .= '</div>' . CRLF;
    }
    if ($data['paging'] == '1') {
        $paging['page'] = $page;
        $paging['total'] = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries e WHERE {$multiple} e.draft = 0 {$visibility} AND e.category >= 0");
        $html .= Paging::getPagingView($paging, $skin->paging, $skin->pagingItem) . CRLF;
        $html .= '<script type="text/javascript">' . CRLF;
        $html .= '//<![CDATA[' . CRLF;
        if ($paging['page'] > 1) {
            $html .= 'var prevURL = "' . $paging['url'] . '?page=' . ($paging['page'] - 1) . '"' . CRLF;
        }
        if ($paging['page'] < $paging['total']) {
            $html .= 'var nextURL = "' . $paging['url'] . '?page=' . ($paging['page'] + 1) . '"' . CRLF;
        }
        $html .= '//]]>' . CRLF;
        $html .= '</script>';
    }
    $target = $html;
    $cache->contents[$page] = $target;
    $cache->contents = serialize($cache->contents);
    $cache->dbContents = Timestamp::getUNIXtime();
    $cache->update();
    unset($cache);
    return $target;
}
Esempio n. 9
0
}
if (preg_match("@\\[##_link_list_##\\]@iU", $view)) {
    dress('link_list', getLinkListView(getLinks($blogid)), $view, false, true);
}
if (preg_match("@\\[##_paging_##\\]@iU", $view)) {
    if (isset($paging)) {
        if (isset($cache) && strpos($cache->name, 'Paging') !== false) {
            if ($cache->load()) {
                $pagingView = $cache->contents;
            } else {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
                $cache->contents = $pagingView;
                $cache->update();
            }
        } else {
            $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem);
        }
        dress('paging_list', $pagingView, $view, false, true);
        if (!empty($entries) || $suri['directive'] == '/guestbook') {
            dress('paging', $pagingView, $view, false, true);
        }
        $url = URL::encode($paging['url'], $service['useEncodedURL']);
        $prefix = $paging['prefix'];
        $postfix = isset($paging['postfix']) ? $paging['postfix'] : '';
        // prev_page, next_page for legacy support.
        dress('prev_page', isset($paging['prev']) ? "href='{$url}{$prefix}{$paging['prev']}{$postfix}'" : '', $view);
        dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view);
        dress('next_page', isset($paging['next']) ? "href='{$url}{$prefix}{$paging['next']}{$postfix}'" : '', $view);
        dress('next_page_title', isset($paging['next_title']) ? $paging['next_title'] : '', $view);
    } else {
        if (isset($cache) && strpos($cache->name, 'Paging') !== false && $cache->load()) {
Esempio n. 10
0
function getFlickrPhotos($target)
{
    global $blogURL, $pluginURL, $configVal;
    requireModel('reader.common');
    requireComponent('Textcube.Model.Paging');
    requireComponent('Textcube.Function.misc');
    $data = misc::fetchConfigVal($configVal);
    $flickruserid = isset($data['flickruserid']) ? $data['flickruserid'] : "";
    require_once "lib/phpFlickr.php";
    $flickr_api_key = "d1038f051000214af2bf694014ca8f98";
    //It's key for plugin. It does not change.
    $f = new phpFlickr($flickr_api_key);
    $listLength = isset($_GET['length']) ? $_GET['length'] : 16;
    $searchKey = isset($_GET['search']) && !empty($_GET['search']) ? urldecode($_GET['search']) : "";
    $photoSets = isset($_GET['photoSets']) && !empty($_GET['photoSets']) ? $_GET['photoSets'] : "";
    $personMode = isset($_GET['person']) ? $_GET['person'] : "my";
    $page = isset($_GET['page']) ? $_GET['page'] : 1;
    $zoomStyle = "flickr";
    ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="<?php 
    echo $pluginURL;
    ?>
/style/default.css" />
	</head>
	<script type="text/javascript">
	//<![CDDA[
		function insertPhoto(_link, _src_m, _src_l, _title, _style){
			var linkTag_A = '', linkTag_B = '', imgTag = '';
			linkTag_A = '<a href="' + _link + '" title="' + _title + '" target="_blank">'; 
			linkTag_B = '</a>';
			imgTag	= '<img src="' + _src_m + '" border="0" />';

			var isWYSIWYG = false;
			try{
				if(parent.editor.editMode == 'WYSIWYG')
					isWYSIWYG = true;
			}
			catch(e){ }
			if(isWYSIWYG) {
				parent.editor.command('Raw', (linkTag_A + imgTag), linkTag_B);
			}else{
				parent.insertTag(parent.editor.textarea, (linkTag_A + imgTag), linkTag_B);
			}
		}
	//]]>
	</script>
	<body style="margin:0;padding:0;border:none;background-color:#ffffff;">
	<div id="photosBody" style="height:200px;width:100%;overflow-x:hidden;overflow-y:auto;background-color:#fff;">
	<?php 
    if ($personMode == "my" && !empty($flickruserid) && empty($searchKey)) {
        if (!empty($photoSets)) {
            $photoset = $f->photosets_getPhotos($photoSets, "owner_name", NULL, $listLength, $page);
            $photos['photos'] = $photoset['photoset'];
        } else {
            $photos = $f->people_getPublicPhotos($flickruserid, NULL, NULL, $listLength, $page);
        }
        foreach ($photos['photos']['photo'] as $photo) {
            $_output = getFlickrPhotosInfo($photo, $zoomStyle, $flickruserid);
            echo $_output;
        }
    } else {
        if (($personMode == "my" || $personMode == "all") && !empty($searchKey)) {
            if ($personMode == "my" && !empty($flickruserid)) {
                $searchArray = array("user_id" => $flickruserid, "text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
            } else {
                $searchArray = array("text" => $searchKey, "sort" => "date-posted-desc", "per_page" => $listLength, "page" => $page);
            }
            $photos['photos'] = $f->photos_search($searchArray);
            if ($photos['photos']['total'] > 0) {
                foreach ($photos['photos']['photo'] as $photo) {
                    $_output = getFlickrPhotosInfo($photo, $zoomStyle);
                    echo $_output;
                }
            } else {
                echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos. Please input title, description or tags.</p>';
            }
        } else {
            if ($personMode == "all" && empty($searchKey)) {
                $photos['photos'] = $f->photos_getRecent(NULL, $listLength, $page);
                foreach ($photos['photos']['photo'] as $photo) {
                    $_output = getFlickrPhotosInfo($photo, $zoomStyle);
                    echo $_output;
                }
            } else {
                echo '<p style="margin-top:30px; text-align:center; font-size:9pt;">Flickr did not find any photos.', !$nickName ? '(Input title, description or tags.)' : '', '</p>';
            }
        }
    }
    $pageLink = '?person=' . $personMode . '&photoSets=' . $photoSets . '&length=' . $listLength . '&search=' . rawurlencode($searchKey);
    //$photos['total'] = $photos['total'] > 996 ? 996 : $photos['total'];
    $paging = HC_getFetchWithPaging($photos['photos']['total'], $page, $listLength, "{$blogURL}/plugin/flickrPhotos", $pageLink . "&page=");
    $pagingTemplate = '[##_paging_rep_##]';
    $pagingItemTemplate = '<a [##_paging_rep_link_##] class="num">[##_paging_rep_link_num_##]</a>';
    $prev_page = isset($paging['prev']) ? " href=\"{$pageLink}&page={$paging['prev']}\" " : '';
    $next_page = isset($paging['next']) ? " href=\"{$pageLink}&page={$paging['next']}\" " : '';
    $no_more_prev = isset($paging['prev']) ? '' : 'no-more-prev';
    $no_more_next = isset($paging['next']) ? '' : 'no-more-next';
    $target = '<div class="paging-list"><a ' . $prev_page . ' class="prev ' . $no_more_prev . '">prev </a>';
    $target .= '<span class="numbox">' . str_repeat("\t", 12) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . '</span>';
    $target .= '<a ' . $next_page . ' class="next ' . $no_more_next . '"> next</a>';
    $target .= '<div class="totalResults">';
    $target .= 'Total ' . $photos['photos']['total'] . ' photos.';
    $target .= '</div></div>';
    echo $target;
    ?>
	</div>
	</body>
	</html>
	<?php 
}