本文整理汇总了PHP中get_plugin_setting函数的典型用法代码示例。如果您正苦于以下问题:PHP get_plugin_setting函数的具体用法?PHP get_plugin_setting怎么用?PHP get_plugin_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_plugin_setting函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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}");
}
}
示例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);
}
示例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;
}
示例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');
}
}
示例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");
}
示例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');
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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');
}
示例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);
}
示例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);
}
示例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);
}
}
示例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');
}
示例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;
}