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


PHP PLG_invokeService函数代码示例

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


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

示例1: service_get_staticpages

/**
 * Get an existing static page
 *
 * @param   array   args    Contains all the data provided by the client
 * @param   string  &output OUTPUT parameter containing the returned text
 * @param   string  &svc_msg OUTPUT parameter containing any service messages
 * @return  int		    Response code as defined in lib-plugins.php
 */
function service_get_staticpages($args, &$output, &$svc_msg)
{
    global $_CONF, $_TABLES, $LANG_ACCESS, $LANG12, $LANG_STATIC, $_SP_CONF;
    $output = '';
    $svc_msg['output_fields'] = array('sp_hits', 'sp_format', 'draft_flag', 'owner_id', 'group_id', 'perm_owner', 'perm_group', 'perm_members', 'perm_anon', 'sp_help', 'sp_php', 'sp_inblock', 'commentcode');
    if (empty($args['sp_id']) && !empty($args['id'])) {
        $args['sp_id'] = $args['id'];
    }
    if ($args['gl_svc']) {
        if (isset($args['sp_id'])) {
            $args['sp_id'] = COM_applyBasicFilter($args['sp_id']);
        }
        if (isset($args['mode'])) {
            $args['mode'] = COM_applyBasicFilter($args['mode']);
        }
        if (empty($args['sp_id'])) {
            $svc_msg['gl_feed'] = true;
        } else {
            $svc_msg['gl_feed'] = false;
        }
    } else {
        $svc_msg['gl_feed'] = false;
    }
    if (!$svc_msg['gl_feed']) {
        $page = '';
        if (isset($args['sp_id'])) {
            $page = $args['sp_id'];
        }
        $mode = '';
        if (isset($args['mode'])) {
            $mode = $args['mode'];
        }
        $error = 0;
        if ($page == '') {
            $error = 1;
        }
        $perms = SP_getPerms();
        if (!SEC_hasRights('staticpages.edit')) {
            if (!empty($perms)) {
                $perms .= ' AND';
            }
            $perms .= '(draft_flag = 0)';
        }
        if (!empty($perms)) {
            $perms = ' AND ' . $perms;
        }
        $sql = array();
        $sql['mysql'] = "SELECT sp_title,sp_page_title,sp_content,sp_hits,created,modified,sp_format," . "commentcode,meta_description,meta_keywords,template_flag,template_id,draft_flag," . "owner_id,group_id,perm_owner,perm_group," . "perm_members,perm_anon,sp_tid,sp_help,sp_php," . "sp_inblock FROM {$_TABLES['staticpage']} " . "WHERE (sp_id = '{$page}')" . $perms;
        $sql['mssql'] = "SELECT sp_title,sp_page_title," . "CAST(sp_content AS text) AS sp_content,sp_hits," . "created,modified,sp_format,commentcode," . "CAST(meta_description AS text) AS meta_description," . "CAST(meta_keywords AS text) AS meta_keywords,template_flag,template_id,draft_flag," . "owner_id,group_id,perm_owner,perm_group,perm_members," . "perm_anon,sp_tid,sp_help,sp_php,sp_inblock " . "FROM {$_TABLES['staticpage']} WHERE (sp_id = '{$page}')" . $perms;
        $sql['pgsql'] = "SELECT sp_title,sp_page_title,sp_content,sp_hits," . "created,modified,sp_format," . "commentcode,meta_description,meta_keywords,template_flag,template_id,draft_flag," . "owner_id,group_id,perm_owner,perm_group," . "perm_members,perm_anon,sp_tid,sp_help,sp_php," . "sp_inblock FROM {$_TABLES['staticpage']} " . "WHERE (sp_id = '{$page}')" . $perms;
        $result = DB_query($sql);
        $count = DB_numRows($result);
        if ($count == 0 || $count > 1) {
            $error = 1;
        }
        if (!$error) {
            $output = DB_fetchArray($result, false);
            // WE ASSUME $output doesn't have any confidential fields
            if ($output['template_id'] != '') {
                $retval = '';
                $mode = '';
                $xmlObject = simplexml_load_string($output['sp_content']);
                // create array of XML data
                $tag = array();
                foreach ($xmlObject->variable as $variable) {
                    $key = $variable["name"] . '';
                    $value = $variable->data;
                    $tag[$key] = $value;
                }
                // Loop through variables to replace any autotags first
                foreach ($tag as &$value) {
                    $value = PLG_replaceTags($value);
                }
                $args = array('sp_id' => $output['template_id'], 'mode' => $mode, 'gl_svc' => '');
                $svc_msg = array();
                if (PLG_invokeService('staticpages', 'get', $args, $retval, $svc_msg) == PLG_RET_OK) {
                    $retval['sp_content'] = str_replace(array_keys($tag), array_values($tag), $retval['sp_content']);
                    $output['sp_content'] = $retval['sp_content'];
                }
            }
        } else {
            // an error occured (page not found, access denied, ...)
            /**
             * if the user has edit permissions and the page does not exist,
             * send them to the editor so they can create it "wiki style"
             */
            $create_page = false;
            if ($mode !== 'autotag' && $count == 0 && SEC_hasRights('staticpages.edit')) {
                // check again without permissions
                if (DB_count($_TABLES['staticpage'], 'sp_id', $page) == 0) {
                    $url = $_CONF['site_admin_url'] . '/plugins/staticpages/index.php?mode=edit&sp_new_id=' . $page . '&msg=21';
                    $output = COM_refresh($url);
//.........这里部分代码省略.........
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:101,代码来源:services.inc.php

示例2: submitstory

/**
* Saves story to database
*
* @param    string      $type           story submission or (new) story
* @param    string      $sid            ID of story to save
* @param    int         $uid            ID of user that wrote the story
* @param    string      $tid            Topic ID story belongs to
* @param    string      $title          Title of story
* @param    string      $page_title     Title of the page
* @param    string      $introtext      Introduction text
* @param    string      $bodytext       Text of body
* @param    int         $hits           Number of times story has been viewed
* @param    string      $unixdate       Date story was originally saved
* @param    int         $featured       Flag on whether or not this is a featured article
* @param    string      $commentcode    Indicates if comments are allowed to be made to article
* @param    string      $trackbackcode  Indicates if trackbacks are allowed to be made to article
* @param    string      $statuscode     Status of the story
* @param    string      $postmode       Is this HTML or plain text?
* @param    string      $frontpage      Flag indicates if story will appear on front page and topic or just topic
* @param    int         $draft_flag     Flag indicates if story is a draft or not
* @param    int         $numemails      Number of times this story has been emailed to someone
* @param    int         $owner_id       ID of owner (not necessarily the author)
* @param    int         $group_id       ID of group story belongs to
* @param    int         $perm_owner     Permissions the owner has on story
* @param    int         $perm_group     Permissions the group has on story
* @param    int         $perm_member    Permissions members have on story
* @param    int         $perm_anon      Permissions anonymous users have on story
* @param    int         $delete         String array of attached images to delete from article
*
*/
function submitstory($type = '')
{
    $output = '';
    $args =& $_POST;
    // Handle Magic GPC Garbage:
    while (list($key, $value) = each($args)) {
        if (!is_array($value)) {
            $args[$key] = COM_stripslashes($value);
        } else {
            while (list($subkey, $subvalue) = each($value)) {
                $value[$subkey] = COM_stripslashes($subvalue);
            }
        }
    }
    /* ANY FURTHER PROCESSING on POST variables - COM_stripslashes etc.
     * Do it HERE on $args */
    PLG_invokeService('story', 'submit', $args, $output, $svc_msg);
    echo $output;
}
开发者ID:geeklog-cms,项目名称:geeklog,代码行数:49,代码来源:story.php

示例3: WS_delete

/**
 * Handles the DELETE request
 */
function WS_delete()
{
    global $_CONF, $WS_PLUGIN, $WS_VERBOSE;
    if ($WS_VERBOSE) {
        COM_errorLog("WS: DELETE request received");
    }
    WS_dissectURI($args);
    // @TODO Store array $args
    // object id has already been stored from the URI
    /* Indicates that the method are being called by the webservice */
    $args['gl_svc'] = true;
    $ret = PLG_invokeService($WS_PLUGIN, 'delete', $args, $out, $svc_msg);
    if ($ret == PLG_RET_OK) {
        header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
        return;
    }
    WS_error($ret, $svc_msg['error_desc']);
}
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:21,代码来源:lib-webservices.php

示例4: STORY_deleteStory

/**
 * Delete a story.
 * This is used to delete a story from the list of stories.
 *
 * @param    string $sid ID of the story to delete
 * @return   string          HTML, e.g. a meta redirect
 */
function STORY_deleteStory($sid)
{
    $args = array('sid' => $sid);
    $output = '';
    PLG_invokeService('story', 'delete', $args, $output, $svc_msg);
    return $output;
}
开发者ID:mystralkk,项目名称:geeklog,代码行数:14,代码来源:lib-story.php

示例5: submitstaticpage

/**
* Saves a Static Page to the database
*
* @param string sp_id            ID of static page
* @param string sp_title         title of page
* @param string sp_page_title    page title of the staticpage
* @param string sp_content       page content
* @param int    sp_hits          Number of page views
* @param string sp_format        HTML or plain text
* @param string sp_onmenu        Flag to place entry on menu
* @param string sp_label         Menu Entry
* @param int    commentcode      Comment Code
* @param int    owner_id         Permission bits
* @param int    group_id
* @param int    perm_owner
* @param int    perm_members
* @param int    perm_anon
* @param int    sp_php           Flag to indicate PHP usage
* @param string sp_nf            Flag to indicate type of not found message
* @param string sp_old_id        original ID of this static page
* @param string sp_centerblock   Flag to indicate display as a center block
* @param string sp_help          Help URL that displays in the block
* @param int    sp_where         position of center block
* @param string sp_inblock       Flag: wrap page in a block (or not)
* @param string postmode
* @param string meta_description
* @param string meta_keywords
* @param string draft_flag       Flag: save as draft
* @param string cache_time       Cache time of page
*
*/
function submitstaticpage($sp_id, $sp_title, $sp_page_title, $sp_content, $sp_hits, $sp_format, $sp_onmenu, $sp_label, $commentcode, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf, $sp_old_id, $sp_centerblock, $sp_help, $sp_where, $sp_inblock, $postmode, $meta_description, $meta_keywords, $draft_flag, $template_flag, $template_id, $cache_time)
{
    $retval = '';
    $args = array('sp_id' => $sp_id, 'sp_title' => $sp_title, 'sp_page_title' => $sp_page_title, 'sp_content' => $sp_content, 'sp_hits' => $sp_hits, 'sp_format' => $sp_format, 'sp_onmenu' => $sp_onmenu, 'sp_label' => $sp_label, 'commentcode' => $commentcode, 'meta_description' => $meta_description, 'meta_keywords' => $meta_keywords, 'template_flag' => $template_flag, 'template_id' => $template_id, 'draft_flag' => $draft_flag, 'cache_time' => $cache_time, 'owner_id' => $owner_id, 'group_id' => $group_id, 'perm_owner' => $perm_owner, 'perm_group' => $perm_group, 'perm_members' => $perm_members, 'perm_anon' => $perm_anon, 'sp_php' => $sp_php, 'sp_nf' => $sp_nf, 'sp_old_id' => $sp_old_id, 'sp_centerblock' => $sp_centerblock, 'sp_help' => $sp_help, 'sp_where' => $sp_where, 'sp_inblock' => $sp_inblock, 'postmode' => $postmode);
    PLG_invokeService('staticpages', 'submit', $args, $retval, $svc_msg);
    return $retval;
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:38,代码来源:index.php

示例6: PAGE_submit

/**
* Saves a Static Page to the database
*
* @param sp_id           string  ID of static page
* @param sp_uid          string  ID of user that created page
* @param sp_title        string  title of page
* @param sp_content      string  page content
* @param sp_hits         int     Number of page views
* @param sp_format       string  HTML or plain text
* @param sp_onmenu       string  Flag to place entry on menu
* @param sp_label        string  Menu Entry
* @param commentcode     int     Comment Code
* @param owner_id        int     Permission bits
* @param group_id        int
* @param perm_owner      int
* @param perm_members    int
* @param perm_anon       int
* @param sp_php          int     Flag to indicate PHP usage
* @param sp_nf           string  Flag to indicate type of not found message
* @param sp_old_id       string  original ID of this static page
* @param sp_centerblock  string  Flag to indicate display as a center block
* @param sp_help         string  Help URL that displays in the block
* @param sp_tid          string  topid id (for center block)
* @param sp_where        int     position of center block
* @param sp_inblock      string  Flag: wrap page in a block (or not)
*
*/
function PAGE_submit($sp_id, $sp_status, $sp_uid, $sp_title, $sp_content, $sp_hits, $sp_format, $sp_onmenu, $sp_label, $commentcode, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf, $sp_old_id, $sp_centerblock, $sp_help, $sp_tid, $sp_where, $sp_inblock, $postmode, $sp_search)
{
    global $_CONF, $_TABLES, $LANG12, $LANG_STATIC, $_SP_CONF;
    $retval = '';
    $args = array('sp_id' => $sp_id, 'sp_status' => $sp_status, 'sp_uid' => $sp_uid, 'sp_title' => $sp_title, 'sp_content' => $sp_content, 'sp_hits' => $sp_hits, 'sp_format' => $sp_format, 'sp_onmenu' => $sp_onmenu, 'sp_label' => $sp_label, 'commentcode' => $commentcode, 'owner_id' => $owner_id, 'group_id' => $group_id, 'perm_owner' => $perm_owner, 'perm_group' => $perm_group, 'perm_members' => $perm_members, 'perm_anon' => $perm_anon, 'sp_php' => $sp_php, 'sp_nf' => $sp_nf, 'sp_old_id' => $sp_old_id, 'sp_centerblock' => $sp_centerblock, 'sp_help' => $sp_help, 'sp_tid' => $sp_tid, 'sp_where' => $sp_where, 'sp_inblock' => $sp_inblock, 'postmode' => $postmode, 'sp_search' => $sp_search);
    PLG_invokeService('staticpages', 'submit', $args, $retval, $svc_msg);
    CACHE_remove_instance('stmenu');
    return $retval;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:36,代码来源:index.php

示例7: COM_refresh

    }
}
if (empty($sid)) {
    echo COM_refresh($_CONF['site_url'] . '/index.php');
    exit;
}
if (strcasecmp($order, 'ASC') != 0 && strcasecmp($order, 'DESC') != 0) {
    $order = '';
}
$result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '{$sid}'" . COM_getPermSql('AND'));
$A = DB_fetchArray($result);
if ($A['count'] > 0) {
    $story = new Story();
    $args = array('sid' => $sid, 'mode' => 'view');
    $output = STORY_LOADED_OK;
    $result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
    if ($result == PLG_RET_OK) {
        /* loadFromArray cannot be used, since it overwrites the timestamp */
        reset($story->_dbFields);
        while (list($fieldname, $save) = each($story->_dbFields)) {
            $varname = '_' . $fieldname;
            if (array_key_exists($fieldname, $output)) {
                $story->{$varname} = $output[$fieldname];
            }
        }
        $story->_username = $output['username'];
        $story->_fullname = $output['fullname'];
    }
    if ($output == STORY_PERMISSION_DENIED) {
        $display .= COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG_ACCESS['storydenialmsg'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')) . COM_siteFooter();
    } elseif ($output == STORY_INVALID_SID) {
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:31,代码来源:article.php

示例8: _createMailStory

function _createMailStory($sid)
{
    global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG01, $LANG08;
    USES_lib_story();
    $story = new Story();
    $args = array('sid' => $sid, 'mode' => 'view');
    $output = STORY_LOADED_OK;
    $result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
    if ($result == PLG_RET_OK) {
        /* loadFromArray cannot be used, since it overwrites the timestamp */
        reset($story->_dbFields);
        while (list($fieldname, $save) = each($story->_dbFields)) {
            $varname = '_' . $fieldname;
            if (array_key_exists($fieldname, $output)) {
                $story->{$varname} = $output[$fieldname];
            }
        }
        $story->_username = $output['username'];
        $story->_fullname = $output['fullname'];
    }
    if ($output == STORY_PERMISSION_DENIED) {
        $display = COM_siteHeader('menu', $LANG_ACCESS['accessdenied']) . COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true, 'error') . COM_siteFooter();
        echo $display;
        exit;
    } elseif ($output == STORY_INVALID_SID) {
        COM_404();
    } else {
        $T = new Template($_CONF['path_layout'] . 'article');
        $T->set_file('article', 'mailable.thtml');
        list($cacheFile, $style_cache_url) = COM_getStyleCacheLocation();
        $T->set_var('direction', $LANG_DIRECTION);
        $T->set_var('css_url', $style_cache_url);
        $T->set_var('page_title', $_CONF['site_name'] . ': ' . $story->displayElements('title'));
        $T->set_var('story_title', $story->DisplayElements('title'));
        $T->set_var('story_subtitle', $story->DisplayElements('subtitle'));
        $story_image = $story->DisplayElements('story_image');
        if ($story_image != '') {
            $T->set_var('story_image', $story_image);
        } else {
            $T->unset_var('story_image');
        }
        if ($_CONF['hidestorydate'] != 1) {
            $T->set_var('story_date', $story->displayElements('date'));
        }
        if ($_CONF['contributedbyline'] == 1) {
            $T->set_var('lang_contributedby', $LANG01[1]);
            $authorname = COM_getDisplayName($story->displayElements('uid'));
            $T->set_var('author', $authorname);
            $T->set_var('story_author', $authorname);
            $T->set_var('story_author_username', $story->DisplayElements('username'));
        }
        $T->set_var('story_introtext', $story->DisplayElements('introtext'));
        $T->set_var('story_bodytext', $story->DisplayElements('bodytext'));
        $T->set_var('site_name', $_CONF['site_name']);
        $T->set_var('site_slogan', $_CONF['site_slogan']);
        $T->set_var('story_id', $story->getSid());
        $articleUrl = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid());
        if ($story->DisplayElements('commentcode') >= 0) {
            $commentsUrl = $articleUrl . '#comments';
            $comments = $story->DisplayElements('comments');
            $numComments = COM_numberFormat($comments);
            $T->set_var('story_comments', $numComments);
            $T->set_var('comments_url', $commentsUrl);
            $T->set_var('comments_text', $numComments . ' ' . $LANG01[3]);
            $T->set_var('comments_count', $numComments);
            $T->set_var('lang_comments', $LANG01[3]);
            $comments_with_count = sprintf($LANG01[121], $numComments);
            if ($comments > 0) {
                $comments_with_count = COM_createLink($comments_with_count, $commentsUrl);
            }
            $T->set_var('comments_with_count', $comments_with_count);
        }
        $T->set_var('lang_full_article', $LANG08[33]);
        $T->set_var('article_url', $articleUrl);
        COM_setLangIdAndAttribute($T);
        $T->parse('output', 'article');
        $htmlMsg = $T->finish($T->get_var('output'));
        return $htmlMsg;
    }
}
开发者ID:spacequad,项目名称:glfusion,代码行数:80,代码来源:profiles.php

示例9: COM_emailUserTopics

/**
* This will email new stories in the topics that the user is interested in
*
* In account information the user can specify which topics for which they
* will receive any new article for in a daily digest.
*
* @return   void
*/
function COM_emailUserTopics()
{
    global $_CONF, $_USER, $_VARS, $_TABLES, $LANG04, $LANG08, $LANG24;
    if ($_CONF['emailstories'] == 0) {
        return;
    }
    $storytext = '';
    $storytext_text = '';
    USES_lib_story();
    $subject = strip_tags($_CONF['site_name'] . $LANG08[30] . strftime('%Y-%m-%d', time()));
    $authors = array();
    // Get users who want stories emailed to them
    $usersql = "SELECT username,email,etids,{$_TABLES['users']}.uid AS uuid, status " . "FROM {$_TABLES['users']}, {$_TABLES['userindex']} " . "WHERE {$_TABLES['users']}.uid > 1 AND {$_TABLES['userindex']}.uid = {$_TABLES['users']}.uid AND status=" . USER_ACCOUNT_ACTIVE . " AND (etids <> '-' OR etids IS NULL) ORDER BY {$_TABLES['users']}.uid";
    $users = DB_query($usersql);
    $nrows = DB_numRows($users);
    if (!isset($_VARS['lastemailedstories'])) {
        $_VARS['lastemailedstories'] = 0;
    }
    $lastrun = $_VARS['lastemailedstories'];
    // For each user, pull the stories they want and email it to them
    for ($x = 0; $x < $nrows; $x++) {
        $U = DB_fetchArray($users);
        $storysql = "SELECT sid,uid,date AS day,title,introtext,bodytext";
        $commonsql = " FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND date >= '{$lastrun}'";
        $topicsql = "SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL('WHERE', $U['uuid']);
        $tresult = DB_query($topicsql);
        $trows = DB_numRows($tresult);
        if ($trows == 0) {
            // this user doesn't seem to have access to any topics ...
            continue;
        }
        $TIDS = array();
        for ($i = 0; $i < $trows; $i++) {
            $T = DB_fetchArray($tresult);
            $TIDS[] = $T['tid'];
        }
        if (!empty($U['etids'])) {
            $ETIDS = explode(' ', $U['etids']);
            $TIDS = array_intersect($TIDS, $ETIDS);
        }
        if (sizeof($TIDS) > 0) {
            $commonsql .= " AND (tid IN ('" . implode("','", $TIDS) . "'))";
        }
        $commonsql .= COM_getPermSQL('AND', $U['uuid']);
        $commonsql .= ' ORDER BY featured DESC, date DESC';
        $storysql .= $commonsql;
        $stories = DB_query($storysql);
        $nsrows = DB_numRows($stories);
        if ($nsrows == 0) {
            // If no new stories where pulled for this user, continue with next
            continue;
        }
        $T = new Template($_CONF['path_layout']);
        $T->set_file(array('message' => 'digest.thtml', 'story' => 'digest_story.thtml'));
        $TT = new Template($_CONF['path_layout']);
        $TT->set_file(array('message' => 'digest_text.thtml', 'story' => 'digest_story_text.thtml'));
        $T->set_var('week_date', strftime($_CONF['shortdate'], time()));
        $TT->set_var('week_date', strftime($_CONF['shortdate'], time()));
        $T->set_var('site_name', $_CONF['site_name']);
        $TT->set_var('site_name', $_CONF['site_name']);
        $T->set_var('remove_msg', sprintf($LANG08[36], $_CONF['site_name'], $_CONF['site_url']));
        $TT->set_var('remove_msg', sprintf($LANG08[37], $_CONF['site_name'], $_CONF['site_url']));
        for ($y = 0; $y < $nsrows; $y++) {
            // Loop through stories building the requested email message
            $S = DB_fetchArray($stories);
            $story = new Story();
            $args = array('sid' => $S['sid'], 'mode' => 'view');
            $output = STORY_LOADED_OK;
            $result = PLG_invokeService('story', 'get', $args, $output, $svc_msg);
            if ($result == PLG_RET_OK) {
                /* loadFromArray cannot be used, since it overwrites the timestamp */
                reset($story->_dbFields);
                while (list($fieldname, $save) = each($story->_dbFields)) {
                    $varname = '_' . $fieldname;
                    if (array_key_exists($fieldname, $output)) {
                        $story->{$varname} = $output[$fieldname];
                    }
                }
                $story->_username = $output['username'];
                $story->_fullname = $output['fullname'];
            }
            $story_url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $S['sid']);
            $title = COM_undoSpecialChars($S['title']);
            if ($_CONF['contributedbyline'] == 1) {
                if (empty($authors[$S['uid']])) {
                    $storyauthor = COM_getDisplayName($S['uid']);
                    $authors[$S['uid']] = $storyauthor;
                } else {
                    $storyauthor = $authors[$S['uid']];
                }
            }
            $dt = new Date($S['day'], $_USER['tzid']);
//.........这里部分代码省略.........
开发者ID:NewRoute,项目名称:glfusion,代码行数:101,代码来源:lib-common.php

示例10: STORY_submit

/**
* Saves story to database
*
* @param    string      $type           story submission or (new) story
* @param    string      $sid            ID of story to save
* @param    int         $uid            ID of user that wrote the story
* @param    string      $tid            Topic ID story belongs to
* @param    string      $title          Title of story
* @param    string      $introtext      Introduction text
* @param    string      $bodytext       Text of body
* @param    int         $hits           Number of times story has been viewed
* @param    string      $unixdate       Date story was originally saved
* @param    int         $featured       Flag on whether or not this is a featured article
* @param    string      $commentcode    Indicates if comments are allowed to be made to article
* @param    string      $trackbackcode  Indicates if trackbacks are allowed to be made to article
* @param    string      $statuscode     Status of the story
* @param    string      $postmode       Is this HTML or plain text?
* @param    string      $frontpage      Flag indicates if story will appear on front page and topic or just topic
* @param    int         $draft_flag     Flag indicates if story is a draft or not
* @param    int         $numemails      Number of times this story has been emailed to someone
* @param    int         $owner_id       ID of owner (not necessarily the author)
* @param    int         $group_id       ID of group story belongs to
* @param    int         $perm_owner     Permissions the owner has on story
* @param    int         $perm_group     Permissions the group has on story
* @param    int         $perm_member    Permissions members have on story
* @param    int         $perm_anon      Permissions anonymous users have on story
* @param    int         $delete         String array of attached images to delete from article
*
*/
function STORY_submit($type = '')
{
    $output = '';
    $args =& $_POST;
    while (list($key, $value) = each($args)) {
        if (!is_array($value)) {
            $args[$key] = $value;
        } else {
            while (list($subkey, $subvalue) = each($value)) {
                $value[$subkey] = $subvalue;
            }
        }
    }
    /* ANY FURTHER PROCESSING on POST variables - COM_stripslashes etc.
     * Do it HERE on $args */
    $rc = PLG_invokeService('story', 'submit', $args, $output, $svc_msg);
    switch ($rc) {
        case PLG_RET_ERROR:
            break;
        case PLG_RET_PERMISSION_DENIED:
            break;
        case PLG_RET_PERMISSION_DENIED:
            break;
        case PLG_RET_PRECONDITION_FAILED:
            break;
        case PLG_RET_AUTH_FAILED:
            break;
    }
    return $output;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:59,代码来源:story.php

示例11: STORY_deleteStory

/**
* Delete a story.
*
* This is used to delete a story from the list of stories.
*
* @param    string  $sid    ID of the story to delete
* @return   string          HTML, e.g. a meta redirect
*
*/
function STORY_deleteStory($sid)
{
    $args = array('sid' => $sid);
    $output = '';
    PLG_invokeService('story', 'delete', $args, $output, $svc_msg);
    CACHE_remove_instance('whatsnew');
    CACHE_remove_instance('story_' . $sid);
    return $output;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:18,代码来源:lib-story.php


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