本文整理汇总了PHP中getBlogId函数的典型用法代码示例。如果您正苦于以下问题:PHP getBlogId函数的具体用法?PHP getBlogId怎么用?PHP getBlogId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getBlogId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeAll
function removeAll($removeAttachments = true)
{
global $database;
$blogid = getBlogId();
POD::query("UPDATE {$database['prefix']}BlogStatistics SET visits = 0 WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}DailyStatistics WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Categories WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Attachments WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Comments WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RemoteResponses WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Entries WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Links WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Filters WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RefererLogs WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RefererStatistics WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Plugins WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedStarred WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedReads WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid}");
if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml")) {
unlink(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml");
}
if ($removeAttachments) {
Path::removeFiles(Path::combine(ROOT, 'attach', $blogid));
}
}
示例2: open
function open($filter = '', $fields = 'f.*, g.groupid', $sort = 'id')
{
global $database;
if (is_numeric($filter)) {
$filter = 'AND id = ' . $filter;
} else {
if (!empty($filter)) {
$filter = 'AND ' . $filter;
}
}
if (!empty($sort)) {
$sort = 'ORDER BY ' . $sort;
}
$this->close();
$this->_result = POD::query("SELECT {$fields} FROM {$database['prefix']}Feeds f JOIN {$database['prefix']}FeedGroupRelations g ON f.id = g.feed WHERE g.blogid = " . getBlogId() . " {$filter} {$sort}");
if ($this->_result) {
if ($this->_count = POD::num_rows($this->_result)) {
return $this->shift();
} else {
POD::free($this->_result);
}
}
unset($this->_result);
return false;
}
示例3: load
function load($fields = '*')
{
global $database;
$blogid = getBlogId();
$this->reset();
$query = DBModel::getInstance();
$query->reset('BlogSettings');
if ($query->doesExist()) {
$query->setQualifier('blogid', 'equals', $blogid);
$blogSettings = $query->getAll('name,value');
if (isset($blogSettings)) {
foreach ($blogSettings as $blogSetting) {
$name = $blogSetting['name'];
$value = $blogSetting['value'];
switch ($name) {
case 'logo':
$name = 'banner';
break;
case 'entriesOnPage':
$name = 'postsOnPage';
break;
case 'entriesOnList':
$name = 'postsOnList';
break;
case 'entriesOnRSS':
$name = 'postsOnFeed';
break;
case 'publishWholeOnRSS':
$name = 'publishWholeOnFeed';
break;
case 'allowWriteOnGuestbook':
$name = 'acceptGuestComment';
break;
case 'allowWriteDblCommentOnGuestbook':
$name = 'acceptcommentOnGuestComment';
break;
case 'defaultDomain':
case 'useSloganOnPost':
case 'useSloganOnCategory':
case 'useSloganOnTag':
case 'acceptGuestComment':
case 'acceptcommentOnGuestComment':
$value = $value ? true : false;
break;
}
$this->{$name} = $value;
}
}
return true;
}
return false;
}
示例4: resampleImage
function resampleImage($imgString, $filename, $useAbsolutePath = true)
{
$blogid = getBlogId();
$context = Model_Context::getInstance();
if (!extension_loaded('gd') || !file_exists(ROOT . "/attach/{$blogid}/{$filename}")) {
return $imgString;
}
if (!is_dir(ROOT . "/cache/thumbnail")) {
@mkdir(ROOT . "/cache/thumbnail");
@chmod(ROOT . "/cache/thumbnail", 0777);
}
if (!is_dir(ROOT . "/cache/thumbnail/" . getBlogId())) {
@mkdir(ROOT . "/cache/thumbnail/" . getBlogId());
@chmod(ROOT . "/cache/thumbnail/" . getBlogId(), 0777);
}
$origImageSrc = ($useAbsolutePath ? $context->getProperty('uri.service') : $context->getProperty('uri.path')) . "/attach/{$blogid}/{$filename}";
$tempWidth = $tempHeight = '';
if (preg_match('/width="([1-9][0-9]*)"/i', $imgString, $temp)) {
$tempWidth = $temp[1];
}
if (preg_match('/height="([1-9][0-9]*)"/i', $imgString, $temp)) {
$tempHeight = $temp[1];
}
if (!empty($tempWidth) && is_numeric($tempWidth) && !empty($tempHeight) && is_numeric($tempHeight)) {
$resizeImage = getImageResizer($filename, array('width' => $tempWidth, 'height' => $tempHeight, 'absolute' => $useAbsolutePath));
} else {
if (!empty($tempWidth) && !is_numeric($tempWidth) && empty($tempHeight)) {
$resizeImage = getImageResizer($filename, array('width' => $tempWidth, 'absolute' => $useAbsolutePath));
} else {
if (empty($tempWidth) && !empty($tempHeight) && is_numeric($tempHeight)) {
$resizeImage = getImageResizer($filename, array('height' => $tempHeight, 'absolute' => $useAbsolutePath));
} else {
return $imgString;
}
}
}
if ($resizeImage === false) {
return $imgString;
}
if (basename($resizeImage[0]) == $filename) {
return $imgString;
}
$resizeImageSrc = $resizeImage[0];
$resizeImageWidth = $resizeImage[1];
$resizeImageHeight = $resizeImage[2];
$imgString = preg_replace('/src="([^"]+)"/i', 'src="' . $resizeImageSrc . '"', $imgString);
$imgString = preg_replace('/width="([^"]+)"/i', 'width="' . $resizeImageWidth . '"', $imgString);
$imgString = preg_replace('/height="([^"]+)"/i', 'height="' . $resizeImageHeight . '"', $imgString);
$imgString = preg_replace('/onclick="open_img\\(\'([^\']+)\'\\)"/', "onclick=\"open_img('{$origImageSrc}')\"", $imgString);
return $imgString;
}
示例5: FM_Modern_editorinit
function FM_Modern_editorinit($editor)
{
global $entry;
$context = Model_Context::getInstance();
$blogid = getBlogId();
if (is_null($context->getProperty('plugin.config', null))) {
$config = array('paragraphdelim' => 'BR', 'defaultmode' => 'WYSIWYG');
} else {
$config = $context->getProperty('plugin.config');
}
if (in_array(Setting::getBlogSettingGlobal('defaultFormatter', 'html'), array('markdown', 'textile')) || in_array($entry['contentformatter'], array('markdown', 'textile'))) {
$config['defaultmode'] = 'TEXTAREA';
} else {
if (!isset($config['defaultmode'])) {
$config['defaultmode'] = 'WYSIWYG';
}
}
ob_start();
?>
if (typeof(document.execCommand) == "undefined" || !(STD.isIE || STD.isFirefox || (STD.isWebkit && STD.engineVersion >= 419.3))) return null;
var editor = new TTModernEditor();
editor.fixPosition = <?php
echo Setting::getBlogSettingGlobal('editorPropertyPositionFix', 0);
?>
;
editor.hasGD = <?php
echo extension_loaded('gd') ? 'true' : 'false';
?>
;
editor.propertyFilePath = "<?php
echo $context->getProperty('service.path');
?>
/attach/<?php
echo $blogid;
?>
/";
editor.editMode = "<?php
echo $config['defaultmode'];
?>
";
editor.newLineToParagraph = <?php
echo isset($config['paragraphdelim']) && $config['paragraphdelim'] == 'P' ? 'true' : 'false';
?>
;
return editor;
<?php
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例6: Xquared_editorinit
function Xquared_editorinit($editor)
{
global $configVal, $entry, $pluginURL;
$blogid = getBlogId();
if (is_null($configVal) || empty($configVal)) {
$config = array('paragraphdelim' => 'BR', 'defaultmode' => 'WYSIWYG');
} else {
$config = Setting::fetchConfigVal($configVal);
}
if (in_array(Setting::getBlogSettingGlobal('defaultFormatter', 'html'), array('markdown', 'textile')) || in_array($entry['contentformatter'], array('markdown', 'textile'))) {
$config['defaultmode'] = 'TEXTAREA';
} else {
if (!isset($config['defaultmode'])) {
$config['defaultmode'] = 'WYSIWYG';
}
}
ob_start();
?>
var editor = new xq.Editor("editWindow");
editor.config.contentCssList = ["<?php
echo $pluginURL;
?>
/stylesheets/xq_contents.css"];
editor.config.imagePathForDefaultToolbar = '<?php
echo $pluginURL;
?>
/images/toolbar/';
editor.setEditMode('wysiwyg');
editor.origInitialize = editor.initialize;
editor.origFinalize = editor.finalize;
editor.initialize = function() {
this.origInitialize();
}
editor.finalize = function() {
this.origFinalize();
}
editor.syncTextarea = function(){
var oForm = document.getElementById('editor-form');
oForm.content.value = this.getCurrentContent();
}
return editor;
<?php
$result = ob_get_contents();
ob_end_clean();
return $result;
}
示例7: removeAll
function removeAll($removeAttachments = true)
{
global $database;
$blogid = getBlogId();
$tags = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}");
POD::query("UPDATE {$database['prefix']}BlogStatistics SET visits = 0 WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}DailyStatistics WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Categories WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Attachments WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Comments WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RemoteResponses WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Entries WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}LinkCategories WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Links WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RefererLogs WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}RefererStatistics WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}Plugins WHERE blogid = {$blogid}");
//POD::query("DELETE FROM {$database['prefix']}UserSettings WHERE user = $blogid");
POD::query("DELETE FROM {$database['prefix']}Filters WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedStarred WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedReads WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}");
POD::query("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid} AND id <> 0");
if (count($tags) > 0) {
$tagliststr = implode(', ', $tags);
$nottargets = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE tag in ( {$tagliststr} )");
if (count($nottargets) > 0) {
$nottargetstr = implode(', ', $nottargets);
POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )");
} else {
POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) ");
}
}
if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml")) {
unlink(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml");
}
if ($removeAttachments) {
Path::removeFiles(Path::combine(ROOT, 'attach', $blogid));
POD::query("UPDATE {$database['prefix']}BlogSettings SET logo = '' WHERE blogid = {$blogid}");
}
}
示例8: KeywordUI_bindTag
function KeywordUI_bindTag($target, $mother)
{
global $blogURL, $pluginURL, $configVal;
requireModel('blog.keyword');
$blogid = getBlogId();
if (isset($mother) && isset($target)) {
$tagsWithKeywords = array();
$keywordNames = getKeywordNames($blogid);
foreach ($target as $tag => $tagLink) {
if (in_array($tag, $keywordNames) == true) {
$tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
} else {
$tagsWithKeywords[$tag] = $tagLink;
}
}
$target = $tagsWithKeywords;
}
return $target;
}
示例9: login
function login($loginid, $password, $expires = null)
{
$ctx = Model_Context::getInstance();
$loginid = POD::escapeString($loginid);
$blogid = getBlogId();
$userid = Auth::authenticate($blogid, $loginid, $password);
if ($userid === false) {
return false;
}
if (empty($_POST['save'])) {
setcookie('TSSESSION_LOGINID', '', time() - 31536000, $ctx->getProperty('service.path') . '/', $ctx->getProperty('service.domain'));
} else {
setcookie('TSSESSION_LOGINID', $loginid, time() + 31536000, $ctx->getProperty('service.path') . '/', $ctx->getProperty('service.domain'));
}
if (in_array("group.writers", Acl::getCurrentPrivilege())) {
Session::authorize($blogid, $userid, $expires);
}
return true;
}
示例10: KeywordUI_bindTag
function KeywordUI_bindTag($target, $mother)
{
$context = Model_Context::getInstance();
importlib('model.blog.keyword');
$blogid = getBlogId();
$blogURL = $context->getProperty("uri.blog");
$pluginURL = $context->getProperty("plugin.uri");
if (isset($mother) && isset($target)) {
$tagsWithKeywords = array();
$keywordNames = getKeywordNames($blogid);
foreach ($target as $tag => $tagLink) {
if (in_array($tag, $keywordNames) == true) {
$tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
} else {
$tagsWithKeywords[$tag] = $tagLink;
}
}
$target = $tagsWithKeywords;
}
return $target;
}
示例11: CT_Statistics_Default
function CT_Statistics_Default($target)
{
$blogid = getBlogId();
$stats = Statistics::getStatistics($blogid);
$target .= '<ul class="CT_Statistics_Default">';
$target .= '<li class="TotalCount"><h4>Total Counts</h4><div style="text-align:right; width:100%">';
$target .= '<span style="font-size:200%">';
$target .= number_format($stats['total']);
$target .= '</span>';
$target .= '</div></li>';
$target .= '<li class="TodayCount"><h4>Today</h4><div style="text-align:right; width:100%">';
$target .= '<span style="font-size:200%">';
$target .= number_format($stats['today']);
$target .= '</span>';
$target .= '</div></li>';
$target .= '<li class="YesterdayCount"><h4>Yesterday</h4><div style="text-align:right; width:100%">';
$target .= '<span style="font-size:200%">';
$target .= number_format($stats['yesterday']);
$target .= '</span>';
$target .= '</div></li>';
$target .= '</ul>';
return $target;
}
示例12: 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);
}
示例13:
<?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';
if (CacheControl::flushAll(getBlogId())) {
Respond::ResultPage(0);
} else {
Respond::ResultPage(-1);
}
示例14: isset
<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
echo abs($entry['visibility']) == 0 ? ' checked="checked"' : '';
?>
/><label for="visibility_private"><?php
echo _t('비공개');
?>
</label></div>
<div id="status-protected" class="status-protected"<?php
示例15: _buildQuery
function _buildQuery()
{
global $database;
$query = DBModel::getInstance();
$query->reset('Comments');
$query->setQualifier('blogid', 'equals', getBlogId());
$query->setQualifier('entry', 'equals', 0);
if (isset($this->id)) {
if (!Validator::number($this->id, 1)) {
return $this->_error('id');
}
$query->setQualifier('id', 'equals', $this->id);
}
if (isset($this->parent)) {
if (!Validator::number($this->parent, 1)) {
return $this->_error('parent');
}
}
$query->setAttribute('parent', $this->parent);
if (isset($this->commenter)) {
if (!Validator::number($this->commenter, 1)) {
return $this->_error('commenter');
}
if (!($this->name = User::getName($this->commenter))) {
return $this->_error('commenter');
}
$query->setAttribute('replier', $this->commenter);
}
if (isset($this->name)) {
$this->name = Utils_Unicode::lessenAsEncoding(trim($this->name), 80);
if (empty($this->name)) {
return $this->_error('name');
}
$query->setAttribute('name', $this->name, true);
}
if (isset($this->openid)) {
$this->openid = Utils_Unicode::lessenAsEncoding(trim($this->openid), 128);
if (empty($this->openid)) {
return $this->_error('openid');
}
$query->setAttribute('openid', $this->openid, true);
}
if (isset($this->homepage)) {
$this->homepage = Utils_Unicode::lessenAsEncoding(trim($this->homepage), 80);
if (empty($this->homepage)) {
return $this->_error('homepage');
}
$query->setAttribute('homepage', $this->homepage, true);
}
if (isset($this->ip)) {
if (!Validator::ip($this->ip)) {
return $this->_error('ip');
}
$query->setAttribute('ip', $this->ip, true);
}
if (isset($this->secret)) {
$query->setAttribute('secret', Validator::getBit($this->secret));
}
if (isset($this->content)) {
$this->content = trim($this->content);
if (empty($this->content)) {
return $this->_error('content');
}
$query->setAttribute('comment', $this->content, true);
}
if (isset($this->written)) {
if (!Validator::timestamp($this->written)) {
return $this->_error('written');
}
$query->setAttribute('written', $this->written);
}
if (isset($this->isfiltered)) {
$query->setAttribute('isfiltered', Validator::getBit($this->isfiltered));
}
if (isset($this->password)) {
$this->password = Utils_Unicode::lessenAsEncoding($this->password, 32);
$query->setAttribute('password', $this->password, true);
$this->password = null;
}
return $query;
}