本文整理汇总了PHP中get_pconfig函数的典型用法代码示例。如果您正苦于以下问题:PHP get_pconfig函数的具体用法?PHP get_pconfig怎么用?PHP get_pconfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_pconfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Send a multipart/alternative message with Text and HTML versions
*
* @param fromName name of the sender
* @param fromEmail email fo the sender
* @param replyTo replyTo address to direct responses
* @param toEmail destination email address
* @param messageSubject subject of the message
* @param htmlVersion html version of the message
* @param textVersion text only version of the message
* @param additionalMailHeader additions to the smtp mail header
* @param optional uid user id of the destination user
*/
public static function send($params)
{
call_hooks('emailer_send_prepare', $params);
$email_textonly = False;
if (x($params, "uid")) {
$email_textonly = get_pconfig($params['uid'], "system", "email_textonly");
}
$fromName = email_header_encode(html_entity_decode($params['fromName'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
$messageSubject = email_header_encode(html_entity_decode($params['messageSubject'], ENT_QUOTES, 'UTF-8'), 'UTF-8');
// generate a mime boundary
$mimeBoundary = rand(0, 9) . "-" . rand(10000000000, 99999999999) . "-" . rand(10000000000, 99999999999) . "=:" . rand(10000, 99999);
// generate a multipart/alternative message header
$messageHeader = $params['additionalMailHeader'] . "From: {$fromName} <{$params['fromEmail']}>\n" . "Reply-To: {$fromName} <{$params['replyTo']}>\n" . "MIME-Version: 1.0\n" . "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
// assemble the final multipart message body with the text and html types included
$textBody = chunk_split(base64_encode($params['textVersion']));
$htmlBody = chunk_split(base64_encode($params['htmlVersion']));
$multipartMessageBody = "--" . $mimeBoundary . "\n" . "Content-Type: text/plain; charset=UTF-8\n" . "Content-Transfer-Encoding: base64\n\n" . $textBody . "\n";
if (!$email_textonly && !is_null($params['htmlVersion'])) {
$multipartMessageBody .= "--" . $mimeBoundary . "\n" . "Content-Type: text/html; charset=UTF-8\n" . "Content-Transfer-Encoding: base64\n\n" . $htmlBody . "\n";
}
$multipartMessageBody .= "--" . $mimeBoundary . "--\n";
// message ending
// send the message
$hookdata = array('to' => $params['toEmail'], 'subject' => $messageSubject, 'body' => $multipartMessageBody, 'headers' => $messageHeader);
//echo "<pre>"; var_dump($hookdata); killme();
call_hooks("emailer_send", $hookdata);
$res = mail($hookdata['to'], $hookdata['subject'], $hookdata['body'], $hookdata['headers']);
logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
logger("return value " . ($res ? "true" : "false"), LOGGER_DEBUG);
return $res;
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:44,代码来源:Emailer.php
示例2: update_network_content
function update_network_content(&$a)
{
$profile_uid = intval($_GET['p']);
header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";
echo "<section>";
if (!get_pconfig($profile_uid, "system", "no_auto_update") or $_GET['force'] == 1) {
$text = network_content($a, $profile_uid);
} else {
$text = "";
}
$pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
$replace = "<img\${1} dst=\"\${2}\"";
$text = preg_replace($pattern, $replace, $text);
$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
$pattern = "/<\\s*audio[^>]*>(.*?)<\\s*\\/\\s*audio>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\\s*video[^>]*>(.*?)<\\s*\\/\\s*video>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\\s*embed[^>]*>(.*?)<\\s*\\/\\s*embed>/i";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<\\s*iframe[^>]*>(.*?)<\\s*\\/\\s*iframe>/i";
$text = preg_replace($pattern, $replace, $text);
echo str_replace("\t", ' ', $text);
echo "</section>";
echo "</body></html>\r\n";
killme();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:28,代码来源:update_network.php
示例3: nofed_post_local
function nofed_post_local(&$a, &$b)
{
if ($b['created'] != $b['edited']) {
return;
}
if ($b['mid'] !== $b['parent_mid']) {
return;
}
if (local_channel() && local_channel() == $b['uid']) {
if ($b['allow_cid'] || $b['allow_gid'] || $b['deny_cid'] || $b['deny_gid']) {
return;
}
$nofed_post = get_pconfig(local_channel(), 'nofed', 'post');
if (!$nofed_post) {
return;
}
$nofed_enable = $nofed_post && x($_REQUEST, 'nofed_enable') ? intval($_REQUEST['nofed_enable']) : 0;
// if API is used, default to the chosen settings
if ($_REQUEST['api_source'] && intval(get_pconfig(local_channel(), 'nofed', 'post_by_default'))) {
$nofed_enable = 1;
}
if ($nofed_enable) {
return;
}
if (strlen($b['postopts'])) {
$b['postopts'] .= ',';
}
$b['postopts'] .= 'nodeliver';
}
}
开发者ID:royalterra,项目名称:hubzilla-addons,代码行数:30,代码来源:nofed.php
示例4: curweather_plugin_settings
function curweather_plugin_settings(&$a, &$s)
{
if (!local_user()) {
return;
}
/* Add our stylesheet to the curweather so we can make our settings look nice */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */
$curweather_loc = get_pconfig(local_user(), 'curweather', 'curweather_loc');
$enable = intval(get_pconfig(local_user(), 'curweather', 'curweather_enable'));
$enable_checked = $enable ? ' checked="checked" ' : '';
/* Add some HTML to the existing form */
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Current Weather') . '</h3>';
$s .= '<div id="curweather-settings-wrapper">';
$s .= '<p>Find the location code for the airport/weather station nearest you <a href="http://en.wikipedia.org/wiki/International_Air_Transport_Association_airport_code" target="_blank">here</a>.</p>';
$s .= '<label id="curweather-location-label" for="curweather_loc">' . t('Weather Location: ') . '</label>';
$s .= '<input id="curweather-location" type="text" name="curweather_loc" value="' . $curweather_loc . '"/>';
$s .= '<div class="clear"></div>';
$s .= '<label id="curweather-enable-label" for="curweather_enable">' . t('Enable Current Weather') . '</label>';
$s .= '<input id="curweather-enable" type="checkbox" name="curweather_enable" value="1" ' . $enable_checked . '/>';
$s .= '<div class="clear"></div>';
$s .= '</div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="curweather-settings-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
}
开发者ID:swathe,项目名称:friendica-addons,代码行数:26,代码来源:curweather.php
示例5: 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
示例6: altpager_settings
/**
*
* Called from the Plugin Setting form.
* Add our own settings info to the page.
*
*/
function altpager_settings(&$a, &$s)
{
if (!local_user()) {
return;
}
$global = get_config("alt_pager", "global");
if ($global == 1) {
return;
}
/* Add our stylesheet to the page so we can make our settings look nice */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/altpager/altpager.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */
$altpager = get_pconfig(local_user(), 'system', 'alt_pager');
if ($altpager === false) {
$altpager = 0;
}
$checked = $altpager ? ' checked="checked" ' : '';
/* Add some HTML to the existing form */
$s .= '<div class="settings-block">';
$s .= '<h3>' . t('Alternate Pagination Setting') . '</h3>';
$s .= '<div id="altpager-wrapper">';
$s .= '<label id="altpager-label" for="altpager">' . t('Use links to "newer" and "older" pages in place of page numbers?') . '</label>';
$s .= '<input id="altpager-input" type="checkbox" name="altpager" value="1" ' . $checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="altpager-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:33,代码来源:altpager.php
示例7: theme_content
/**
* Theme settings
*/
function theme_content(&$a)
{
if (!local_user()) {
return;
}
$font_size = get_pconfig(local_user(), 'diabook', 'font_size');
$line_height = get_pconfig(local_user(), 'diabook', 'line_height');
$resolution = get_pconfig(local_user(), 'diabook', 'resolution');
$color = get_pconfig(local_user(), 'diabook', 'color');
$TSearchTerm = get_pconfig(local_user(), 'diabook', 'TSearchTerm');
$ELZoom = get_pconfig(local_user(), 'diabook', 'ELZoom');
$ELPosX = get_pconfig(local_user(), 'diabook', 'ELPosX');
$ELPosY = get_pconfig(local_user(), 'diabook', 'ELPosY');
$close_pages = get_pconfig(local_user(), 'diabook', 'close_pages');
$close_mapquery = get_pconfig(local_user(), 'diabook', 'close_mapquery');
$close_profiles = get_pconfig(local_user(), 'diabook', 'close_profiles');
$close_helpers = get_pconfig(local_user(), 'diabook', 'close_helpers');
$close_services = get_pconfig(local_user(), 'diabook', 'close_services');
$close_friends = get_pconfig(local_user(), 'diabook', 'close_friends');
$close_twitter = get_pconfig(local_user(), 'diabook', 'close_twitter');
$close_lastusers = get_pconfig(local_user(), 'diabook', 'close_lastusers');
$close_lastphotos = get_pconfig(local_user(), 'diabook', 'close_lastphotos');
$close_lastlikes = get_pconfig(local_user(), 'diabook', 'close_lastlikes');
return diabook_form($a, $font_size, $line_height, $resolution, $color, $TSearchTerm, $ELZoom, $ELPosX, $ELPosY, $close_pages, $close_mapquery, $close_profiles, $close_helpers, $close_services, $close_friends, $close_twitter, $close_lastusers, $close_lastphotos, $close_lastlikes);
}
开发者ID:ridcully,项目名称:friendica,代码行数:28,代码来源:config.php
示例8: invite_content
function invite_content(&$a)
{
if (!local_user()) {
notice(t('Permission denied.') . EOL);
return;
}
$tpl = get_markup_template('invite.tpl');
$invonly = false;
if (get_config('system', 'invitation_only')) {
$invonly = true;
$x = get_pconfig(local_user(), 'system', 'invites_remaining');
if (!$x && !is_site_admin()) {
notice(t('You have no more invitations available') . EOL);
return '';
}
}
$dirloc = get_config('system', 'directory_submit_url');
if (strlen($dirloc)) {
if ($a->config['register_policy'] == REGISTER_CLOSED) {
$linktxt = sprintf(t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), dirname($dirloc) . '/siteinfo');
} elseif ($a->config['register_policy'] != REGISTER_CLOSED) {
$linktxt = sprintf(t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), $a->get_baseurl()) . "\r\n" . "\r\n" . sprintf(t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'), dirname($dirloc) . '/siteinfo');
}
} else {
$o = t('Our apologies. This system is not currently configured to connect with other public sites or invite members.');
return $o;
}
$o = replace_macros($tpl, array('$invite' => t('Send invitations'), '$addr_text' => t('Enter email addresses, one per line:'), '$msg_text' => t('Your message:'), '$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n" . $linktxt . "\r\n" . "\r\n" . ($invonly ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') . t('Once you have registered, please connect with me via my profile page at:') . "\r\n" . "\r\n" . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendica.com') . "\r\n" . "\r\n", '$submit' => t('Submit')));
return $o;
}
开发者ID:robhell,项目名称:friendica,代码行数:30,代码来源:invite.php
示例9: oembed_replacecb
/** @file */
function oembed_replacecb($matches)
{
$embedurl = $matches[1];
// implements a personal embed white/black list for logged in members
if (local_channel()) {
if ($x = get_pconfig(local_channel(), 'system', 'embed_deny')) {
$l = explode("\n", $x);
if ($l) {
foreach ($l as $ll) {
if (trim($ll) && strpos($embedurl, trim($ll)) !== false) {
return '<a href="' . $embedurl . '">' . $embedurl . '</a>';
}
}
}
}
if ($x = get_pconfig(local_channel(), 'system', 'embed_allow')) {
$found = false;
$l = explode("\n", $x);
if ($l) {
foreach ($l as $ll) {
if (trim($ll) && strpos($embedurl, trim($ll)) !== false) {
$found = true;
break;
}
}
}
if (!$found) {
return '<a href="' . $embedurl . '">' . $embedurl . '</a>';
}
}
}
$j = oembed_fetch_url($embedurl);
$s = oembed_format_object($j);
return $s;
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:36,代码来源:oembed.php
示例10: change_channel
/**
* @brief Change to another channel with current logged-in account.
*
* @param int $change_channel The channel_id of the channel you want to change to
*
* @return bool|array false or channel record of the new channel
*/
function change_channel($change_channel)
{
$ret = false;
if ($change_channel) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_account_id = %d and channel_removed = 0 limit 1", intval($change_channel), intval(get_account_id()));
// It's not there. Is this an administrator, and is this the sys channel?
if (is_developer()) {
if (!$r) {
if (is_site_admin()) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_system = 1 and channel_removed = 0 limit 1", intval($change_channel));
}
}
}
if ($r) {
$hash = $r[0]['channel_hash'];
$_SESSION['uid'] = intval($r[0]['channel_id']);
get_app()->set_channel($r[0]);
$_SESSION['theme'] = $r[0]['channel_theme'];
$_SESSION['mobile_theme'] = get_pconfig(local_channel(), 'system', 'mobile_theme');
date_default_timezone_set($r[0]['channel_timezone']);
$ret = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($hash));
if ($x) {
$_SESSION['my_url'] = $x[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3);
get_app()->set_observer($x[0]);
get_app()->set_perms(get_all_perms(local_channel(), $hash));
}
if (!is_dir('store/' . $r[0]['channel_address'])) {
@os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS, true);
}
}
return $ret;
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:42,代码来源:security.php
示例11: langfilter_prepare_body
function langfilter_prepare_body(&$a, &$b)
{
if (get_pconfig(local_user(), 'langfilter', 'disable')) {
return;
}
if (local_user()) {
$langs = get_pconfig(local_user(), 'langfilter', 'languages');
}
if ($langs) {
$arr = explode(',', $langs);
} else {
return;
}
$found = false;
$l = new Text_LanguageDetect();
$l->_name_mode = 2;
// two letter codes
$l->_threshold = 600;
// make it a bit harder to be confident with a lng
// IOW make it more possible that lng is correct
$lng = $l->detectSimple($b['html']);
if ($lng == null) {
return;
}
if (!in_array($lng, $arr)) {
$found = true;
}
if ($lng == null) {
$found = false;
}
if ($found) {
$rnd = random_string(8);
$b['html'] = '<div id="langfilter-wrap-' . $rnd . '" class="fakelink" onclick=openClose(\'langfilter-' . $rnd . '\'); >' . sprintf(t('unspoken language %s - Click to open/close'), $lng) . '</div><div id="langfilter-' . $rnd . '" style="display: none; " >' . $b['html'] . '</div>';
}
}
开发者ID:strk,项目名称:friendica-addons,代码行数:35,代码来源:langfilter.php
示例12: change_channel
function change_channel($change_channel)
{
$ret = false;
if ($change_channel) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_account_id = %d and not ( channel_pageflags & %d) limit 1", intval($change_channel), intval(get_account_id()), intval(PAGE_REMOVED));
if ($r) {
$hash = $r[0]['channel_hash'];
$_SESSION['uid'] = intval($r[0]['channel_id']);
get_app()->set_channel($r[0]);
$_SESSION['theme'] = $r[0]['channel_theme'];
$_SESSION['mobile_theme'] = get_pconfig(local_user(), 'system', 'mobile_theme');
date_default_timezone_set($r[0]['channel_timezone']);
$ret = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($hash));
if ($x) {
$_SESSION['my_url'] = $x[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3);
get_app()->set_observer($x[0]);
get_app()->set_perms(get_all_perms(local_user(), $hash));
}
if (!is_dir('store/' . $r[0]['channel_address'])) {
@os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS, true);
}
}
return $ret;
}
开发者ID:Mauru,项目名称:red,代码行数:27,代码来源:security.php
示例13: pdledit_content
function pdledit_content(&$a)
{
if (!local_channel()) {
notice(t('Permission denied.') . EOL);
return;
}
if (argc() > 1) {
$module = 'mod_' . argv(1) . '.pdl';
} else {
$o .= '<h1>' . t('Edit System Page Description') . '</h1>';
$files = glob('mod/*');
if ($files) {
foreach ($files as $f) {
$name = basename($f, '.php');
$x = theme_include('mod_' . $name . '.pdl');
if ($x) {
$o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
}
}
}
// list module pdl files
return $o;
}
$t = get_pconfig(local_channel(), 'system', $module);
if (!$t) {
$t = file_get_contents(theme_include($module));
}
if (!$t) {
notice(t('Layout not found.') . EOL);
return '';
}
$o = replace_macros(get_markup_template('pdledit.tpl'), array('$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), '$module' => argv(1), '$content' => htmlspecialchars($t, ENT_COMPAT, 'UTF-8'), '$submit' => t('Submit')));
return $o;
}
开发者ID:bashrc,项目名称:hubzilla,代码行数:34,代码来源:pdledit.php
示例14: search_doc_files
function search_doc_files($s)
{
$a = get_app();
$itemspage = get_pconfig(local_channel(), 'system', 'itemspage');
App::set_pager_itemspage(intval($itemspage) ? $itemspage : 20);
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
$regexop = db_getfunc('REGEXP');
$r = q("select item_id.sid, item.* from item left join item_id on item.id = item_id.iid where service = 'docfile' and\n\t\tbody {$regexop} '%s' and item_type = %d {$pager_sql}", dbesc($s), intval(ITEM_TYPE_DOC));
$r = fetch_post_tags($r, true);
for ($x = 0; $x < count($r); $x++) {
$r[$x]['text'] = $r[$x]['body'];
$r[$x]['rank'] = 0;
if ($r[$x]['term']) {
foreach ($r[$x]['term'] as $t) {
if (stristr($t['term'], $s)) {
$r[$x]['rank']++;
}
}
}
if (stristr($r[$x]['sid'], $s)) {
$r[$x]['rank']++;
}
$r[$x]['rank'] += substr_count(strtolower($r[$x]['text']), strtolower($s));
// bias the results to the observer's native language
if ($r[$x]['lang'] === App::$language) {
$r[$x]['rank'] = $r[$x]['rank'] + 10;
}
}
usort($r, 'doc_rank_sort');
return $r;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:31,代码来源:help.php
示例15: snautofollow_settings
function snautofollow_settings(&$a, &$s)
{
if (!local_user()) {
return;
}
/* Add our stylesheet to the page so we can make our settings look nice */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/snautofollow/snautofollow.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */
$snautofollow = get_pconfig(local_user(), 'system', 'ostatus_autofriend');
if ($snautofollow === false) {
$snautofollow = false;
}
$snautofollow_checked = $snautofollow ? ' checked="checked" ' : '';
/* Add some HTML to the existing form */
$s .= '<span id="settings_snautofollow_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_snautofollow_expanded\'); openClose(\'settings_snautofollow_inflated\');">';
$s .= '<h3>' . t('StatusNet AutoFollow') . '</h3>';
$s .= '</span>';
$s .= '<div id="settings_snautofollow_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_snautofollow_expanded\'); openClose(\'settings_snautofollow_inflated\');">';
$s .= '<h3>' . t('StatusNet AutoFollow') . '</h3>';
$s .= '</span>';
$s .= '<div id="snautofollow-wrapper">';
$s .= '<label id="snautofollow-label" for="snautofollow-checkbox">' . t('Automatically follow any StatusNet followers/mentioners') . '</label>';
$s .= '<input id="snautofollow-checkbox" type="checkbox" name="snautofollow" value="1" ' . $snautofollow_checked . '/>';
$s .= '</div><div class="clear"></div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="snautofollow-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:28,代码来源:snautofollow.php
示例16: startpage_settings
/**
*
* Called from the Plugin Setting form.
* Add our own settings info to the page.
*
*/
function startpage_settings(&$a, &$s)
{
if (!local_user()) {
return;
}
/* Add our stylesheet to the page so we can make our settings look nice */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/startpage/startpage.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */
$page = get_pconfig(local_user(), 'startpage', 'startpage');
/* Add some HTML to the existing form */
$s .= '<span id="settings_startpage_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_startpage_expanded\'); openClose(\'settings_startpage_inflated\');">';
$s .= '<h3>' . t('Startpage') . '</h3>';
$s .= '</span>';
$s .= '<div id="settings_startpage_expanded" class="settings-block" style="display: none;">';
$s .= '<span class="fakelink" onclick="openClose(\'settings_startpage_expanded\'); openClose(\'settings_startpage_inflated\');">';
$s .= '<h3>' . t('Startpage') . '</h3>';
$s .= '</span>';
$s .= '<div id="startpage-page-wrapper">';
$s .= '<label id="startpage-page-label" for="startpage-page">' . t('Home page to load after login - leave blank for profile wall') . '</label>';
$s .= '<input id="startpage-page" type="text" name="startpage" value="' . $page . '" />';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="startpage-desc">' . t('Examples: "network" or "notifications/system"') . '</div>';
/* provide a submit button */
$s .= '<div class="settings-submit-wrapper" ><input type="submit" name="startpage-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div></div>';
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:31,代码来源:startpage.php
示例17: 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
示例18: post
function post()
{
$using_api = false;
if (\App::$data['api_info'] && array_key_exists('media', $_FILES)) {
$using_api = true;
$user_info = \App::$data['api_info'];
$nick = $user_info['screen_name'];
$channel = get_channel_by_nick($user_info['screen_name']);
} elseif (argc() > 1) {
$channel = get_channel_by_nick(argv(1));
}
if (!$channel) {
killme();
}
$observer = \App::get_observer();
$def_album = get_pconfig($channel['channel_id'], 'system', 'photo_path');
$def_attach = get_pconfig($channel['channel_id'], 'system', 'attach_path');
$r = attach_store($channel, $observer ? $observer['xchan_hash'] : '', '', array('source' => 'editor', 'visible' => 0, 'album' => $def_album, 'directory' => $def_attach, 'allow_cid' => '<' . $channel['channel_hash'] . '>'));
if (!$r['success']) {
notice($r['message'] . EOL);
killme();
}
if (intval($r['data']['is_photo'])) {
$s = "\n\n" . $r['body'] . "\n\n";
} else {
$s = "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
}
if ($using_api) {
return $s;
}
echo $s;
killme();
}
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:33,代码来源:Wall_attach.php
示例19: init
function init()
{
$ret = array();
call_hooks('home_init', $ret);
$splash = argc() > 1 && argv(1) === 'splash' ? true : false;
$channel = \App::get_channel();
if (local_channel() && $channel && $channel['xchan_url'] && !$splash) {
$dest = $channel['channel_startpage'];
if (!$dest) {
$dest = get_pconfig(local_channel(), 'system', 'startpage');
}
if (!$dest) {
$dest = get_config('system', 'startpage');
}
if (!$dest) {
$dest = z_root() . '/network';
}
goaway($dest);
}
if (remote_channel() && !$splash && $_SESSION['atoken']) {
$r = q("select * from atoken where atoken_id = %d", intval($_SESSION['atoken']));
if ($r) {
$x = channelx_by_n($r[0]['atoken_uid']);
if ($x) {
goaway(z_root() . '/channel/' . $x['channel_address']);
}
}
}
if (get_account_id() && !$splash) {
goaway(z_root() . '/new_channel');
}
}
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:32,代码来源:Home.php
示例20: feature_enabled
function feature_enabled($uid, $feature)
{
//return true;
$x = get_pconfig($uid, 'feature', $feature);
$arr = array('uid' => $uid, 'feature' => $feature, 'enabled' => $x);
call_hooks('feature_enabled', $arr);
return $arr['enabled'];
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:8,代码来源:features.php
注:本文中的get_pconfig函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论