当前位置: 首页>>代码示例>>PHP>>正文


PHP requireModel函数代码示例

本文整理汇总了PHP中requireModel函数的典型用法代码示例。如果您正苦于以下问题:PHP requireModel函数的具体用法?PHP requireModel怎么用?PHP requireModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了requireModel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printIphoneCategoriesView

function printIphoneCategoriesView($totalPosts, $categories)
{
    global $blogURL, $service, $blog;
    requireModel('blog.category');
    requireLibrary('blog.skin');
    $blogid = getBlogId();
    $categoryCount = 0;
    $categoryCountAll = 0;
    $parentCategoryCount = 0;
    $tree = array('id' => 0, 'label' => 'All Category', 'value' => $totalPosts, 'link' => "{$blogURL}/category/0", 'children' => array());
    foreach ($categories as $category1) {
        $children = array();
        if (doesHaveOwnership() || getCategoryVisibility($blogid, $category1['id']) > 1) {
            foreach ($category1['children'] as $category2) {
                if (doesHaveOwnership() || getCategoryVisibility($blogid, $category2['id']) > 1) {
                    array_push($children, array('id' => $category2['id'], 'label' => $category2['name'], 'value' => doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries'], 'link' => "{$blogURL}/category/" . $category2['id'], 'children' => array()));
                    $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']);
                }
                $categoryCountAll = $categoryCountAll + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']);
            }
            $parentCategoryCount = doesHaveOwnership() ? $category1['entriesinlogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll;
            if ($category1['id'] != 0) {
                array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => "{$blogURL}/category/" . $category1['id'], 'children' => $children));
            }
            $categoryCount = 0;
            $categoryCountAll = 0;
            $parentCategoryCount = 0;
        }
    }
    return printIphonePrintTreeView($tree, true);
}
开发者ID:hinablue,项目名称:TextCube,代码行数:31,代码来源:iphoneView.php

示例2: CT_Start_Default

function CT_Start_Default($target)
{
    requireModel("blog.attachment");
    requireComponent("Eolin.PHP.Core");
    requireComponent("Textcube.Function.misc");
    global $blogid, $blogURL, $database, $service;
    $target .= '<ul>';
    $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
    $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
    if ($latestEntryId !== 0) {
        $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
        if ($latestEntry != false) {
            $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
        }
    }
    if (Acl::check('group.administrators')) {
        $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
    }
    if ($service['reader'] != false) {
        $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
    }
    $target .= '</ul>';
    return $target;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:28,代码来源:index.php

示例3: printMobileCategoriesView

function printMobileCategoriesView($totalPosts, $categories)
{
    $context = Model_Context::getInstance();
    requireModel('blog.category');
    requireLibrary('blog.skin');
    $blogid = $context->getProperty('blog.id');
    $categoryCount = 0;
    $categoryCountAll = 0;
    $parentCategoryCount = 0;
    $tree = array('id' => 0, 'label' => 'All Category', 'value' => $totalPosts, 'link' => $context->getProperty('uri.blog') . "/category/0", 'children' => array());
    foreach ($categories as $category1) {
        $children = array();
        if (doesHaveOwnership() || getCategoryVisibility($blogid, $category1['id']) > 1) {
            foreach ($category1['children'] as $category2) {
                if (doesHaveOwnership() || getCategoryVisibility($blogid, $category2['id']) > 1) {
                    array_push($children, array('id' => $category2['id'], 'label' => $category2['name'], 'value' => doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries'], 'link' => $context->getProperty('uri.blog') . "/category/" . $category2['id'], 'children' => array()));
                    $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']);
                }
                $categoryCountAll = $categoryCountAll + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']);
            }
            $parentCategoryCount = doesHaveOwnership() ? $category1['entriesinlogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll;
            if ($category1['id'] != 0) {
                array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => $context->getProperty('uri.blog') . "/category/" . $category1['id'], 'children' => $children));
            }
            $categoryCount = 0;
            $categoryCountAll = 0;
            $parentCategoryCount = 0;
        }
    }
    return printMobilePrintTreeView($tree, true);
}
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:iphoneView.php

示例4: sendAbstractToEolin

/**
 * @brief Send abstract about specific entry.
 * @see Tag, User, DBModel, Model_Context
 */
function sendAbstractToEolin()
{
    // TODO : Rewrite routines to fit Textcube 1.8 or later.
    requireModel('blog.category');
    $entryId = $_GET['entryId'];
    $context = Model_Context::getInstance();
    $blogid = $context->getProperty('blog.id');
    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<response>\r\n";
    list($allComments, $allTrackbacks) = POD::queryRow("SELECT \n\t\t\tSUM(comments), SUM(trackbacks) \n\t\t\tFROM {$context->getProperty('database.prefix')}Entries \n\t\t\tWHERE blogid = " . $blogid . " AND draft = 0 AND visibility = 3", 'num');
    if ($entry = POD::queryRow("SELECT e.*, c.name AS categoryName \n\t\t\t\tFROM {$context->getProperty('database.prefix')}Entries e \n\t\t\t\tLEFT JOIN {$context->getProperty('database.prefix')}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\t\t\tWHERE e.blogid = " . $blogid . " AND e.id = " . $entryId . " AND e.draft = 0 AND e.visibility = 3" . getPrivateCategoryExclusionQuery($blogid))) {
        header('Content-Type: text/xml; charset=utf-8');
        echo '<version>1.1</version>', "\r\n";
        echo '<status>1</status>', "\r\n";
        echo '<blog>', "\r\n";
        echo '<generator>' . TEXTCUBE_NAME . '/' . TEXTCUBE_VERSION . '</generator>', "\r\n";
        echo '<language>', htmlspecialchars($context->getProperty('blog.language')), '</language>', "\r\n";
        echo '<url>', htmlspecialchars($context->getProperty('uri.default')), '</url>', "\r\n";
        echo '<title>', htmlspecialchars($context->getProperty('blog.title')), '</title>', "\r\n";
        echo '<description>', htmlspecialchars($context->getProperty('blog.description')), '</description>', "\r\n";
        echo '<comments>', $allComments, '</comments>', "\r\n";
        echo '<trackbacks>', $allTrackbacks, '</trackbacks>', "\r\n";
        echo '</blog>', "\r\n";
        echo '<entry>', "\r\n";
        echo '<permalink>', htmlspecialchars($context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$entry['slogan']}" : $entry['id'])), '</permalink>', "\r\n";
        echo '<title>', htmlspecialchars($entry['title']), '</title>', "\r\n";
        echo '<content>', htmlspecialchars(getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'])), '</content>', "\r\n";
        echo '<author>', htmlspecialchars(User::authorName($blogid, $entryId)), '</author>', "\r\n";
        echo '<category>', htmlspecialchars($entry['categoryName']), '</category>', "\r\n";
        $tags = Tag::getTagsWithEntryId($blogid, $entry);
        foreach ($tags as $tag) {
            echo '<tag>', htmlspecialchars($tag), '</tag>', "\r\n";
        }
        echo '<location>', htmlspecialchars($entry['location']), '</location>', "\r\n";
        echo '<comments>', $entry['comments'], '</comments>', "\r\n";
        echo '<trackbacks>', $entry['trackbacks'], '</trackbacks>', "\r\n";
        echo '<written>', Timestamp::getRFC1123($entry['published']), '</written>', "\r\n";
        foreach (getAttachments($blogid, $entry['id']) as $attachment) {
            echo '<attachment>', "\r\n";
            echo '<mimeType>', $attachment['mime'], '</mimeType>', "\r\n";
            echo '<filename>', $attachment['label'], '</filename>', "\r\n";
            echo '<length>', $attachment['size'], '</length>', "\r\n";
            echo '<url>', $context->getProperty('uri.service'), '/attachment/', $attachment['name'], '</url>', "\r\n";
            echo '</attachment>', "\r\n";
        }
        echo '</entry>', "\r\n";
    } else {
        echo '<version>1.1</version>', "\r\n", '<status>0</status>', "\r\n";
    }
    echo "</response>";
    exit;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:55,代码来源:index.php

示例5: 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;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:19,代码来源:index.php

示例6: dumbCronScheduler

function dumbCronScheduler($checkOnly = true)
{
    $ctx = 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 = ROOT . '/cache/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') {
                requireModel('blog.trash');
                trashVan();
            }
            fwrite($log, date('Y-m-d H:i:s') . ' ' . $ctx->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:hinablue,项目名称:TextCube,代码行数:38,代码来源:blog.cron.php

示例7: array

<?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)
$IV = array('POST' => array('targets' => array('list', 'default' => '', 'mandatory' => false), 'ip' => array('ip', 'default' => '', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.comment");
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
if (isset($suri['id'])) {
    if (trashCommentInOwner($blogid, $suri['id']) === true) {
        $isAjaxRequest ? Respond::ResultPage(0) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $isAjaxRequest ? Respond::ResultPage(-1) : header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    if (!empty($_POST['targets'])) {
        foreach (explode(',', $_POST['targets']) as $target) {
            trashCommentInOwner($blogid, $target);
        }
    }
    if (!empty($_POST['ip'])) {
        trashCommentInOwnerByIP($blogid, $_POST['ip']);
    }
    Respond::ResultPage(0);
}
开发者ID:ragi79,项目名称:Textcube,代码行数:27,代码来源:index.php

示例8: setEntryVisibility

function setEntryVisibility($id, $visibility)
{
    global $database;
    requireModel("blog.feed");
    requireModel("blog.category");
    requireComponent('Needlworks.Cache.PageCache');
    $blogid = getBlogId();
    if ($visibility < 0 || $visibility > 3) {
        return false;
    }
    list($oldVisibility, $category) = POD::queryRow("SELECT visibility, category FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$id} AND draft = 0");
    if ($category < 0) {
        if ($visibility == 1) {
            $visibility = 0;
        }
        if ($visibility == 3) {
            $visibility = 2;
        }
    }
    if ($oldVisibility === null) {
        return false;
    }
    if ($visibility == $oldVisibility) {
        return true;
    }
    if ($oldVisibility == 3) {
        syndicateEntry($id, 'delete');
    } else {
        if ($visibility == 3) {
            if (!syndicateEntry($id, 'create')) {
                POD::query("UPDATE {$database['prefix']}Entries \n\t\t\t\tSET visibility = {$oldVisibility}, \n\t\t\t\t\tmodified = UNIX_TIMESTAMP() \n\t\t\t\tWHERE blogid = {$blogid} AND id = {$id}");
                return false;
            }
        }
    }
    $result = POD::queryCount("UPDATE {$database['prefix']}Entries \n\t\tSET visibility = {$visibility}, \n\t\t\tmodified = UNIX_TIMESTAMP() \n\t\tWHERE blogid = {$blogid} AND id = {$id}");
    if (!$result) {
        // Error.
        return false;
    }
    if ($result == 0) {
        // Not changed.
        return true;
    }
    if ($category >= 0) {
        if ($oldVisibility >= 2 && $visibility < 2 || $oldVisibility < 2 && $visibility >= 2) {
            clearFeed();
        }
        if ($oldVisibility == 3 && $visibility <= 2 || $oldVisibility <= 2 && $visibility == 3) {
            clearFeed();
        }
        if ($category > 0) {
            updateCategoryByEntryId($blogid, $id, 'update', $parameters = array('visibility' => array($oldVisibility, $visibility)));
        }
        //			updateEntriesOfCategory($blogid, $category);
    }
    CacheControl::flushEntry($id);
    CacheControl::flushDBCache('entry');
    CacheControl::flushDBCache('comment');
    CacheControl::flushDBCache('trackback');
    fireEvent('ChangeVisibility', $visibility, $id);
    return true;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:63,代码来源:blog.entry.php

示例9: array

<?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)
$IV = array('POST' => array('name' => array('string'), 'rss' => array('string', 'default' => ''), 'url' => array('string'), 'category' => array('int', 'mandatory' => false), 'newCategory' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.link");
requireStrictRoute();
if (strpos($_POST['rss'], 'http://') !== 0) {
    $_POST['rss'] = 'http://' . $_POST['rss'];
}
if (strpos($_POST['url'], 'http://') !== 0) {
    $_POST['url'] = 'http://' . $_POST['url'];
}
Respond::ResultPage(addLink($blogid, $_POST));
开发者ID:ragi79,项目名称:Textcube,代码行数:16,代码来源:index.php

示例10: array

<?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)
$IV = array('POST' => array('fileName' => array('filename'), 'order' => array(array('0', '1'))));
require ROOT . '/library/preprocessor.php';
requireModel('blog.attachment');
requireStrictRoute();
$result = setEnclosure($_POST['fileName'], $_POST['order']);
Respond::PrintResult(array('error' => $result < 3 ? 0 : 1, 'order' => $result));
开发者ID:ragi79,项目名称:Textcube,代码行数:11,代码来源:index.php

示例11: array

<?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)
if (isset($_POST['page'])) {
    $_GET['page'] = $_POST['page'];
}
$IV = array('GET' => array('category' => array('int', 'mandatory' => false), 'visibility' => array('string', 'mandatory' => false), 'page' => array('int', 1, 'default' => 1), 'tagId' => array('int', 1, 'mandatory' => false), 'search' => array('string', 'mandatory' => false)), 'POST' => array('category' => array('int', 'mandatory' => false), 'visibility' => array('string', 'mandatory' => false), 'categoryAtHome' => array('int', 'mandatory' => false), 'perPage' => array('int', 1, 'mandatory' => false), 'search' => array('string', 'mandatory' => false), 'withSearch' => array(array('on'), 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.trash");
requireModel("blog.entry");
trashVan();
publishEntries();
// 카테고리 설정.
if (isset($_POST['category'])) {
    $categoryId = $_POST['category'];
} else {
    if (isset($_GET['category'])) {
        $categoryId = $_GET['category'];
    } else {
        if (isset($_POST['categoryAtHome'])) {
            $categoryId = $_POST['categoryAtHome'];
        } else {
            $categoryId = -5;
        }
    }
}
// 공개 / 비공개 설정
if (isset($_GET['visibility'])) {
    $_POST['visibility'] = $_GET['visibility'];
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php

示例12: cancelInvite

function cancelInvite($userid, $clean = true)
{
    global $database;
    requireModel('blog.user');
    if (POD::queryCell("SELECT count(*) FROM {$database['prefix']}Users WHERE userid = {$userid} AND lastlogin = 0") == 0) {
        return false;
    }
    if (POD::queryCell("SELECT count(*) FROM {$database['prefix']}Users WHERE userid = {$userid} AND host = " . getUserId()) === 0) {
        return false;
    }
    $blogidWithOwner = User::getOwnedBlogs($userid);
    foreach ($blogidWithOwner as $blogids) {
        if (deleteBlog($blogids) === false) {
            return false;
        }
    }
    if ($clean && !POD::queryAll("SELECT * FROM {$database['prefix']}Privileges WHERE userid = {$userid}")) {
        User::removePermanent($userid);
    }
    return true;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:21,代码来源:blog.blogSetting.php

示例13: array

<?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)
if (count($_POST) > 0) {
    $IV = array('POST' => array('deleteCategory' => array('id', 'mandatory' => false), 'direction' => array(array('up', 'down'), 'mandatory' => false), 'id' => array('int', 'mandatory' => false), 'newCategory' => array('string', 'mandatory' => false), 'modifyCategoryName' => array('string', 'mandatory' => false), 'modifyCategoryBodyId' => array('string', 'default' => 'tt-body-category'), 'visibility' => array('int', 'mandatory' => false)));
}
require ROOT . '/library/preprocessor.php';
$context = Model_Context::getInstance();
requireModel('blog.category');
requireModel('blog.entry');
if (!empty($_POST['id'])) {
    $selected = $_POST['id'];
} else {
    if (empty($_GET['id'])) {
        $selected = 0;
    } else {
        $selected = $_GET['id'];
    }
}
if (!empty($_POST['visibility'])) {
    $setVisibility = $_POST['visibility'];
    $visibility = setCategoryVisibility($blogid, $selected, $setVisibility);
} else {
    $visibility = getCategoryVisibility($blogid, $selected);
}
if (!empty($_POST['deleteCategory'])) {
    $parent = getParentCategoryId($blogid, $_POST['deleteCategory']);
    $selected = is_null($parent) ? 0 : $parent;
    $_POST['modifyCategoryName'] = '';
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php

示例14: addUser

 function addUser($email, $name, $comment, $senderName, $senderEmail)
 {
     requireModel('blog.user');
     requireModel('blog.blogSetting');
     global $database, $service, $blogURL, $hostURL, $user, $blog;
     $blogid = getBlogId();
     if (empty($email)) {
         return 1;
     }
     if (!preg_match('/^[^@]+@([-a-zA-Z0-9]+\\.)+[-a-zA-Z0-9]+$/', $email)) {
         return array(2, _t('이메일이 바르지 않습니다.'));
     }
     $isUserExists = User::getUserIdByEmail($email);
     if (empty($isUserExists)) {
         // If user is not exist
         User::add($email, $name);
     }
     $userid = User::getUserIdByEmail($email);
     $result = addBlog(getBlogId(), $userid, null);
     if ($result === true) {
         return sendInvitationMail(getBlogId(), $userid, User::getName($userid), $comment, $senderName, $senderEmail);
     }
     return $result;
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:24,代码来源:Textcube.Core.php

示例15: array

if (isset($_GET['url'])) {
    $_POST['url'] = $_GET['url'];
}
if (isset($_GET['withSearch'])) {
    $_POST['withSearch'] = $_GET['withSearch'];
}
if (isset($_GET['search'])) {
    $_POST['search'] = $_GET['search'];
}
if (isset($_GET['trashType'])) {
    $_POST['trashType'] = $_GET['trashType'];
}
$IV = array('GET' => array('page' => array('int', 1, 'default' => 1)), 'POST' => array('category' => array('int', 'default' => 0), 'site' => array('string', 'default' => ''), 'url' => array('url', 'default' => ''), 'ip' => array('ip', 'default' => ''), 'withSearch' => array(array('on'), 'mandatory' => false), 'search' => array('string', 'default' => ''), 'perPage' => array('int', 10, 30, 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.response.remote");
requireModel("blog.trash");
$categoryId = empty($_POST['category']) ? 0 : $_POST['category'];
$site = empty($_POST['site']) ? '' : $_POST['site'];
$url = empty($_POST['url']) ? '' : $_POST['url'];
$ip = empty($_POST['ip']) ? '' : $_POST['ip'];
$search = empty($_POST['withSearch']) || empty($_POST['search']) ? '' : trim($_POST['search']);
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
    $perPage = $_POST['perPage'];
    Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}
$tabsClass = array();
$tabsClass['postfix'] = null;
$tabsClass['postfix'] .= isset($_POST['category']) ? '&amp;category=' . $_POST['category'] : '';
$tabsClass['postfix'] .= isset($_POST['site']) ? '&amp;site=' . $_POST['site'] : '';
$tabsClass['postfix'] .= isset($_POST['ip']) ? '&amp;ip=' . $_POST['ip'] : '';
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php


注:本文中的requireModel函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。