示例#1
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;
}
示例#2
0
													<td class="check">
														<input type="checkbox" id="check_<?php 
        echo $count;
        ?>
" />
													</td>
													<td class="name"><?php 
        echo $value['name'];
        ?>
</td>
													<td class="email"><?php 
        echo htmlspecialchars($value['loginid']);
        ?>
</td>
													<td class="date"><?php 
        echo Timestamp::format5($value['created']);
        ?>
</td>
													<td class="posting"><?php 
        echo $value['posting'];
        ?>
</td>
													<td class="status">
<?php 
        $authtoken = getAuthToken($value['userid']);
        if ($value['lastlogin'] == 0) {
            ?>
													<?php 
            echo _t('미참여');
            if ($value['acl'] & BITWISE_ADMINISTRATOR) {
                $invitationURL = getInvitationLink(getBlogURLById($blogid), htmlspecialchars($value['loginid']), $value['password'], $authtoken);
示例#3
0
 $itemsView .= '	<span class="left">' . ($category == 0 ? _text('모든 카테고리') : ucwords(getCategoryNameById($blogid, $category))) . ' (' . $list['count'] . ')</span>' . CRLF;
 $itemsView .= '	<span class="right">Page <span class="now_page">' . $paging['page'] . '</span> / ' . $paging['pages'] . '</span>' . CRLF;
 $itemsView .= '</li>' . CRLF;
 foreach ($list['items'] as $item) {
     $author = User::getName($item['userid']);
     if ($imageName = printIphoneAttachmentExtract(printIphoneEntryContent($blogid, $item['userid'], $item['id']))) {
         $imageSrc = printIphoneImageResizer($blogid, $imageName, 28);
     } else {
         $imageSrc = $service['path'] . '/resources/style/iphone/image/noPostThumb.png';
     }
     $itemsView .= '<li class="post_item">' . CRLF;
     $itemsView .= '	<span class="image"><img src="' . $imageSrc . '" width="28" height="28" /></span>' . CRLF;
     $itemsView .= '	<a href="' . $blogURL . '/entry/' . $item['id'] . '" class="link">' . CRLF;
     $itemsView .= '		<div class="post">' . CRLF;
     $itemsView .= '			<span class="title">' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</span>' . CRLF;
     $itemsView .= '			<span class="description">' . Timestamp::format5($item['published']) . ', ' . 'Comments(' . ($item['comments'] > 0 ? $item['comments'] : 0) . ')' . '</span>' . CRLF;
     $itemsView .= '		</div>' . CRLF;
     $itemsView .= '	</a>' . CRLF;
     $itemsView .= '</li>' . CRLF;
 }
 $itemsView .= '<li class="pagination">' . CRLF;
 if (isset($paging['prev'])) {
     $itemsView .= '<a href="' . $blogURL . '/category/' . $category . '?page=' . $paging['prev'] . '" class="previous">' . _textf('%1 페이지', $paging['prev']) . '</a>' . CRLF;
 }
 if (isset($paging['next'])) {
     $itemsView .= '<a href="' . $blogURL . '/category/' . $category . '?page=' . $paging['next'] . '" class="next">' . _textf('%1 페이지', $paging['next']) . '</a>' . CRLF;
 }
 if ($suri['page'] > 1 && $suri['page'] != $paging['pages']) {
     $itemsView .= '<strong>' . $suri['page'] . '</strong>' . CRLF;
 }
 $itemsView .= '</li>' . CRLF;
示例#4
0
function sitemap_Manage()
{
    global $blog, $service, $database, $pluginURL, $hostURL, $blogURL, $blogid;
    $userid = getUserId();
    $version = explode('.', trim(file_get_contents(ROOT . '/cache/CHECKUP')));
    if ($version[0] < 1 || $version[0] === '1' && (int) $version[1] < 8) {
        $_text = _t('Alert ::\\r\\n - This plugin must be Textcube 1.8 or above. \\r\\n Please update your textcube and try again.');
        $setupAlert = '<script type="text/javascript">alert("' . $_text . '"); history.go(-1);</script>';
        exit;
    }
    $sitemap = new HC_XMLSitemap();
    $indexonTime = Timestamp::format5(filemtime(ROOT . "/cache/sitemap/" . $sitemap->filename));
    $gzonTime = Timestamp::format5(filemtime(ROOT . "/cache/sitemap/" . $blogid . "/" . $sitemap->filename . ".gz"));
    ?>
	<style type="text/css">
	<!--
	th div {
		text-align: left;
		font-weight: bold;
	}
	.site div {
		text-align: left;
	}
	.site div blockquote {
		margin-left: 2.0em;
	}
	.site ul li {
		line-height: 2.0em;
	}
	ul.status li {
		list-style-type: circle !important;
	}
	button.rebuild-sitemap {
		color: #0066CC;
		cursor: pointer;
	}
	li dfn {
		color: #FF0000;
		font-style: normal;
	}
	-->
	</style>

	<script type="text/javascript">
	//<![CDATA[
	function toggle_buildonchange() {
		try {
			var oo = document.getElementById( 'buildonchange' );
			if( ! oo ) {
				return false;
			}
			oo = oo.checked ? "1" : "0";
			var request = new HTTPRequest("GET", "<?php 
    echo $blogURL;
    ?>
/plugin/sitemap/buildonchange?mode=" + oo);
			request.onSuccess = function() {
				PM.removeRequest(this);
				PM.showMessage("<?php 
    echo _t('Data save success.');
    ?>
", "center", "bottom");
			}
			request.onError = function() {
				PM.removeRequest(this);
				PM.showErrorMessage("<?php 
    echo _t('Data save error.');
    ?>
", "center", "bottom");
			}
			request.send("");
		} catch(e) {
		}
	}
	function toggle_notification(target) {
		try {
			var targetId = 'notify'+target;
			var oo = document.getElementById( targetId );
			if( ! oo ) {
				return false;
			}
			oo = oo.checked ? "1" : "0";
			var request = new HTTPRequest("GET", "<?php 
    echo $blogURL;
    ?>
/plugin/sitemap/notification?mode=" + target + "&setup=" + oo);
			request.onSuccess = function() {
				PM.removeRequest(this);
				PM.showMessage("<?php 
    echo _t('Notification update success.');
    ?>
", "center", "bottom");
			}
			request.onError = function() {
				PM.removeRequest(this);
				PM.showErrorMessage("<?php 
    echo _t('Notification update error.');
    ?>
", "center", "bottom");
			}
			request.send("");
		} catch(e) {
		}
	}
	function toggle_rebuildsitemap() {
		try {
			var request = new HTTPRequest("GET", "<?php 
    echo $blogURL;
    ?>
/plugin/sitemap/rebuildsitemap?force=1");
			request.onSuccess = function() {
				PM.removeRequest(this);
				PM.showMessage("<?php 
    echo _t('Sitemap rebuild completed.');
    ?>
", "center", "bottom");
			}
			request.onError = function() {
				PM.removeRequest(this);
				PM.showErrorMessage("<?php 
    echo _t('Sitemap no need to rebuild.');
    ?>
", "center", "bottom");
			}
			request.send("");
		} catch(e) {
		}
	}
	//]]>
	</script>

	<div id="sitemap-status" calss="part">
		<h2 class="caption"><span class="main-text"><?php 
    echo _t('Status.');
    ?>
</span></h2>
		<table class="data-inbox" cellspacing="0" cellpadding="0">
			<tbody>
				<tr class="site">
					<td><div><blockquote><ul class="status">
						<li><?php 
    echo _f('Your sitemap was last built on %1', $indexonTime);
    ?>
</li>
						<li><?php 
    echo _f('Your sitemap(zipped, .gz) was last built on %1', $gzonTime);
    ?>
</li>
						<li><?php 
    echo _f('The building process took about %1 seconds to complete.', $sitemap->getRunOverTime());
    ?>
</li>
						<li><?php 
    echo _f('If you changed something on your server or blog, your should %1rebuild the sitemap%2 manually.', '&nbsp;<button class="rebuild-sitemap" onclick="toggle_rebuildsitemap();">', '</button>');
    ?>
</li>
					</ul></blockquote></div></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div id="sitemap-basic-options" calss="part">
		<h2 class="caption"><span class="main-text"><?php 
    echo _t('Basic Options.');
    ?>
</span></h2>
		<table class="data-inbox" cellspacing="0" cellpadding="0">
			<thead>
				<tr><th><div><?php 
    echo _t('Building mode:');
    ?>
</div></th></tr>
			</thead>
			<tbody>
				<tr class="site">
					<td><div><blockquote><ul>
						<li><input id="buildonchange" type="checkbox" name="buildonchange" onclick="toggle_buildonchange();"<?php 
    echo $sitemap->getBuildOnChange() ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="buildonchange"><?php 
    echo _t('Rebuild sitemap if you change the content of your blog.');
    ?>
</label></li>
					</ul></blockquote></div></td>
				</tr>
			</tbody>
		</table>
		<table class="data-inbox" cellspacing="0" cellpadding="0">
			<thead>
				<tr><th><div><?php 
    echo _t('Update notification:');
    ?>
</div></th></tr>
			</thead>
			<tbody>
				<tr class="site">
					<td><div><blockquote><ul>
						<li><input id="notifygoogle" type="checkbox" name="notifygoogle" onclick="toggle_notification('google');"<?php 
    echo $sitemap->getNotify('google') ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="notifyGoogle"><?php 
    echo _t('Notify Google about updates of your blog.');
    ?>
</label></li>
						<li><input id="notifyyahoo" type="checkbox" name="notifyyahoo" onclick="toggle_notification('yahoo');" <?php 
    echo $sitemap->getNotify('yahoo') ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="notifyYahoo"><?php 
    echo _t('Notify Yahoo! about updates of your blog.');
    ?>
</label></li>
						<li><input id="notifymsn" type="checkbox" name="notifymsn" onclick="toggle_notification('msn');" <?php 
    echo $sitemap->getNotify('msn') ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="notifyMSN"><?php 
    echo _t('Notify MSN about updates of your blog.');
    ?>
</label></li>
						<li><input id="notifyask" type="checkbox" name="notifyask" onclick="toggle_notification('ask');" <?php 
    echo $sitemap->getNotify('ask') ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="notifyASK"><?php 
    echo _t('Notify ASK.com about updates of your blog.');
    ?>
</label></li>
						<li><input id="notifybing" type="checkbox" name="notifybing" onclick="toggle_notification('bing');" <?php 
    echo $sitemap->getNotify('bing') ? ' checked="checked"' : '';
    ?>
 />&nbsp;<label for="notifyBing"><?php 
    echo _t('Notify Bing about updates of your blog.');
    ?>
</label></li>
					</ul></blockquote></div></td>
				</tr>
			</tbody>
		</table>
	</div>
<?php 
}
示例#5
0
function dumpAsFile($data)
{
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "")) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "");
        @chmod(__TEXTCUBE_CACHE_DIR__ . "", 0777);
    }
    $dumpFile = __TEXTCUBE_CACHE_DIR__ . '/dump';
    if (file_exists($dumpFile)) {
        $dumpedLog = @file_get_contents($dumpFile);
    } else {
        $dumpedLog = '';
    }
    $dumpedLog = $dumpedLog . Timestamp::format5() . " : " . print_r($data, true) . CRLF;
    $fileHandle = fopen($dumpFile, 'w');
    fwrite($fileHandle, $dumpedLog);
    fclose($fileHandle);
}
function getRemoteResponseLog($blogid, $entry, $type = null)
{
    global $database;
    if ($type === null) {
        $filter = '';
    } else {
        $filter = " AND responsetype = '" . POD::escapeString($type) . "'";
    }
    $result = POD::query("SELECT * FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid} AND entry = {$entry} {$filter}");
    $str = '';
    while ($row = POD::fetch($result)) {
        $str .= $row['id'] . ',' . $row['url'] . ',' . Timestamp::format5($row['written']) . '*';
    }
    return $str;
}
示例#7
0
    $className .= $i == sizeof($rec) - 1 ? ' last-line' : '';
    ?>
									<tr class="<?php 
    echo $className;
    ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
										<td><?php 
    echo "{$record['openid']} {$nickname}";
    ?>
</td>
										<td><?php 
    echo $record['delegatedid'];
    ?>
</td>
										<td><?php 
    echo $record['logincount'];
    ?>
</td>
										<td><?php 
    echo Timestamp::format5($record['lastlogin']);
    ?>
</td>
									</tr>
<?php 
}
?>
								</tbody>
							</table>
						</div>
<?php 
require ROOT . '/interface/common/owner/footer.php';
示例#8
0
文件: index.php 项目: ragi79/Textcube
function MT_Cover_getRecentEntries($parameters)
{
    global $database, $blog, $service, $serviceURL, $suri, $configVal, $defaultURL, $skin;
    requireModel("blog.entry");
    requireModel("blog.tag");
    $data = Setting::fetchConfigVal($configVal);
    $data['coverMode'] = !isset($data['coverMode']) ? 1 : $data['coverMode'];
    if (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/" . getBlogId())) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId());
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId(), 0777);
    }
    if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/coverPostThumbnail/")) {
        @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/coverPostThumbnail/");
        @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/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];
        }
    }
    if (Misc::isMetaBlog() == true && doesHaveOwnership() && $service['type'] != 'single') {
        $visibility = 'AND e.visibility > 1 AND (c.visibility > 1 OR e.category = 0)';
    } else {
        $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 1 AND (c.visibility > 1 OR e.category = 0)';
    }
    $multiple = $data['coverMode'] == 2 ? '' : 'e.blogid = ' . getBlogId() . ' AND';
    $privateBlogId = POD::queryColumn("SELECT blogid \n\t\tFROM {$database['prefix']}BlogSettings\n\t\tWHERE name = 'visibility'\n\t\tAND value < 2");
    if (!empty($privateBlogId)) {
        $privateBlogs = ' AND e.blogid NOT IN (' . implode(',', $privateBlogId) . ')';
    } else {
        $privateBlogs = '';
    }
    list($entries, $paging) = Paging::fetch("SELECT e.blogid, e.id, e.userid, e.title, e.content, e.slogan, e.category, e.published, e.contentformatter, c.label\n\t\tFROM {$database['prefix']}Entries e\n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id\n\t\tWHERE {$multiple} e.draft = 0 {$visibility} AND e.category >= 0 {$privateBlogs}\n\t\tORDER BY published DESC", $page, $entryLength);
    $html = '';
    foreach ((array) $entries as $entry) {
        $tagLabelView = "";
        $blogid = $data['coverMode'] == 2 ? $entry['blogid'] : getBlogId();
        $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'], $service['useEncodedURL']) : $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 .= 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;
}
示例#9
0
文件: index.php 项目: ragi79/Textcube
function PN_Subscription_Default()
{
    global $pluginMenuURL, $pluginSelfParam, $totalSubscribers, $updatedSubscribers;
    $blogid = getBlogId();
    $temp = getSubscriptionStatistics($blogid);
    $aggregatorInfo = organizeAggregatorInfo($temp);
    Setting::setBlogSetting('SubscriberCount', $totalSubscribers);
    ?>
						<script type="text/javascript">
							//<![CDATA[
								window.addEventListener("load", execLoadFunction, false);
								
								function execLoadFunction() {
									//removeItselfById('log-pages-submit');
								}
							//]]>
						</script>
						<div id="part-statistics-total" class="part">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("전체 피드 통계");
    ?>
</span></h2>
							<dl class="data-inbox">
								<dt class="number"><span class="text"><?php 
    echo _t("전체 구독자수");
    ?>
</span></dt>
								<dd class="number"><span class="text"><?php 
    echo _f("%1 명", $totalSubscribers);
    ?>
</span></dd>
								<dt class="aggregator"><span class="text"><?php 
    echo _t("구독기");
    ?>
</span></dt>
								<dd class="aggregator"><span class="text"><?php 
    echo _f("%1 종류의 구독기 및 크롤러가 구독중입니다.", sizeof($aggregatorInfo));
    ?>
</span></dd>
								<dt class="lastRSSupdate"><span class="text"><?php 
    echo _t("최종 RSS 갱신일");
    ?>
</span></dt>
								<dd class="lastRSSupdate"><span class="text"><?php 
    echo Setting::getBlogSetting('LatestRSSrefresh', null) !== null ? Timestamp::format5(Setting::getBlogSetting('LatestRSSrefresh', null)) : _t('정보가 갱신되지 않았습니다');
    ?>
</span></dd>
								<dt class="updatedAggregators"><span class="text"><?php 
    echo _t("이후 갱신된 RSS 구독기");
    ?>
</span></dt>
								<dd class="updatedAggregators"><span class="text"><?php 
    echo $updatedSubscribers;
    ?>
</span></dd>
							</dl>
						</div>

						<hr class="hidden" />

						<div id="part-statistics-rank" class="part">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("피드 구독 순위");
    ?>
</span></h2>
							<div class="main-explain-box">
								<p class="explain">
									<?php 
    echo _t("크롤러에 구독자 수 정보를 넣지 않는 웹 RSS 리더의 경우 정상적인 구독자수를 판별할 수 없습니다.");
    ?>
<br />
									<?php 
    echo _t("강조 표시된 구독기는 검색 엔진 및 메타 프로그램을 의미합니다.");
    ?>
								</p>
							</div>
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="rank"><span class="text"><?php 
    echo _t("순위");
    ?>
</span></th>
										<th class="aggregator"><span class="text"><?php 
    echo _t("구독기");
    ?>
</span></th>
										<th class="count"><span class="text"><?php 
    echo _t("구독자 수");
    ?>
</span></th>
										<th class="subscribed"><span class="text"><?php 
    echo _t("구독 시작일");
    ?>
</span></th>
										<th class="referred"><span class="text"><?php 
    echo _t("최근 구독일");
    ?>
</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $i = 0;
    foreach ($aggregatorInfo as $agent => $info) {
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($aggregatorInfo) - 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="aggregator"><?php 
        if ($info['isRobot']) {
            echo '<span class="robot">' . $agent . '</span>';
        } else {
            echo $agent;
        }
        ?>
</td>
										<td class="count"><?php 
        echo $info["subscribers"];
        ?>
명</td>
										<td class="subscribed"><?php 
        echo Timestamp::formatDate($info["subscribed"]);
        ?>
</td>
										<td class="referred"><?php 
        echo Timestamp::formatDate($info["referred"]);
        ?>
</td>
									</tr>
<?php 
        $i++;
    }
    ?>
								</tbody>
							</table>
						</div>
						
						<div class="clear"></div>
<?php 
}
示例#10
0
function printMobileCommentView($entryId)
{
    global $blogURL;
    $comments = getComments($entryId);
    if (count($comments) == 0) {
        ?>
		<div class="comment">
			<?php 
        echo _text('댓글이 없습니다');
        ?>
		</div>
		<hr />
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<div class="comment">
			<div class="name">
				<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
				<a href="<?php 
            echo $blogURL;
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
">RE</a>
				<a href="<?php 
            echo $blogURL;
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
">DEL</a><br />
				(<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
)
			</div>
			<div class="body"><?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
</div>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<blockquote>
				<div class="name">
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
					<a href="<?php 
                echo $blogURL;
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
">DEL</a><br />
					(<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
)
				</div>
				<div class="body"><?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
</div>
			</blockquote>
			<?php 
            }
            ?>
		</div>
		<hr />
		<?php 
        }
    }
    printMobileCommentFormView($entryId);
}
示例#11
0
function getFeedItemByLines($lines)
{
    $context = Model_Context::getInstance();
    $channelItems = array();
    foreach ($lines as $row) {
        $entryURL = $context->getProperty('uri.default') . '/line#' . $row['id'];
        $content = $row['content'];
        $item = array('id' => $row['id'], 'title' => RSSMessage(Timestamp::format5($row['created'])), 'link' => $entryURL, 'author' => RSSMessage($row['author']), 'categories' => array(), 'description' => RSSMessage($content), 'pubDate' => $row['created'], 'updDate' => $row['created'], 'guid' => $entryURL);
        array_push($channelItems, $item);
    }
    return $channelItems;
}
示例#12
0
                         dress('article_rep_tb_link', "return false", $entryView);
                     }
                     dress('article_rep_tb_cnt_id', "trackbackCount{$entry['id']}", $entryView);
                     list($tempTag, $trackbackView) = getTrackbackCountPart($entry['trackbacks'], $skin);
                     dress($tempTag, $trackbackView, $entryView);
                     $entriesView .= $entryView;
                 } else {
                     // Protected entries
                     $protectedEntryView = $skin->entryProtected;
                     $author = User::getName($entry['userid']);
                     dress('article_rep_author', fireEvent('ViewPostAuthor', $author, $entry['id']), $protectedEntryView);
                     dress('article_rep_author_link', $blogURL . "/author/" . rawurlencode($author), $protectedEntryView);
                     dress('article_rep_id', $entry['id'], $protectedEntryView);
                     dress('article_rep_link', $permalink, $protectedEntryView);
                     dress('article_rep_title', htmlspecialchars(fireEvent('ViewPostTitle', $entry['title'], $entry['id'])), $protectedEntryView);
                     dress('article_rep_date', fireEvent('ViewPostDate', Timestamp::format5($entry['published'])), $protectedEntryView);
                     dress('article_password', "entry{$entry['id']}password", $protectedEntryView);
                     dress('article_dissolve', "reloadEntry({$entry['id']});", $protectedEntryView);
                     if (isset($_POST['partial'])) {
                         $entriesView .= $protectedEntryView;
                     } else {
                         $entriesView .= "<div id=\"entry{$entry['id']}\">{$protectedEntryView}</div>";
                     }
                 }
             }
         }
     }
 }
 if (count($entries) > 1 || count($entries) == 1 && empty($suri['value'])) {
     unset($totalTags);
 }
