• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_site_admin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

 function init()
 {
     load_theme_textdomain('p2', get_template_directory() . '/languages');
     add_filter('the_content', 'make_clickable');
     if (isset($_REQUEST['p2ajax'])) {
         require_once P2_INC_PATH . '/ajax.php';
         P2Ajax::dispatch();
         die;
     }
     if (function_exists('is_site_admin') && !is_site_admin()) {
         return;
     }
     $is_media_upload = isset($_REQUEST['p2-upload']);
     // don't redirect to https version when uploading files, since the domain may be different
     // and we don't have SSL certificates for blog domain, only for admin
     if ($is_media_upload && isset($GLOBALS['pagenow']) && 'media-upload.php' == $GLOBALS['pagenow']) {
         force_ssl_admin(is_ssl());
         add_filter('get_user_option_use_ssl', returner(false));
     }
     if ($is_media_upload) {
         add_filter('flash_uploader', returner(false));
         add_filter('auth_redirect_scheme', returner('logged_in'));
         add_filter('admin_url', array('P2', 'url_filter'));
         add_filter('includes_url', array('P2', 'url_filter'));
         add_filter('script_loader_src', array('P2', 'url_filter'));
         add_filter('wp_get_attachment_url', lambda('$url', 'str_replace(get_bloginfo("url")."/", site_url("/"), $url);'), 11);
         add_filter('media_upload_form_url', lambda('$url', 'add_query_arg( array( "p2-upload" => "true" ), $url );'));
     }
 }
开发者ID:alx,项目名称:pressmark,代码行数:29,代码来源:p2.php


示例2: fortunate_install

