本文整理汇总了PHP中get_plugin_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP get_plugin_setting函数的具体用法?PHP get_plugin_setting怎么用?PHP get_plugin_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_plugin_setting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: blog2groups_push_post
/**
* Push the blog post to the configured site
*/
function blog2groups_push_post($event, $object_type, $object)
{
// work around Elgg bug with subtype
$id = get_subtype_id('object', 'blog');
if ($object->subtype !== 'blog' && $object->subtype !== $id) {
return;
}
if ($object->access_id == ACCESS_PRIVATE) {
return;
}
$url = get_plugin_setting('url', 'blog2groups');
if (!$url) {
return;
}
// work around a Elgg bug with encoding parameters
$url = str_replace('&', '&', $url);
$body = $object->summary . "\n\n" . $object->description;
$params = array('username' => $object->getOwnerEntity()->username, 'title' => $object->title, 'body' => $body);
$post_data = http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$json = curl_exec($ch);
curl_close($ch);
$result = json_decode($json);
if ($result->status != 0) {
error_log("Failed to send blog post: {$result->message}");
}
}
开发者ID:Elgg,项目名称:blog2groups,代码行数:34,代码来源:start.php
示例2: profile_fields_setup
/**
* This function loads a set of default fields into the profile, then triggers a hook letting other plugins to edit
* add and delete fields.
*
* Note: This is a secondary system:init call and is run at a super low priority to guarantee that it is called after all
* other plugins have initialised.
*/
function profile_fields_setup()
{
global $CONFIG;
$profile_defaults = array('description' => 'longtext', 'briefdescription' => 'text', 'location' => 'tags', 'interests' => 'tags', 'skills' => 'tags', 'contactemail' => 'email', 'phone' => 'text', 'mobile' => 'text', 'website' => 'url');
// TODO: Have an admin interface for this
$n = 0;
$loaded_defaults = array();
while ($translation = get_plugin_setting("admin_defined_profile_{$n}", 'profile')) {
// Add a translation
add_translation(get_current_language(), array("profile:admin_defined_profile_{$n}" => $translation));
// Detect type
$type = get_plugin_setting("admin_defined_profile_type_{$n}", 'profile');
if (!$type) {
$type = 'text';
}
// Set array
$loaded_defaults["admin_defined_profile_{$n}"] = $type;
$n++;
}
if (count($loaded_defaults)) {
$CONFIG->profile_using_custom = true;
$profile_defaults = $loaded_defaults;
}
$CONFIG->profile = trigger_plugin_hook('profile:fields', 'profile', NULL, $profile_defaults);
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:32,代码来源:start.php
示例3: get_gateway_variables
function get_gateway_variables()
{
/*
$user = get_loggedin_user()->name ;
$domain = $vars['entity']->cclite_payment_domain ;
$protocol = $vars['entity']->cclite_transfer_protocol ;
$apikey = $vars['entity']->cclite_api_key;
$hashing = $vars['entity']->cclite_hashing_algorithm;
$registry = $vars['entity']->cclite_registry;
$limit = $vars['entity']->cclite_api_transaction_display_limit ;
*/
$user = get_loggedin_user()->name;
$domain = get_plugin_setting('cclite_payment_domain', 'cclite');
$protocol = get_plugin_setting('cclite_protocol', 'cclite');
$apikey = get_plugin_setting('cclite_api_key', 'cclite');
$hashing = get_plugin_setting('cclite_hashing_algorithm', 'cclite');
$registry = get_plugin_setting('cclite_registry', 'cclite');
$limit = get_plugin_setting('cclite_api_transaction_display_limit', 'cclite');
$values = array('user' => $user, 'limit' => $limit, 'domain' => $domain, 'protocol' => $protocol, 'apikey' => $apikey, 'hashing' => $hashing, 'registry' => $registry, 'verbose' => 0);
/*
$str = "getting variables " . $_SERVER['SERVER_ADDR'] . "<br/>" . "user is " . $user . "<br/>" . "registry is " . $registry ;
echo $str ;
*/
return $values;
}
开发者ID:hbarnard,项目名称:cclite,代码行数:25,代码来源:cclite-common-simple.php
示例4: uncaptcha_validate_user
/**
* Validates the user through uncaptcha.
*
* @param $event
* @param $object_type
* @param $object
* @return unknown_type
*/
function uncaptcha_validate_user($event, $object_type, $object)
{
global $CONFIG;
if (get_plugin_setting('instant_validate', 'uncaptcha')) {
$validated = set_user_validation_status($object->guid, true, 'uncaptcha');
}
}
开发者ID:eokyere,项目名称:elgg,代码行数:15,代码来源:start.php
示例5: sitepages_init
/**
* Start the site pages plugin.
*/
function sitepages_init()
{
require_once dirname(__FILE__) . '/sitepages_functions.php';
global $CONFIG;
// register our subtype
run_function_once('sitepages_runonce');
// Register a page handler, so we can have nice URLs
register_page_handler('sitepages', 'sitepages_page_handler');
// Register a URL handler for external pages
register_entity_url_handler('sitepages_url', 'object', 'sitepages');
elgg_extend_view('footer/links', 'sitepages/footer_menu');
elgg_extend_view('metatags', 'sitepages/metatags');
// Replace the default index page if user has requested
if (get_plugin_setting('ownfrontpage', 'sitepages') == 'yes') {
register_plugin_hook('index', 'system', 'sitepages_custom_index');
}
// parse views for keywords
register_plugin_hook('display', 'view', 'sitepages_parse_view');
// register the views we want to parse for the keyword replacement
// right now this is just the custom front page, but we can
// expand it to the other pages later.
$CONFIG->sitepages_parse_views = array('sitepages/custom_frontpage');
// an example of how to register and respond to the get_keywords trigger
register_plugin_hook('get_keywords', 'sitepages', 'sitepages_keyword_hook');
// grab the list of keywords and their views from plugins
if ($keywords = trigger_plugin_hook('get_keywords', 'sitepages', NULL, array())) {
$CONFIG->sitepages_keywords = $keywords;
}
register_action("sitepages/add", FALSE, $CONFIG->pluginspath . "sitepages/actions/add.php");
register_action("sitepages/addfront", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfront.php");
register_action("sitepages/addmeta", FALSE, $CONFIG->pluginspath . "sitepages/actions/addmeta.php");
register_action("sitepages/edit", FALSE, $CONFIG->pluginspath . "sitepages/actions/edit.php");
register_action("sitepages/delete", FALSE, $CONFIG->pluginspath . "sitepages/actions/delete.php");
}
开发者ID:adamboardman,项目名称:Elgg,代码行数:37,代码来源:start.php
示例6: garbagecollector_cron
/**
* Cron job
*
*/
function garbagecollector_cron($hook, $entity_type, $returnvalue, $params)
{
global $CONFIG;
echo elgg_echo('garbagecollector');
// Garbage collect metastrings
echo elgg_echo('garbagecollector:gc:metastrings');
if (delete_orphaned_metastrings() !== false) {
echo elgg_echo('garbagecollector:ok');
} else {
echo elgg_echo('garbagecollector:error');
}
echo "\n";
// Now, because we are nice, trigger a plugin hook to let other plugins do some GC
$rv = true;
$period = get_plugin_setting('period', 'garbagecollector');
trigger_plugin_hook('gc', 'system', array('period' => $period));
// Now we optimize all tables
$tables = get_db_tables();
foreach ($tables as $table) {
echo sprintf(elgg_echo('garbagecollector:optimize'), $table);
if (optimize_table($table) !== false) {
echo elgg_echo('garbagecollector:ok');
} else {
echo elgg_echo('garbagecollector:error');
}
echo "\n";
}
echo elgg_echo('garbagecollector:done');
}
开发者ID:eokyere,项目名称:elgg,代码行数:33,代码来源:start.php
示例7: questions_can_comment
/**
* Check if the can comment setting is active
*
* @return bool
*/
function questions_can_comment()
{
if (get_plugin_setting('cancomment', 'questions') == "no") {
return false;
}
return true;
}
开发者ID:Pleio,项目名称:questions,代码行数:12,代码来源:functions.php
示例8: westorElggMan_get_plugin_setting
function westorElggMan_get_plugin_setting($name, $plugin_id = "")
{
if (function_exists("elgg_get_plugin_setting")) {
return elgg_get_plugin_setting($name, $plugin_id);
} else {
return get_plugin_setting($name, $plugin_id);
}
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:8,代码来源:start.php
示例9: set_user_redirect
function set_user_redirect()
{
global $CONFIG;
$username = get_loggedin_user()->username;
$custom = get_plugin_setting("custom_redirect", "first_login_redirector");
if (!empty($custom)) {
$custom = str_replace("[wwwroot]", $CONFIG->wwwroot, $custom);
$custom = str_replace("[username]", $username, $custom);
$_SESSION['last_forward_from'] = $custom;
}
}
开发者ID:eokyere,项目名称:elgg,代码行数:11,代码来源:start.php
示例10: groups_from_members_init
function groups_from_members_init()
{
global $CONFIG;
add_group_tool_option('members_invite', elgg_echo('groupsfrommembers:members-invite'), false);
if (get_plugin_setting('maxusers') == 0) {
set_plugin_setting('maxusers', 20);
}
register_plugin_hook('permissions_check', 'group', 'groups_from_members_member_can_invite');
register_elgg_event_handler('pagesetup', 'system', 'groups_from_members_submenus');
register_plugin_hook('action', 'groups/invite', 'groups_from_members_member_invited_action');
register_action('groupsfrommembers/search', false, $CONFIG->pluginspath . 'groupsfrommembers/actions/search.php');
}
开发者ID:eokyere,项目名称:elgg,代码行数:12,代码来源:start.php
示例11: friends_of_friends_init
function friends_of_friends_init()
{
global $CONFIG;
// Register a page handler, so we can have nice URLs
register_page_handler('friendsoffriends', 'friends_of_friends_page_handler');
// Extend CSS
extend_view('css', 'friends_of_friends/css');
//Read Settings
$CONFIG->mod->friends_of_friends->config->hidefriendsof = get_plugin_setting('hidefriendsof', 'friends_of_friends');
register_action("friends_of_friends/get_text", false, $CONFIG->pluginspath . "friends_of_friends/actions/get_text.php", true);
register_action("friends_of_friends/translate", false, $CONFIG->pluginspath . "friends_of_friends/actions/translate.php", true);
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:12,代码来源:start.php
示例12: cclite_get_access_token
function cclite_get_access_token($oauth_verifier = NULL)
{
global $SESSION;
$consumer_key = get_plugin_setting('consumer_key', 'cclite');
$consumer_secret = get_plugin_setting('consumer_secret', 'cclite');
// retrieve stored tokens
$oauth_token = $SESSION['cclite']['oauth_token'];
$oauth_token_secret = $SESSION['cclite']['oauth_token_secret'];
$SESSION->offsetUnset('cclite');
// fetch an access token
$api = new ccliteOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
return $api->getAccessToken($oauth_verifier);
}
开发者ID:hbarnard,项目名称:cclite,代码行数:13,代码来源:oauthservice_lib.php
示例13: perform_redirect
function perform_redirect()
{
global $CONFIG;
$username = get_loggedin_user()->username;
$custom = get_plugin_setting("custom_redirect", "new_profile_redirector");
if (!get_loggedin_user()->profile_updated && !empty($custom)) {
$custom = str_replace("[wwwroot]", $CONFIG->wwwroot, $custom);
$custom = str_replace("[username]", $username, $custom);
get_loggedin_user()->profile_updated = 1;
trigger_elgg_event('firstprofileupdate', 'user', $user);
forward($custom);
}
}
开发者ID:eokyere,项目名称:elgg,代码行数:13,代码来源:start.php
示例14: riverdashboard_init
/**
* Elgg river dashboard plugin
*/
function riverdashboard_init()
{
global $CONFIG;
// Register and optionally replace the dashboard
if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes') {
register_page_handler('dashboard', 'riverdashboard_page_handler');
} else {
// Activity main menu
add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
}
// Page handler
register_page_handler('riverdashboard', 'riverdashboard_page_handler');
elgg_extend_view('css', 'riverdashboard/css');
}
开发者ID:adamboardman,项目名称:Elgg,代码行数:17,代码来源:start.php
示例15: get_gateway_variables
function get_gateway_variables()
{
$user = get_loggedin_user()->name;
// hack for the moment
$domain = get_plugin_setting('cclite_payment_domain', 'cclite');
$protocol = get_plugin_setting('cclite_protocol', 'cclite');
$apikey = get_plugin_setting('cclite_api_key', 'cclite');
$hashing = get_plugin_setting('cclite_hashing_algorithm', 'cclite');
$registry = get_plugin_setting('cclite_registry', 'cclite');
$values = array('user' => $user, 'domain' => $domain, 'protocol' => $protocol, 'apikey' => $apikey, 'hashing' => $hashing, 'registry' => $registry);
/*
$str = "getting variables " . $_SERVER['SERVER_ADDR'] . "<br/>" . "user is " . $user . "<br/>" . "registry is " . $registry ;
echo $str ;
*/
return $values;
}
开发者ID:hbarnard,项目名称:cclite,代码行数:16,代码来源:cclite-common.php
示例16: riverdashboard_init
/**
* Elgg river dashboard plugin
*
* @package ElggRiverDash
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd <[email protected]>
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.org/
*/
function riverdashboard_init()
{
global $CONFIG;
// Register and optionally replace the dashboard
if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes') {
register_page_handler('dashboard', 'riverdashboard_page_handler');
} else {
// Activity main menu
if (isloggedin()) {
add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
}
}
// Page handler
register_page_handler('riverdashboard', 'riverdashboard_page_handler');
elgg_extend_view('css', 'riverdashboard/css');
add_widget_type('river_widget', elgg_echo('river:widget:title'), elgg_echo('river:widget:description'));
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:26,代码来源:start.php
示例17: launcher
/**
* Launcher executes functionality on plugin init
*
* Launcher is responsible for querying the settings and running anything
* that is demanded to run initially.
*/
public static function launcher()
{
$displayerrors = get_plugin_setting('displayerrors', 'elgg_developer_tools');
if ($displayerrors) {
ini_set('display_errors', 1);
}
$errorlog = get_plugin_setting('errorlog', 'elgg_developer_tools');
if ($errorlog) {
ini_set('error_log', datalist_get('dataroot') . "debug.log");
}
$exceptionhandler = get_plugin_setting('exceptionhandler', 'elgg_developer_tools');
if ($exceptionhandler) {
restore_exception_handler();
}
$errorhandler = get_plugin_setting('errorhandler', 'elgg_developer_tools');
if ($errorhandler) {
restore_error_handler();
}
/** include firePHP if need be **/
$firephp = get_plugin_setting('enablefirephp', 'elgg_developer_tools');
if ($firephp) {
require_once dirname(__FILE__) . '/firephp/FirePHP.class.php';
require_once dirname(__FILE__) . '/firephp/fb.php';
} else {
require_once dirname(__FILE__) . '/FirePHPDisabled.php';
}
$timing = get_plugin_setting('timing', 'elgg_developer_tools');
if ($timing) {
register_elgg_event_handler('shutdown', 'system', 'elgg_dev_tools_shutdown_hook');
}
$showviews = get_plugin_setting('showviews', 'elgg_developer_tools');
if ($showviews) {
register_plugin_hook('display', 'view', 'elgg_dev_tools_outline_views');
}
$showstrings = get_plugin_setting('showstrings', 'elgg_developer_tools');
if ($showstrings) {
// first and last in case a plugin registers a translation in an init method
register_elgg_event_handler('init', 'system', 'elgg_dev_clear_strings', 1000);
register_elgg_event_handler('init', 'system', 'elgg_dev_clear_strings', 1);
}
$logevents = get_plugin_setting('logevents', 'elgg_developer_tools');
if ($logevents) {
register_plugin_hook('all', 'all', 'elgg_dev_log_events');
register_elgg_event_handler('all', 'all', 'elgg_dev_log_events');
}
}
开发者ID:CashElgg,项目名称:elgg-developer-tools,代码行数:52,代码来源:ElggDevTools.php
示例18: mediawiki_pagesetup
/**
* mediawiki_pagesetup
*
* @return void
*/
function mediawiki_pagesetup()
{
// add to group profile page
$page_owner = page_owner_entity();
if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
$group_watchlist = get_plugin_setting('group_watchlist', 'mediawiki');
if (!$group_watchlist || $group_watchlist != 'no') {
$group_profile_display = get_plugin_setting('group_profile_display', 'mediawiki');
if (!$group_profile_display || $group_profile_display == 'left') {
extend_view('groups/left_column', 'mediawiki/watchlist');
} else {
if ($group_profile_display == 'right') {
extend_view('groups/right_column', 'mediawiki/watchlist');
}
}
}
}
}
开发者ID:surevine-elgg,项目名称:mediawiki,代码行数:23,代码来源:start.php
示例19: chat_init
/**
* Initialisation. Register page handler and extend some views.
*/
function chat_init()
{
global $CONFIG;
// Add topbar icon
extend_view('elgg_topbar/extend', 'chat/topbar');
// Add link for users not logged in to access the chat
if (!get_plugin_setting('strict_access', 'chat') && !isloggedin()) {
if (get_plugin_setting('use_popup', 'chat')) {
add_menu(elgg_echo('Chat'), "javascript:chat_open('" . $CONFIG->wwwroot . "pg/chat')");
} else {
add_menu(elgg_echo('Chat'), $CONFIG->wwwroot . 'pg/chat');
}
}
// Add styles
extend_view('css', 'chat/css');
// Add javascript stuff
extend_view('metatags', 'chat/metatags');
// Register page handler and translations
register_page_handler('chat', 'chat_page_handler');
register_translations($CONFIG->pluginspath . "chat/languages/");
}
开发者ID:eokyere,项目名称:elgg,代码行数:24,代码来源:start.php
示例20: beechat_init
function beechat_init()
{
global $CONFIG;
register_translations($CONFIG->pluginspath . "beechat/languages/");
register_elgg_event_handler('pagesetup', 'system', 'beechat_pagesetup');
register_action('beechat/get_statuses', false, $CONFIG->pluginspath . 'beechat/actions/get_statuses.php');
register_action('beechat/get_icons', false, $CONFIG->pluginspath . 'beechat/actions/get_icons.php');
register_action('beechat/get_details', false, $CONFIG->pluginspath . 'beechat/actions/get_details.php');
register_action('beechat/get_connection', false, $CONFIG->pluginspath . 'beechat/actions/get_connection.php');
register_action('beechat/get_state', false, $CONFIG->pluginspath . 'beechat/actions/get_state.php');
register_action('beechat/save_state', false, $CONFIG->pluginspath . 'beechat/actions/save_state.php');
register_plugin_hook('action', 'friends/add', 'beechat_xmpp_add_friend');
register_plugin_hook('action', 'friends/remove', 'beechat_xmpp_remove_friend');
extend_view('js/initialise_elgg', 'js/json2.js');
extend_view('js/initialise_elgg', 'js/jquery.cookie.min.js');
extend_view('js/initialise_elgg', 'js/jquery.scrollTo-min.js');
extend_view('js/initialise_elgg', 'js/jquery.serialScroll-min.js');
extend_view('js/initialise_elgg', 'js/b64.js');
extend_view('js/initialise_elgg', 'js/sha1.js');
extend_view('js/initialise_elgg', 'js/md5.js');
extend_view('js/initialise_elgg', 'js/strophe.min.js');
extend_view('js/initialise_elgg', 'js/jquery.tools.min.js');
extend_view('css', 'beechat/screen.css');
extend_view('js/initialise_elgg', 'beechat/beechat.js');
extend_view('metatags', 'beechat/beechat.userjs');
extend_view('footer/analytics', 'beechat/beechat');
$domain = get_plugin_setting("domain", "beechat");
$dbname = get_plugin_setting("dbname", "beechat");
$dbhost = get_plugin_setting("dbhost", "beechat");
$dbuser = get_plugin_setting("dbuser", "beechat");
$dbpassword = get_plugin_setting("dbpassword", "beechat");
$CONFIG->chatsettings['domain'] = $domain;
$CONFIG->chatsettings['dbname'] = $dbname;
$CONFIG->chatsettings['dbhost'] = $dbhost;
$CONFIG->chatsettings['dbuser'] = $dbuser;
$CONFIG->chatsettings['dbpassword'] = $dbpassword;
}
开发者ID:beechannels,项目名称:beechat,代码行数:37,代码来源:start.php
注:本文中的get_plugin_setting函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论