示例#13
0
文件: index.php 项目: ragi79/Textcube
    $itemsView = '<li class="group ui-bar ui-bar-e">' . CRLF;
    $itemsView .= '	<span class="left">' . htmlspecialchars($search) . ' ' . _text('검색 결과') . '(' . $list['count'] . ')</span>' . CRLF;
    $itemsView .= '	<span class="right ui-li-aside">' . _text('페이지') . '<span class="now_page">' . $paging['page'] . '</span> / ' . $paging['pages'] . '</span>' . CRLF;
    $itemsView .= '</li>' . CRLF;
    foreach ($list['items'] as $item) {
        $author = User::getName($item['userid']);
        if ($imageName = printMobileAttachmentExtract(printMobileEntryContent($blogid, $item['userid'], $item['id']))) {
            $imageSrc = printMobileImageResizer($blogid, $imageName, 80);
        } else {
            $imageSrc = $service['path'] . '/resources/style/iphone/image/noPostThumb.png';
        }
        $itemsView .= '<li class="post_item">' . CRLF;
        $itemsView .= '	<a href="' . $context->getProperty('uri.blog') . '/entry/' . $item['id'] . '" class="link">' . CRLF;
        $itemsView .= '	<img src="' . $imageSrc . '"  />' . CRLF;
        $itemsView .= '	<h3>' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</h3>' . CRLF;
        $itemsView .= '	<p>' . Timestamp::format5($item['published']) . '</span><span class="ui-li-count"> ' . _textf('댓글 %1개', $item['comments'] > 0 ? $item['comments'] : 0) . '</p>' . CRLF;
        $itemsView .= '	</a>' . CRLF;
        $itemsView .= '</li>' . CRLF;
    }
    $itemsView .= '</ul>' . CRLF;
    print $itemsView;
    print printMobileListNavigation($paging, 'search/' . $search);
    ?>
	</ul>