function fortunate_install()
{
    register_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
    if (FORTUNATE_SERVER == 'hostname.com' && is_site_admin()) {
        notice('Fortunate plugin requires configuration. See README');
    }
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:7,代码来源:fortunate.php


示例3: bp_activity_template

 function bp_activity_template($type, $user_id, $per_page, $max, $timeframe)
 {
     global $bp;
     $this->pag_page = isset($_REQUEST['acpage']) ? intval($_REQUEST['acpage']) : 1;
     $this->pag_num = isset($_REQUEST['num']) ? intval($_REQUEST['num']) : $per_page;
     $this->filter_content = false;
     $this->activity_type = $type;
     if ($type == 'sitewide') {
         $this->activities = bp_activity_get_sitewide_activity($max, $this->pag_num, $this->pag_page);
     }
     if ($type == 'personal') {
         $this->activities = bp_activity_get_user_activity($user_id, $timeframe, $this->page_num, $this->pag_page);
     }
     if ($type == 'friends' && (bp_is_home() || is_site_admin() || $bp->loggedin_user->id == $user_id)) {
         $this->activities = bp_activity_get_friends_activity($user_id, $timeframe, $this->pag_num, $this->pag_page);
     }
     if (!$max) {
         $this->total_activity_count = (int) $this->activities['total'];
     } else {
         $this->total_activity_count = (int) $max;
     }
     $this->activities = $this->activities['activities'];
     if ($max) {
         if ($max >= count($this->activities)) {
             $this->activity_count = count($this->activities);
         } else {
             $this->activity_count = (int) $max;
         }
     } else {
         $this->activity_count = count($this->activities);
     }
     $this->full_name = $bp->displayed_user->fullname;
     $this->pag_links = paginate_links(array('base' => add_query_arg('acpage', '%#%'), 'format' => '', 'total' => ceil((int) $this->total_activity_count / (int) $this->pag_num), 'current' => (int) $this->pag_page, 'prev_text' => '«', 'next_text' => '»', 'mid_size' => 1));
 }
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:34,代码来源:bp-activity-templatetags.php


示例4: rendertime_page_end

function rendertime_page_end(&$a, &$o)
{
    $duration = microtime(true) - $a->performance["start"];
    if (is_site_admin() and $_GET["mode"] != "minimal" and !$a->is_mobile and !$a->is_tablet) {
        $o = $o . '<div class="renderinfo">' . sprintf(t("Performance: Database: %s, Network: %s, Rendering: %s, Parser: %s, I/O: %s, Other: %s, Total: %s"), round($a->performance["database"], 3), round($a->performance["network"], 3), round($a->performance["rendering"], 3), round($a->performance["parser"], 3), round($a->performance["file"], 3), round($duration - $a->performance["database"] - $a->performance["network"] - $a->performance["rendering"] - $a->performance["parser"] - $a->performance["file"], 3), round($duration, 3)) . "</div>";
    }
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:7,代码来源:rendertime.php


示例5: get

 function get()
 {
     $o .= '<h3>Probe Diagnostic</h3>';
     $o .= '<form action="probe" method="get">';
     $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';
     $o .= '<input type="submit" name="submit" value="Submit" /></form>';
     $o .= '<br /><br />';
     if (x($_GET, 'addr')) {
         $channel = \App::get_channel();
         $addr = trim($_GET['addr']);
         $do_import = intval($_GET['import']) && is_site_admin() ? true : false;
         $j = \Zotlabs\Zot\Finger::run($addr, $channel, false);
         //			$res = zot_finger($addr,$channel,false);
         $o .= '<pre>';
         if (!$j['success']) {
             $o .= sprintf(t('Fetching URL returns error: %1$s'), $res['error'] . "\r\n\r\n");
             $o .= "<strong>https connection failed. Trying again with auto failover to http.</strong>\r\n\r\n";
             $j = \Zotlabs\Zot\Finger::run($addr, $channel, true);
             if (!$j['success']) {
                 $o .= sprintf(t('Fetching URL returns error: %1$s'), $res['error'] . "\r\n\r\n");
             }
         }
         if ($do_import && $j) {
             $x = import_xchan($j);
         }
         if ($j && $j['permissions'] && $j['permissions']['iv']) {
             $j['permissions'] = json_decode(crypto_unencapsulate($j['permissions'], $channel['channel_prvkey']), true);
         }
         $o .= str_replace("\n", '<br />', print_r($j, true));
         $o .= '</pre>';
     }
     return $o;
 }
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:33,代码来源:Probe.php


示例6: 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


示例7: get

 /**
  * @return string
  */
 function get()
 {
     logger('admin_content', LOGGER_DEBUG);
     if (!is_site_admin()) {
         return login(false);
     }
     /*
      * Page content
      */
     $o = '';
     if (argc() > 1) {
         $o = $this->sm->call('get');
         if ($o === false) {
             notice(t('Item not found.'));
         }
     } else {
         $o = $this->admin_page_summary();
     }
     if (is_ajax()) {
         echo $o;
         killme();
         return '';
     } else {
         return $o;
     }
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:29,代码来源:Admin.php


示例8: regmod_content

function regmod_content(&$a)
{
    global $lang;
    $_SESSION['return_url'] = $a->cmd;
    if (!local_user()) {
        info(t('Please login.') . EOL);
        $o .= '<br /><br />' . login($a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
        return $o;
    }
    if (!is_site_admin() || x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
        notice(t('Permission denied.') . EOL);
        return '';
    }
    if ($a->argc != 3) {
        killme();
    }
    $cmd = $a->argv[1];
    $hash = $a->argv[2];
    if ($cmd === 'deny') {
        user_deny($hash);
        goaway($a->get_baseurl() . "/admin/users/");
        killme();
    }
    if ($cmd === 'allow') {
        user_allow($hash);
        goaway($a->get_baseurl() . "/admin/users/");
        killme();
    }
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:29,代码来源:regmod.php


示例9: regmod_content

function regmod_content(&$a)
{
    global $lang;
    $_SESSION['return_url'] = $a->cmd;
    if (!local_user()) {
        info(t('Please login.') . EOL);
        $o .= '<br /><br />' . login($a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
        return $o;
    }
    if (!is_site_admin()) {
        notice(t('Permission denied.') . EOL);
        return '';
    }
    if ($a->argc != 3) {
        killme();
    }
    $cmd = $a->argv[1];
    $hash = $a->argv[2];
    if ($cmd === 'deny') {
        if (!user_deny($hash)) {
            killme();
        }
    }
    if ($cmd === 'allow') {
        if (!user_allow($hash)) {
            killme();
        }
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:29,代码来源:regmod.php


示例10: admin_content

/**
 * @param App &$a
 * @return string
 */
function admin_content(&$a)
{
    logger('admin_content', LOGGER_DEBUG);
    if (!is_site_admin()) {
        return login(false);
    }
    /*
     * Page content
     */
    $o = '';
    // urls
    if (argc() > 1) {
        switch (argv(1)) {
            case 'site':
                $o = admin_page_site($a);
                break;
            case 'users':
                $o = admin_page_users($a);
                break;
            case 'channels':
                $o = admin_page_channels($a);
                break;
            case 'plugins':
                $o = admin_page_plugins($a);
                break;
            case 'themes':
                $o = admin_page_themes($a);
                break;
                //			case 'hubloc':
                //				$o = admin_page_hubloc($a);
                //				break;
            //			case 'hubloc':
            //				$o = admin_page_hubloc($a);
            //				break;
            case 'logs':
                $o = admin_page_logs($a);
                break;
            case 'dbsync':
                $o = admin_page_dbsync($a);
                break;
            case 'profs':
                $o = admin_page_profs($a);
                break;
            case 'queue':
                $o = admin_page_queue($a);
                break;
            default:
                notice(t('Item not found.'));
        }
    } else {
        $o = admin_page_summary($a);
    }
    if (is_ajax()) {
        echo $o;
        killme();
        return '';
    } else {
        return $o;
    }
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:64,代码来源:admin.php


示例11: tehnik_filter_buddypress_activities

function tehnik_filter_buddypress_activities($a, $activities)
{
    //if admin we want to know
    if (is_site_admin()) {
        return $activities;
    }
    foreach ($activities->activities as $key => $activity) {
        //new_member is the type name (component is 'profile')
        if ($activity->type == 'bbp_topic_create' || $activity->type == 'bbp_reply_create') {
            $post_id = $activity->secondary_item_id;
            if ($activity->type == 'bbp_reply_create') {
                $post_id = bbp_get_topic_forum_id($post_id);
            }
            if (!tehnik_bpp_can_user_view_post_id($post_id)) {
                unset($activities->activities[$key]);
                $activities->activity_count = $activities->activity_count - 1;
                $activities->total_activity_count = $activities->total_activity_count - 1;
                $activities->pag_num = $activities->pag_num - 1;
            }
        }
    }
    /* Renumber the array keys to account for missing items */
    $activities_new = array_values($activities->activities);
    $activities->activities = $activities_new;
    return $activities;
}
开发者ID:dnaleor,项目名称:Tehnik-bbPress-Permissions,代码行数:26,代码来源:tehnik_bpp_buddypress.php


示例12: regmod_content

function regmod_content(&$a)
{
    global $lang;
    $_SESSION['return_url'] = App::$cmd;
    if (!local_channel()) {
        info(t('Please login.') . EOL);
        $o .= '<br /><br />' . login(App::$config['system']['register_policy'] == REGISTER_CLOSED ? 0 : 1);
        return $o;
    }
    if (!is_site_admin()) {
        notice(t('Permission denied.') . EOL);
        return '';
    }
    if (argc() != 3) {
        killme();
    }
    $cmd = argv(1);
    $hash = argv(2);
    if ($cmd === 'deny') {
        if (!account_deny($hash)) {
            killme();
        }
    }
    if ($cmd === 'allow') {
        if (!account_allow($hash)) {
            killme();
        }
    }
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:29,代码来源:regmod.php


示例13: 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 not ( channel_pageflags & %d)>0 limit 1", intval($change_channel), intval(get_account_id()), intval(PAGE_REMOVED));
        // 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_pageflags & %d) and not (channel_pageflags & %d )>0 limit 1", intval($change_channel), intval(PAGE_SYSTEM), 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_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:einervonvielen,项目名称:redmatrix,代码行数:42,代码来源:security.php


示例14: rendertime_page_end

function rendertime_page_end(&$a, &$o)
{
    $duration = microtime(true) - $a->performance["start"];
    if (is_site_admin() and $_GET["mode"] != "minimal" and !$a->is_mobile and !$a->is_tablet) {
        $o = $o . '<div class="renderinfo">' . sprintf(t("Performance: Database: %s, Network: %s, Rendering: %s, Parser: %s, I/O: %s, Other: %s, Total: %s"), round($a->performance["database"], 3), round($a->performance["network"], 3), round($a->performance["rendering"], 3), round($a->performance["parser"], 3), round($a->performance["file"], 3), round($duration - $a->performance["database"] - $a->performance["network"] - $a->performance["rendering"] - $a->performance["parser"] - $a->performance["file"], 3), round($duration, 3)) . "</div>";
        if (get_config("rendertime", "callstack")) {
            $o .= "<pre>";
            $o .= "\nDatabase:\n";
            foreach ($a->callstack["database"] as $func => $time) {
                $time = round($time, 3);
                if ($time > 0) {
                    $o .= $func . ": " . $time . "\n";
                }
            }
            $o .= "\nNetwork:\n";
            foreach ($a->callstack["network"] as $func => $time) {
                $time = round($time, 3);
                if ($time > 0) {
                    $o .= $func . ": " . $time . "\n";
                }
            }
            $o .= "</pre>";
        }
    }
}
开发者ID:shtrom,项目名称:friendica-addons,代码行数:25,代码来源:rendertime.php


示例15: regmod_content

function regmod_content(&$a)
{
    global $lang;
    $_SESSION['return_url'] = $a->cmd;
    if (!local_user()) {
        info(t('Please login.') . EOL);
        $o .= '<br /><br />' . login($a->config['system']['register_policy'] == REGISTER_CLOSED ? 0 : 1);
        return $o;
    }
    if (!is_site_admin() || x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
        notice(t('Permission denied.') . EOL);
        return '';
    }
    if (argc() != 3) {
        killme();
    }
    $cmd = argv(1);
    $hash = argv(2);
    if ($cmd === 'deny') {
        if (!user_deny($hash)) {
            killme();
        }
    }
    if ($cmd === 'allow') {
        if (!user_allow($hash)) {
            killme();
        }
    }
}
开发者ID:Mauru,项目名称:red,代码行数:29,代码来源:regmod.php


示例16: get

 function get()
 {
     if (!\App::$profile) {
         notice(t('Requested profile is not available.') . EOL);
         \App::$error = 404;
         return;
     }
     $which = argv(1);
     $uid = local_channel();
     $owner = 0;
     $channel = null;
     $observer = \App::get_observer();
     $channel = \App::get_channel();
     if (\App::$is_sys && is_site_admin()) {
         $sys = get_sys_channel();
         if ($sys && intval($sys['channel_id'])) {
             $uid = $owner = intval($sys['channel_id']);
             $channel = $sys;
             $observer = $sys;
         }
     }
     if (!$owner) {
         // Figure out who the page owner is.
         $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which));
         if ($r) {
             $owner = intval($r[0]['channel_id']);
         }
     }
     $ob_hash = $observer ? $observer['xchan_hash'] : '';
     if (!perm_is_allowed($owner, $ob_hash, 'write_pages')) {
         notice(t('Permission denied.') . EOL);
         return;
     }
     $is_owner = $uid && $uid == $owner ? true : false;
     $o = '';
     // Figure out which post we're editing
     $post_id = argc() > 2 ? intval(argv(2)) : 0;
     if (!$post_id) {
         notice(t('Item not found') . EOL);
         return;
     }
     // Now we've got a post and an owner, let's find out if we're allowed to edit it
     $ob_hash = $observer ? $observer['xchan_hash'] : '';
     $perms = get_all_perms($owner, $ob_hash);
     if (!$perms['write_pages']) {
         notice(t('Permission denied.') . EOL);
         return;
     }
     $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1", intval($post_id), intval($owner));
     $item_id = q("select * from item_id where service = 'PDL' and iid = %d limit 1", intval($itm[0]['id']));
     if ($item_id) {
         $layout_title = $item_id[0]['sid'];
     }
     $rp = 'layouts/' . $which;
     $x = array('webpage' => ITEM_TYPE_PDL, 'nickname' => $channel['channel_address'], 'editor_autocomplete' => true, 'bbco_autocomplete' => 'comanche', 'return_path' => $rp, 'button' => t('Edit'), 'hide_voting' => true, 'hide_future' => true, 'hide_expire' => true, 'hide_location' => true, 'hide_weblink' => true, 'hide_attach' => true, 'hide_preview' => true, 'ptyp' => $itm[0]['obj_type'], 'body' => undo_post_tagging($itm[0]['body']), 'post_id' => $post_id, 'title' => htmlspecialchars($itm[0]['title'], ENT_COMPAT, 'UTF-8'), 'pagetitle' => $layout_title, 'ptlabel' => t('Layout Name'), 'placeholdertitle' => t('Layout Description (Optional)'), 'showacl' => false, 'profile_uid' => intval($owner));
     $editor = status_editor($a, $x);
     $o .= replace_macros(get_markup_template('edpost_head.tpl'), array('$title' => t('Edit Layout'), '$delete' => $itm[0]['author_xchan'] === $ob_hash || $itm[0]['owner_xchan'] === $ob_hash ? t('Delete') : false, '$id' => $itm[0]['id'], '$editor' => $editor));
     return $o;
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:59,代码来源:Editlayout.php


示例17: migrator_content

function migrator_content(&$a)
{
    // It's not an API call. Check login.
    if (!is_site_admin()) {
        json_error_die(401, 'Unauthorized', 'Only admin accounts may use this endpoint.');
    }
    return "Migrator version " . MIGRATOR_VERSION;
}
开发者ID:kenrestivo,项目名称:migrator-plugin,代码行数:8,代码来源:migrator.php


示例18: bp_forums_add_admin_menu

function bp_forums_add_admin_menu()
{
    global $wpdb, $bp;
    if (is_site_admin()) {
        /* Add the administration tab under the "Site Admin" tab for site administrators */
        add_submenu_page('bp-core.php', __('Forums Setup', 'buddypress'), __('Forums Setup', 'buddypress'), 2, __FILE__, "bp_forums_bbpress_admin");
    }
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:8,代码来源:bp-forums-admin.php


示例19: bp_zoneideas_add_admin_menu

/**
 * bp_zoneideas_add_admin_menu()
 *
 * Registers the component admin menu into the admin menu array.
 */
function bp_zoneideas_add_admin_menu()
{
    global $wpdb, $bp;
    if (is_site_admin()) {
        /* Add the administration tab under the "Site Admin" tab for site administrators */
        add_submenu_page('wpmu-admin.php', __('zoneideas Admin', 'bp-zoneideas'), __('zoneideas Admin', 'bp-zoneideas'), 1, "bp_zoneideas_settings", "bp_zoneideas_admin");
    }
}
开发者ID:BGCX261,项目名称:zoneideas-svn-to-git,代码行数:13,代码来源:bp-zoneideas-admin.php


示例20: get

 function get()
 {
     if (!\App::$profile) {
         notice(t('Requested profile is not available.') . EOL);
         \App::$error = 404;
         return;
     }
     $which = argv(1);
     $uid = local_channel();
     $owner = 0;
     $channel = null;
     $observer = \App::get_observer();
     $channel = \App::get_channel();
     if (\App::$is_sys && is_site_admin()) {
         $sys = get_sys_channel();
         if ($sys && intval($sys['channel_id'])) {
             $uid = $owner = intval($sys['channel_id']);
             $channel = $sys;
             $observer = $sys;
         }
     }
     if (!$owner) {
         // Figure out who the page owner is.
         $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which));
         if ($r) {
             $owner = intval($r[0]['channel_id']);
         }
     }
     $ob_hash = $observer ? $observer['xchan_hash'] : '';
     if (!perm_is_allowed($owner, $ob_hash, 'write_pages')) {
         notice(t('Permission denied.') . EOL);
         return;
     }
     $is_owner = $uid && $uid == $owner ? true : false;
     $o = '';
     // Figure out which post we're editing
     $post_id = argc() > 2 ? intval(argv(2)) : 0;
     if (!($post_id && $owner)) {
         notice(t('Item not found') . EOL);
         return;
     }
     $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1", intval($post_id), intval($owner));
     if ($itm) {
         $item_id = q("select * from item_id where service = 'BUILDBLOCK' and iid = %d limit 1", intval($itm[0]['id']));
         if ($item_id) {
             $block_title = $item_id[0]['sid'];
         }
     } else {
         notice(t('Item not found') . EOL);
         return;
     }
     $mimetype = $itm[0]['mimetype'];
     $rp = 'blocks/' . $channel['channel_address'];
     $x = array('nickname' => $channel['channel_address'], 'bbco_autocomplete' => $mimetype == 'text/bbcode' ? 'bbcode' : 'comanche-block', 'return_path' => $rp, 'webpage' => ITEM_TYPE_BLOCK, 'ptlabel' => t('Block Name'), 'button' => t('Edit'), 'writefiles' => $mimetype == 'text/bbcode' ? perm_is_allowed($owner, get_observer_hash(), 'write_storage') : false, 'weblink' => $mimetype == 'text/bbcode' ? t('Insert web link') : false, 'hide_voting' => true, 'hide_future' => true, 'hide_location' => true, 'hide_expire' => true, 'showacl' => false, 'ptyp' => $itm[0]['type'], 'mimeselect' => true, 'mimetype' => $itm[0]['mimetype'], 'body' => undo_post_tagging($itm[0]['body']), 'post_id' => $post_id, 'visitor' => true, 'title' => htmlspecialchars($itm[0]['title'], ENT_COMPAT, 'UTF-8'), 'placeholdertitle' => t('Title (optional)'), 'pagetitle' => $block_title, 'profile_uid' => intval($channel['channel_id']), 'bbcode' => $mimetype == 'text/bbcode' ? true : false);
     $editor = status_editor($a, $x);
     $o .= replace_macros(get_markup_template('edpost_head.tpl'), array('$title' => t('Edit Block'), '$delete' => $itm[0]['author_xchan'] === $ob_hash || $itm[0]['owner_xchan'] === $ob_hash ? t('Delete') : false, '$id' => $itm[0]['id'], '$editor' => $editor));
     return $o;
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:58,代码来源:Editblock.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_siteadmin函数代码示例发布时间:2022-05-15
下一篇:
PHP is_siswa函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap