本文整理汇总了PHP中fireEvent函数 的典型用法代码示例。如果您正苦于以下问题:PHP fireEvent函数的具体用法?PHP fireEvent怎么用?PHP fireEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fireEvent函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: logout
function logout()
{
fireEvent("Logout");
Acl::clearAcl();
Transaction::clear();
session_destroy();
}
开发者ID:ni5am, 项目名称:Textcube, 代码行数:7, 代码来源:auth.php
示例2: printMobileEntryListView
function printMobileEntryListView($entries, $listid, $title, $paging, $count = 0, $header = true)
{
$context = Model_Context::getInstance();
$itemsView = '<ul data-role="listview" class="posts" id="' . $listid . '" title="' . $title . '" selected="false" data-inset="true">' . CRLF;
if ($header) {
$itemsView .= '<li class="group ui-bar ui-bar-e">' . CRLF;
$itemsView .= ' <h3>' . $title . '</h3>' . CRLF;
$itemsView .= ' <span class="ui-li-count">' . $count . '</span>' . CRLF;
$itemsView .= ' <span class="ui-li-aside">' . _text('페이지') . ' ' . $paging['page'] . ' / ' . $paging['pages'] . '</span>' . CRLF;
$itemsView .= '</li>' . CRLF;
}
foreach ($entries as $item) {
$author = User::getName($item['userid']);
if ($imageName = printMobileAttachmentExtract($item['content'])) {
$imageSrc = printMobileImageResizer($context->getProperty('blog.id'), $imageName, 80);
} else {
$imageSrc = $context->getProperty('service.path') . '/resources/style/iphone/images/noPostThumb.png';
}
$itemsView .= '<li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-bar-b ui-btn-up-c" style="font-size:8pt;font-weight:normal">';
$itemsView .= ' ' . Timestamp::format5($item['published']) . '</li>' . CRLF;
$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 class="ui-li-count"> ' . _textf('댓글 %1개', $item['comments'] > 0 ? $item['comments'] : 0) . '</p>' . CRLF;
if (!empty($item['content'])) {
$itemsView .= ' <p>' . htmlspecialchars(Utils_Unicode::lessenAsEm(removeAllTags(stripHTML($item['content'])), 150)) . '</p>' . CRLF;
}
$itemsView .= ' </a>' . CRLF;
$itemsView .= '</li>' . CRLF;
}
$itemsView .= '</ul>' . CRLF;
return $itemsView;
}
开发者ID:ragi79, 项目名称:Textcube, 代码行数:34, 代码来源:iphoneView.php
示例3: replace
function replace($matches)
{
$keyword = $matches[0];
if (!$this->_replaceOnce || !array_key_exists($keyword, $this->_binded)) {
$this->_binded[$keyword] = null;
$keyword = fireEvent('BindKeyword', $keyword);
}
return $keyword;
}
开发者ID:hinablue, 项目名称:TextCube, 代码行数:9, 代码来源:blog.keyword.php
示例4: RecentRP_getRecentCommentsView
function RecentRP_getRecentCommentsView($comments, $template)
{
global $contentContainer;
$context = Model_Context::getInstance();
ob_start();
foreach ($comments as $comment) {
$view = "{$template}";
Utils_Misc::dress('rctrp_rep_link', $context->getProperty('uri.blog') . "/{$comment['entry']}#comment{$comment['id']}", $view);
$contentContainer["recent_comment_{$comment['id']}"] = htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30));
Utils_Misc::dress('rctrp_rep_desc', setTempTag("recent_comment_{$comment['id']}"), $view);
Utils_Misc::dress('rctrp_rep_desc', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30)), $view);
Utils_Misc::dress('rctrp_rep_time', fireEvent('ViewRecentCommentDate', Timestamp::format3($comment['written'])), $view);
Utils_Misc::dress('rctrp_rep_name', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['name']), 10)) . $comment['secret'] . $comment['replier'], $view);
print $view;
}
$view = ob_get_contents();
ob_end_clean();
return $view;
}
开发者ID:Avantians, 项目名称:Textcube, 代码行数:19, 代码来源:index.php
示例5: dumbCronScheduler
function dumbCronScheduler($checkOnly = true)
{
$context = Model_Context::getInstance();
$now = Timestamp::getUNIXtime();
$dumbCronStamps = Setting::getServiceSetting('dumbCronStamps', serialize(array('1m' => 0, '5m' => 0, '30m' => 0, '1h' => 0, '2h' => 0, '6h' => 0, '12h' => 0, '24h' => 0, 'Daily' => 0)), true);
$dumbCronStamps = unserialize($dumbCronStamps);
$schedules = array('1m' => 60, '5m' => 60 * 5, '10m' => 60 * 10, '30m' => 60 * 30, '1h' => 60 * 60, '2h' => 60 * 60 * 2, '6h' => 60 * 60 * 6, '12h' => 60 * 60 * 12, '24h' => 60 * 60 * 24, 'Daily' => 60 * 60 * 24, '1w' => 60 * 60 * 24 * 7);
/* Events: Cron1m, Cron5m, Cron30m, Cron1h, Cron2h, Cron6h, Cron12h */
$log_file = __TEXTCUBE_CACHE_DIR__ . '/cronlog.txt';
$log = fopen($log_file, "a");
foreach ($schedules as $d => $diff) {
if (!isset($dumbCronStamps[$d])) {
$dumbCronStamps[$d] = 0;
}
if ($now > $diff + $dumbCronStamps[$d]) {
if ($checkOnly && eventExists("Cron{$d}")) {
fclose($log);
return true;
}
fireEvent("Cron{$d}", null, $now);
if ($d == '6h') {
importlib('model.blog.trash');
trashVan();
}
fwrite($log, date('Y-m-d H:i:s') . ' ' . $context->getProperty('blog.name') . " Cron{$d} executed ({$_SERVER['REQUEST_URI']})\r\n");
$dumbCronStamps[$d] = $now;
}
}
fclose($log);
/* Keep just 1000 lines */
$logcontent = explode("\r\n", file_get_contents($log_file));
$logcontent = implode("\r\n", array_slice($logcontent, -1000));
$log = fopen($log_file, "w");
fwrite($log, $logcontent);
fclose($log);
Setting::setServiceSetting('dumbCronStamps', serialize($dumbCronStamps), true);
return false;
}
开发者ID:Avantians, 项目名称:Textcube, 代码行数:38, 代码来源:cron.php
示例6: pretty_dress
function pretty_dress($view)
{
global $blogid, $blog, $database, $service, $stats, $skinSetting;
$context = Model_Context::getInstance();
/* local static */
global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
if (isset($_REQUEST['safe'])) {
// safe mode
return '<div class="coverpage-element-safebox">…</div>';
}
if (isset($_REQUEST['tag'])) {
// safe mode
return '<div class="coverpage-element-safebox"><p>' . nl2br(htmlspecialchars($view, ENT_QUOTES)) . '</p></div>';
}
$writer = User::getBlogOwnerName($blogid);
$pageTitle = _t('페이지 제목');
dress('page_title', htmlspecialchars($pageTitle), $view);
dress('blogger', htmlspecialchars($writer), $view);
dress('title', htmlspecialchars($context->getProperty('blog.title')), $view);
dress('desc', htmlspecialchars($context->getProperty('blog.description')), $view);
if ($context->getProperty('blog.logo') != null) {
dress('image', $context->getProperty('service.path') . "/attach/{$blogid}/" . $context->getProperty('blog.logo'), $view);
} else {
dress('image', $context->getProperty('service.path') . "/resources/image/spacer.gif", $view);
}
dress('blog_link', $context->getProperty('uri.blog') . "/", $view);
dress('keylog_link', $context->getProperty('uri.blog') . "/keylog", $view);
dress('localog_link', $context->getProperty('uri.blog') . "/location", $view);
dress('taglog_link', $context->getProperty('uri.blog') . "/tag", $view);
dress('guestbook_link', $context->getProperty('uri.blog') . "/guestbook", $view);
list($view, $searchView) = Skin::cutSkinTag($view, 'search');
dress('search_name', 'search', $searchView);
dress('search_text', isset($search) ? htmlspecialchars($search) : '', $searchView);
dress('search_onclick_submit', 'searchBlog()', $searchView);
dress('search', '<form id="TTSearchForm" action="' . parseURL($context->getProperty('uri.blog') . '/search/') . '" method="get" onsubmit="return searchBlog()">' . $searchView . '</form>', $view);
dress('category', $pd_category, $view);
dress('category_list', $pd_categoryXhtml, $view);
dress('count_total', $stats['total'], $view);
dress('count_today', $stats['today'], $view);
dress('count_yesterday', $stats['yesterday'], $view);
list($view, $archiveView) = Skin::cutSkinTag($view, 'archive_rep');
dress('archive_rep', getArchivesView($pd_archive, $archiveView), $view);
dress('calendar', $pd_calendar, $view);
list($view, $randomView) = Skin::cutSkinTag($view, 'random_tags');
dress('random_tags', getRandomTagsView($pd_tags, $randomView), $view);
list($view, $recentNoticeItem) = Skin::cutSkinTag($view, 'rct_notice_rep');
list($view, $noticeView) = Skin::cutSkinTag($view, 'rct_notice');
$notices = $pd_notices;
if (sizeof($notices) == 0) {
$notices = array(array('title' => _t('공지 제목'), 'id' => -1));
}
if (sizeof($notices) > 0) {
$itemsView = '';
foreach ($notices as $notice) {
$itemView = $recentNoticeItem;
dress('notice_rep_title', htmlspecialchars(fireEvent('ViewNoticeTitle', Utils_Unicode::lessenAsEm($notice['title'], $skinSetting['recentNoticeLength']), $notice['id'])), $itemView);
dress('notice_rep_link', "{$context->getProperty}('uri.blog')/notice/{$notice['id']}", $itemView);
$itemsView .= $itemView;
}
dress('rct_notice_rep', $itemsView, $noticeView);
dress('rct_notice', $noticeView, $view);
}
list($view, $authorList) = Skin::cutSkinTag($view, 'author_rep');
dress('author_rep', getAuthorListView($pd_authorList, $authorList), $view);
list($view, $recentEntry) = Skin::cutSkinTag($view, 'rctps_rep');
dress('rctps_rep', getRecentEntriesView($pd_recentEntry, null, $recentEntry), $view);
list($view, $recentComments) = Skin::cutSkinTag($view, 'rctrp_rep');
dress('rctrp_rep', getRecentCommentsView($pd_recentComment, null, $recentComments), $view);
list($view, $recentTrackback) = Skin::cutSkinTag($view, 'rcttb_rep');
dress('rcttb_rep', getRecentTrackbacksView($pd_recentTrackback, null, $recentTrackback), $view);
list($view, $s_link_rep) = Skin::cutSkinTag($view, 'link_rep');
dress('link_rep', getLinksView($pd_link, $s_link_rep), $view);
dress('rss_url', "{$context->getProperty}('uri.blog')/rss", $view);
dress('owner_url', "{$context->getProperty}('uri.blog')/owner", $view);
dress('textcube_name', TEXTCUBE_NAME, $view);
dress('textcube_version', TEXTCUBE_VERSION, $view);
$tagSearches = array('@<a @i', '@</a *>@i', '@ id *= *".*"@isU', '@ onkey(down|up|press) *="@i', '@ on(click|load|unload) *="@i', '@<input +@i', '@<script.*</script *>@siU', '@<form @siU', '@</form>@siU');
$tagReplaces = array('<span ', '</span>', '', ' onnothing="', ' onnothing="', '<input disabled="disabled" ', '', '<div ', '</div>');
$view = preg_replace($tagSearches, $tagReplaces, $view);
return correctCoverpageImage($view);
}
开发者ID:webhacking, 项目名称:Textcube, 代码行数:82, 代码来源:index.php
示例7: fireEvent
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
fireEvent($suri['directive'] . '/' . $suri['value']);
if (!headers_sent()) {
Respond::NotFoundPage();
}
开发者ID:webhacking, 项目名称:Textcube, 代码行数:10, 代码来源:pluginForOwner.php
示例8: array
<?php
/// Copyright (c) 2004-2015, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('id' => array('int', 'min' => 1)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$line = Model_Line::getInstance();
$line->reset();
$line->setFilter(array('blogid', 'equals', getBlogId()));
$line->setFilter(array('id', 'equals', $_POST['id']));
if ($line->remove()) {
fireEvent('DeleteLine', 0, $line);
Respond::ResultPage(0);
} else {
fireEvent('DeleteLine', -1, $line);
Respond::ResultPage(-1);
}
开发者ID:Avantians, 项目名称:Textcube, 代码行数:19, 代码来源:index.php
示例9: htmlspecialchars
<?php
}
?>
</select></dd>
</dl>
<div id="formatbox-container" class="container"></div>
<textarea id="editWindow" name="content" cols="80" rows="20"><?php
echo htmlspecialchars($entry['content']);
?>
</textarea>
<div id="status-container" class="container"><span id="pathStr"><?php
echo _t('path');
?>
</span><span class="divider"> : </span><span id="pathContent"></span></div>
<?php
$view = fireEvent('AddPostEditorToolbox', '');
if (!empty($view)) {
?>
<div id="toolbox-container" class="container"><?php
echo $view;
?>
</div>
<?php
}
?>
<div id="templateDialog" class="entry-editor-property<?php
echo defined('__TEXTCUBE_POST__') ? NULL : ' hidden';
?>
">
<div class="temp-box">
开发者ID:ragi79, 项目名称:Textcube, 代码行数:31, 代码来源:index.php
示例10: empty
if ($_POST['permalink'] == '') {
$entry['slogan'] = '';
}
}
$entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1;
$entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1;
$entry['published'] = empty($_POST['published']) ? 0 : $_POST['published'];
$entry['draft'] = 0;
if (strpos($entry['slogan'], 'TCDraftPost') === 0) {
$entry['slogan'] = $entry['title'];
}
if (empty($suri['id'])) {
if ($id = addEntry($blogid, $entry)) {
fireEvent('AddPost', $id, $entry);
Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $id, true);
$result = array();
$result['error'] = ($id !== false) === true ? 0 : 1;
$result['entryId'] = $id;
Respond::PrintResult($result);
exit;
}
} else {
if ($id = updateEntry($blogid, $entry, $updateDraft)) {
fireEvent('UpdatePost', $id, $entry);
Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $suri['id'], true);
Respond::ResultPage(0);
exit;
}
}
}
Respond::ResultPage(-1);
开发者ID:Avantians, 项目名称:Textcube, 代码行数:31, 代码来源:index.php
示例11: array
$IV = array('POST' => array('visibility' => array('int', 0, 3), 'starred' => array('int', 0, 2), 'category' => array('int', 'default' => 0), 'title' => array('string'), 'content' => array('string'), 'contentformatter' => array('string'), 'contenteditor' => array('string'), 'permalink' => array('string', 'default' => ''), 'location' => array('string', 'default' => '/'), 'latitude' => array('number', 'default' => null, 'min' => -90.0, 'max' => 90.0, 'bypass' => true), 'longitude' => array('number', 'default' => null, 'min' => -180.0, 'max' => 180.0, 'bypass' => true), 'tag' => array('string', 'default' => ''), 'acceptcomment' => array(array('0', '1'), 'default' => '0'), 'accepttrackback' => array(array('0', '1'), 'default' => '0'), 'published' => array('int', 0, 'default' => 1), 'draft' => array(array('0', '1'), 'default' => '0')));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.entry");
requireStrictRoute();
$entry = array();
$entry['visibility'] = $_POST['visibility'];
$entry['starred'] = $_POST['starred'];
$entry['category'] = empty($_POST['category']) ? 0 : $_POST['category'];
$entry['title'] = $_POST['title'];
if (isset($_POST['permalink']) && $_POST['permalink'] != '') {
$entry['slogan'] = $_POST['permalink'];
}
$entry['content'] = $_POST['content'];
$entry['contentformatter'] = $_POST['contentformatter'];
$entry['contenteditor'] = $_POST['contenteditor'];
$entry['location'] = empty($_POST['location']) ? '/' : $_POST['location'];
$entry['latitude'] = empty($_POST['latitude']) || $_POST['latitude'] == "null" ? null : $_POST['latitude'];
$entry['longitude'] = empty($_POST['longitude']) || $_POST['longitude'] == "null" ? null : $_POST['longitude'];
$entry['tag'] = empty($_POST['tag']) ? '' : $_POST['tag'];
$entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1;
$entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1;
$entry['published'] = empty($_POST['published']) ? 1 : $_POST['published'];
$entry['draft'] = empty($_POST['draft']) ? 0 : $_POST['draft'];
if ($id = addEntry($blogid, $entry)) {
fireEvent('AddPost', $id, $entry);
Setting::setBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), $id);
}
$result = array();
$result['error'] = ($id !== false) === true ? 0 : 1;
$result['entryId'] = $id;
Respond::PrintResult($result);
开发者ID:Avantians, 项目名称:Textcube, 代码行数:31, 代码来源:index.php
示例12: define
define('__TEXTCUBE_ADMINPANEL__', true);
$IV = array('GET' => array('requestURI' => array('url', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
global $openid_session;
global $openid_session_id;
$context = Model_Context::getInstance();
if (empty($_GET['requestURI'])) {
$requestURI = $context->getProperty('uri.blog');
} else {
$requestURI = filterJavaScript($_GET['requestURI']);
if (Acl::getIdentity('openid')) {
header("Location: {$requestURI}");
exit;
}
}
list($openid_help_link, $openid_signup_link) = fireEvent('OpenIDAffiliateLinks', $requestURI);
$img_url = $context->getProperty('uri.host') . $context->getProperty('service.path') . "/plugins/" . basename(dirname(__FILE__)) . "/login-bg.gif";
if (!empty($_COOKIE['openid'])) {
$openid_remember_check = "checked";
$cookie_openid = $_COOKIE['openid'];
} else {
$openid_remember_check = "";
$cookie_openid = '';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?php
echo _text('텍스트큐브') . ":" . _text('오픈아이디 인증');
开发者ID:webhacking, 项目名称:Textcube, 代码行数:31, 代码来源:index.php
示例13: updateVisitorStatistics
static function updateVisitorStatistics($blogid)
{
global $database, $blogURL;
if (!fireEvent('UpdatingVisitorStatistics', true)) {
return;
}
if (doesHaveOwnership()) {
return;
}
$id = session_id();
if (POD::queryCount("SELECT blogid FROM {$database['prefix']}SessionVisits WHERE id = '{$id}' AND address = '{$_SERVER['REMOTE_ADDR']}' AND blogid = {$blogid}") > 0) {
return;
}
if (POD::queryCount("INSERT INTO {$database['prefix']}SessionVisits values('{$id}', '{$_SERVER['REMOTE_ADDR']}', {$blogid})") > 0) {
if (POD::queryCount("UPDATE {$database['prefix']}BlogStatistics SET visits = visits + 1 WHERE blogid = {$blogid}") < 1) {
POD::execute("INSERT into {$database['prefix']}BlogStatistics values({$blogid}, 1)");
}
$period = Timestamp::getDate();
if (POD::queryCount("UPDATE {$database['prefix']}DailyStatistics SET visits = visits + 1 WHERE blogid = {$blogid} AND datemark = {$period}") < 1) {
POD::execute("INSERT INTO {$database['prefix']}DailyStatistics VALUES ({$blogid}, {$period}, 1)");
}
if (!empty($_SERVER['HTTP_REFERER'])) {
$referer = parse_url($_SERVER['HTTP_REFERER']);
if (!empty($referer['host']) && ($referer['host'] != $_SERVER['HTTP_HOST'] || strncmp($referer['path'], $blogURL, strlen($blogURL)) != 0)) {
if (Filter::isFiltered('ip', $_SERVER['REMOTE_ADDR']) || Filter::isFiltered('url', $_SERVER['HTTP_REFERER'])) {
return;
}
if (!fireEvent('AddingRefererLog', true, array('host' => $referer['host'], 'url' => $_SERVER['HTTP_REFERER']))) {
return;
}
$host = POD::escapeString(Utils_Unicode::lessenAsEncoding($referer['host'], 64));
$url = POD::escapeString(Utils_Unicode::lessenAsEncoding($_SERVER['HTTP_REFERER'], 255));
POD::query("INSERT INTO {$database['prefix']}RefererLogs values({$blogid}, '{$host}', '{$url}', UNIX_TIMESTAMP())");
// POD::query("DELETE FROM {$database['prefix']}RefererLogs WHERE referred < UNIX_TIMESTAMP() - 604800"); // Moved to trashVan
if (!POD::queryCount("UPDATE {$database['prefix']}RefererStatistics SET count = count + 1 WHERE blogid = {$blogid} AND host = '{$host}' LIMIT 1")) {
POD::execute("INSERT into {$database['prefix']}RefererStatistics values({$blogid}, '{$host}', 1)");
}
}
}
}
}
开发者ID:Avantians, 项目名称:Textcube, 代码行数:41, 代码来源:Textcube.Model.Statistics.php
示例14: receiveNotifiedComment
function receiveNotifiedComment($post)
{
if (empty($post['mode']) || $post['mode'] != 'fb') {
return 1;
}
global $database;
CacheControl::flushCommentNotifyRSS();
$post = fireEvent('ReceiveNotifiedComment', $post);
if ($post === false) {
return 7;
}
$blogid = getBlogId();
$title = POD::escapeString(UTF8::lessenAsEncoding($post['s_home_title'], 255));
$name = POD::escapeString(UTF8::lessenAsEncoding($post['s_name'], 255));
$entryId = POD::escapeString($post['s_no']);
$homepage = POD::escapeString(UTF8::lessenAsEncoding($post['url'], 255));
$entryurl = POD::escapeString($post['s_url']);
$entrytitle = POD::escapeString($post['s_post_title']);
$parent_id = $post['r1_no'];
$parent_name = POD::escapeString(UTF8::lessenAsEncoding($post['r1_name'], 80));
$parent_parent = $post['r1_rno'];
$parent_homepage = POD::escapeString(UTF8::lessenAsEncoding($post['r1_homepage'], 80));
$parent_written = $post['r1_regdate'];
$parent_comment = POD::escapeString($post['r1_body']);
$parent_url = POD::escapeString(UTF8::lessenAsEncoding($post['r1_url'], 255));
$child_id = $post['r2_no'];
$child_name = POD::escapeString(UTF8::lessenAsEncoding($post['r2_name'], 80));
$child_parent = $post['r2_rno'];
$child_homepage = POD::escapeString(UTF8::lessenAsEncoding($post['r2_homepage'], 80));
$child_written = $post['r2_regdate'];
$child_comment = POD::escapeString($post['r2_body']);
$child_url = POD::escapeString(UTF8::lessenAsEncoding($post['r2_url'], 255));
$siteid = POD::queryCell("SELECT id FROM {$database['prefix']}CommentsNotifiedSiteInfo WHERE url = '{$homepage}'");
if (empty($siteid)) {
$insertId = getCommentsNotifiedSiteInfoMaxId() + 1;
if (POD::execute("INSERT INTO {$database['prefix']}CommentsNotifiedSiteInfo\n\t\t\t( id, title, name, url, modified)\n\t\t\tVALUES ({$insertId}, '{$title}', '{$name}', '{$homepage}', UNIX_TIMESTAMP());")) {
$siteid = $insertId;
} else {
return 2;
}
}
$parentId = POD::queryCell("SELECT id\n\t\tFROM {$database['prefix']}CommentsNotified\n\t\tWHERE entry = {$entryId}\n\t\t\tAND siteid = {$siteid}\n\t\t\tAND blogid = {$blogid}\n\t\t\tAND remoteid = {$parent_id}");
if (empty($parentId)) {
$insertId = getCommentsNotifiedMaxId() + 1;
$sql = "INSERT INTO {$database['prefix']}CommentsNotified\n\t\t\t( blogid , replier , id , entry , parent , name , password , homepage , secret , comment , ip , written, modified , siteid , isnew , url , remoteid ,entrytitle , entryurl )\n\t\t\tVALUES (\n\t\t\t\t{$blogid}, NULL , {$insertId}, " . $entryId . ", " . (empty($parent_parent) ? 'null' : $parent_parent) . ", '" . $parent_name . "', '', '" . $parent_homepage . "', '', '" . $parent_comment . "', '', " . $parent_written . ",UNIX_TIMESTAMP(), " . $siteid . ", 1, '" . $parent_url . "'," . $parent_id . ", '" . $entrytitle . "', '" . $entryurl . "'\n)";
if (!POD::execute($sql)) {
return 3;
}
$parentId = $insertId;
}
if (POD::queryCell("SELECT count(*) FROM {$database['prefix']}CommentsNotified WHERE siteid={$siteid} AND remoteid={$child_id}") > 0) {
return 4;
}
$insertId = getCommentsNotifiedMaxId() + 1;
$sql = "INSERT INTO {$database['prefix']}CommentsNotified\n\t\t( blogid , replier , id , entry , parent , name , password , homepage , secret , comment , ip , written, modified , siteid , isnew , url , remoteid ,entrytitle , entryurl )\n\t\tVALUES (\n\t\t\t{$blogid}, NULL , {$insertId}, " . $entryId . ", {$parentId}, '{$child_name}', '', '{$child_homepage}', '', '{$child_comment}', '', {$child_written}, UNIX_TIMESTAMP(), {$siteid}, 1, '{$child_url}', {$child_id}, '{$entrytitle}', '{$entryurl}')";
if (!POD::execute($sql)) {
return 5;
}
$sql = "UPDATE {$database['prefix']}CommentsNotified SET modified = UNIX_TIMESTAMP() WHERE blogid = {$blogid} AND id = {$parentId}";
if (!POD::execute($sql)) {
return 6;
}
return 0;
}
开发者ID:hinablue, 项目名称:TextCube, 代码行数:64, 代码来源:blog.comment.php
示例15: receiveNotifiedComment
function receiveNotifiedComment($post)
{
if (empty($post['mode']) || $post['mode'] != 'fb') {
return 1;
}
$context = Model_Context::getInstance();
CacheControl::flushCommentNotifyRSS();
$post = fireEvent('ReceiveNotifiedComment', $post);
if ($post === false) {
return 7;
}
$pool = DBModel::getInstance();
$blogid = getBlogId();
$title = Utils_Unicode::lessenAsEncoding($post['s_home_title'], 255);
$name = Utils_Unicode::lessenAsEncoding($post['s_name'], 255);
$entryId = $post['s_no'];
$homepage = Utils_Unicode::lessenAsEncoding($post['url'], 255);
$entryurl = $post['s_url'];
$entrytitle = $post['s_post_title'];
$parent_id = $post['r1_no'];
$parent_name = Utils_Unicode::lessenAsEncoding($post['r1_name'], 80);
$parent_parent = $post['r1_rno'];
$parent_homepage = Utils_Unicode::lessenAsEncoding($post['r1_homepage'], 80);
$parent_written = $post['r1_regdate'];
$parent_comment = $post['r1_body'];
$parent_url = Utils_Unicode::lessenAsEncoding($post['r1_url'], 255);
$child_id = $post['r2_no'];
$child_name = Utils_Unicode::lessenAsEncoding($post['r2_name'], 80);
$child_parent = $post['r2_rno'];
$child_homepage = Utils_Unicode::lessenAsEncoding($post['r2_homepage'], 80);
$child_written = $post['r2_regdate'];
$child_comment = $post['r2_body'];
$child_url = Utils_Unicode::lessenAsEncoding($post['r2_url'], 255);
$pool->reset('CommentsNotifiedSiteInfo');
$pool->setQualifier('url', 'eq', $homepage);
$siteid = $pool->getCell('id');
if (empty($siteid)) {
$insertId = getCommentsNotifiedSiteInfoMaxId() + 1;
$pool->reset('CommentsNotifiedSiteInfo');
$pool->setAttribute('id', $insertId);
$pool->setAttribute('title', $title, true);
$pool->setAttribute('name', $name, true);
$pool->setAttribute('url', $homepage, true);
$pool->setAttribute('modified', Timestamp::getUNIXtime());
if ($pool->insert()) {
$siteid = $insertId;
} else {
return 2;
}
}
$pool->reset('CommentsNotified');
$pool->setQualifier('entry', 'eq', $entryId);
$pool->setQualifier('siteid', 'eq', $siteid);
$pool->setQualifier('blogid', 'eq', $blogid);
$pool->setQualifier('remoteid', 'eq', $parent_id);
$parentId = $pool->getCell('id');
if (empty($parentId)) {
$insertId = getCommentsNotifiedMaxId() + 1;
$pool->reset('CommentsNotified');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('replier', NULL);
$pool->setAttribute('id', $insertId);
$pool->setAttribute('entry', $entryId);
$pool->setAttribute('parent', empty($parent_parent) ? NULL : $parent_parent);
$pool->setAttribute('name', $parent_name, true);
$pool->setAttribute('password', '', true);
$pool->setAttribute('homepage', $parent_homepage, true);
$pool->setAttribute('secret', '', true);
$pool->setAttribute('comment', $parent_comment, true);
$pool->setAttribute('ip', '', true);
$pool->setAttribute('written', $parent_written, true);
$pool->setAttribute('modified', Timestamp::getUNIXtime());
$pool->setAttribute('siteid', $siteid);
$pool->setAttribute('isnew', 1);
$pool->setAttribute('url', $parent_url, true);
$pool->setAttribute('remoteid', $parent_id);
$pool->setAttribute('entrytitle', $entrytitle, true);
$pool->setAttribute('entryurl', $entryurl, true);
if (!$pool->insert()) {
return 3;
}
$parentId = $insertId;
}
$pool->reset('CommentsNotified');
$pool->setQualifier('siteid', 'eq', $siteid);
$pool->setQualifier('remoteid', 'eq', $child_id);
if ($pool->getCount() > 0) {
return 4;
}
$insertId = getCommentsNotifiedMaxId() + 1;
$pool->reset('CommentsNotified');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('replier', NULL);
$pool->setAttribute('id', $insertId);
$pool->setAttribute('entry', $entryId);
$pool->setAttribute('parent', $parentId);
$pool->setAttribute('name', $child_name, true);
$pool->setAttribute('password', '', true);
$pool->setAttribute('homepage', $child_homepage, true);
$pool->setAttribute('secret', '', true);
//.........这里部分代码省略.........
开发者ID:webhacking, 项目名称:Textcube, 代码行数:101, 代码来源:comment.php
示例16: define
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_ADMINPANEL__', true);
require ROOT . '/library/preprocessor.php';
importlib('model.blog.comment');
$IV = array('POST' => array('name' => array('string', 'default' => ''), 'comment' => array('string', 'default' => ''), 'mode' => array(array('commit'), 'default' => ''), 'homepage' => array('string', 'default' => ''), 'password' => array('string', 'default' => ''), 'secret' => array(array('on'), 'default' => null)));
$context = Model_Context::getInstance();
$customIV = fireEvent('ManipulateIVRules', $IV, $context->getProperty('uri.interfaceRoute'));
Validator::addRule($customIV);
if (!Validator::isValid()) {
Respond::PrintResult(array('error' => 1, 'description' => 'Illegal parameters'));
}
requireStrictRoute();
if (!Setting::getBlogSettingGlobal('acceptComments', 0) && !doesHaveOwnership()) {
Respond::PrintResult(array('error' => 0, 'commentBlock' => '', 'recentCommentBlock' => ''));
exit;
}
$pool = DBModel::getInstance();
if ((doesHaveMembership() || !empty($_POST['name'])) && !empty($_POST['comment']) && !empty($_POST['mode']) && $_POST['mode'] == 'commit') {
if (!empty($_POST['name'])) {
setcookie('guestName', $_POST['name'], time() + 2592000, $context->getProperty('uri.blog') . "/");
}
if (!empty($_POST['homepage']) && $_POST['homepage'] != 'http://') {
if (strpos($_POST['homepage'], 'http://') === 0) {
setcookie('guestHomepage', $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
} else {
setcookie('guestHomepage', 'http://' . $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
}
开发者ID:webhacking, 项目名称:Textcube, 代码行数:31, 代码来源:index.php
示例17: receiveTrackback
function receiveTrackback($blogid, $entry, $title, $url, $excerpt, $site)
{
global $database, $blog, $defaultURL;
if (empty($url)) {
return 5;
}
$post = new Post();
if (!$post->doesAcceptTrackback($entry)) {
return 3;
}
$filtered = 0;
if (!Filter::isAllowed($url)) {
if (Filter::isFiltered('ip', $_SERVER['REMOTE_ADDR']) || Filter::isFiltered('url', $url)) {
$filtered = 1;
} else {
if (Filter::isFiltered('content', $excerpt)) {
$filtered = 1;
} else {
if (!fireEvent('AddingTrackback', true, array('entry' => $entry, 'url' => $url, 'site' => $site, 'title' => $title, 'excerpt' => $excerpt))) {
$filtered = 1;
}
}
}
}
$title = correctTTForXmlText($title);
$excerpt = correctTTForXmlText($excerpt);
$url = UTF8::lessenAsEncoding($url);
$site = UTF8::lessenAsEncoding($site);
$title = UTF8::lessenAsEncoding($title);
$excerpt = UTF8::lessenAsEncoding($excerpt);
$trackback = new Trackback();
$trackback->entry = $entry;
$trackback->url = $url;
$trackback->site = $site;
$trackback->title = $title;
$trackback->excerpt = $excerpt;
if ($filtered > 0) {
$trackback->isfiltered = true;
}
if ($trackback->add()) {
if ($filtered == 0) {
CacheControl::flushDBCache('trackback');
}
return $filtered == 0 ? 0 : 3;
} else {
return 4;
}
return 0;
}
开发者ID:hinablue, 项目名称:TextCube, 代码行数:49, 代码来源:blog.response.remote.php
示例18: _text
$itemsView = '<li class="group">' . CRLF;
$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;
}
开发者ID:hinablue, 项目名称:TextCube, 代码行数:31, 代码来源:index.php
示例19: define
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_KEYLOG__', true);
require ROOT . '/library/preprocessor.php';
if (strlen($suri['value'])) {
if (!($keylog = getKeylogByTitle($blogid, $suri['value']))) {
Respond::ErrorPage();
exit;
}
$entries = array();
$entries = getEntriesByKeyword($blogid, $keylog['title']);
$skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
if (!is_null($skinSetting['keylogSkin'])) {
require ROOT . '/interface/common/blog/keylog.php';
} else {
Respond::ErrorPage(_t('No handling plugin'));
}
} else {
$keywords = getKeywordNames($blogid, true);
$skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
require ROOT . '/interface/common/blog/begin.php';
require ROOT . '/interface/common/blog/keywords.php';
require ROOT . '/interface/common/blog/end.php';
}
开发者ID:ragi79, 项目名称:Textcube, 代码行数:27, 代码来源:keylog.php
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1291| 2022-08-30
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1205| 2022-08-17
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1002| 2022-11-06
Vesta v1.0.0-5 was discovered to contain a cross-site scripting (XSS) vulnerabil
阅读:533| 2022-07-29
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1401| 2022-08-18
sslcommerz/SSLCommerz-Laravel: SSLCOMMERZ is a bangladeshi payment gateway provi
阅读:917| 2022-08-13
qiangxi/CheckUpdateLibrary: Android检查更新库
阅读:881| 2022-08-15
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:518| 2022-08-16
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:669| 2022-11-06
这个文章不会说具体0到1的代码流程,我会着重讲几个问题的解决 准备以下依赖 amp;quot
阅读:643| 2022-07-18
请发表评论