<?php 
    printMobileHTMLFooter();
} else {
    ?>
	<div data-role="page" data-theme="a" id="search">
		<form id="searchForm" method="GET" class="dialog snug editorBar" action="<?php 
    echo $blogURL;
示例#14
0
function dumpAsFile($data)
{
    if (!is_dir(ROOT . "/cache")) {
        @mkdir(ROOT . "/cache");
        @chmod(ROOT . "/cache", 0777);
    }
    $dumpFile = ROOT . '/cache/dump';
    if (file_exists($dumpFile)) {
        $dumpedLog = @file_get_contents($dumpFile);
    } else {
        $dumpedLog = '';
    }
    $dumpedLog = $dumpedLog . Timestamp::format5() . " : " . print_r($data, true) . CRLF;
    $fileHandle = fopen($dumpFile, 'w');
    fwrite($fileHandle, $dumpedLog);
    fclose($fileHandle);
}
示例#15
0
function getFeedItemByLines($lines)
{
    global $database, $serviceURL, $defaultURL, $blog, $service;
    $channelItems = array();
    foreach ($lines as $row) {
        $entryURL = $defaultURL . '/line#' . $row['id'];
        $content = $row['content'];
        $item = array('id' => $row['id'], 'title' => RSSMessage(Timestamp::format5($row['created'])), 'link' => $entryURL, 'author' => RSSMessage($row['author']), 'categories' => array(), 'description' => RSSMessage($content), 'pubDate' => $row['created'], 'updDate' => $row['created'], 'guid' => $entryURL);
        array_push($channelItems, $item);
    }
    return $channelItems;
}
示例#16
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;
}
示例#17
0
function printIphoneCommentView($entryId, $page = null, $mode = null)
{
    global $blogURL, $blogid, $skinSetting, $paging;
    if ($mode == 'recent') {
        // Recent comments
        list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
    } else {
        if (!is_null($page)) {
            // Guestbook
            list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
        } else {
            // Comments related to specific article
            $comments = getComments($entryId);
        }
    }
    if (count($comments) == 0) {
        ?>
		<p>&nbsp;<?php 
        echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
        ?>
</p>
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<ul id="comment_<?php 
            echo $commentItem['id'];
            ?>
" class="comment">
			<li class="group">
				<span class="left">
					<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
					(<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
)
				</span>
				<span class="right">
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
            ?>
</a> :
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo _text('지우기');
            ?>
</a>
				</span>
			</li>
			<li class="body">
				<?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
			</li>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<li class="groupSub">
				<span class="left">&nbsp;Re :
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
					(<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
)
				</span>
				<span class="right">
					<a href="<?php 
                echo $blogURL;
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
">DEL</a><br />
				</span>
			</li>
			<li class="body">
				<?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('Secret Comment') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
			</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
    }
    if ($mode != 'recent') {
        printIphoneCommentFormView($entryId, $entryId == 0 ? _text('방명록 쓰기') : _text('댓글 쓰기'), 'comment');
    }
}
示例#18
0
function getRemoteResponseLog($blogid, $entryId, $type = null)
{
    $pool = getRemoteResponseLogModel($blogid, $entryId, $type);
    $result = $pool->getAll();
    $str = '';
    if (!empty($result)) {
        foreach ($result as $row) {
            $str .= $row['id'] . ',' . $row['url'] . ',' . Timestamp::format5($row['written']) . '*';
        }
    }
    return $str;
}
示例#19
0
文件: index.php 项目: ragi79/Textcube
    echo $entry['id'];
    ?>
" title="<?php 
    echo htmlspecialchars($entry['title']);
    ?>
" class="panel"<?php 
    echo !empty($entryPrint) ? 'selected="true"' : '';
    ?>
>
		<div class="entry_info">
			<h2><?php 
    echo htmlspecialchars($entry['title']);
    ?>
</h2>
			<h3 class="noBorderLine"><?php 
    echo Timestamp::format5($entry['published']);
    ?>
</h3>
		</div>
		<div class="content"><?php 
    printMobileEntryContentView($blogid, $entry, null);
    ?>
</div>
<?php 
    $entryTags = getTags($entry['blogid'], $entry['id']);
    if (sizeof($entryTags) > 0) {
        ?>
		<div class="entry_tags" data-role="content" data-theme="c">
		<h3 class="tags_title">Tags</h3>
<?php 
        $tags = array();
示例#20
0
							<form id="DBRemoveDialog" class="dialog" method="get" action="<?php 
echo $context->getProperty('uri.blog');
?>
/owner/data/remove" style="position: absolute; display: none; z-index: 100;">
								<h3><?php 
echo _t('데이터 삭제를 시작합니다');
?>
</h3>
								
								<div class="message-body">
<?php 
if ($backup) {
    ?>
									<p class="explain">
										<?php 
    echo _f('서버에 <em>%1</em>에 저장된 백업파일이 있습니다. 삭제후 복원에는 이 파일을 이용하실 수 있습니다.', Timestamp::format5($backup));
    ?>
<br />
									</p>
<?php 
}
?>
									<div class="message">
										<?php 
echo _t('첨부파일을 포함하여 삭제하시겠습니까?');
?>
									</div>
									<div class="selection">
										<div class="select-yes"><input type="radio" id="removeAttachments-yes" class="radio" name="removeAttachments" value="1" /><label for="removeAttachments-yes"><?php 
echo _t('첨부파일을 포함합니다.');
?>
示例#21
0
文件: index.php 项目: ragi79/Textcube
    echo _t('갱신');
    ?>
</label></div>
<?php 
}
?>
													<div class="publish-preserve">
														<input type="radio" id="publishedPreserve" class="radio" name="published" value="2" <?php 
