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


PHP set_pconfig函数代码示例

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


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

示例1: theme_post

function theme_post(&$a)
{
    if (!local_user()) {
        return;
    }
    if (isset($_POST['diabook-settings-submit'])) {
        set_pconfig(local_user(), 'diabook', 'font_size', $_POST['diabook_font_size']);
        set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
        set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
        set_pconfig(local_user(), 'diabook', 'color', $_POST['diabook_color']);
        set_pconfig(local_user(), 'diabook', 'TSearchTerm', $_POST['diabook_TSearchTerm']);
        set_pconfig(local_user(), 'diabook', 'ELZoom', $_POST['diabook_ELZoom']);
        set_pconfig(local_user(), 'diabook', 'ELPosX', $_POST['diabook_ELPosX']);
        set_pconfig(local_user(), 'diabook', 'ELPosY', $_POST['diabook_ELPosY']);
        set_pconfig(local_user(), 'diabook', 'ELPosY', $_POST['diabook_ELPosY']);
        set_pconfig(local_user(), 'diabook', 'close_pages', $_POST['diabook_close_pages']);
        set_pconfig(local_user(), 'diabook', 'close_mapquery', $_POST['diabook_close_mapquery']);
        set_pconfig(local_user(), 'diabook', 'close_profiles', $_POST['diabook_close_profiles']);
        set_pconfig(local_user(), 'diabook', 'close_helpers', $_POST['diabook_close_helpers']);
        set_pconfig(local_user(), 'diabook', 'close_services', $_POST['diabook_close_services']);
        set_pconfig(local_user(), 'diabook', 'close_friends', $_POST['diabook_close_friends']);
        set_pconfig(local_user(), 'diabook', 'close_twitter', $_POST['diabook_close_twitter']);
        set_pconfig(local_user(), 'diabook', 'close_lastusers', $_POST['diabook_close_lastusers']);
        set_pconfig(local_user(), 'diabook', 'close_lastphotos', $_POST['diabook_close_lastphotos']);
        set_pconfig(local_user(), 'diabook', 'close_lastlikes', $_POST['diabook_close_lastlikes']);
    }
}
开发者ID:ridcully,项目名称:friendica,代码行数:27,代码来源:config.php

示例2: langfilter_addon_settings_post