echo isset($entry['appointed']) ? 'checked="checked"' : '';
?>
 /><label for="publishedPreserve" onclick="document.getElementById('appointed').select()"><?php 
echo _t('예약');
?>
</label>
														<input type="text" id="appointed" class="input-text" name="appointed" value="<?php 
echo Timestamp::format5(isset($entry['appointed']) ? $entry['appointed'] : $entry['published']);
?>
" onfocus="document.getElementById('editor-form').published[document.getElementById('editor-form').published.length - 1].checked = true" onkeypress="return preventEnter(event);" />
													</div>
												</dd>
											</dl>
<?php 
$countResult = POD::queryExistence("SELECT id FROM {$database['prefix']}Entries WHERE blogid = " . getBlogId() . " AND visibility = 3");
?>
											<dl id="status-line" class="line">
												<dt><span class="label"><?php 
echo _t('공개여부');
?>
</span></dt>
												<dd>
													<div id="status-private" class="status-private"><input type="radio" id="visibility_private" class="radio" name="visibility" value="0"<?php 
示例#22
0
function printMobileCommentView($entryId, $page = null, $mode = null)
{
    $context = Model_Context::getInstance();
    $blogid = $context->getProperty('blog.id');
    global $paging;
    if ($mode == 'recent') {
        // Recent comments
        list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
    } else {
        if (!is_null($page)) {
            // Guestbook
            list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
        } else {
            // Comments related to specific article
            $comments = getComments($entryId);
        }
    }
    if (count($comments) == 0) {
        ?>
		<div class="center ui-bar ui-bar-e"><?php 
        echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
        ?>
</div>
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<ul data-role="listview" data-inset="true" id="comment_<?php 
            echo $commentItem['id'];
            ?>
" class="comment">
			<li class="group">
				<p class="left">
					<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
				</p>
				<p class="ui-li-aside">
					<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
				</p>
				<p class="right">
					<div class="comment_button" data-role="controlgroup" data-type="horizontal">
						<a href="<?php 
            echo $context->getProperty('uri.blog');
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
" data-role="button" data-icon="plus" data-iconpos="notext"><?php 
            echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
            ?>
</a> 
						<a href="<?php 
            echo $context->getProperty('uri.blog');
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
" data-role="button" data-icon="delete" data-iconpos="notext"><?php 
            echo _text('지우기');
            ?>
</a>
					</div>
				</p>
			</li>
			<li class="body">
				<?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
			</li>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<li class="groupSub">
				<p class="left">Re :
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
				</p>
				<p class="ui-li-aside">
					<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
				</p>
				<p class="right">
					<div class="comment_button" data-role="controlgroup" data-type="horizontal">
						<a href="<?php 
                echo $context->getProperty('uri.blog');
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
" data-role="button" data-icon="delete" data-inline="true" data-iconpos="notext"><?php 
                echo _text('지우기');
                ?>
</a>
					</div>
				</p>
			</li>
			<li class="body">
				<?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
			</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
    }
    if ($mode != 'recent') {
        printMobileCommentFormView($entryId, $entryId == 0 ? _text('방명록 쓰기') : _text('댓글 쓰기'), 'comment');
    }
    return array($comments, $paging);
}