function langfilter_addon_settings_post(&$a, &$b)
{
    if (!local_user()) {
        return;
    }
    if ($_POST['langfilter-settings-submit']) {
        set_pconfig(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages']));
        $enable = x($_POST, 'langfilter_enable') ? intval($_POST['langfilter_enable']) : 0;
        $disable = 1 - $enable;
        set_pconfig(local_user(), 'langfilter', 'disable', $disable);
        $minconfidence = 0 + $_POST['langfilter_minconfidence'];
        if (!$minconfidence) {
            $minconfidence = 0;
        } else {
            if ($minconfidence < 0) {
                $minconfidence = 0;
            } else {
                if ($minconfidence > 100) {
                    $minconfidence = 100;
                }
            }
        }
        set_pconfig(local_user(), 'langfilter', 'minconfidence', $minconfidence / 100.0);
        info(t('Language Filter Settings saved.') . EOL);
    }
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:26,代码来源:langfilter.php

示例3: redred_settings_post

function redred_settings_post($a, $post)
{
    if (!local_channel()) {
        return;
    }
    // don't check redred settings if redred submit button is not clicked
    if (!x($_POST, 'redred-submit')) {
        return;
    }
    $channel = App::get_channel();
    // Don't let somebody post to their self channel. Since we aren't passing message-id this would be very very bad.
    if (!trim($_POST['redred_channel'])) {
        notice(t('Channel is required.') . EOL);
        return;
    }
    if ($channel['channel_address'] === trim($_POST['redred_channel'])) {
        notice(t('Invalid channel.') . EOL);
        return;
    }
    set_pconfig(local_channel(), 'redred', 'baseapi', trim($_POST['redred_baseapi']));
    set_pconfig(local_channel(), 'redred', 'username', trim($_POST['redred_username']));
    set_pconfig(local_channel(), 'redred', 'password', z_obscure(trim($_POST['redred_password'])));
    set_pconfig(local_channel(), 'redred', 'channel', trim($_POST['redred_channel']));
    set_pconfig(local_channel(), 'redred', 'post', intval($_POST['redred_enable']));
    set_pconfig(local_channel(), 'redred', 'post_by_default', intval($_POST['redred_default']));
    info(t('redred Settings saved.') . EOL);
}
开发者ID:phellmes,项目名称:hubzilla-addons,代码行数:27,代码来源:redred.php

示例4: notes_init

/** @file */
function notes_init(&$a)
{
    if (!local_channel()) {
        return;
    }
    $ret = array('success' => true);
    if (array_key_exists('note_text', $_REQUEST)) {
        $body = escape_tags($_REQUEST['note_text']);
        // I've had my notes vanish into thin air twice in four years.
        // Provide a backup copy if there were contents previously
        // and there are none being saved now.
        if (!$body) {
            $old_text = get_pconfig(local_channel(), 'notes', 'text');
            if ($old_text) {
                set_pconfig(local_channel(), 'notes', 'text.bak', $old_text);
            }
        }
        set_pconfig(local_channel(), 'notes', 'text', $body);
    }
    // push updates to channel clones
    if (argc() > 1 && argv(1) === 'sync') {
        require_once 'include/zot.php';
        build_sync_packet();
    }
    logger('notes saved.', LOGGER_DEBUG);
    json_return_and_die($ret);
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:28,代码来源:notes.php

示例5: skeleton_settings_post

function skeleton_settings_post($a, $s)
{
    if (!local_channel()) {
        return;
    }
    set_pconfig(local_channel(), 'skeleton', 'some_setting', $_POST['some_setting']);
}
开发者ID:git-marijus,项目名称:hubzilla-addons,代码行数:7,代码来源:skeleton.php

示例6: widgets_settings

function widgets_settings(&$a, &$o)
{
    if (!local_user()) {
        return;
    }
    $key = get_pconfig(local_user(), 'widgets', 'key');
    if ($key == '') {
        $key = mt_rand();
        set_pconfig(local_user(), 'widgets', 'key', $key);
    }
    $widgets = array();
    $d = dir(dirname(__FILE__));
    while (false !== ($f = $d->read())) {
        if (substr($f, 0, 7) == "widget_") {
            preg_match("|widget_([^.]+).php|", $f, $m);
            $w = $m[1];
            if ($w != "") {
                require_once $f;
                $widgets[] = array($w, call_user_func($w . "_widget_name"));
            }
        }
    }
    $t = file_get_contents(dirname(__FILE__) . "/settings.tpl");
    $o .= replace_macros($t, array('$submit' => t('Generate new key'), '$baseurl' => $a->get_baseurl(), '$title' => "Widgets", '$label' => t('Widgets key'), '$key' => $key, '$widgets_h' => t('Widgets available'), '$widgets' => $widgets));
}
开发者ID:robhell,项目名称:friendica-addons,代码行数:25,代码来源:widgets.php

示例7: notimeline_settings_post

function notimeline_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'notimeline-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'no_wall_archive_widget', intval($_POST['notimeline']));
    info(t('No Timeline settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:8,代码来源:notimeline.php

示例8: gnot_settings_post

/**
 *
 * Callback from the settings post function.
 * $post contains the $_POST array.
 * We will make sure we've got a valid user account
 * and if so set our configuration setting for this person.
 *
 */
function gnot_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'gnot-submit')) {
        return;
    }
    set_pconfig(local_user(), 'gnot', 'enable', intval($_POST['gnot']));
    info(t('Gnot settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:16,代码来源:gnot.php

示例9: editplain_settings_post

/**
 *
 * Callback from the settings post function.
 * $post contains the $_POST array.
 * We will make sure we've got a valid user account
 * and if so set our configuration setting for this person.
 *
 */
function editplain_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'editplain-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'plaintext', intval($_POST['editplain']));
    info(t('Editplain settings updated.') . EOL);
}
开发者ID:robhell,项目名称:friendica-addons,代码行数:16,代码来源:editplain.php

示例10: numfriends_settings_post

/**
 *
 * Callback from the settings post function.
 * $post contains the $_POST array.
 * We will make sure we've got a valid user account
 * and if so set our configuration setting for this person.
 *
 */
function numfriends_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'numfriends-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'display_friend_count', intval($_POST['numfriends']));
    info(t('Numfriends settings updated.') . EOL);
}
开发者ID:robhell,项目名称:friendica-addons,代码行数:16,代码来源:numfriends.php

示例11: altpager_settings_post

/**
 *
 * Callback from the settings post function.
 * $post contains the $_POST array.
 * We will make sure we've got a valid user account
 * and if so set our configuration setting for this person.
 *
 */
function altpager_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'altpager-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'alt_pager', intval($_POST['altpager']));
    info(t('Altpager settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:16,代码来源:altpager.php

示例12: group_text_settings_post

/**
 *
 * Callback from the settings post function.
 * $post contains the $_POST array.
 * We will make sure we've got a valid user account
 * and if so set our configuration setting for this person.
 *
 */
function group_text_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'group_text-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'groupedit_image_limit', intval($_POST['group_text']));
    info(t('Group Text settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:16,代码来源:group_text.php

示例13: remote_permissions_settings_post

function remote_permissions_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'remote-perms-submit')) {
        return;
    }
    set_pconfig(local_user(), 'remote_perms', 'show', intval($_POST['remote-perms']));
    info(t('Remote Permissions settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:8,代码来源:remote_permissions.php

示例14: snautofollow_settings_post

function snautofollow_settings_post($a, $post)
{
    if (!local_user() || !x($_POST, 'snautofollow-submit')) {
        return;
    }
    set_pconfig(local_user(), 'system', 'ostatus_autofriend', intval($_POST['snautofollow']));
    info(t('StatusNet AutoFollow settings updated.') . EOL);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:8,代码来源:snautofollow.php

示例15: uhremotestorage_settings_post

function uhremotestorage_settings_post($a, $post)
{
    if (!local_user()) {
        return;
    }
    set_pconfig(local_user(), 'uhremotestorage', 'unhoestedurl', $_POST['unhoestedurl']);
    set_pconfig(local_user(), 'uhremotestorage', 'unhoestedauth', $_POST['unhoestedauth']);
    set_pconfig(local_user(), 'uhremotestorage', 'unhoestedapi', $_POST['unhoestedapi']);
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:9,代码来源:uhremotestorage.php


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